use of nl.nn.adapterframework.testutil.FixedQuerySenderMock.ResultSetBuilder in project iaf by ibissource.
the class DatabaseSchedulerTest method executeJob.
@Test
public void executeJob() throws Exception {
ResultSetBuilder builder = FixedQuerySenderMock.ResultSetBuilder.create();
builder.setValue("JOBNAME", "dummy name");
builder.setValue("JOBGROUP", "dummy group");
builder.setValue("ADAPTER", "testAdapter");
builder.setValue("RECEIVER", "testReceiver");
builder.setValue("CRON", "");
builder.setValue("EXECUTIONINTERVAL", "10");
builder.setValue("MESSAGE", "dummy message");
Adapter adapter = configuration.createBean(Adapter.class);
adapter.setName("testAdapter");
configuration.registerAdapter(adapter);
configuration.mockQuery("SELECT COUNT(*) FROM IBISSCHEDULES", builder.build());
job.execute(configuration.getIbisManager());
MessageKeeper messageKeeper = job.getMessageKeeper();
for (int i = 0; i < messageKeeper.size(); i++) {
MessageKeeperMessage message = messageKeeper.getMessage(i);
if ("ERROR".equals(message.getMessageLevel())) {
assertThat(message.getMessageText(), CoreMatchers.containsString("adapter [testAdapter] receiver [testReceiver] not registered"));
}
}
}
Aggregations