mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 16:05:44 +01:00
Add unit test
This commit is contained in:
@@ -0,0 +1,28 @@
|
|||||||
|
package sonia.scm.api.v2.resources;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
|
import static java.util.Collections.emptySet;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
|
class NoBlankStringsValidatorTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void shouldAcceptNonEmptyElements() {
|
||||||
|
assertTrue(new NoBlankStringsValidator().isValid(Arrays.asList("not", "empty"), null));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void shouldFailForEmptyElements() {
|
||||||
|
assertFalse(new NoBlankStringsValidator().isValid(Arrays.asList("one", "", "three"), null));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void shouldAcceptEmptyList() {
|
||||||
|
assertTrue(new NoBlankStringsValidator().isValid(emptySet(), null));
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user