RiverService { public boolean embarkTourists(int n) throws RiverServiceException { processInstance = ksession.startProcess("com.yahoo.sorelmitra.EmbarkTourists"); int state = processInstance.getState(); LOG.info("Process state is " + state); if (state != ProcessInstance.STATE_COMPLETED) { throw new RiverServiceException("Process state is not COMPLETED, but " + state); } return embarked; } RiverService(); void addBoat(Boat b); boolean embarkTourists(int n); RiverServiceFactory getKieFactory(); void setKieFactory(RiverServiceFactory kieFactory);  }
@Test public void testSingleTourist() throws RiverServiceException { Assert.assertEquals(10, cutter.getEmptySeats()); boolean result; result = rs.embarkTourists(6); Assert.assertTrue(result); Assert.assertEquals(4, cutter.getEmptySeats()); result = rs.embarkTourists(6); Assert.assertFalse(result); Assert.assertEquals(4, cutter.getEmptySeats()); result = rs.embarkTourists(4); Assert.assertTrue(result); Assert.assertEquals(0, cutter.getEmptySeats()); }