@Test public void pipelineMultipleMapsTest() { List<Map<String, String>> listWithManyMaps = new LinkedList<>(); HashMap<String, String> nonEmptyMapOne = new HashMap<>(); nonEmptyMapOne.put("var_out_test_1", "Lorem"); nonEmptyMapOne.put("var_out_test_2", "ipsum"); listWithManyMaps.add(nonEmptyMapOne); HashMap<String, String> nonEmptyMapTwo = new HashMap<>(nonEmptyMapOne); listWithManyMaps.add(nonEmptyMapTwo); HashMap<String, String> nonEmptyMapThree = new HashMap<>(nonEmptyMapOne); listWithManyMaps.add(nonEmptyMapThree); SingleValueAssignExtension assign = new SingleValueAssignExtension(); Assign concreteAssignTag = new Assign(); concreteAssignTag.setName("var_out_test_3"); concreteAssignTag.setExpr("consectetur"); List<Map<String, String>> processedList = assign.pipelinePossibleStates(concreteAssignTag, listWithManyMaps); Assert.assertEquals(3, processedList.size()); Map<String, String> resultMap = processedList.get(0); Assert.assertEquals(3, resultMap.keySet().size()); Assert.assertEquals("Lorem", resultMap.get("var_out_test_1")); Assert.assertEquals("ipsum", resultMap.get("var_out_test_2")); Assert.assertEquals("consectetur", resultMap.get("var_out_test_3")); resultMap = processedList.get(1); Assert.assertEquals(3, resultMap.keySet().size()); Assert.assertEquals("Lorem", resultMap.get("var_out_test_1")); Assert.assertEquals("ipsum", resultMap.get("var_out_test_2")); Assert.assertEquals("consectetur", resultMap.get("var_out_test_3")); resultMap = processedList.get(2); Assert.assertEquals(3, resultMap.keySet().size()); Assert.assertEquals("Lorem", resultMap.get("var_out_test_1")); Assert.assertEquals("ipsum", resultMap.get("var_out_test_2")); Assert.assertEquals("consectetur", resultMap.get("var_out_test_3")); }
public List<Map<String, String>> pipelinePossibleStates(Assign action, List<Map<String, String>> possibleStateList) { for (Map<String, String> possibleState : possibleStateList) { possibleState.put(action.getName(), action.getExpr()); } return possibleStateList; }
SingleValueAssignExtension implements CustomTagExtension<Assign> { public List<Map<String, String>> pipelinePossibleStates(Assign action, List<Map<String, String>> possibleStateList) { for (Map<String, String> possibleState : possibleStateList) { possibleState.put(action.getName(), action.getExpr()); } return possibleStateList; } }
SingleValueAssignExtension implements CustomTagExtension<Assign> { public List<Map<String, String>> pipelinePossibleStates(Assign action, List<Map<String, String>> possibleStateList) { for (Map<String, String> possibleState : possibleStateList) { possibleState.put(action.getName(), action.getExpr()); } return possibleStateList; }  }
SingleValueAssignExtension implements CustomTagExtension<Assign> { public List<Map<String, String>> pipelinePossibleStates(Assign action, List<Map<String, String>> possibleStateList) { for (Map<String, String> possibleState : possibleStateList) { possibleState.put(action.getName(), action.getExpr()); } return possibleStateList; }  Class<Assign> getTagActionClass(); String getTagName(); String getTagNameSpace(); List<Map<String, String>> pipelinePossibleStates(Assign action, List<Map<String, String>> possibleStateList); }
SingleValueAssignExtension implements CustomTagExtension<Assign> { public List<Map<String, String>> pipelinePossibleStates(Assign action, List<Map<String, String>> possibleStateList) { for (Map<String, String> possibleState : possibleStateList) { possibleState.put(action.getName(), action.getExpr()); } return possibleStateList; }  Class<Assign> getTagActionClass(); String getTagName(); String getTagNameSpace(); List<Map<String, String>> pipelinePossibleStates(Assign action, List<Map<String, String>> possibleStateList);  }