### Question:
InfoHeaderMessagePostProcessor implements MessagePostProcessor { @Override public Message postProcessMessage(final Message message) { MessageProperties messageProperties = message.getMessageProperties(); headers.putIfAbsent("spring-application-name", getEnvironment().getProperty("spring.application.name", String.class)); headers.put("execution-time", new Date().toString()); messageProperties.getHeaders().putIfAbsent("info", headers); return message; }  @Override Message postProcessMessage(final Message message);  }### Answer:
@Test public void addInfoHeadersToMessage() { infoHeaderMessagePostProcessor.postProcessMessage(message); Map<String, Object> headers = (Map<String, Object>) message.getMessageProperties().getHeaders().get("info"); assertThat(headers.get("info-key"), is(equalTo("info-value"))); assertThat(headers.get("spring-application-name"), is(equalTo("my-application-name"))); assertNotNull(headers.get("execution-time")); }
@Test public void addDefaultHeadersToMessage() { infoHeaderMessagePostProcessor.getHeaders().clear(); infoHeaderMessagePostProcessor.postProcessMessage(message); Map<String, Object> headers = (Map<String, Object>) message.getMessageProperties().getHeaders().get("info"); assertThat(headers.get("spring-application-name"), is(equalTo("my-application-name"))); assertNotNull(headers.get("execution-time")); }