use of org.drools.testcoverage.common.model.TestEvent in project drools by kiegroup.
the class StarImportTest method starImportedFactAlsoDeclaredInDRL.
/**
* Tests that rule fires if supplied with a fact that is imported using
* "star" import.
*
* See BZ 973264.
*/
@Test
public void starImportedFactAlsoDeclaredInDRL() throws Exception {
session.setGlobal("LOGGER", LOGGER);
AgendaEventListener ael = mock(AgendaEventListener.class);
session.addEventListener(ael);
List<Command<?>> commands = new ArrayList<Command<?>>();
commands.add(getCommands().newInsert(new TestEvent(1, "event 1", 0)));
commands.add(getCommands().newFireAllRules());
session.execute(getCommands().newBatchExecution(commands, null));
// the rule should have fired exactly once
try {
verify(ael, times(1)).afterMatchFired(any(AfterMatchFiredEvent.class));
} catch (WantedButNotInvoked e) {
Assertions.fail("The rule does not fire. For more information see BZ 973264", e);
}
}
Aggregations