@Test public void testFindTaskEventsForNotExistingTask() { String invalidId = "-999"; try { taskClient.findTaskEvents(CONTAINER_ID, -999L, 0, 10); fail("KieServicesException should be thrown when task not found"); } catch (KieServicesException e) { if(configuration.isRest()) { KieServerAssert.assertResultContainsString(e.getMessage(), "Could not find task instance with id \"" + invalidId + "\""); KieServicesHttpException httpEx = (KieServicesHttpException) e; assertEquals(Integer.valueOf(404), httpEx.getHttpCode()); } else { assertTrue(e.getMessage().contains("No task found with id " + invalidId)); } } catch (TaskNotFoundException tnfe) { assertTrue(tnfe.getMessage().contains("No task found with id " + invalidId)); } }
@Test public void testFindTaskEventsForNotExistingTask() { String invalidId = "-9,999"; try { taskClient.findTaskEvents(-9999l, 0, 10); fail("KieServicesException should be thrown when task not found"); } catch (KieServicesException e) { if(configuration.isRest()) { KieServerAssert.assertResultContainsString(e.getMessage(), "Could not find task instance with id \"" + invalidId + "\""); KieServicesHttpException httpEx = (KieServicesHttpException) e; assertEquals(Integer.valueOf(404), httpEx.getHttpCode()); } else { assertTrue(e.getMessage().contains("No task found with id " + invalidId)); } } catch (TaskNotFoundException tnfe) { assertTrue(tnfe.getMessage().contains("No task found with id " + invalidId)); } }
KieServerAssert.assertNullOrEmpty("Task events list is not empty.", events); } catch (TaskNotFoundException e) { assertTrue(e.getMessage().contains( "No task found with id " + taskInstance.getId() )); } catch (KieServicesException ee) { if(configuration.isRest()) {
KieServerAssert.assertNullOrEmpty("Task events list is not empty.", events); } catch (TaskNotFoundException e) { assertTrue(e.getMessage().contains( "No task found with id " + taskInstance.getId() )); } catch (KieServicesException ee) { if(configuration.isRest()) {