@Test
public void checkPermissionsAssertRoleNameIsTrimmed()
{

    NamespaceEntity expectedNamespaceEntity = new NamespaceEntity();
    String iamRoleName1 = "iamRoleName1";
    String iamRoleName2 = "iamRoleName2";
    Collection<String> requestedIamRoleNames = Arrays.asList(StringUtils.wrap(iamRoleName1, BLANK_TEXT), StringUtils.wrap(iamRoleName2, BLANK_TEXT));
    List<NamespaceIamRoleAuthorizationEntity> namespaceIamRoleAuthorizationEntities = new ArrayList<>();
    NamespaceIamRoleAuthorizationEntity namespaceIamRoleAuthorizationEntity1 = new NamespaceIamRoleAuthorizationEntity();
    namespaceIamRoleAuthorizationEntity1.setIamRoleName(iamRoleName1);
    namespaceIamRoleAuthorizationEntities.add(namespaceIamRoleAuthorizationEntity1);
    NamespaceIamRoleAuthorizationEntity namespaceIamRoleAuthorizationEntity2 = new NamespaceIamRoleAuthorizationEntity();
    namespaceIamRoleAuthorizationEntity2.setIamRoleName(iamRoleName2);
    namespaceIamRoleAuthorizationEntities.add(namespaceIamRoleAuthorizationEntity2);
    when(configurationHelper.getBooleanProperty(any())).thenReturn(true);
    when(namespaceIamRoleAuthorizationDao.getNamespaceIamRoleAuthorizations(any())).thenReturn(namespaceIamRoleAuthorizationEntities);
    namespaceIamRoleAuthorizationHelper.checkPermissions(expectedNamespaceEntity, requestedIamRoleNames);
    verify(configurationHelper).getBooleanProperty(ConfigurationValue.NAMESPACE_IAM_ROLE_AUTHORIZATION_ENABLED);
    verify(namespaceIamRoleAuthorizationDao).getNamespaceIamRoleAuthorizations(expectedNamespaceEntity);
    verifyNoMoreInteractions(configurationHelper, namespaceIamRoleAuthorizationDao);
}