Skip to content

Commit

Permalink
test(common-utils): Test EnvironmentVariableFilter with empty deny …
Browse files Browse the repository at this point in the history
…list

Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Dec 13, 2024
1 parent 0753d33 commit d2ba8e4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions utils/common/src/test/kotlin/EnvironmentVariableFilterTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,18 @@ class EnvironmentVariableFilterTest : StringSpec({

environment should containExactly(filteredEnvironment)
}

"An empty deny list should not deny anything" {
EnvironmentVariableFilter.reset(denySubstrings = emptyList())

EnvironmentVariableFilter.DEFAULT_DENY_SUBSTRINGS.forAll {
EnvironmentVariableFilter.isAllowed(it) shouldBe true
}

EnvironmentVariableFilter.DEFAULT_ALLOW_NAMES.forAll {
EnvironmentVariableFilter.isAllowed(it) shouldBe true
}

EnvironmentVariableFilter.isAllowed("PATH") shouldBe true
}
})

0 comments on commit d2ba8e4

Please sign in to comment.