Skip to content

Commit

Permalink
Terminate TestThreadPool
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Aug 16, 2024
1 parent 7374479 commit efac919
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public void testSingleIdentityPluginSucceeds() {
List<IdentityPlugin> pluginList1 = List.of(identityPlugin1);
IdentityService identityService1 = new IdentityService(Settings.EMPTY, threadPool, pluginList1);
assertThat(identityService1.getTokenManager(), is(instanceOf(ShiroTokenManager.class)));
terminate(threadPool);
}

public void testMultipleIdentityPluginsFail() {
Expand All @@ -40,6 +41,7 @@ public void testMultipleIdentityPluginsFail() {
List<IdentityPlugin> pluginList = List.of(identityPlugin1, identityPlugin2, identityPlugin3);
Exception ex = assertThrows(OpenSearchException.class, () -> new IdentityService(Settings.EMPTY, threadPool, pluginList));
assert (ex.getMessage().contains("Multiple identity plugins are not supported,"));
terminate(threadPool);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public void testSingleIdentityPluginSucceeds() {
IdentityService identityService1 = new IdentityService(Settings.EMPTY, threadPool, pluginList1);
assertTrue(identityService1.getUserSubject().getPrincipal().getName().equalsIgnoreCase("Unauthenticated"));
assertThat(identityService1.getTokenManager(), is(instanceOf(NoopTokenManager.class)));
terminate(threadPool);
}

public void testMultipleIdentityPluginsFail() {
Expand All @@ -41,5 +42,6 @@ public void testMultipleIdentityPluginsFail() {
List<IdentityPlugin> pluginList = List.of(identityPlugin1, identityPlugin2, identityPlugin3);
Exception ex = assertThrows(OpenSearchException.class, () -> new IdentityService(Settings.EMPTY, threadPool, pluginList));
assert (ex.getMessage().contains("Multiple identity plugins are not supported,"));
terminate(threadPool);
}
}

0 comments on commit efac919

Please sign in to comment.