  @Test
  public void
      tests_that_generateCommonIamPrincipalAuthMetadata_checks_base_iam_role_arn_of_assumed_role_arn() {

    authenticationService.adminRoleArns = "arn:aws:iam::0000000000:role/admin";

    String principalArn = "arn:aws:sts::0000000000:assumed-role/admin/role-session";
    String iamRoleArn = "arn:aws:iam::0000000000:role/admin";
    when(awsIamRoleArnParser.convertPrincipalArnToRoleArn(principalArn)).thenReturn(iamRoleArn);
    when(awsIamRoleArnParser.isAssumedRoleArn(principalArn)).thenReturn(true);

    Map<String, String> result =
        authenticationService.generateCommonIamPrincipalAuthMetadata(principalArn);

    assertTrue(result.containsKey(CerberusPrincipal.METADATA_KEY_IS_ADMIN));
    assertEquals("true", result.get(CerberusPrincipal.METADATA_KEY_IS_ADMIN));
  }