Batch Test improvements
[aaf/authz.git] / auth / auth-batch / src / main / java / org / onap / aaf / auth / batch / approvalsets / Pending.java
index 3072038..5d720c2 100644 (file)
@@ -34,15 +34,6 @@ public class Pending {
        boolean hasNew;
        Date earliest;
        
-       /**
-        * Use this Constructor when there is no Last Notified Date
-        */
-       public Pending() {
-               qty = 1;
-               hasNew = true;
-               earliest = null;
-       }
-
        /**
         * Use this constructor to indicate when last Notified
         * @param last_notified
@@ -84,6 +75,11 @@ public class Pending {
        
        public void inc(Pending value) {
                qty+=value.qty;
+               if(earliest==null) {
+                       earliest = value.earliest;
+               } else if(value.earliest!=null && value.earliest.before(earliest)) {
+                       earliest = value.earliest;
+               }
        }
 
        public void earliest(Date lastnotified) {
@@ -106,4 +102,8 @@ public class Pending {
                return hasNew;
        }
 
+       public static Pending create() {
+               return new Pending((Date)null);
+       }
+
 }
\ No newline at end of file