DataSecurityLoaderResource extends AbstractDataResource { @POST @Path("securityLoad") public Response loadSecurities(SecurityLoaderRequest request) { SecurityLoaderResult result = getSecurityLoader().loadSecurities(request); return responseOkObject(result); } DataSecurityLoaderResource(final SecurityLoader securityLoader); SecurityLoader getSecurityLoader(); @GET Response getHateaos(@Context UriInfo uriInfo); @HEAD @Path("securityLoad") Response status(); @POST // should be a get, but query is too large @Path("securityLoad") Response loadSecurities(SecurityLoaderRequest request); static URI uriGet(URI baseUri);  }
@Test public void testGet() { final SecurityLoaderRequest request = SecurityLoaderRequest.create(ExternalIdBundle.of("A", "B")); final SecurityLoaderResult result = new SecurityLoaderResult(); when(_underlying.loadSecurities(same(request))).thenReturn(result); Response test = _resource.loadSecurities(request); assertEquals(Status.OK.getStatusCode(), test.getStatus()); assertSame(result, test.getEntity()); }