@Test
	@Configuration("{ \"direction\" : \"both\", \"logStatusCode\" : true }")
	public void testLogHeadersWithoutAnyRequestHeaders() throws PolicyFailureError, Throwable {
	    PrintStream out = System.out;
	    ByteArrayOutputStream testOutput = new ByteArrayOutputStream();
        System.setOut(new PrintStream(testOutput));
        try {
            PolicyTestResponse response = send(PolicyTestRequest.build(PolicyTestRequestType.GET, "/some/resource"));
    		Assert.assertEquals(200, response.code());
    		String output = testOutput.toString("UTF-8");
    		output = redactDates(output);
    		output = normalize(output);
    		String expected = "INFO: Logging 0 HTTP Request headers for io.apiman.test.policies.EchoBackEndApi\n" +
                    "INFO: Status code 200 for io.apiman.test.policies.EchoBackEndApi\n" +
                    "INFO: Logging 4 HTTP Response headers for io.apiman.test.policies.EchoBackEndApi\n" +
    		        "Key : Content-Length, Value : 167\n" +
    		        "Key : Content-Type, Value : application/json\n" +
    		        "Key : Date, Value : XXX\n" +
    		        "Key : Server, Value : apiman.policy-test\n" +
    		        "";
    		Assert.assertEquals(expected, output);
        } finally {
            System.setOut(out);
        }
	}
A simple happy flow test to verify the policy does not blow up in our face.
plugins/log-policy/src/test/java/io/apiman/plugins/log_policy/LogHeadersPolicyTest.java