@Test
public void testGetResources() throws Exception {

  RoleAuthorizationEntity roleAuthorizationEntity = createNiceMock(RoleAuthorizationEntity.class);
  expect(roleAuthorizationEntity.getAuthorizationId()).andReturn("TEST.DO_SOMETHING");
  expect(roleAuthorizationEntity.getAuthorizationName()).andReturn("Do Something");
  List<RoleAuthorizationEntity> authorizationEntities = new ArrayList<RoleAuthorizationEntity>();
  authorizationEntities.add(roleAuthorizationEntity);
  RoleAuthorizationDAO roleAuthorizationDAO = injector.getInstance(RoleAuthorizationDAO.class);
  expect(roleAuthorizationDAO.findAll()).andReturn(authorizationEntities);
  replayAll();
  AmbariManagementController managementController = injector.getInstance(AmbariManagementController.class);
  RoleAuthorizationResourceProvider provider = new RoleAuthorizationResourceProvider(managementController);
  injector.injectMembers(provider);
  Set<Resource> resources = provider.getResources(PropertyHelper.getReadRequest(), null);
  Assert.assertEquals(1, resources.size());
  Resource resource = resources.iterator().next();
  Assert.assertEquals("TEST.DO_SOMETHING", resource.getPropertyValue(RoleAuthorizationResourceProvider.AUTHORIZATION_ID_PROPERTY_ID));
  Assert.assertEquals("Do Something", resource.getPropertyValue(RoleAuthorizationResourceProvider.AUTHORIZATION_NAME_PROPERTY_ID));
  Assert.assertNull(resource.getPropertyValue(RoleAuthorizationResourceProvider.PERMISSION_ID_PROPERTY_ID));
  verifyAll();
}