@Test
public void testCreateResources() throws Exception {

  Resource.Type type = Resource.Type.Task;
  AmbariManagementController managementController = createMock(AmbariManagementController.class);
  RequestStatusResponse response = createNiceMock(RequestStatusResponse.class);
  // replay
  replay(managementController, response);
  ResourceProvider provider = AbstractControllerResourceProvider.getResourceProvider(
      type,
      PropertyHelper.getPropertyIds(type),
      PropertyHelper.getKeyPropertyIds(type),
      managementController);
  // add the property map to a set for the request.  add more maps for multiple creates
  Set<Map<String, Object>> propertySet = new LinkedHashSet<Map<String, Object>>();
  Map<String, Object> properties = new LinkedHashMap<String, Object>();
  // add properties to the request map
  properties.put(TaskResourceProvider.TASK_REQUEST_ID_PROPERTY_ID, 100);
  properties.put(TaskResourceProvider.TASK_ID_PROPERTY_ID, 100);
  propertySet.add(properties);
  // create the request
  Request request = PropertyHelper.getCreateRequest(propertySet, null);
  try {
    provider.createResources(request);
    Assert.fail("Expected an UnsupportedOperationException");
  } catch (UnsupportedOperationException e) {
    // expected
  }
  // verify
  verify(managementController, response);
}