Search in sources :

Example 1 with ScopeDescription

use of org.xdi.oxauth.model.uma.ScopeDescription in project oxAuth by GluuFederation.

the class UmaScopeWSTest method scopePresence.

// private MetadataConfiguration m_configuration;
//
// @Parameters({"umaConfigurationPath"})
// @Test
// public void init(final String umaConfigurationPath) {
// m_configuration = TUma.requestConfiguration(this, umaConfigurationPath);
// UmaTestUtil.assert_(m_configuration);
// }
@Parameters({ "umaScopePath" })
@Test
public void scopePresence(final String umaScopePath) throws Exception {
    String path = umaScopePath + "/" + "modify";
    System.out.println("Path: " + path);
    Builder request = ResteasyClientBuilder.newClient().target(url.toString() + path).request();
    request.header("Accept", UmaConstants.JSON_MEDIA_TYPE);
    Response response = request.get();
    String entity = response.readEntity(String.class);
    BaseTest.showResponse("UMA : UmaScopeWSTest.scopePresence() : ", response, entity);
    assertEquals(response.getStatus(), Response.Status.OK.getStatusCode(), "Unexpected response code.");
    final ScopeDescription scope = TUma.readJsonValue(entity, ScopeDescription.class);
    UmaTestUtil.assert_(scope);
}
Also used : Response(javax.ws.rs.core.Response) ResteasyClientBuilder(org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder) Builder(javax.ws.rs.client.Invocation.Builder) ScopeDescription(org.xdi.oxauth.model.uma.ScopeDescription) Parameters(org.testng.annotations.Parameters) Test(org.testng.annotations.Test) BaseTest(org.xdi.oxauth.BaseTest)

Example 2 with ScopeDescription

use of org.xdi.oxauth.model.uma.ScopeDescription in project oxAuth by GluuFederation.

the class ScopeHttpTest method scopePresence.

@Test
@Parameters({ "umaMetaDataUrl" })
public void scopePresence(final String umaMetaDataUrl) {
    final UmaConfiguration conf = UmaClientFactory.instance().createMetaDataConfigurationService(umaMetaDataUrl).getMetadataConfiguration();
    final ScopeService scopeService = UmaClientFactory.instance().createScopeService(conf);
    final ScopeDescription modifyScope = scopeService.getScope("modify");
    UmaTestUtil.assert_(modifyScope);
}
Also used : ScopeService(org.xdi.oxauth.client.uma.ScopeService) UmaConfiguration(org.xdi.oxauth.model.uma.UmaConfiguration) ScopeDescription(org.xdi.oxauth.model.uma.ScopeDescription) Parameters(org.testng.annotations.Parameters) Test(org.testng.annotations.Test)

Aggregations

Parameters (org.testng.annotations.Parameters)2 Test (org.testng.annotations.Test)2 ScopeDescription (org.xdi.oxauth.model.uma.ScopeDescription)2 Builder (javax.ws.rs.client.Invocation.Builder)1 Response (javax.ws.rs.core.Response)1 ResteasyClientBuilder (org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder)1 BaseTest (org.xdi.oxauth.BaseTest)1 ScopeService (org.xdi.oxauth.client.uma.ScopeService)1 UmaConfiguration (org.xdi.oxauth.model.uma.UmaConfiguration)1