@Autowired
private PollableChannel output;
@Test
public void verifyTransformation() {
Passenger payload = new Passenger();
Profile profile = new Profile();
profile.setEmailAddress(EMAIL_ADDRESS);
payload.addProfile(profile);
Message<Passenger> passengerToTransform = MessageBuilder.withPayload(payload).build();
input.send(passengerToTransform);
Message<Passenger> transformedPassenger = (Message<Passenger>) output.receive(0);
assertEquals(transformedPassenger.getHeaders().get(MailHeaders.TO), EMAIL_ADDRESS);
}