@Test public void shouldGetRole_notFound() { final String roleId = "role-id"; doReturn(Single.error(new RoleNotFoundException(roleId))).when(roleService).findById(ReferenceType.PLATFORM, Platform.DEFAULT, roleId); final Response response = target("platform").path("roles").path(roleId).request().get(); assertEquals(HttpStatusCode.NOT_FOUND_404, response.getStatus()); }
@GET @Path("{role}") @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Get a system role", notes = "There is no particular permission needed. User must be authenticated.") @ApiResponses({ @ApiResponse(code = 200, message = "System role successfully fetched", response = Role.class), @ApiResponse(code = 500, message = "Internal server error")}) public void get( @PathParam("role") String role, @Suspended final AsyncResponse response) { roleService.findById(ReferenceType.PLATFORM, Platform.DEFAULT, role) .map(this::convert) .subscribe(response::resume, response::resume); }
SystemRoleResource extends AbstractResource { @GET @Path("{role}") @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Get a system role", notes = "There is no particular permission needed. User must be authenticated.") @ApiResponses({ @ApiResponse(code = 200, message = "System role successfully fetched", response = Role.class), @ApiResponse(code = 500, message = "Internal server error")}) public void get( @PathParam("role") String role, @Suspended final AsyncResponse response) { roleService.findById(ReferenceType.PLATFORM, Platform.DEFAULT, role) .map(this::convert) .subscribe(response::resume, response::resume); } }
SystemRoleResource extends AbstractResource { @GET @Path("{role}") @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Get a system role", notes = "There is no particular permission needed. User must be authenticated.") @ApiResponses({ @ApiResponse(code = 200, message = "System role successfully fetched", response = Role.class), @ApiResponse(code = 500, message = "Internal server error")}) public void get( @PathParam("role") String role, @Suspended final AsyncResponse response) { roleService.findById(ReferenceType.PLATFORM, Platform.DEFAULT, role) .map(this::convert) .subscribe(response::resume, response::resume); }  }
SystemRoleResource extends AbstractResource { @GET @Path("{role}") @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Get a system role", notes = "There is no particular permission needed. User must be authenticated.") @ApiResponses({ @ApiResponse(code = 200, message = "System role successfully fetched", response = Role.class), @ApiResponse(code = 500, message = "Internal server error")}) public void get( @PathParam("role") String role, @Suspended final AsyncResponse response) { roleService.findById(ReferenceType.PLATFORM, Platform.DEFAULT, role) .map(this::convert) .subscribe(response::resume, response::resume); }  @GET @Path("{role}") @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Get a system role", notes = "There is no particular permission needed. User must be authenticated.") @ApiResponses({ @ApiResponse(code = 200, message = "System role successfully fetched", response = Role.class), @ApiResponse(code = 500, message = "Internal server error")}) void get(
            @PathParam("role") String role,
            @Suspended final AsyncResponse response); }
SystemRoleResource extends AbstractResource { @GET @Path("{role}") @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Get a system role", notes = "There is no particular permission needed. User must be authenticated.") @ApiResponses({ @ApiResponse(code = 200, message = "System role successfully fetched", response = Role.class), @ApiResponse(code = 500, message = "Internal server error")}) public void get( @PathParam("role") String role, @Suspended final AsyncResponse response) { roleService.findById(ReferenceType.PLATFORM, Platform.DEFAULT, role) .map(this::convert) .subscribe(response::resume, response::resume); }  @GET @Path("{role}") @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Get a system role", notes = "There is no particular permission needed. User must be authenticated.") @ApiResponses({ @ApiResponse(code = 200, message = "System role successfully fetched", response = Role.class), @ApiResponse(code = 500, message = "Internal server error")}) void get(
            @PathParam("role") String role,
            @Suspended final AsyncResponse response);  }