use of com.amazonaws.services.identitymanagement.model.GetRoleResult in project cloudbreak by hortonworks.
the class AwsIamServiceTest method validRole.
@Test
public void validRole() {
String roleArn = "account/validRole";
Role expectedRole = new Role().withArn(roleArn);
GetRoleResult getRoleResult = mock(GetRoleResult.class);
when(getRoleResult.getRole()).thenReturn(expectedRole);
when(iam.getRole(any(GetRoleRequest.class))).thenReturn(getRoleResult);
ValidationResultBuilder validationRequestBuilder = new ValidationResultBuilder();
Role role = awsIamService.getRole(iam, roleArn, validationRequestBuilder);
assertThat(role.getArn()).isEqualTo(roleArn);
assertThat(validationRequestBuilder.build().hasError()).isFalse();
}
Aggregations