Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions cdc-service/src/test/java/com/xtrmetl/cdc/util/EnvUtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,30 @@

import org.junit.jupiter.api.Test;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

class EnvUtilsTest {

@Test
void publicEnvironmentUtilityHasBeginnerReadableJavadocs() throws IOException {
String source = Files.readString(Path.of(
"src/main/java/com/xtrmetl/cdc/util/EnvUtils.java"
));

assertTrue(source.contains("Environment-variable access helpers for CDC deployment configuration."));
assertTrue(source.contains("Returns the configured environment value, or the supplied default when it is missing or blank."));
assertTrue(source.contains("Returns the required environment value and fails when it is missing or blank."));
}

@Test
void getEnvReturnsDefaultWhenMissingOrBlank() {
Map<String, String> env = new HashMap<>();
Expand Down
Loading