@RunAsClient @Parameters({ "gluuConfigurationPath", "webTarget" }) @Consumes(MediaType.APPLICATION_JSON) @Test public void getConfigurationTest(String gluuConfigurationPath, @Optional @ArquillianResteasyResource("") final WebTarget webTarget) throws Exception { Response response = webTarget.path(gluuConfigurationPath).request().get(); String entity = response.readEntity(String.class); BaseTest.showResponse("UMA : TConfiguration.configuration", response, entity); assertEquals(response.getStatus(), 200, "Unexpected response code."); try { GluuConfiguration appConfiguration = ServerUtil.createJsonMapper().readValue(entity, GluuConfiguration.class); System.err.println(appConfiguration.getIdGenerationEndpoint()); assertNotNull(appConfiguration, "Meta data configuration is null"); assertNotNull(appConfiguration.getIdGenerationEndpoint()); assertNotNull(appConfiguration.getIntrospectionEndpoint()); assertNotNull(appConfiguration.getAuthLevelMapping()); assertNotNull(appConfiguration.getScopeToClaimsMapping()); } catch (IOException e) { e.printStackTrace(); fail(); } }
@GET @Produces({"application/json"}) public Response getConfiguration() { try { final GluuConfiguration conf = new GluuConfiguration(); conf.setIdGenerationEndpoint(appConfiguration.getIdGenerationEndpoint()); conf.setIntrospectionEndpoint(appConfiguration.getIntrospectionEndpoint()); conf.setAuthLevelMapping(createAuthLevelMapping()); conf.setScopeToClaimsMapping(createScopeToClaimsMapping()); final String entity = ServerUtil.asPrettyJson(conf); log.trace("Gluu configuration: {}", entity); return Response.ok(entity).build(); } catch (Throwable ex) { log.error(ex.getMessage(), ex); throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR) .entity(errorResponseFactory.getErrorResponse(GluuErrorResponseType.SERVER_ERROR)).build()); } }
GluuConfigurationWS { @GET @Produces({"application/json"}) public Response getConfiguration() { try { final GluuConfiguration conf = new GluuConfiguration(); conf.setIdGenerationEndpoint(appConfiguration.getIdGenerationEndpoint()); conf.setIntrospectionEndpoint(appConfiguration.getIntrospectionEndpoint()); conf.setAuthLevelMapping(createAuthLevelMapping()); conf.setScopeToClaimsMapping(createScopeToClaimsMapping()); final String entity = ServerUtil.asPrettyJson(conf); log.trace("Gluu configuration: {}", entity); return Response.ok(entity).build(); } catch (Throwable ex) { log.error(ex.getMessage(), ex); throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR) .entity(errorResponseFactory.getErrorResponse(GluuErrorResponseType.SERVER_ERROR)).build()); } } }
GluuConfigurationWS { @GET @Produces({"application/json"}) public Response getConfiguration() { try { final GluuConfiguration conf = new GluuConfiguration(); conf.setIdGenerationEndpoint(appConfiguration.getIdGenerationEndpoint()); conf.setIntrospectionEndpoint(appConfiguration.getIntrospectionEndpoint()); conf.setAuthLevelMapping(createAuthLevelMapping()); conf.setScopeToClaimsMapping(createScopeToClaimsMapping()); final String entity = ServerUtil.asPrettyJson(conf); log.trace("Gluu configuration: {}", entity); return Response.ok(entity).build(); } catch (Throwable ex) { log.error(ex.getMessage(), ex); throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR) .entity(errorResponseFactory.getErrorResponse(GluuErrorResponseType.SERVER_ERROR)).build()); } }  }
GluuConfigurationWS { @GET @Produces({"application/json"}) public Response getConfiguration() { try { final GluuConfiguration conf = new GluuConfiguration(); conf.setIdGenerationEndpoint(appConfiguration.getIdGenerationEndpoint()); conf.setIntrospectionEndpoint(appConfiguration.getIntrospectionEndpoint()); conf.setAuthLevelMapping(createAuthLevelMapping()); conf.setScopeToClaimsMapping(createScopeToClaimsMapping()); final String entity = ServerUtil.asPrettyJson(conf); log.trace("Gluu configuration: {}", entity); return Response.ok(entity).build(); } catch (Throwable ex) { log.error(ex.getMessage(), ex); throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR) .entity(errorResponseFactory.getErrorResponse(GluuErrorResponseType.SERVER_ERROR)).build()); } }  @GET @Produces({"application/json"}) Response getConfiguration(); Map<Integer, Set<String>> createAuthLevelMapping(); }
GluuConfigurationWS { @GET @Produces({"application/json"}) public Response getConfiguration() { try { final GluuConfiguration conf = new GluuConfiguration(); conf.setIdGenerationEndpoint(appConfiguration.getIdGenerationEndpoint()); conf.setIntrospectionEndpoint(appConfiguration.getIntrospectionEndpoint()); conf.setAuthLevelMapping(createAuthLevelMapping()); conf.setScopeToClaimsMapping(createScopeToClaimsMapping()); final String entity = ServerUtil.asPrettyJson(conf); log.trace("Gluu configuration: {}", entity); return Response.ok(entity).build(); } catch (Throwable ex) { log.error(ex.getMessage(), ex); throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR) .entity(errorResponseFactory.getErrorResponse(GluuErrorResponseType.SERVER_ERROR)).build()); } }  @GET @Produces({"application/json"}) Response getConfiguration(); Map<Integer, Set<String>> createAuthLevelMapping();  }