Hello, folks!
I've just reproduced it:
Code:
@Test
public void testMultiValueMap() {
QueueChannel replyChannel = new QueueChannel();
DirectChannel requestChannel = new DirectChannel();
requestChannel.subscribe(new AbstractReplyProducingMessageHandler() {
@Override
protected Object handleRequestMessage(Message<?> requestMessage) {
return new Source("John", "Doe");
}
});
ContentEnricher enricher = new ContentEnricher();
enricher.setRequestChannel(requestChannel);
SpelExpressionParser parser = new SpelExpressionParser();
Map<String, Expression> propertyExpressions = new HashMap<String, Expression>();
propertyExpressions.put("name", parser.parseExpression("payload.lastName + ', ' + payload.firstName"));
enricher.setPropertyExpressions(propertyExpressions);
enricher.afterPropertiesSet();
Message<?> requestMessage = MessageBuilder.withPayload(new LinkedMultiValueMap()).setReplyChannel(replyChannel).build();
enricher.handleMessage(requestMessage);
Message<?> reply = replyChannel.receive(0);
MultiValueMap result = (MultiValueMap) reply.getPayload();
assertEquals("test", result.get("name"));
}
The problem is really laying on MultiValueMap. It requeries that the value should be java.util.List.
The simple fix of it - just wrap the expression with {}:
HTML Code:
<int:enricher id="deletePaymentInstrumentEnricher" input-channel="deletePayloadEnricher" >
<introperty name="paymentInstrumentToken" value="{onewerewrwerwe}" />
</int:enricher>
So, there is no any reason to open new JIRA.
Best regards,
Artem Bilan