@Test public void newDefaultKieSessionWithPseudoClock() { final KieBase kBase = mock(KieBase.class); final KieSession kSession = mock(KieSession.class); doReturn(kBase).when(kieContainer).getKieBase(); doReturn(kSession).when(kBase).newKieSession(sessionConfigurationArgumentCaptor.capture(), eq(null)); final KieSession resultKSession = sessionService.newDefaultKieSessionWithPseudoClock(kieModule); final SessionConfiguration sessionConfiguration = sessionConfigurationArgumentCaptor.getValue(); verify(builder).build(); assertEquals(ClockType.PSEUDO_CLOCK, sessionConfiguration.getClockType()); assertEquals(resultKSession, kSession); }
@Override public KieSession newDefaultKieSessionWithPseudoClock(final KieModule project) { final KieContainer kieContainer = getKieContainer(project); if (kieContainer == null) { return null; } final SessionConfiguration conf = SessionConfiguration.newInstance(); conf.setClockType(ClockType.PSEUDO_CLOCK); return kieContainer.getKieBase().newKieSession(conf, null); }
SessionServiceImpl implements SessionService { @Override public KieSession newDefaultKieSessionWithPseudoClock(final KieModule project) { final KieContainer kieContainer = getKieContainer(project); if (kieContainer == null) { return null; } final SessionConfiguration conf = SessionConfiguration.newInstance(); conf.setClockType(ClockType.PSEUDO_CLOCK); return kieContainer.getKieBase().newKieSession(conf, null); } }
SessionServiceImpl implements SessionService { @Override public KieSession newDefaultKieSessionWithPseudoClock(final KieModule project) { final KieContainer kieContainer = getKieContainer(project); if (kieContainer == null) { return null; } final SessionConfiguration conf = SessionConfiguration.newInstance(); conf.setClockType(ClockType.PSEUDO_CLOCK); return kieContainer.getKieBase().newKieSession(conf, null); } SessionServiceImpl(); @Inject  SessionServiceImpl(final BuildInfoService buildInfoService); }
SessionServiceImpl implements SessionService { @Override public KieSession newDefaultKieSessionWithPseudoClock(final KieModule project) { final KieContainer kieContainer = getKieContainer(project); if (kieContainer == null) { return null; } final SessionConfiguration conf = SessionConfiguration.newInstance(); conf.setClockType(ClockType.PSEUDO_CLOCK); return kieContainer.getKieBase().newKieSession(conf, null); } SessionServiceImpl(); @Inject  SessionServiceImpl(final BuildInfoService buildInfoService); @Override KieSession newKieSession(KieModule project, String ksessionName); @Override KieSession newDefaultKieSessionWithPseudoClock(final KieModule project); }
SessionServiceImpl implements SessionService { @Override public KieSession newDefaultKieSessionWithPseudoClock(final KieModule project) { final KieContainer kieContainer = getKieContainer(project); if (kieContainer == null) { return null; } final SessionConfiguration conf = SessionConfiguration.newInstance(); conf.setClockType(ClockType.PSEUDO_CLOCK); return kieContainer.getKieBase().newKieSession(conf, null); } SessionServiceImpl(); @Inject  SessionServiceImpl(final BuildInfoService buildInfoService); @Override KieSession newKieSession(KieModule project, String ksessionName); @Override KieSession newDefaultKieSessionWithPseudoClock(final KieModule project);  }