DataConfigSourceResource extends AbstractDataResource { @GET @Path("configs/{uid}") public Response get( @PathParam("uid") final String uidStr) { final UniqueId uid = UniqueId.parse(uidStr); final ConfigItem<?> result = getConfigSource().get(uid); return responseOkObject(configItemResult(result)); } DataConfigSourceResource(final ConfigSource configSource); ConfigSource getConfigSource(); @GET Response getHateaos(@Context final UriInfo uriInfo); @GET @Path("configs") Response search(
    @QueryParam("type") final String typeStr,
    @QueryParam("versionCorrection") final String versionCorrectionStr,
    @QueryParam("name") final String name); static URI uriGet(final URI baseUri, final String name, final VersionCorrection versionCorrection, final Class<?> type); @GET @Path("configs/{uid}") Response get(
    @PathParam("uid") final String uidStr); static URI uriGet(final URI baseUri, final UniqueId uniqueId); @GET @Path("configs/{oid}/{versionCorrection}") Response getByOidVersionCorrection(
    @PathParam("oid") final String idStr,
    @PathParam("versionCorrection") final String versionCorrectionStr); static URI uriGet(final URI baseUri, final ObjectId objectId, VersionCorrection versionCorrection); @GET @Path("configSearches/single") Response searchSingle(
    @QueryParam("type") final String typeStr,
    @QueryParam("versionCorrection") final String versionCorrectionStr,
    @QueryParam("name") final String name); static URI uriSearchSingle(final URI baseUri, final String name, final VersionCorrection versionCorrection, final Class<?> type); @GET @Path("configSearches") Response search(
    @QueryParam("type") final String typeStr,
    @QueryParam("versionCorrection") final String versionCorrectionStr); static URI uriSearch(final URI baseUri, final Class<?> type, final VersionCorrection versionCorrection); @PUT @Path("put") Response put(
    @QueryParam("type") final String typeStr,
    @QueryParam("versionCorrection") final String versionCorrectionStr); static URI uriPut(final URI baseUri);  }
@SuppressWarnings({"unchecked", "rawtypes" }) @Test public void testGetConfigByUid() { final SimpleExchange target = new SimpleExchange(); target.setName("Test"); when(_underlying.get(eq(UID))).thenReturn((ConfigItem) ConfigItem.of(target)); final Response test = _resource.get(UID.toString()); assertEquals(Status.OK.getStatusCode(), test.getStatus()); assertEquals(target, OpenGammaFudgeContext.getInstance().fromFudgeMsg(ConfigItem.class, (FudgeMsg) test.getEntity()).getValue()); }