-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fd5164b
commit e778b4f
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
apps/opik-backend/src/test/java/com/comet/opik/utils/ValidationUtilsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.comet.opik.utils; | ||
|
||
import org.junit.jupiter.params.ParameterizedTest; | ||
import org.junit.jupiter.params.provider.Arguments; | ||
import org.junit.jupiter.params.provider.MethodSource; | ||
|
||
import java.util.stream.Stream; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
class ValidationUtilsTest { | ||
|
||
public static Stream<Arguments> testNullOrNotBlank() { | ||
return Stream.of( | ||
Arguments.of("", false), | ||
Arguments.of(" ", false), | ||
Arguments.of("\n", false), | ||
Arguments.of("a", true), | ||
Arguments.of(" a ", true), | ||
Arguments.of("\n a \n", true) | ||
); | ||
} | ||
|
||
@ParameterizedTest | ||
@MethodSource | ||
void testNullOrNotBlank(String input, boolean expected) { | ||
assertEquals(expected, input.matches(ValidationUtils.NULL_OR_NOT_BLANK)); | ||
} | ||
|
||
} |