ApplicationStatusHandler extends AbstractRequestHandler { static JSONArray renderObjectComponents(Map<ComponentId, ?> componentsById) { JSONArray ret = new JSONArray(); for (Map.Entry<ComponentId, ?> componentEntry : componentsById.entrySet()) { JSONObject jc = renderComponent(componentEntry.getValue(), componentEntry.getKey()); ret.put(jc); } return ret; } @Inject  ApplicationStatusHandler(ApplicationMetadataConfig metaConfig,
                                    ApplicationUserdataConfig userConfig,
                                    JdiscBindingsConfig bindingsConfig,
                                    ComponentRegistry<ClientProvider> clientProviderRegistry,
                                    ComponentRegistry<ServerProvider> serverProviderRegistry,
                                    ComponentRegistry<RequestFilterBase> requestFilterRegistry,
                                    ComponentRegistry<ResponseFilterBase> responseFilterRegistry); @Override ContentChannel handleRequest(com.yahoo.jdisc.Request request, ResponseHandler handler);  }
@Test public void object_components_are_rendered() throws Exception { HashMap<ComponentId, Object> id2object = new HashMap<>(); id2object.put(new ComponentId("myComponent"), new Object()); String json = ApplicationStatusHandler.renderObjectComponents(id2object).toString(); assertThat(json, containsString("myComponent")); }