The statement that a string not empty in junit can be done in the following ways:
assertTrue(!string.isEmpty()); assertFalse(string.isEmpty()); assertThat(string.toCharArray(), is(not(emptyArray()));
My question is : is there a better way to check this: something like:
assertThat(string, is(not(empty())) ?
java unit-testing junit hamcrest
Armine
source share