use of org.springframework.integration.transformer.support.StaticHeaderValueMessageProcessor in project spring-integration by spring-projects.
the class MethodInvokingHeaderEnricherTests method overwriteId.
@Test
public void overwriteId() {
HeaderEnricher enricher = new HeaderEnricher(Collections.singletonMap(MessageHeaders.ID, new StaticHeaderValueMessageProcessor<>("foo")));
try {
enricher.afterPropertiesSet();
fail("BeanInitializationException expected");
} catch (Exception e) {
assertThat(e, instanceOf(BeanInitializationException.class));
assertThat(e.getMessage(), containsString("HeaderEnricher cannot override 'id' and 'timestamp' read-only headers."));
}
}
Aggregations