-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds integration tests for non-default RAC plugin
Signed-off-by: Darshit Chanpura <[email protected]>
- Loading branch information
1 parent
eee5ce1
commit 77c56be
Showing
4 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
.../java/org/opensearch/accesscontrol/resources/NonDefaultResourceAccessControlPluginIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.accesscontrol.resources; | ||
|
||
import org.opensearch.accesscontrol.resources.testplugins.TestRACPlugin; | ||
import org.opensearch.accesscontrol.resources.testplugins.TestResourcePlugin; | ||
import org.opensearch.plugins.Plugin; | ||
import org.opensearch.plugins.ResourceAccessControlPlugin; | ||
import org.opensearch.test.OpenSearchIntegTestCase; | ||
import org.hamcrest.MatcherAssert; | ||
import org.hamcrest.Matchers; | ||
|
||
import java.util.Collection; | ||
import java.util.List; | ||
|
||
public class NonDefaultResourceAccessControlPluginIT extends OpenSearchIntegTestCase { | ||
@Override | ||
protected Collection<Class<? extends Plugin>> nodePlugins() { | ||
return List.of(TestResourcePlugin.class, TestRACPlugin.class); | ||
} | ||
|
||
public void testSampleResourcePluginCallsTestRACPluginToManageResourceAccess() { | ||
ResourceAccessControlPlugin racPlugin = TestResourcePlugin.GuiceHolder.getResourceService().getResourceAccessControlPlugin(); | ||
MatcherAssert.assertThat(racPlugin.getClass(), Matchers.is(TestRACPlugin.class)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...nalClusterTest/java/org/opensearch/accesscontrol/resources/testplugins/TestRACPlugin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.accesscontrol.resources.testplugins; | ||
|
||
import org.opensearch.plugins.Plugin; | ||
import org.opensearch.plugins.ResourceAccessControlPlugin; | ||
|
||
public class TestRACPlugin extends Plugin implements ResourceAccessControlPlugin {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters