Skip to content

Commit

Permalink
Run CI/CD on Java 8, 11, 14 and 17.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <dblock@dblock.org>
  • Loading branch information
dblock committed Feb 28, 2022
1 parent 1da8807 commit 63aa43a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ jobs:
build:
strategy:
matrix:
java: [14]
java:
- 8
- 11
- 14
- 17

name: Build and Test
runs-on: ubuntu-latest
Expand Down
10 changes: 7 additions & 3 deletions src/test/java/org/opensearch/commons/InjectSecurityTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import static org.opensearch.commons.ConfigConstants.OPENSEARCH_SECURITY_USE_INJECTED_USER_FOR_PLUGINS;

import java.util.Arrays;
import java.util.Map;
import java.util.HashMap;

import org.junit.jupiter.api.Test;
import org.opensearch.common.settings.Settings;
Expand Down Expand Up @@ -114,7 +114,9 @@ public void testInjectProperty() {
assertTrue(helper.injectProperty("property1", true));
assertTrue(helper.injectProperty("property2", "some value"));
assertTrue(helper.injectProperty("property3", ""));
assertTrue(helper.injectProperty("property4", Map.of("key", "value")));
assertTrue(helper.injectProperty("property4", new HashMap<String, String>() {{
put("key", "value");
}}));
// verify the set properties are not null and equal to what was set
assertNull(threadContext.getTransient("property"));
assertNotNull(threadContext.getTransient("property1"));
Expand All @@ -124,7 +126,9 @@ public void testInjectProperty() {
assertNotNull(threadContext.getTransient("property3"));
assertEquals("", threadContext.getTransient("property3"));
assertNotNull(threadContext.getTransient("property4"));
assertEquals(Map.of("key", "value"), threadContext.getTransient("property4"));
assertEquals(new HashMap<String, String>() {{
put("key", "value");
}}, threadContext.getTransient("property4"));
}
assertEquals("1", threadContext.getHeader("default"));
assertEquals("opendistro", threadContext.getHeader("name"));
Expand Down

0 comments on commit 63aa43a

Please sign in to comment.