@Test public void shouldFindContextIsUsed() { final String CONTEXT_ID = "contextId"; IdentityModel identityModel = new IdentityModel(); identityModel.setContextId(CONTEXT_ID); given(identityService.contextIsUsed(CONTEXT_ID)).willReturn(true); Response response = identityResource.contextIsUsed(CONTEXT_ID); assertThat(response.getStatus()).isEqualTo(Response.Status.OK.getStatusCode()); }
@GET @Path("context/{contextId}") @Produces(MediaType.APPLICATION_JSON) public Response contextIsUsed(@PathParam("contextId") String contextId) { return Response.ok().entity(identityService.contextIsUsed(contextId)).build(); }
IdentityResource { @GET @Path("context/{contextId}") @Produces(MediaType.APPLICATION_JSON) public Response contextIsUsed(@PathParam("contextId") String contextId) { return Response.ok().entity(identityService.contextIsUsed(contextId)).build(); } }
IdentityResource { @GET @Path("context/{contextId}") @Produces(MediaType.APPLICATION_JSON) public Response contextIsUsed(@PathParam("contextId") String contextId) { return Response.ok().entity(identityService.contextIsUsed(contextId)).build(); } IdentityResource(IdentityService identityService); }
IdentityResource { @GET @Path("context/{contextId}") @Produces(MediaType.APPLICATION_JSON) public Response contextIsUsed(@PathParam("contextId") String contextId) { return Response.ok().entity(identityService.contextIsUsed(contextId)).build(); } IdentityResource(IdentityService identityService); @GET @Consumes(MediaType.APPLICATION_OCTET_STREAM) @Produces(MediaType.APPLICATION_JSON) IdentityModel findIdentityByCertificate(byte[] certificate); @GET @Path("context/{contextId}") @Produces(MediaType.APPLICATION_JSON) Response contextIsUsed(@PathParam("contextId") String contextId); }
IdentityResource { @GET @Path("context/{contextId}") @Produces(MediaType.APPLICATION_JSON) public Response contextIsUsed(@PathParam("contextId") String contextId) { return Response.ok().entity(identityService.contextIsUsed(contextId)).build(); } IdentityResource(IdentityService identityService); @GET @Consumes(MediaType.APPLICATION_OCTET_STREAM) @Produces(MediaType.APPLICATION_JSON) IdentityModel findIdentityByCertificate(byte[] certificate); @GET @Path("context/{contextId}") @Produces(MediaType.APPLICATION_JSON) Response contextIsUsed(@PathParam("contextId") String contextId);  }