@Test public void defaultTest() { Map<String, String> variableDomains = new HashMap<>(); List<Map<String, String>> listOfMaps = new LinkedList<>(); listOfMaps.add(variableDomains); PositiveBoundHiveDate dateTest = new PositiveBoundHiveDate(); PositiveBoundHiveDate.PositiveBoundHiveDateTag tag = new PositiveBoundHiveDate.PositiveBoundHiveDateTag(); tag.setName("name"); tag.setOnlyBusinessDays("false"); Calendar currDate = Calendar.getInstance(); Calendar prevDate = Calendar.getInstance(); prevDate.add(Calendar.DATE, -1); String current = new SimpleDateFormat("yyyy-MM-dd").format(currDate.getTime()); String prev = new SimpleDateFormat("yyyy-MM-dd").format(prevDate.getTime()); String day = current.substring(8, 10); String month = current.substring(5, 7); String year = current.substring(0, 4); String prevDay = prev.substring(8, 10); String prevMonth = prev.substring(5, 7); String preYear = prev.substring(0, 4); List<Map<String, String>> newList = dateTest.pipelinePossibleStates(tag, listOfMaps); Assert.assertEquals(newList.get(0).get("name"), "1970-01-01"); Assert.assertEquals(newList.get(1).get("name"), "1970-01-02"); Assert.assertEquals(newList.get(2).get("name"), preYear + "-" + prevMonth + "-" + prevDay); Assert.assertEquals(newList.get(3).get("name"), year + "-" + month + "-" + day); }
public List<Map<String, String>> pipelinePossibleStates(PositiveBoundHiveDate.PositiveBoundHiveDateTag action, List<Map<String, String>> possibleStateList) { return returnStates(action, possibleStateList, setParameters(action, true)); }
PositiveBoundHiveDate extends BoundaryDate<PositiveBoundHiveDate.PositiveBoundHiveDateTag> { public List<Map<String, String>> pipelinePossibleStates(PositiveBoundHiveDate.PositiveBoundHiveDateTag action, List<Map<String, String>> possibleStateList) { return returnStates(action, possibleStateList, setParameters(action, true)); } }
PositiveBoundHiveDate extends BoundaryDate<PositiveBoundHiveDate.PositiveBoundHiveDateTag> { public List<Map<String, String>> pipelinePossibleStates(PositiveBoundHiveDate.PositiveBoundHiveDateTag action, List<Map<String, String>> possibleStateList) { return returnStates(action, possibleStateList, setParameters(action, true)); }  }
PositiveBoundHiveDate extends BoundaryDate<PositiveBoundHiveDate.PositiveBoundHiveDateTag> { public List<Map<String, String>> pipelinePossibleStates(PositiveBoundHiveDate.PositiveBoundHiveDateTag action, List<Map<String, String>> possibleStateList) { return returnStates(action, possibleStateList, setParameters(action, true)); }  Class<PositiveBoundHiveDateTag> getTagActionClass(); String getTagName(); String getTagNameSpace(); List<Map<String, String>> pipelinePossibleStates(PositiveBoundHiveDate.PositiveBoundHiveDateTag action,
                                                            List<Map<String, String>> possibleStateList); }
PositiveBoundHiveDate extends BoundaryDate<PositiveBoundHiveDate.PositiveBoundHiveDateTag> { public List<Map<String, String>> pipelinePossibleStates(PositiveBoundHiveDate.PositiveBoundHiveDateTag action, List<Map<String, String>> possibleStateList) { return returnStates(action, possibleStateList, setParameters(action, true)); }  Class<PositiveBoundHiveDateTag> getTagActionClass(); String getTagName(); String getTagNameSpace(); List<Map<String, String>> pipelinePossibleStates(PositiveBoundHiveDate.PositiveBoundHiveDateTag action,
                                                            List<Map<String, String>> possibleStateList);  }