DataSecurityProviderResource extends AbstractDataResource { @POST @Path("securityGet") public Response getSecurity(SecurityProviderRequest request) { SecurityProviderResult result = getSecurityProvider().getSecurities(request); return responseOkObject(result); } DataSecurityProviderResource(final SecurityProvider securityProvider); SecurityProvider getSecurityProvider(); @GET Response getHateaos(@Context UriInfo uriInfo); @HEAD @Path("securityGet") Response status(); @POST // should be a get, but query is too large @Path("securityGet") Response getSecurity(SecurityProviderRequest request); static URI uriGet(URI baseUri);  }
@Test public void testGet() { final SecurityProviderRequest request = SecurityProviderRequest.createGet( ExternalIdBundle.of("A", "B"), "S"); final SecurityProviderResult result = new SecurityProviderResult(); when(_underlying.getSecurities(same(request))).thenReturn(result); Response test = _resource.getSecurity(request); assertEquals(Status.OK.getStatusCode(), test.getStatus()); assertSame(result, test.getEntity()); }