@Test
public void testCalculateConfigurations() throws Exception {

  Map<Resource.Type, String> keyPropertyIds = Collections.emptyMap();
  Set<String> propertyIds = Collections.emptySet();
  AmbariManagementController ambariManagementController = mock(AmbariManagementController.class);
  RecommendationResourceProvider provider = new RecommendationResourceProvider(propertyIds,
      keyPropertyIds, ambariManagementController);
  Request request = mock(Request.class);
  Set<Map<String, Object>> propertiesSet = new HashSet<Map<String, Object>>();
  Map<String, Object> propertiesMap = new HashMap<String, Object>();
  propertiesMap.put(CONFIGURATIONS_PROPERTY_ID + "site/properties/string_prop", "string");
  List<Object> array = new ArrayList<Object>();
  array.add("array1");
  array.add("array2");
  propertiesMap.put(CONFIGURATIONS_PROPERTY_ID + "site/properties/array_prop", array);
  propertiesSet.add(propertiesMap);
  doReturn(propertiesSet).when(request).getProperties();
  Map<String, Map<String, Map<String, String>>> calculatedConfigurations = provider.calculateConfigurations(request);
  assertNotNull(calculatedConfigurations);
  assertEquals(1, calculatedConfigurations.size());
  Map<String, Map<String, String>> site = calculatedConfigurations.get("site");
  assertNotNull(site);
  assertEquals(1, site.size());
  Map<String, String> properties = site.get("properties");
  assertNotNull(properties);
  assertEquals(2, properties.size());
  assertEquals("string", properties.get("string_prop"));
  assertEquals("[array1, array2]", properties.get("array_prop"));
}