This repository has been archived by the owner on Sep 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#327 Can now deploy privileges with CMA
- Loading branch information
Showing
8 changed files
with
110 additions
and
5 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
41 changes: 41 additions & 0 deletions
41
src/test/java/com/marklogic/appdeployer/command/security/DeployPrivilegesWithCmaTest.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,41 @@ | ||
package com.marklogic.appdeployer.command.security; | ||
|
||
import com.marklogic.appdeployer.AbstractAppDeployerTest; | ||
import com.marklogic.appdeployer.command.CommandContext; | ||
import com.marklogic.mgmt.resource.ResourceManager; | ||
import com.marklogic.mgmt.resource.security.PrivilegeManager; | ||
import org.junit.Test; | ||
|
||
public class DeployPrivilegesWithCmaTest extends AbstractAppDeployerTest { | ||
|
||
@Test | ||
public void test() { | ||
initializeAppDeployer(new TestDeployPrivilegesCommand()); | ||
|
||
PrivilegeManager mgr = new PrivilegeManager(manageClient); | ||
appConfig.setDeployPrivilegesWithCma(true); | ||
|
||
try { | ||
deploySampleApp(); | ||
assertTrue(mgr.exists("sample-app-execute-1")); | ||
assertTrue(mgr.exists("sample-app-execute-1")); | ||
|
||
deploySampleApp(); | ||
assertTrue(mgr.exists("sample-app-execute-1")); | ||
assertTrue(mgr.exists("sample-app-execute-1")); | ||
} finally { | ||
initializeAppDeployer(new DeployPrivilegesCommand()); | ||
|
||
undeploySampleApp(); | ||
assertFalse(mgr.exists("sample-app-execute-1")); | ||
assertFalse(mgr.exists("sample-app-execute-1")); | ||
} | ||
} | ||
} | ||
|
||
class TestDeployPrivilegesCommand extends DeployPrivilegesCommand { | ||
@Override | ||
protected ResourceManager getResourceManager(CommandContext context) { | ||
throw new RuntimeException("This should not be called when deploying with CMA"); | ||
} | ||
} |