use of org.sakuli.exceptions.NonScreenshotException in project sakuli by ConSol.
the class TestCaseActionTest method testThrowExceptionWithScreenshot.
@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
@Test
public void testThrowExceptionWithScreenshot() throws Exception {
String exMessage = "TEST";
testling.throwException(exMessage, true);
ArgumentCaptor<Throwable> ac = ArgumentCaptor.forClass(Throwable.class);
verify(exceptionHandlerMock).handleException(ac.capture());
assertEquals(ac.getValue().getMessage(), exMessage);
assertFalse(ac.getValue() instanceof SakuliValidationException);
assertFalse(ac.getValue() instanceof NonScreenshotException);
assertTrue(ac.getValue() instanceof SakuliActionException);
}
use of org.sakuli.exceptions.NonScreenshotException in project sakuli by ConSol.
the class TestCaseActionTest method testThrowExceptionNoScreenshot.
@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
@Test
public void testThrowExceptionNoScreenshot() throws Exception {
String exMessage = "TEST";
testling.throwException(exMessage, false);
ArgumentCaptor<Throwable> ac = ArgumentCaptor.forClass(Throwable.class);
verify(exceptionHandlerMock).handleException(ac.capture());
assertEquals(ac.getValue().getMessage(), exMessage);
assertTrue(ac.getValue() instanceof SakuliValidationException);
assertTrue(ac.getValue() instanceof NonScreenshotException);
assertFalse(ac.getValue() instanceof SakuliActionException);
}
Aggregations