use of org.talend.esb.sam.server.persistence.EventRowMapper in project tesb-rt-se by Talend.
the class MonitoringServiceImplTest method testWritingSeveralEvents.
// @Before
// public void setUp() throws Exception {
// executeSqlScript("create.sql", true);
// }
@Test
public void testWritingSeveralEvents() {
List<Event> events = new ArrayList<Event>();
events.add(generateEvent());
events.add(generateEvent());
events.add(generateEvent());
monitoringSerivce.putEvents(events);
for (Event event : events) {
EventRowMapper rowMapper = new EventRowMapper();
Event loaded = jdbcTemplate.queryForObject("select * from EVENTS where ID=?", rowMapper, event.getPersistedId());
Assert.assertNotNull(loaded);
Assert.assertEquals(event.getPersistedId(), loaded.getPersistedId());
}
}
Aggregations