public final class Assert extends Object
Modifier and Type | Method and Description |
---|---|
static void |
assertFalse(boolean bool) |
static void |
assertFalse(boolean bool,
String message,
Object... args) |
static void |
assertFalse(Object input,
org.apache.commons.collections.Predicate predicate) |
static void |
assertGreaterZero(Double value) |
static void |
assertGreaterZero(Double value,
String message) |
static void |
assertGreaterZero(Integer value) |
static void |
assertGreaterZero(Integer value,
String message) |
static void |
assertNotBlank(String input) |
static void |
assertNotBlank(String input,
String message) |
static void |
assertNotEmpty(String input) |
static void |
assertNotEmpty(String input,
String message) |
static void |
assertNotNull(Object input) |
static void |
assertNotNull(Object input,
String message) |
static void |
assertNotNullOrEmpty(Collection<?> collection) |
static void |
assertNotNullOrEmpty(Collection<?> collection,
String message) |
static void |
assertNotNullOrEmpty(Map<?,?> map) |
static void |
assertNotNullOrEmpty(Map<?,?> map,
String message) |
static void |
assertNotNullOrEmpty(Object[] array) |
static void |
assertNotNullOrEmpty(Object[] array,
String message) |
static void |
assertNull(Object input) |
static void |
assertNull(Object input,
String message) |
static void |
assertTrue(boolean bool) |
static void |
assertTrue(boolean bool,
String message,
Object... args) |
static void |
assertTrue(Object input,
org.apache.commons.collections.Predicate predicate) |
public static void assertTrue(Object input, org.apache.commons.collections.Predicate predicate) throws IllegalArgumentException
input
- input to test.predicate
- predicate to apply.IllegalArgumentException
- if predicate rejected input.public static void assertTrue(boolean bool) throws IllegalArgumentException
bool
- boolean to test.IllegalArgumentException
- if bool is false.public static void assertTrue(boolean bool, String message, Object... args) throws IllegalArgumentException
message
- message.bool
- boolean to test.args
- arguments to set, optionalIllegalArgumentException
- if bool is false.public static void assertFalse(boolean bool) throws IllegalArgumentException
bool
- boolean to test.IllegalArgumentException
- if bool is true.public static void assertFalse(boolean bool, String message, Object... args) throws IllegalArgumentException
bool
- boolean to test.message
- message.args
- optinal arguments.IllegalArgumentException
- if bool is true.public static void assertFalse(Object input, org.apache.commons.collections.Predicate predicate) throws IllegalArgumentException
input
- input to test.predicate
- predicate to apply.IllegalArgumentException
- if predicate didn't rejected input.public static void assertNotNullOrEmpty(Collection<?> collection) throws IllegalArgumentException
collection
- collection to test.IllegalArgumentException
- if collection is null or empty.public static void assertNotNullOrEmpty(Collection<?> collection, String message) throws IllegalArgumentException
collection
- collection to test.message
- the message.IllegalArgumentException
- if collection is null or empty.public static void assertNotNullOrEmpty(Object[] array) throws IllegalArgumentException
array
- collection to test.IllegalArgumentException
- if collection is null or empty.public static void assertNotNullOrEmpty(Object[] array, String message) throws IllegalArgumentException
array
- array to test.message
- the message.IllegalArgumentException
- if collection is null or empty.public static void assertNotNullOrEmpty(Map<?,?> map) throws IllegalArgumentException
map
- collection to test.IllegalArgumentException
- if collection is null or empty.public static void assertNotNullOrEmpty(Map<?,?> map, String message) throws IllegalArgumentException
map
- map to test.message
- the message.IllegalArgumentException
- if collection is null or empty.public static void assertNotEmpty(String input) throws IllegalArgumentException
input
- input to test.IllegalArgumentException
- if input is null or empty.public static void assertNotEmpty(String input, String message) throws IllegalArgumentException
input
- input to test.message
- the message.IllegalArgumentException
- if input is null or empty.public static void assertNotBlank(String input) throws IllegalArgumentException
input
- input to test.IllegalArgumentException
- if input is null or empty.public static void assertNotBlank(String input, String message) throws IllegalArgumentException
input
- input to test.message
- the message.IllegalArgumentException
- if input is null or empty.public static void assertNotNull(Object input) throws IllegalArgumentException
input
- input to test.IllegalArgumentException
- if input is null.public static void assertNotNull(Object input, String message) throws IllegalArgumentException
input
- input to test.message
- the message.IllegalArgumentException
- if input is null.public static void assertNull(Object input) throws IllegalArgumentException
input
- input to test.IllegalArgumentException
- if input isn't null.public static void assertNull(Object input, String message) throws IllegalArgumentException
input
- input to test.message
- the message.IllegalArgumentException
- if input isn't null.public static void assertGreaterZero(Integer value) throws IllegalArgumentException
value
- value to test.IllegalArgumentException
- if value is null or <= 0.public static void assertGreaterZero(Double value) throws IllegalArgumentException
value
- value to test.IllegalArgumentException
- if value is null or <= 0.public static void assertGreaterZero(Double value, String message) throws IllegalArgumentException
value
- value to test.message
- the message.IllegalArgumentException
- if value is null or <= 0.public static void assertGreaterZero(Integer value, String message) throws IllegalArgumentException
value
- value to test.message
- the message.IllegalArgumentException
- if value is null or <= 0.Copyright © 2018 Hitachi Vantara. All rights reserved.