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"
9393flatbuffers = " 2.0.0"
9494
9595[libraries ]
96+ hamcrest = { group = " org.hamcrest" , name = " hamcrest" , version.ref = " hamcrest" }
9697hdrhistogram = { group = " org.hdrhistogram" , name = " HdrHistogram" , version.ref = " hdrhistogram" }
9798jakartaannotation = { group = " jakarta.annotation" , name = " jakarta.annotation-api" , version.ref = " jakarta_annotation" }
9899jodatime = { group = " joda-time" , name = " joda-time" , version.ref = " joda" }
99100jna = { group = " net.java.dev.jna" , name = " jna" , version.ref = " jna" }
100101jtscore = { group = " org.locationtech.jts" , name = " jts-core" , version.ref = " jts" }
102+ junit = { group = " junit" , name = " junit" , version.ref = " junit" }
101103jzlib = { group = " com.jcraft" , name = " jzlib" , version.ref = " jzlib" }
102104log4japi = { group = " org.apache.logging.log4j" , name = " log4j-api" , version.ref = " log4j" }
103105log4jjul = { group = " org.apache.logging.log4j" , name = " log4j-jul" , version.ref = " log4j" }
Original file line number Diff line number Diff line change 2020 archivesName = ' opensearch-agent-policy'
2121}
2222
23- disableTasks(' forbiddenApisMain' )
23+ disableTasks(' forbiddenApisMain' , ' forbiddenApisTest ' , ' testingConventions ' )
2424
2525dependencies {
26- testImplementation(project(" :test:framework" ))
26+ testImplementation libs. junit
27+ testImplementation libs. hamcrest
2728}
Original file line number Diff line number Diff line change 77 */
88package org .opensearch .secure_sm .policy ;
99
10- import org .opensearch . test . OpenSearchTestCase ;
10+ import org .junit . Test ;
1111
1212import java .io .IOException ;
1313import java .io .Reader ;
1414import java .io .StringReader ;
1515import java .util .List ;
1616
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 {
1821 private static final String POLICY = """
1922 grant codeBase "TestCodeBase" {
2023 permission java.net.NetPermission "accessUnixDomainSocket";
@@ -26,6 +29,7 @@ public class PolicyParserTests extends OpenSearchTestCase {
2629 };
2730 """ ;
2831
32+ @ Test
2933 public void testPolicy () throws IOException , PolicyParser .ParsingException {
3034 try (Reader reader = new StringReader (POLICY )) {
3135 final List <GrantEntry > grantEntries = PolicyParser .read (reader );
You can’t perform that action at this time.
0 commit comments