java.lang.Object
org.seppiko.commons.utils.Assert
Assertion
- Author:
- Leonard Woo
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidAssert that expected and actual are equal.static voidAssert that expected and actual are equal.static voidif string text has not any char without whitespace throw messagestatic voidif true throw messagestatic voidif not true throw messagestatic RuntimeExceptionThrow Exception to RuntimeException.
-
Method Details
-
isTrue
if not true throw message- Parameters:
expression- boolean expression.message- message.- Throws:
IllegalArgumentException- if expression is false throw this.
-
isFalse
if true throw message- Parameters:
expression- boolean expression.message- message.- Throws:
IllegalArgumentException- if expression is true throw this.
-
equals
Assert that expected and actual are equal.- Parameters:
expected- expected value.actual- the value to check againstexpected.
-
equals
Assert that expected and actual are equal.- Parameters:
expected- expected value.actual- the value to check againstexpected.message- the identifying message for theAssertionError(nullokay).
-
hasText
if string text has not any char without whitespace throw message- Parameters:
text- string text.message- message.- Throws:
NullPointerException- if text have not any char throw this.
-
sneakyThrow
Throw Exception to RuntimeException.try { throw new Exception("test"); } catch (Throwable t) { throw Assert.sneakyThrow(t); }- Parameters:
t- any exception.- Returns:
RuntimeException.- Throws:
NullPointerException- if t isnullthrow this.
-