File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed
libs/agent-sm/agent-policy
src/test/java/org/opensearch/secure_sm/policy Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -93,11 +93,13 @@ arrow = "18.1.0"
93
93
flatbuffers = " 2.0.0"
94
94
95
95
[libraries ]
96
+ hamcrest = { group = " org.hamcrest" , name = " hamcrest" , version.ref = " hamcrest" }
96
97
hdrhistogram = { group = " org.hdrhistogram" , name = " HdrHistogram" , version.ref = " hdrhistogram" }
97
98
jakartaannotation = { group = " jakarta.annotation" , name = " jakarta.annotation-api" , version.ref = " jakarta_annotation" }
98
99
jodatime = { group = " joda-time" , name = " joda-time" , version.ref = " joda" }
99
100
jna = { group = " net.java.dev.jna" , name = " jna" , version.ref = " jna" }
100
101
jtscore = { group = " org.locationtech.jts" , name = " jts-core" , version.ref = " jts" }
102
+ junit = { group = " junit" , name = " junit" , version.ref = " junit" }
101
103
jzlib = { group = " com.jcraft" , name = " jzlib" , version.ref = " jzlib" }
102
104
log4japi = { group = " org.apache.logging.log4j" , name = " log4j-api" , version.ref = " log4j" }
103
105
log4jjul = { group = " org.apache.logging.log4j" , name = " log4j-jul" , version.ref = " log4j" }
Original file line number Diff line number Diff line change 20
20
archivesName = ' opensearch-agent-policy'
21
21
}
22
22
23
- disableTasks(' forbiddenApisMain' )
23
+ disableTasks(' forbiddenApisMain' , ' forbiddenApisTest ' , ' testingConventions ' )
24
24
25
25
dependencies {
26
- testImplementation(project(" :test:framework" ))
26
+ testImplementation libs. junit
27
+ testImplementation libs. hamcrest
27
28
}
Original file line number Diff line number Diff line change 7
7
*/
8
8
package org .opensearch .secure_sm .policy ;
9
9
10
- import org .opensearch . test . OpenSearchTestCase ;
10
+ import org .junit . Test ;
11
11
12
12
import java .io .IOException ;
13
13
import java .io .Reader ;
14
14
import java .io .StringReader ;
15
15
import java .util .List ;
16
16
17
- public class PolicyParserTests extends OpenSearchTestCase {
17
+ import static org .junit .Assert .assertEquals ;
18
+ import static org .junit .Assert .assertNull ;
19
+
20
+ public class PolicyParserTests {
18
21
private static final String POLICY = """
19
22
grant codeBase "TestCodeBase" {
20
23
permission java.net.NetPermission "accessUnixDomainSocket";
@@ -26,6 +29,7 @@ public class PolicyParserTests extends OpenSearchTestCase {
26
29
};
27
30
""" ;
28
31
32
+ @ Test
29
33
public void testPolicy () throws IOException , PolicyParser .ParsingException {
30
34
try (Reader reader = new StringReader (POLICY )) {
31
35
final List <GrantEntry > grantEntries = PolicyParser .read (reader );
You can’t perform that action at this time.
0 commit comments