@Test public void testAssertDefaultException() { Assert assertAction = new Assert(); assertAction.setAction(new FailAction()); assertAction.execute(context); }
@Test(expectedExceptions = CitrusRuntimeException.class) @SuppressWarnings({"unchecked", "rawtypes"}) public void testMissingException() { Assert assertAction = new Assert(); assertAction.setAction(new EchoAction()); Class exceptionClass = CitrusRuntimeException.class; assertAction.setException(exceptionClass); assertAction.execute(context); }
@Test @SuppressWarnings({"unchecked", "rawtypes"}) public void testAssertException() { Assert assertAction = new Assert(); assertAction.setAction(new FailAction()); Class exceptionClass = CitrusRuntimeException.class; assertAction.setException(exceptionClass); assertAction.execute(context); }
@Test(expectedExceptions = CitrusRuntimeException.class) @SuppressWarnings({"unchecked", "rawtypes"}) public void testAssertExceptionWrongMessageCheck() { Assert assertAction = new Assert(); FailAction fail = new FailAction(); fail.setMessage("This went wrong!"); assertAction.setAction(fail); Class exceptionClass = CitrusRuntimeException.class; assertAction.setException(exceptionClass); assertAction.setMessage("Excpected error is something else"); assertAction.execute(context); }