File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
src/test/java/com/filestack Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ package com.filestack
2+
3+ import org.junit.Assert
4+ import org.junit.Assert.*
5+ import org.junit.Test
6+
7+ class ConfigTest {
8+
9+ @Test
10+ fun `verifies security` () {
11+ var config = Config (" api_key" )
12+ assertFalse(config.hasSecurity())
13+
14+ config = Config (" api_key" , " return_url" , " policy" , null )
15+ assertFalse(config.hasSecurity())
16+
17+ config = Config (" api_key" , " return_url" , null , " policy" )
18+ assertFalse(config.hasSecurity())
19+
20+ config = Config (" api_key" , " return_url" , " policy" , " signature" )
21+ assertTrue(config.hasSecurity())
22+
23+ val policy = Policy .Builder ()
24+ .giveFullAccess()
25+ .build(" api_key" )
26+
27+ config = Config (" api_key" , policy)
28+ assertTrue(config.hasSecurity())
29+ }
30+
31+ }
You can’t perform that action at this time.
0 commit comments