@@ -10,7 +10,8 @@ import org.junit.jupiter.api.Test
10
10
11
11
internal class ValidationHelpersTests {
12
12
13
- private val hostDentyList = listOf (
13
+ private val hostDenyList = listOf (
14
+ " www.amazon.com" ,
14
15
" 127.0.0.0/8" ,
15
16
" 10.0.0.0/8" ,
16
17
" 172.16.0.0/12" ,
@@ -20,8 +21,9 @@ internal class ValidationHelpersTests {
20
21
)
21
22
22
23
@Test
23
- fun `test ips in denylist` () {
24
+ fun `test hosts in denylist` () {
24
25
val ips = listOf (
26
+ " www.amazon.com" ,
25
27
" 127.0.0.1" , // 127.0.0.0/8
26
28
" 10.0.0.1" , // 10.0.0.0/8
27
29
" 10.11.12.13" , // 10.0.0.0/8
@@ -31,15 +33,15 @@ internal class ValidationHelpersTests {
31
33
" 9.9.9.9"
32
34
)
33
35
for (ip in ips) {
34
- assertEquals(true , isHostInDenylist(" https://$ip " , hostDentyList) )
36
+ assertEquals(true , isHostInDenylist(" https://$ip " , hostDenyList), " address $ip was supposed to be identified as in the deny list, but was not " )
35
37
}
36
38
}
37
39
38
40
@Test
39
- fun `test url in denylist` () {
40
- val urls = listOf (" https://www.amazon.com " , " https://mytest.com " , " https://mytest .com" )
41
+ fun `test hosts not in denylist` () {
42
+ val urls = listOf (" 156.4.77.1 " , " www.something .com" )
41
43
for (url in urls) {
42
- assertEquals(false , isHostInDenylist(url, hostDentyList) )
44
+ assertEquals(false , isHostInDenylist(" https:// $ url" , hostDenyList), " address $url was not supposed to be identified as in the deny list, but was " )
43
45
}
44
46
}
45
47
}
0 commit comments