@Test public void should_create_identity() throws Exception { byte[] bytes = new byte[] {1, 2}; IdentityInsertModel identityModel = new IdentityInsertModel(); identityModel.setContextId("contextId"); identityModel.setCertificate(bytes); Response response = identityResource.createIdentity(identityModel, uriInfo); assertThat(response.getStatusInfo()).isEqualTo(Response.Status.CREATED); }
@POST @Consumes(MediaType.APPLICATION_JSON) public Response createIdentity(IdentityInsertModel identityInsertModel, @Context UriInfo uri) throws InvalidParseOperationException, CertificateException { ParametersChecker.checkParameter("Certificate cannot be null", (Object) identityInsertModel.getCertificate()); identityService.createIdentity(identityInsertModel); return Response.created(uri.getRequestUri().normalize()).build(); }
AdminIdentityResource { @POST @Consumes(MediaType.APPLICATION_JSON) public Response createIdentity(IdentityInsertModel identityInsertModel, @Context UriInfo uri) throws InvalidParseOperationException, CertificateException { ParametersChecker.checkParameter("Certificate cannot be null", (Object) identityInsertModel.getCertificate()); identityService.createIdentity(identityInsertModel); return Response.created(uri.getRequestUri().normalize()).build(); } }
AdminIdentityResource { @POST @Consumes(MediaType.APPLICATION_JSON) public Response createIdentity(IdentityInsertModel identityInsertModel, @Context UriInfo uri) throws InvalidParseOperationException, CertificateException { ParametersChecker.checkParameter("Certificate cannot be null", (Object) identityInsertModel.getCertificate()); identityService.createIdentity(identityInsertModel); return Response.created(uri.getRequestUri().normalize()).build(); } AdminIdentityResource(IdentityService identityService); }
AdminIdentityResource { @POST @Consumes(MediaType.APPLICATION_JSON) public Response createIdentity(IdentityInsertModel identityInsertModel, @Context UriInfo uri) throws InvalidParseOperationException, CertificateException { ParametersChecker.checkParameter("Certificate cannot be null", (Object) identityInsertModel.getCertificate()); identityService.createIdentity(identityInsertModel); return Response.created(uri.getRequestUri().normalize()).build(); } AdminIdentityResource(IdentityService identityService); @POST @Consumes(MediaType.APPLICATION_JSON) Response createIdentity(IdentityInsertModel identityInsertModel, @Context UriInfo uri); @PUT @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) IdentityModel linkContextToIdentity(IdentityInsertModel identityInsertModel, @Context UriInfo uri); }
AdminIdentityResource { @POST @Consumes(MediaType.APPLICATION_JSON) public Response createIdentity(IdentityInsertModel identityInsertModel, @Context UriInfo uri) throws InvalidParseOperationException, CertificateException { ParametersChecker.checkParameter("Certificate cannot be null", (Object) identityInsertModel.getCertificate()); identityService.createIdentity(identityInsertModel); return Response.created(uri.getRequestUri().normalize()).build(); } AdminIdentityResource(IdentityService identityService); @POST @Consumes(MediaType.APPLICATION_JSON) Response createIdentity(IdentityInsertModel identityInsertModel, @Context UriInfo uri); @PUT @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) IdentityModel linkContextToIdentity(IdentityInsertModel identityInsertModel, @Context UriInfo uri);  }