@Test public void assertHasText_throwsIllegalArgumentExceptionContainingMessage() { String message = "A message"; assertThatThrownBy(() -> { Assertions.assertHasText(null, message); }).isInstanceOf(IllegalArgumentException.class).hasMessage(message); assertThatThrownBy(() -> { Assertions.assertHasText("", message); }).isInstanceOf(IllegalArgumentException.class).hasMessage(message); assertThatThrownBy(() -> { Assertions.assertHasText(" ", message); }).isInstanceOf(IllegalArgumentException.class).hasMessage(message); }
public static void assertHasText(String string, String message) { if (string == null || string.trim().isEmpty()) { throw new IllegalArgumentException(message); } }
Assertions { public static void assertHasText(String string, String message) { if (string == null || string.trim().isEmpty()) { throw new IllegalArgumentException(message); } } }
Assertions { public static void assertHasText(String string, String message) { if (string == null || string.trim().isEmpty()) { throw new IllegalArgumentException(message); } } private  Assertions(); }
Assertions { public static void assertHasText(String string, String message) { if (string == null || string.trim().isEmpty()) { throw new IllegalArgumentException(message); } } private  Assertions(); static void assertNotNull(Object object, String message); static void assertHasText(String string, String message); }
Assertions { public static void assertHasText(String string, String message) { if (string == null || string.trim().isEmpty()) { throw new IllegalArgumentException(message); } } private  Assertions(); static void assertNotNull(Object object, String message); static void assertHasText(String string, String message);  }