assertEquals("GOLD123456", confirmation.getReservationCode());
}
@Test
public void testRejection() {
CancellationRequest cancellationRequest = new CancellationRequest();
cancellationRequest.setReservationCode("SILVER123456");
input.send(MessageBuilder.withPayload(cancellationRequest).build());
Message<?> confirmedMessage = confirmed.receive(0);
assertNull(confirmedMessage);
Message<?> rejectedMessage = rejected.receive(0);
assertNotNull(rejectedMessage);
assertEquals(CancellationRequest.class, rejectedMessage.getPayload().getClass());
CancellationRequest request = (CancellationRequest) rejectedMessage.getPayload();
assertEquals("SILVER123456", request.getReservationCode());
}