SecurityPluginPreproccessor implements Postprocessor { public static HashMap<String, List<String>> extractHeadersFromRequest(Request request) { HashMap<String, List<String>> headers = new HashMap<>(); for (String headerName : request.getHeaderNames()) { headers.put(headerName, request.getHeaders(headerName)); } return headers; } SecurityPluginPreproccessor(); @Override void process(Request request, Response response); static HashMap<String, List<String>> extractHeadersFromRequest(Request request);  }
@Test public void testExtractHeadersFromRequest() { System.out.println("extractHeadersFromRequest"); Request request = createTestRequest(); HashMap<String, List<String>> result = SecurityPluginPreproccessor.extractHeadersFromRequest(request); assertNotNull(result); assertTrue(result.containsKey("testHeader_1")); assertTrue(result.containsKey("testHeader_2")); assertNotNull(result.get("testHeader_1")); assertNotNull(result.get("testHeader_2")); assertNotNull(result.get("testHeader_1").get(0)); assertNotNull(result.get("testHeader_1").get(1)); assertNotNull(result.get("testHeader_1").get(2)); assertNotNull(result.get("testHeader_2").get(0)); assertEquals("test1", result.get("testHeader_1").get(0)); assertEquals("test2", result.get("testHeader_1").get(1)); assertEquals("test3", result.get("testHeader_1").get(2)); }