@Test public void shouldGet() { final String extensionGrantPluginId = "extensionGrant-plugin-id"; final ExtensionGrantPlugin extensionGrantPlugin = new ExtensionGrantPlugin(); extensionGrantPlugin.setId(extensionGrantPluginId); extensionGrantPlugin.setName("extensionGrant-plugin-name"); doReturn(Maybe.just(extensionGrantPlugin)).when(extensionGrantPluginService).findById(extensionGrantPluginId); final Response response = target("platform") .path("plugins") .path("extensionGrants") .path(extensionGrantPluginId) .request().get(); assertEquals(HttpStatusCode.OK_200, response.getStatus()); }
@GET @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Get an extension grant plugin", notes = "There is no particular permission needed. User must be authenticated.") public void get( @PathParam("extensionGrant") String extensionGrantId, @Suspended final AsyncResponse response) { extensionGrantPluginService.findById(extensionGrantId) .switchIfEmpty(Maybe.error(new ExtensionGrantPluginNotFoundException(extensionGrantId))) .map(extensionGrantPlugin -> Response.ok(extensionGrantPlugin).build()) .subscribe(response::resume, response::resume); }
ExtensionGrantPluginResource { @GET @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Get an extension grant plugin", notes = "There is no particular permission needed. User must be authenticated.") public void get( @PathParam("extensionGrant") String extensionGrantId, @Suspended final AsyncResponse response) { extensionGrantPluginService.findById(extensionGrantId) .switchIfEmpty(Maybe.error(new ExtensionGrantPluginNotFoundException(extensionGrantId))) .map(extensionGrantPlugin -> Response.ok(extensionGrantPlugin).build()) .subscribe(response::resume, response::resume); } }
ExtensionGrantPluginResource { @GET @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Get an extension grant plugin", notes = "There is no particular permission needed. User must be authenticated.") public void get( @PathParam("extensionGrant") String extensionGrantId, @Suspended final AsyncResponse response) { extensionGrantPluginService.findById(extensionGrantId) .switchIfEmpty(Maybe.error(new ExtensionGrantPluginNotFoundException(extensionGrantId))) .map(extensionGrantPlugin -> Response.ok(extensionGrantPlugin).build()) .subscribe(response::resume, response::resume); }  }
ExtensionGrantPluginResource { @GET @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Get an extension grant plugin", notes = "There is no particular permission needed. User must be authenticated.") public void get( @PathParam("extensionGrant") String extensionGrantId, @Suspended final AsyncResponse response) { extensionGrantPluginService.findById(extensionGrantId) .switchIfEmpty(Maybe.error(new ExtensionGrantPluginNotFoundException(extensionGrantId))) .map(extensionGrantPlugin -> Response.ok(extensionGrantPlugin).build()) .subscribe(response::resume, response::resume); }  @GET @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Get an extension grant plugin", notes = "There is no particular permission needed. User must be authenticated.") void get(
            @PathParam("extensionGrant") String extensionGrantId,
            @Suspended final AsyncResponse response); @GET @Path("schema") @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Get an extension grant plugin's schema", notes = "There is no particular permission needed. User must be authenticated.") void getSchema(@PathParam("extensionGrant") String extensionGrantId,
                          @Suspended final AsyncResponse response); }
ExtensionGrantPluginResource { @GET @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Get an extension grant plugin", notes = "There is no particular permission needed. User must be authenticated.") public void get( @PathParam("extensionGrant") String extensionGrantId, @Suspended final AsyncResponse response) { extensionGrantPluginService.findById(extensionGrantId) .switchIfEmpty(Maybe.error(new ExtensionGrantPluginNotFoundException(extensionGrantId))) .map(extensionGrantPlugin -> Response.ok(extensionGrantPlugin).build()) .subscribe(response::resume, response::resume); }  @GET @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Get an extension grant plugin", notes = "There is no particular permission needed. User must be authenticated.") void get(
            @PathParam("extensionGrant") String extensionGrantId,
            @Suspended final AsyncResponse response); @GET @Path("schema") @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Get an extension grant plugin's schema", notes = "There is no particular permission needed. User must be authenticated.") void getSchema(@PathParam("extensionGrant") String extensionGrantId,
                          @Suspended final AsyncResponse response);  }