CookbookParseResult { public void addAttributeToAllConfigs(String name, List value) { for (Map.Entry<String, HashMap<String, ChefCookbookConfiguration>> entry : cookbookConfigs.entrySet()) { for (Map.Entry<String, ChefCookbookConfiguration> innerentry : entry.getValue().entrySet()) { innerentry.getValue().putAttribute(name, value); } } } CookbookParseResult(String cookbookName);  CookbookParseResult(CookbookParseResult cookbookParseResult); String getCookbookName(); void setCookbookName(String cookbookName); boolean isInDependentRecipe(); void setInDependentRecipe(boolean inDependentRecipe); String getAttribute(String key); void putAttribute(String key, String value); HashMap<String, String> getAttributes(); HashMap<String, HashMap<String, ChefCookbookConfiguration>> getCookbookConfigs(); HashMap<String, ChefCookbookConfiguration> getCookbookConfigsByPlatform(String platformName); void setCookbookConfigs(HashMap<String, HashMap<String, ChefCookbookConfiguration>> cookbookConfigs); void putCookbookConfig(ChefCookbookConfiguration cookbookConfiguration); void clear(); void clearAttributes(); void clearConfigurations(); void putCookbookConfigsAsList(List<ChefCookbookConfiguration> cookbookConfigList); List<ChefCookbookConfiguration> getAllConfigsAsList(); void addNotatedPackage(ChefPackage chefPackage); ArrayList<ChefPackage> getNotatedPackages(); void clearNotatedPackage(); void addAttributeToAllConfigs(String name, List value); void replaceCookbookConfigs(List<ChefCookbookConfiguration> cookbookConfigList); List<CookbookParseResult> getListOfConfigsInOwnParseresult(); int getNumOfCookbookConfigs(); String getCookbookPath(); void setCookbookPath(String cookbookPath); void prepareForDependencie(String cookbookName); boolean isInRecursiveTransformation(); void setInRecursiveTransformation(boolean inRecursiveTransformation);  }
@Test public void addAttributeToAllConfigs() { String attributeValue = "testvalue"; List<String> expectedValues = new ArrayList<>(Arrays.asList(attributeValue)); ChefCookbookConfiguration secondCookbookConfiguration = new ChefCookbookConfiguration(cookbookConfiguration); secondCookbookConfiguration.setSupports(new Platform("windows", "10")); cookbookParseResult.putCookbookConfig(secondCookbookConfiguration); cookbookParseResult.addAttributeToAllConfigs("testname", Collections.singletonList(attributeValue)); assertEquals(expectedValues, cookbookParseResult.getAllConfigsAsList().get(0).getAttribute("testname")); assertEquals(expectedValues, cookbookParseResult.getAllConfigsAsList().get(1).getAttribute("testname")); }