@Theory public void test_isNotIn_assertion(ZonedDateTime referenceDate) { // WHEN assertThat(referenceDate) .isNotIn(referenceDate.plusNanos(1).toString(), referenceDate.plusNanos(2).toString()); // THEN verify_that_isNotIn_assertion_fails_and_throws_AssertionError(referenceDate); }
private static void verify_that_isNotIn_assertion_fails_and_throws_AssertionError( ZonedDateTime reference) { try { assertThat(reference).isNotIn(reference.toString(), reference.plusNanos(1).toString()); } catch (AssertionError e) { // AssertionError was expected return; } fail("Should have thrown AssertionError"); }