@Test void transformHeadersReturnsTransformedBody() { final Map<String, String> got = underTest.transformHeaders(transformationContext, singletonMap("header", "{{ request.method }}")); assertThat(got).containsExactly( entry("header", "method") ); }
public Map<String, String> transformHeaders(TransformationContext transformationContext, Map<String, String> headers) { if(headers == null) return null; final Map<String, String> transformedHeaders = new HashMap<>(); for(Map.Entry<String, String> header : headers.entrySet()) { final String transformedValue = transformValue(transformationContext, header.getValue()); transformedHeaders.put(header.getKey(), transformedValue); } return transformedHeaders; }
ResponseTransformer { public Map<String, String> transformHeaders(TransformationContext transformationContext, Map<String, String> headers) { if(headers == null) return null; final Map<String, String> transformedHeaders = new HashMap<>(); for(Map.Entry<String, String> header : headers.entrySet()) { final String transformedValue = transformValue(transformationContext, header.getValue()); transformedHeaders.put(header.getKey(), transformedValue); } return transformedHeaders; } }
ResponseTransformer { public Map<String, String> transformHeaders(TransformationContext transformationContext, Map<String, String> headers) { if(headers == null) return null; final Map<String, String> transformedHeaders = new HashMap<>(); for(Map.Entry<String, String> header : headers.entrySet()) { final String transformedValue = transformValue(transformationContext, header.getValue()); transformedHeaders.put(header.getKey(), transformedValue); } return transformedHeaders; } ResponseTransformer(Handlebars handlebars); }
ResponseTransformer { public Map<String, String> transformHeaders(TransformationContext transformationContext, Map<String, String> headers) { if(headers == null) return null; final Map<String, String> transformedHeaders = new HashMap<>(); for(Map.Entry<String, String> header : headers.entrySet()) { final String transformedValue = transformValue(transformationContext, header.getValue()); transformedHeaders.put(header.getKey(), transformedValue); } return transformedHeaders; } ResponseTransformer(Handlebars handlebars); Map<String, String> transformHeaders(TransformationContext transformationContext, Map<String, String> headers); String transformBody(TransformationContext transformationContext, String bodyString); }
ResponseTransformer { public Map<String, String> transformHeaders(TransformationContext transformationContext, Map<String, String> headers) { if(headers == null) return null; final Map<String, String> transformedHeaders = new HashMap<>(); for(Map.Entry<String, String> header : headers.entrySet()) { final String transformedValue = transformValue(transformationContext, header.getValue()); transformedHeaders.put(header.getKey(), transformedValue); } return transformedHeaders; } ResponseTransformer(Handlebars handlebars); Map<String, String> transformHeaders(TransformationContext transformationContext, Map<String, String> headers); String transformBody(TransformationContext transformationContext, String bodyString);  }