use of com.amazonaws.services.identitymanagement.model.UpdateAssumeRolePolicyRequest in project pipeline-aws-plugin by jenkinsci.
the class UpdateTrustPolicyStepTests method updateTrustPolicy.
@Test
public void updateTrustPolicy() throws Exception {
WorkflowJob job = this.jenkinsRule.jenkins.createProject(WorkflowJob.class, "updateTest");
Mockito.when(this.iam.updateAssumeRolePolicy(Mockito.any(UpdateAssumeRolePolicyRequest.class))).thenReturn(new UpdateAssumeRolePolicyResult());
job.setDefinition(new CpsFlowDefinition("" + "node {\n" + " writeFile(file: 'testfile', text: '{}')\n" + " updateTrustPolicy(roleName: 'testRole', policyFile: 'testfile')\n" + "}\n", true));
this.jenkinsRule.assertBuildStatusSuccess(job.scheduleBuild2(0));
Mockito.verify(this.iam).updateAssumeRolePolicy(new UpdateAssumeRolePolicyRequest().withRoleName("testRole").withPolicyDocument("{}"));
}
Aggregations