@Test public void shouldGetSchema_technicalManagementException() { final String identityProviderPluginId = "identityProvider-plugin-id"; doReturn(Maybe.error(new TechnicalManagementException("Error occurs"))).when(identityProviderPluginService).findById(identityProviderPluginId); final Response response = target("platform") .path("plugins") .path("identities") .path(identityProviderPluginId) .path("schema") .request().get(); assertEquals(HttpStatusCode.INTERNAL_SERVER_ERROR_500, response.getStatus()); }
@GET @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Get an identity provider", notes = "There is no particular permission needed. User must be authenticated.") public void get( @PathParam("identity") String identityProviderId, @Suspended final AsyncResponse response) { identityProviderPluginService.findById(identityProviderId) .switchIfEmpty(Maybe.error(new IdentityProviderPluginNotFoundException(identityProviderId))) .map(identityProviderPlugin -> Response.ok(identityProviderPlugin).build()) .subscribe(response::resume, response::resume); }
IdentityProviderPluginResource { @GET @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Get an identity provider", notes = "There is no particular permission needed. User must be authenticated.") public void get( @PathParam("identity") String identityProviderId, @Suspended final AsyncResponse response) { identityProviderPluginService.findById(identityProviderId) .switchIfEmpty(Maybe.error(new IdentityProviderPluginNotFoundException(identityProviderId))) .map(identityProviderPlugin -> Response.ok(identityProviderPlugin).build()) .subscribe(response::resume, response::resume); } }
IdentityProviderPluginResource { @GET @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Get an identity provider", notes = "There is no particular permission needed. User must be authenticated.") public void get( @PathParam("identity") String identityProviderId, @Suspended final AsyncResponse response) { identityProviderPluginService.findById(identityProviderId) .switchIfEmpty(Maybe.error(new IdentityProviderPluginNotFoundException(identityProviderId))) .map(identityProviderPlugin -> Response.ok(identityProviderPlugin).build()) .subscribe(response::resume, response::resume); }  }
IdentityProviderPluginResource { @GET @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Get an identity provider", notes = "There is no particular permission needed. User must be authenticated.") public void get( @PathParam("identity") String identityProviderId, @Suspended final AsyncResponse response) { identityProviderPluginService.findById(identityProviderId) .switchIfEmpty(Maybe.error(new IdentityProviderPluginNotFoundException(identityProviderId))) .map(identityProviderPlugin -> Response.ok(identityProviderPlugin).build()) .subscribe(response::resume, response::resume); }  @GET @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Get an identity provider", notes = "There is no particular permission needed. User must be authenticated.") void get(
            @PathParam("identity") String identityProviderId,
            @Suspended final AsyncResponse response); @GET @Path("schema") @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Get an identity provider plugin's schema", notes = "There is no particular permission needed. User must be authenticated.") void getSchema(
            @PathParam("identity") String identityProviderId,
            @Suspended final AsyncResponse response); }
IdentityProviderPluginResource { @GET @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Get an identity provider", notes = "There is no particular permission needed. User must be authenticated.") public void get( @PathParam("identity") String identityProviderId, @Suspended final AsyncResponse response) { identityProviderPluginService.findById(identityProviderId) .switchIfEmpty(Maybe.error(new IdentityProviderPluginNotFoundException(identityProviderId))) .map(identityProviderPlugin -> Response.ok(identityProviderPlugin).build()) .subscribe(response::resume, response::resume); }  @GET @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Get an identity provider", notes = "There is no particular permission needed. User must be authenticated.") void get(
            @PathParam("identity") String identityProviderId,
            @Suspended final AsyncResponse response); @GET @Path("schema") @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Get an identity provider plugin's schema", notes = "There is no particular permission needed. User must be authenticated.") void getSchema(
            @PathParam("identity") String identityProviderId,
            @Suspended final AsyncResponse response);  }