DataUserSourceResource extends AbstractDataResource { @GET @Path("users/name/{userName}") public Response getAccountByName( @PathParam("userName") String userName) { UserAccount result = getUserSource().getAccount(userName); return responseOkObject(result); } DataUserSourceResource(final UserSource userSource); UserSource getUserSource(); @GET Response getHateaos(@Context UriInfo uriInfo); @GET @Path("users/name/{userName}") Response getAccountByName(
      @PathParam("userName") String userName); static URI uriUserByName(URI baseUri, String userName);  }
@Test public void testGetUserByName() { final SimpleUserAccount target = new SimpleUserAccount("bob"); target.setAlternateIds(BUNDLE); target.getProfile().setDisplayName("Test"); when(_underlying.getAccount("bob")).thenReturn(target); Response test = _resource.getAccountByName("bob"); assertEquals(Status.OK.getStatusCode(), test.getStatus()); assertSame(target, test.getEntity()); }