@Test
public void testGetResources() throws Exception {

  IvoryService service = createMock(IvoryService.class);
  Set<Map<String, Object>> propertySet = new HashSet<Map<String, Object>>();
  Map<String, Object> properties = new HashMap<String, Object>();
  List<Instance> instances = new LinkedList<Instance>();
  Instance instance1 = new Instance("Feed1", "Instance1", "s", "st", "et", "d", "l");
  Instance instance2 = new Instance("Feed1", "Instance2", "s", "st", "et", "d", "l");
  Instance instance3 = new Instance("Feed1", "Instance3", "s", "st", "et", "d", "l");
  instances.add(instance1);
  instances.add(instance2);
  instances.add(instance3);
  // set expectations
  expect(service.getFeedNames()).andReturn(Collections.singletonList("Feed1"));
  expect(service.getInstances("Feed1")).andReturn(instances);
  // replay
  replay(service);
  propertySet.add(properties);
  Request request = PropertyHelper.getCreateRequest(propertySet, Collections.<String,String>emptyMap());
  InstanceResourceProvider provider = new InstanceResourceProvider(service,
      PropertyHelper.getPropertyIds(Resource.Type.DRInstance),
      PropertyHelper.getKeyPropertyIds(Resource.Type.DRInstance));
  Set<Resource> resources = provider.getResources(request, null);
  Assert.assertEquals(3, resources.size());
  // verify
  verify(service);
}