Search in sources :

Example 6 with Action

use of com.amazonaws.auth.policy.Action in project cerberus by Nike-Inc.

the class KmsPolicyServiceTest method test_that_statementAllowsAction_returns_true_when_action_in_statement.

@Test
public void test_that_statementAllowsAction_returns_true_when_action_in_statement() {
    Action action = KMSActions.CancelKeyDeletion;
    Statement statement = new Statement(Statement.Effect.Allow).withActions(action);
    assertTrue(kmsPolicyService.statementIncludesAction(statement, action));
}
Also used : Action(com.amazonaws.auth.policy.Action) Statement(com.amazonaws.auth.policy.Statement) Test(org.junit.Test)

Aggregations

Action (com.amazonaws.auth.policy.Action)6 Statement (com.amazonaws.auth.policy.Statement)4 Condition (com.amazonaws.auth.policy.Condition)2 Policy (com.amazonaws.auth.policy.Policy)2 Principal (com.amazonaws.auth.policy.Principal)2 Resource (com.amazonaws.auth.policy.Resource)2 ArrayList (java.util.ArrayList)2 Test (org.junit.Test)2 JsonPolicyReader (com.amazonaws.auth.policy.internal.JsonPolicyReader)1 ContextEntry (com.amazonaws.services.identitymanagement.model.ContextEntry)1 ContextKeyTypeEnum (com.amazonaws.services.identitymanagement.model.ContextKeyTypeEnum)1 SimulatePrincipalPolicyRequest (com.amazonaws.services.identitymanagement.model.SimulatePrincipalPolicyRequest)1 SimulatePrincipalPolicyResult (com.amazonaws.services.identitymanagement.model.SimulatePrincipalPolicyResult)1 GetCallerIdentityRequest (com.amazonaws.services.securitytoken.model.GetCallerIdentityRequest)1 GetCallerIdentityResult (com.amazonaws.services.securitytoken.model.GetCallerIdentityResult)1 AwsCredentialCachingConfig (com.sequenceiq.cloudbreak.cloud.aws.common.cache.AwsCredentialCachingConfig)1 AmazonIdentityManagementClient (com.sequenceiq.cloudbreak.cloud.aws.common.client.AmazonIdentityManagementClient)1 AmazonSecurityTokenServiceClient (com.sequenceiq.cloudbreak.cloud.aws.common.client.AmazonSecurityTokenServiceClient)1 AwsPermissionMissingException (com.sequenceiq.cloudbreak.cloud.aws.common.exception.AwsPermissionMissingException)1 AwsCredentialView (com.sequenceiq.cloudbreak.cloud.aws.common.view.AwsCredentialView)1