@Test public void manageFailureToLoadABuilder() { when(buildInfoService.getBuildInfo(any())).thenReturn(null); assertThatThrownBy(() -> sessionService.newDefaultKieSessionWithPseudoClock(kieModule)) .isInstanceOf(IllegalStateException.class) .hasMessage("Failed to clone Builder."); }
@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);  }