ConfigurationResource { @GET @Produces(MediaType.APPLICATION_JSON) public Map<String, ConfigurationEntry> getConfiguration() { ConfigurationInspector configurationInspector = new ConfigurationInspector(); ImmutableMap.Builder<String, ConfigurationEntry> builder = ImmutableMap.builder(); for (ConfigRecord<?> record : configurationInspector.inspect(configurationFactory)) { for (ConfigAttribute attribute : record.getAttributes()) { builder.put(attribute.getPropertyName(), new AutoValue_ConfigurationResource_ConfigurationEntry(attribute)); } } return builder.build(); } @Inject  ConfigurationResource(ConfigurationFactory configurationFactory); @GET @Produces(MediaType.APPLICATION_JSON) Map<String, ConfigurationEntry> getConfiguration();  }
@Test public void testGetConfiguration() { Map<String, Map<String, String>> response = client.execute( prepareGet().setUri(uriFor("/admin/configuration")).build(), createJsonResponseHandler(jsonCodec(new TypeToken<Map<String, Map<String, String>>>() { }))); assertMapContains(response, "testing.duration", "null", "3.00m", null); assertMapContains(response, "testing.password", "[REDACTED]", "[REDACTED]", "Testing Description"); assertNoExtraneousFields(response); }