@Test
    void testProcessorSetsResponseHeaders() throws InterruptedException {
        ProcessingTestDriver.MockResponseHandler responseHandler = null;
        try {
            Map<String, List<String>> responseHeaders = new HashMap<>();
            responseHeaders.put("foo", List.of("fooValue"));
            responseHeaders.put("bar", List.of("barValue", "bazValue"));

            Map<String, List<String>> otherResponseHeaders = new HashMap<>();
            otherResponseHeaders.put("foo", List.of("fooValue2"));
            otherResponseHeaders.put("bax", List.of("baxValue"));

            List<Chain<Processor>> chains = new ArrayList<>();
            chains.add(new Chain<>("default", new ResponseHeaderSetter(responseHeaders),
                    new ResponseHeaderSetter(otherResponseHeaders)));
            driver = new ProcessingTestDriver(chains);
            responseHandler = driver.sendRequest("http://localhost/?chain=default").awaitResponse();
            Response response = responseHandler.getResponse();
            assertEquals("[fooValue2, fooValue]", response.headers().get("foo").toString());
            assertEquals("[barValue, bazValue]", response.headers().get("bar").toString());
            assertEquals("[baxValue]", response.headers().get("bax").toString());
            assertEquals("{\"datalist\":[]}", responseHandler.read(), "ResponseHeaders are not rendered");
        }
        finally {
            if (responseHandler != null)
                responseHandler.readAll();
        }
    }
Tests processing handler scenarios end to end.

@author bratseth
@author gjoranv
@author Tony Vaagenes
container-core/src/test/java/com/yahoo/processing/handler/ProcessingHandlerTestCase.java