@Test
public void testGetResources() throws Exception {

  // add the property map to a set for the request.  add more maps for multiple creates
  String hostname = "host1";
  String clustername = "Cluster100";
  Predicate predicate = new PredicateBuilder().begin()
          .property(HostStackVersionResourceProvider.HOST_STACK_VERSION_HOST_NAME_PROPERTY_ID).equals(hostname)
          .and()
          .property(HostStackVersionResourceProvider.HOST_STACK_VERSION_CLUSTER_NAME_PROPERTY_ID).equals(clustername)
          .end().and().begin()
          .property(HostStackVersionResourceProvider.HOST_STACK_VERSION_STATE_PROPERTY_ID).equals("INSTALLING")
          .or()
          .property(HostStackVersionResourceProvider.HOST_STACK_VERSION_STATE_PROPERTY_ID).equals("INSTALL_FAILED")
          .or()
          .property(HostStackVersionResourceProvider.HOST_STACK_VERSION_STATE_PROPERTY_ID).equals("OUT_OF_SYNC")
          .end().toPredicate();
  // create the request
  Request request = PropertyHelper.getCreateRequest(Collections.<Map<String,Object>>emptySet(), null);
  ResourceProvider provider = AbstractControllerResourceProvider.getResourceProvider(
          type,
          PropertyHelper.getPropertyIds(type),
          PropertyHelper.getKeyPropertyIds(type),
          managementController);
  expect(hostVersionDAOMock.findByClusterAndHost(clustername, hostname)).andReturn(Collections.singletonList(hostVersionEntityMock));
  expect(hostVersionEntityMock.getRepositoryVersion()).andReturn(repoVersion).anyTimes();
  expect(repositoryVersionDAOMock.findByStackAndVersion(isA(StackId.class), isA(String.class))).andReturn(null).anyTimes();
  expect(hostVersionEntityMock.getState()).andReturn(RepositoryVersionState.INSTALLING).anyTimes();
  replay(hostVersionDAOMock, hostVersionEntityMock, repositoryVersionDAOMock);
  Set<Resource> resources = provider.getResources(request, predicate);
  assertEquals(1, resources.size());
  verify(hostVersionDAOMock, hostVersionEntityMock, repositoryVersionDAOMock);
}