@Test
public void testCreateResources_withSingleConfigurationType() throws Exception {

  Set<Map<String, Object>> setProperties = getBlueprintTestProperties();
  setConfigurationProperties(setProperties);
  AmbariManagementController managementController = createMock(AmbariManagementController.class);
  Map<String, String> requestInfoProperties = new HashMap<String, String>();
  Map<String, Set<HashMap<String, String>>> settingProperties = getSettingProperties();
  requestInfoProperties.put(Request.REQUEST_INFO_BODY_PROPERTY, "{\"configurations\":[{\"configuration-type\":{\"properties\":{\"property\":\"value\"}}}]}");
  Request request = createMock(Request.class);
  Setting setting = createStrictMock(Setting.class);
  // set expectations
  expect(blueprintFactory.createBlueprint(setProperties.iterator().next(), null)).andReturn(blueprint).once();
  blueprint.validateRequiredProperties();
  blueprint.validateTopology();
  expect(blueprint.getSetting()).andReturn(setting).anyTimes();
  expect(setting.getProperties()).andReturn(settingProperties).anyTimes();
  expect(blueprint.toEntity()).andReturn(entity);
  expect(blueprint.getName()).andReturn(BLUEPRINT_NAME).atLeastOnce();
  expect(request.getProperties()).andReturn(setProperties);
  expect(request.getRequestInfoProperties()).andReturn(requestInfoProperties);
  expect(dao.findByName(BLUEPRINT_NAME)).andReturn(null);
  dao.create(entity);
  replay(dao, entity, metaInfo, blueprintFactory, blueprint, setting, request, managementController);
  // end expectations
  ResourceProvider provider = AbstractControllerResourceProvider.getResourceProvider(
      Resource.Type.Blueprint,
      PropertyHelper.getPropertyIds(Resource.Type.Blueprint),
      PropertyHelper.getKeyPropertyIds(Resource.Type.Blueprint),
      managementController);
  AbstractResourceProviderTest.TestObserver observer = new AbstractResourceProviderTest.TestObserver();
  ((ObservableResourceProvider)provider).addObserver(observer);
  provider.createResources(request);
  ResourceProviderEvent lastEvent = observer.getLastEvent();
  assertNotNull(lastEvent);
  assertEquals(Resource.Type.Blueprint, lastEvent.getResourceType());
  assertEquals(ResourceProviderEvent.Type.Create, lastEvent.getType());
  assertEquals(request, lastEvent.getRequest());
  assertNull(lastEvent.getPredicate());
  verify(dao, entity, blueprintFactory, metaInfo, request, managementController);
}