### Question:
HttpRequestUnwrapperProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final JsonNode data = parseBody(body); if (data == null) { return; } final JsonNode paramMap = data.get("parameters"); final JsonNode bodyData = data.get("body"); if (paramMap != null || bodyData != null) { if (paramMap != null) { for (final String key : parameters) { final JsonNode valueNode = paramMap.get(key); if (valueNode != null) { final String val = valueNode.asText(); message.setHeader(key, val); } } } if (bodyData == null) { message.setBody(null); return; } if (bodyData.isContainerNode()) { message.setBody(JsonUtils.toString(bodyData)); return; } message.setHeader(Exchange.CONTENT_TYPE, "text/plain"); message.setBody(bodyData.asText()); } } HttpRequestUnwrapperProcessor(final JsonNode schema); @Override void process(final Exchange exchange);  }### Answer:
@Test public void shouldUnwrapArrayResponses() throws Exception { final Message in = new DefaultMessage(camelContext); exchange.setIn(in); in.setBody("{\"body\":[{\"b1\":\"c1\"},{\"b2\":\"c2\"}]}"); processor.process(exchange); assertThat(in.getBody()).isEqualTo("[{\"b1\":\"c1\"},{\"b2\":\"c2\"}]"); }
@Test public void shouldUnwrapResponses() throws Exception { final Message in = new DefaultMessage(camelContext); exchange.setIn(in); in.setBody("{\"parameters\":{\"h1\":\"v1\",\"h3\":\"v3\"},\"body\":{\"b1\":\"c1\",\"b2\":\"c2\"}}"); processor.process(exchange); assertThat(in.getHeaders()).containsOnly(entry("h1", "v1"), entry("h3", "v3")); assertThat(in.getBody()).isEqualTo("{\"b1\":\"c1\",\"b2\":\"c2\"}"); }
@Test public void simpleNonStringValuesShouldBeUnwrappedVerbatim() throws Exception { final Message in = new DefaultMessage(camelContext); exchange.setIn(in); in.setBody("{\"body\":123}"); processor.process(exchange); assertThat(in.getHeaders()).containsOnly(entry(Exchange.CONTENT_TYPE, "text/plain")); assertThat(in.getBody()).isEqualTo("123"); }
@Test public void simpleValuesShouldBeUnwrappedVerbatim() throws Exception { final Message in = new DefaultMessage(camelContext); exchange.setIn(in); in.setBody("{\"body\":\"simple\"}"); processor.process(exchange); assertThat(in.getHeaders()).containsOnly(entry(Exchange.CONTENT_TYPE, "text/plain")); assertThat(in.getBody()).isEqualTo("simple"); }