DataSecurityResource extends AbstractDocumentDataResource<SecurityDocument> { @POST public Response update(@Context UriInfo uriInfo, SecurityDocument request) { return super.update(uriInfo, request); } DataSecurityResource();  DataSecurityResource(final DataSecurityMasterResource securitiesResource, final ObjectId securityId); DataSecurityMasterResource getSecuritiesResource(); ObjectId getUrlId(); SecurityMaster getMaster(); @GET @Path("versions") Response history(@Context UriInfo uriInfo); @GET Response get(@QueryParam("versionAsOf") String versionAsOf, @QueryParam("correctedTo") String correctedTo); @POST Response update(@Context UriInfo uriInfo, SecurityDocument request); @DELETE void remove(); @GET @Path("versions/{versionId}") Response getVersioned(@PathParam("versionId") String versionId); @PUT @Path("versions/{versionId}") Response replaceVersion(@PathParam("versionId") String versionId, List<SecurityDocument> replacementDocuments); @PUT Response replaceVersions(List<SecurityDocument> replacementDocuments); @PUT @Path("all") Response replaceAllVersions(List<SecurityDocument> replacementDocuments);  }
@Test public void testUpdateSecurity() { final ManageableSecurity security = new ManageableSecurity(null, "Name", "Type", ExternalIdBundle.of("C", "D")); final SecurityDocument request = new SecurityDocument(security); request.setUniqueId(OID.atLatestVersion()); final SecurityDocument result = new SecurityDocument(security); result.setUniqueId(OID.atVersion("1")); when(_underlying.update(same(request))).thenReturn(result); Response test = _resource.update(_uriInfo, request); assertEquals(Status.CREATED.getStatusCode(), test.getStatus()); assertSame(result, test.getEntity()); }