HttpConfigResponse extends HttpResponse { public static HttpConfigResponse createFromConfig(ConfigResponse config) { return new HttpConfigResponse(config); } private  HttpConfigResponse(ConfigResponse config); static HttpConfigResponse createFromConfig(ConfigResponse config); @Override void render(OutputStream outputStream); @Override String getContentType(); static final String JSON_CONTENT_TYPE; }
@Test public void require_that_response_is_created_from_config() throws IOException { final long generation = 1L; ConfigPayload payload = ConfigPayload.fromInstance(new SimpletypesConfig(new SimpletypesConfig.Builder())); ConfigResponse configResponse = SlimeConfigResponse.fromConfigPayload(payload, generation, false, "mymd5"); HttpConfigResponse response = HttpConfigResponse.createFromConfig(configResponse); assertThat(SessionHandlerTest.getRenderedString(response), is("{\"boolval\":false,\"doubleval\":0.0,\"enumval\":\"VAL1\",\"intval\":0,\"longval\":0,\"stringval\":\"s\"}")); }