@Test public void shouldGetConfiguration() { resetAllMocks(); PortalConfigEntity configEntity = new PortalConfigEntity(); doReturn(configEntity).when(configService).getPortalConfig(); final Response response = target().request().get(); assertEquals(HttpStatusCode.OK_200, response.getStatus()); Mockito.verify(configMapper).convert(configEntity); Mockito.verify(configService).getPortalConfig(); }
private ConfigurationApplicationTypesResponse convert(ApplicationTypesEntity enabledApplicationTypes) { ConfigurationApplicationTypesResponse configurationApplicationsTypesResponse = new ConfigurationApplicationTypesResponse(); List<ApplicationType> types = enabledApplicationTypes.getData().stream().map(applicationTypeEntity -> { ApplicationType applicationType = new ApplicationType(); applicationType.setAllowedGrantTypes(convert(applicationTypeEntity.getAllowed_grant_types())); applicationType.setDefaultGrantTypes(convert(applicationTypeEntity.getDefault_grant_types())); applicationType.setMandatoryGrantTypes(convert(applicationTypeEntity.getMandatory_grant_types())); applicationType.setId(applicationTypeEntity.getId()); applicationType.setName(applicationTypeEntity.getName()); applicationType.setDescription(applicationTypeEntity.getDescription()); applicationType.setRequiresRedirectUris(applicationTypeEntity.getRequires_redirect_uris()); return applicationType; }).collect(Collectors.toList()); configurationApplicationsTypesResponse.setData(types); return configurationApplicationsTypesResponse; }
ConfigurationResource extends AbstractResource { private ConfigurationApplicationTypesResponse convert(ApplicationTypesEntity enabledApplicationTypes) { ConfigurationApplicationTypesResponse configurationApplicationsTypesResponse = new ConfigurationApplicationTypesResponse(); List<ApplicationType> types = enabledApplicationTypes.getData().stream().map(applicationTypeEntity -> { ApplicationType applicationType = new ApplicationType(); applicationType.setAllowedGrantTypes(convert(applicationTypeEntity.getAllowed_grant_types())); applicationType.setDefaultGrantTypes(convert(applicationTypeEntity.getDefault_grant_types())); applicationType.setMandatoryGrantTypes(convert(applicationTypeEntity.getMandatory_grant_types())); applicationType.setId(applicationTypeEntity.getId()); applicationType.setName(applicationTypeEntity.getName()); applicationType.setDescription(applicationTypeEntity.getDescription()); applicationType.setRequiresRedirectUris(applicationTypeEntity.getRequires_redirect_uris()); return applicationType; }).collect(Collectors.toList()); configurationApplicationsTypesResponse.setData(types); return configurationApplicationsTypesResponse; } }
ConfigurationResource extends AbstractResource { private ConfigurationApplicationTypesResponse convert(ApplicationTypesEntity enabledApplicationTypes) { ConfigurationApplicationTypesResponse configurationApplicationsTypesResponse = new ConfigurationApplicationTypesResponse(); List<ApplicationType> types = enabledApplicationTypes.getData().stream().map(applicationTypeEntity -> { ApplicationType applicationType = new ApplicationType(); applicationType.setAllowedGrantTypes(convert(applicationTypeEntity.getAllowed_grant_types())); applicationType.setDefaultGrantTypes(convert(applicationTypeEntity.getDefault_grant_types())); applicationType.setMandatoryGrantTypes(convert(applicationTypeEntity.getMandatory_grant_types())); applicationType.setId(applicationTypeEntity.getId()); applicationType.setName(applicationTypeEntity.getName()); applicationType.setDescription(applicationTypeEntity.getDescription()); applicationType.setRequiresRedirectUris(applicationTypeEntity.getRequires_redirect_uris()); return applicationType; }).collect(Collectors.toList()); configurationApplicationsTypesResponse.setData(types); return configurationApplicationsTypesResponse; }  }
ConfigurationResource extends AbstractResource { private ConfigurationApplicationTypesResponse convert(ApplicationTypesEntity enabledApplicationTypes) { ConfigurationApplicationTypesResponse configurationApplicationsTypesResponse = new ConfigurationApplicationTypesResponse(); List<ApplicationType> types = enabledApplicationTypes.getData().stream().map(applicationTypeEntity -> { ApplicationType applicationType = new ApplicationType(); applicationType.setAllowedGrantTypes(convert(applicationTypeEntity.getAllowed_grant_types())); applicationType.setDefaultGrantTypes(convert(applicationTypeEntity.getDefault_grant_types())); applicationType.setMandatoryGrantTypes(convert(applicationTypeEntity.getMandatory_grant_types())); applicationType.setId(applicationTypeEntity.getId()); applicationType.setName(applicationTypeEntity.getName()); applicationType.setDescription(applicationTypeEntity.getDescription()); applicationType.setRequiresRedirectUris(applicationTypeEntity.getRequires_redirect_uris()); return applicationType; }).collect(Collectors.toList()); configurationApplicationsTypesResponse.setData(types); return configurationApplicationsTypesResponse; }  @GET @Produces(MediaType.APPLICATION_JSON) Response getPortalConfiguration(); @GET @Path("users/custom-fields") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response listCustomUserFields(); @GET @Path("identities") @Produces(MediaType.APPLICATION_JSON) Response getPortalIdentityProviders(@BeanParam PaginationParam paginationParam); @GET @Path("identities/{identityProviderId}") @Produces(MediaType.APPLICATION_JSON) Response getPortalIdentityProvider(@PathParam("identityProviderId") String identityProviderId); @GET @Path("links") @Produces(MediaType.APPLICATION_JSON) Response getPortalLinks(@HeaderParam("Accept-Language") String acceptLang); @GET @Path("applications/types") @Produces(MediaType.APPLICATION_JSON) Response getEnabledApplicationTypes(); @GET @Path("applications/roles") @Produces(MediaType.APPLICATION_JSON) Response getApplicationRoles(); }
ConfigurationResource extends AbstractResource { private ConfigurationApplicationTypesResponse convert(ApplicationTypesEntity enabledApplicationTypes) { ConfigurationApplicationTypesResponse configurationApplicationsTypesResponse = new ConfigurationApplicationTypesResponse(); List<ApplicationType> types = enabledApplicationTypes.getData().stream().map(applicationTypeEntity -> { ApplicationType applicationType = new ApplicationType(); applicationType.setAllowedGrantTypes(convert(applicationTypeEntity.getAllowed_grant_types())); applicationType.setDefaultGrantTypes(convert(applicationTypeEntity.getDefault_grant_types())); applicationType.setMandatoryGrantTypes(convert(applicationTypeEntity.getMandatory_grant_types())); applicationType.setId(applicationTypeEntity.getId()); applicationType.setName(applicationTypeEntity.getName()); applicationType.setDescription(applicationTypeEntity.getDescription()); applicationType.setRequiresRedirectUris(applicationTypeEntity.getRequires_redirect_uris()); return applicationType; }).collect(Collectors.toList()); configurationApplicationsTypesResponse.setData(types); return configurationApplicationsTypesResponse; }  @GET @Produces(MediaType.APPLICATION_JSON) Response getPortalConfiguration(); @GET @Path("users/custom-fields") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response listCustomUserFields(); @GET @Path("identities") @Produces(MediaType.APPLICATION_JSON) Response getPortalIdentityProviders(@BeanParam PaginationParam paginationParam); @GET @Path("identities/{identityProviderId}") @Produces(MediaType.APPLICATION_JSON) Response getPortalIdentityProvider(@PathParam("identityProviderId") String identityProviderId); @GET @Path("links") @Produces(MediaType.APPLICATION_JSON) Response getPortalLinks(@HeaderParam("Accept-Language") String acceptLang); @GET @Path("applications/types") @Produces(MediaType.APPLICATION_JSON) Response getEnabledApplicationTypes(); @GET @Path("applications/roles") @Produces(MediaType.APPLICATION_JSON) Response getApplicationRoles();  }