Search in sources :

Example 1 with UmaConfiguration

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

the class UmaConfigurationWSTest method configurationPresence.

@Parameters({ "umaConfigurationPath" })
@Test
public void configurationPresence(final String umaConfigurationPath) throws Exception {
    final UmaConfiguration c = TUma.requestConfiguration(url, umaConfigurationPath);
    UmaTestUtil.assert_(c);
}
Also used : UmaConfiguration(org.xdi.oxauth.model.uma.UmaConfiguration) Parameters(org.testng.annotations.Parameters) Test(org.testng.annotations.Test) BaseTest(org.xdi.oxauth.BaseTest)

Example 2 with UmaConfiguration

use of org.xdi.oxauth.model.uma.UmaConfiguration 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)

Example 3 with UmaConfiguration

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

the class MetaDataFlowHttpTest method testGetUmaMetaDataConfiguration.

/**
     * Test for getting meta data configuration
     */
@Test
@Parameters({ "umaMetaDataUrl" })
public void testGetUmaMetaDataConfiguration(final String umaMetaDataUrl) throws Exception {
    showTitle("testGetUmaMetaDataConfiguration");
    UmaConfigurationService metaDataConfigurationService = UmaClientFactory.instance().createMetaDataConfigurationService(umaMetaDataUrl);
    // Get meta data configuration
    UmaConfiguration c = null;
    try {
        c = metaDataConfigurationService.getMetadataConfiguration();
    } catch (ClientResponseFailure ex) {
        System.err.println(ex.getResponse().getEntity(String.class));
        throw ex;
    }
    UmaTestUtil.assert_(c);
}
Also used : UmaConfigurationService(org.xdi.oxauth.client.uma.UmaConfigurationService) UmaConfiguration(org.xdi.oxauth.model.uma.UmaConfiguration) ClientResponseFailure(org.jboss.resteasy.client.ClientResponseFailure) Parameters(org.testng.annotations.Parameters) Test(org.testng.annotations.Test) BaseTest(org.xdi.oxauth.BaseTest)

Example 4 with UmaConfiguration

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

the class UmaMultithreadTest method test.

@Test(invocationCount = 30, threadPoolSize = 3)
public void test() {
    final UmaConfiguration metadataConfiguration = service.getMetadataConfiguration();
    Assert.assertNotNull(metadataConfiguration);
    System.out.println(metadataConfiguration);
}
Also used : UmaConfiguration(org.xdi.oxauth.model.uma.UmaConfiguration) Test(org.testng.annotations.Test)

Example 5 with UmaConfiguration

use of org.xdi.oxauth.model.uma.UmaConfiguration in project oxTrust by GluuFederation.

the class AppInitializer method initUmaMetadataConfiguration.

@Produces
@ApplicationScoped
@Named("umaMetadataConfiguration")
public UmaConfiguration initUmaMetadataConfiguration() throws OxIntializationException {
    String umaConfigurationEndpoint = getUmaConfigurationEndpoint();
    if (StringHelper.isEmpty(umaConfigurationEndpoint)) {
        return null;
    }
    UmaConfigurationService metaDataConfigurationService = UmaClientFactory.instance().createMetaDataConfigurationService(umaConfigurationEndpoint);
    UmaConfiguration metadataConfiguration = metaDataConfigurationService.getMetadataConfiguration();
    if (metadataConfiguration == null) {
        throw new OxIntializationException("UMA meta data configuration is invalid!");
    }
    return metadataConfiguration;
}
Also used : UmaConfigurationService(org.xdi.oxauth.client.uma.UmaConfigurationService) UmaConfiguration(org.xdi.oxauth.model.uma.UmaConfiguration) OxIntializationException(org.xdi.exception.OxIntializationException) Named(javax.inject.Named) Produces(javax.enterprise.inject.Produces) ApplicationScoped(javax.enterprise.context.ApplicationScoped)

Aggregations

UmaConfiguration (org.xdi.oxauth.model.uma.UmaConfiguration)6 Test (org.testng.annotations.Test)4 Parameters (org.testng.annotations.Parameters)3 BaseTest (org.xdi.oxauth.BaseTest)2 UmaConfigurationService (org.xdi.oxauth.client.uma.UmaConfigurationService)2 ApiOperation (com.wordnik.swagger.annotations.ApiOperation)1 ApiResponses (com.wordnik.swagger.annotations.ApiResponses)1 ApplicationScoped (javax.enterprise.context.ApplicationScoped)1 Produces (javax.enterprise.inject.Produces)1 Named (javax.inject.Named)1 GET (javax.ws.rs.GET)1 Produces (javax.ws.rs.Produces)1 WebApplicationException (javax.ws.rs.WebApplicationException)1 ClientResponseFailure (org.jboss.resteasy.client.ClientResponseFailure)1 OxIntializationException (org.xdi.exception.OxIntializationException)1 ScopeService (org.xdi.oxauth.client.uma.ScopeService)1 ScopeDescription (org.xdi.oxauth.model.uma.ScopeDescription)1