@Test
public void testGenerateClusterChefJsonsForInstallation() throws KaramelException {

  Settings.CB_CLASSPATH_MODE = true;
  String jsonString = "  {\"name\":\"MySqlCluster\","
      + "\"cookbooks\":[{\"id\":\"https://github.com/testorg/testrepo/tree/master/cookbooks/hopshadoop/ndb-chef\","
      + "\"attrs\":{\"ndb/DataMemory\":"
      + "\"111\"}}],\"groups\":[{\"name\":\"datanodes\","
      + "\"cookbooks\":[{\"id\":\"https://github.com/testorg/testrepo/tree/master/cookbooks/hopshadoop/ndb-chef\","
      + "\"attrs\":{},"
      + "\"recipes\":[{\"name\":\"ndb::ndbd\"}]}],\"size\":2,\"provider\":null},{\"name\":\"mgmnodes\",\"cookbooks\":"
      + "[{\"id\":\"https://github.com/testorg/testrepo/tree/master/cookbooks/hopshadoop/ndb-chef\","
      + "\"attrs\":{},\"recipes\":"
      + "[{\"name\":\"ndb::mgmd\"},{\"name\":\"ndb::mysqld\"},{\"name\":\"ndb::memcached\"}]}],\"size\":"
      + "1,\"provider\":null}],\"ec2\":{\"type\":\"m3.medium\",\"ami\":null,\"region\":\"eu-west-1\",\"price\":"
      + "null,\"vpc\":null,\"subnet\":null}}";
  //Workaround for https://github.com/karamelchef/karamel/issues/28
  String yaml = ClusterDefinitionService.jsonToYaml(jsonString);
  JsonCluster definition = ClusterDefinitionService.yamlToJsonObject(yaml);
    JsonCluster definition = ClusterDefinitionService.jsonToJsonObject(jsonString);
  List<JsonCookbook> cookbooks = definition.getCookbooks();
  JsonCookbook ndb = null;
  for (JsonCookbook jc : cookbooks) {
    if (jc.getName().equals("ndb")) {
      ndb = jc;
    }
  }
  ClusterRuntime clusterRuntime = MockingUtil.dummyRuntime(definition);
  Map<String, JsonObject> chefJsons = ChefJsonGenerator.generateClusterChefJsonsForInstallation(definition, clusterRuntime);
  JsonObject jsonObject = chefJsons.get("mgmnodes1ndb::mgmd");
  String st = jsonObject.toString();
  Assert.assertTrue(st.contains("\"DataMemory\":\"111\""));
}