MeetingStartEvent meetingEvent = new MeetingStartEvent(meeting);
meetingsEP.insert(meetingEvent);
//30 minutes later, a call to Paul arrives.
clock.advanceTime(30, TimeUnit.MINUTES);
IncomingCallEvent callEvent = new IncomingCallEvent(paul);
incomingCallsEP.insert(callEvent);
assertEquals(IncomingCallEvent.CallStatus.PENDING, callEvent.getStatus());
ksession.fireAllRules();
//because Paul is in a meeting the call is redirected to an answering machine
assertEquals(IncomingCallEvent.CallStatus.REDIRECTED, callEvent.getStatus());
//at the same time, an incoming call to Michael arrives
callEvent = new IncomingCallEvent(michael);
incomingCallsEP.insert(callEvent);
assertEquals(IncomingCallEvent.CallStatus.PENDING, callEvent.getStatus());
clock.advanceTime(1, TimeUnit.MINUTES);
System.out.println("FIRE FIRE");
ksession.fireAllRules();
//because Michael is not in a meeting the call is dispatched
assertEquals(IncomingCallEvent.CallStatus.DISPATCHED, callEvent.getStatus());
ksession.dispose();
}