@Test public void getPriamConfig() { new Expectations() { { priamServer.getConfiguration(); result = fakeConfiguration; times = 3; } }; Response response = resource.getPriamConfig("all"); assertEquals(200, response.getStatus()); Map<String, Object> result = GsonJsonSerializer.getGson().fromJson(response.getEntity().toString(), Map.class); assertNotNull(result); assertTrue(!result.isEmpty()); final Map<String, String> expected = new HashMap<>(); expected.put("backupLocation", "casstestbackup"); String expectedJsonString = GsonJsonSerializer.getGson().toJson(expected); response = resource.getPriamConfigByName("all", "backupLocation"); assertEquals(200, response.getStatus()); assertEquals(expectedJsonString, response.getEntity()); result = GsonJsonSerializer.getGson().fromJson(response.getEntity().toString(), Map.class); assertEquals(result, expected); Response badResponse = resource.getPriamConfigByName("all", "getUnrealThing"); assertEquals(404, badResponse.getStatus()); }
@GET @Path("/structured/{group}") public Response getPriamConfig(@PathParam("group") String group) { return doGetPriamConfig(group, null); }
PriamConfig { @GET @Path("/structured/{group}") public Response getPriamConfig(@PathParam("group") String group) { return doGetPriamConfig(group, null); } }
PriamConfig { @GET @Path("/structured/{group}") public Response getPriamConfig(@PathParam("group") String group) { return doGetPriamConfig(group, null); } @Inject  PriamConfig(PriamServer server); }
PriamConfig { @GET @Path("/structured/{group}") public Response getPriamConfig(@PathParam("group") String group) { return doGetPriamConfig(group, null); } @Inject  PriamConfig(PriamServer server); @GET @Path("/structured/{group}") Response getPriamConfig(@PathParam("group") String group); @GET @Path("/structured/{group}/{name}") Response getPriamConfigByName(
            @PathParam("group") String group, @PathParam("name") String name); @GET @Path("/unstructured/{name}") Response getProperty(
            @PathParam("name") String name, @QueryParam("default") String defaultValue); }
PriamConfig { @GET @Path("/structured/{group}") public Response getPriamConfig(@PathParam("group") String group) { return doGetPriamConfig(group, null); } @Inject  PriamConfig(PriamServer server); @GET @Path("/structured/{group}") Response getPriamConfig(@PathParam("group") String group); @GET @Path("/structured/{group}/{name}") Response getPriamConfigByName(
            @PathParam("group") String group, @PathParam("name") String name); @GET @Path("/unstructured/{name}") Response getProperty(
            @PathParam("name") String name, @QueryParam("default") String defaultValue);  }