String data = "1,B2,Keira,Knightley,ISIN,XX23456789,BUY,Share,400.25,EUR,14-01-2009,16-02-2010 23:21:59\r\n";
template.sendBody("direct:out", data);
assertMockEndpointsSatisfied();
Order order = getMockEndpoint("mock:out").getReceivedExchanges().get(0).getIn().getBody(Order.class);
assertEquals(1, order.getOrderNr());
assertEquals("BUY", order.getOrderType());
assertEquals("B2", order.getClientNr());
assertEquals("Keira", order.getFirstName());
assertEquals("Knightley", order.getLastName());
assertEquals(new BigDecimal("400.25"), order.getAmount());
assertEquals("ISIN", order.getInstrumentCode());
assertEquals("XX23456789", order.getInstrumentNumber());
assertEquals("Share", order.getInstrumentType());
assertEquals("EUR", order.getCurrency());
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
// 4 hour shift
// 16-02-2010 23:21:59 by GMT+4
calendar.set(2010, 1, 16, 19, 21, 59);
calendar.set(Calendar.MILLISECOND, 0);
assertEquals(calendar.getTime(), order.getOrderDateTime());
}