pdp statistics database provider implementation
[policy/models.git] / models-provider / src / test / java / org / onap / policy / models / provider / impl / DummyBadProviderImpl.java
index 3e182c0..d809f66 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019 Nordix Foundation.
+ *  Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 package org.onap.policy.models.provider.impl;
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
-
 import javax.ws.rs.core.Response;
-
 import lombok.NonNull;
-
 import org.onap.policy.models.base.PfModelException;
 import org.onap.policy.models.base.PfModelRuntimeException;
 import org.onap.policy.models.pdp.concepts.Pdp;
@@ -55,10 +56,14 @@ public class DummyBadProviderImpl implements PolicyModelsProvider {
     }
 
     @Override
-    public void close() throws PfModelException {}
+    public void close() throws PfModelException {
+        // do nothing
+    }
 
     @Override
-    public void init() throws PfModelException {}
+    public void init() throws PfModelException {
+        // do nothing
+    }
 
     @Override
     public ToscaServiceTemplate getPolicyTypes(final String name, final String version) throws PfModelException {
@@ -103,7 +108,8 @@ public class DummyBadProviderImpl implements PolicyModelsProvider {
     }
 
     @Override
-    public LegacyOperationalPolicy getOperationalPolicy(@NonNull String policyId) throws PfModelException {
+    public LegacyOperationalPolicy getOperationalPolicy(@NonNull final String policyId, final String policyVersion)
+            throws PfModelException {
         return null;
     }
 
@@ -120,12 +126,14 @@ public class DummyBadProviderImpl implements PolicyModelsProvider {
     }
 
     @Override
-    public LegacyOperationalPolicy deleteOperationalPolicy(@NonNull String policyId) throws PfModelException {
+    public LegacyOperationalPolicy deleteOperationalPolicy(@NonNull String policyId,
+            @NonNull final String policyVersion) throws PfModelException {
         return null;
     }
 
     @Override
-    public Map<String, LegacyGuardPolicyOutput> getGuardPolicy(@NonNull String policyId) throws PfModelException {
+    public Map<String, LegacyGuardPolicyOutput> getGuardPolicy(@NonNull String policyId, final String policyVersion)
+            throws PfModelException {
         return null;
     }
 
@@ -142,28 +150,31 @@ public class DummyBadProviderImpl implements PolicyModelsProvider {
     }
 
     @Override
-    public Map<String, LegacyGuardPolicyOutput> deleteGuardPolicy(@NonNull String policyId) throws PfModelException {
+    public Map<String, LegacyGuardPolicyOutput> deleteGuardPolicy(@NonNull String policyId,
+            @NonNull final String policyVersion) throws PfModelException {
         return null;
     }
 
     @Override
     public List<PdpGroup> getPdpGroups(String name) throws PfModelException {
-        return null;
+        return Collections.emptyList();
     }
 
     @Override
     public List<PdpGroup> createPdpGroups(@NonNull List<PdpGroup> pdpGroups) throws PfModelException {
-        return null;
+        return Collections.emptyList();
     }
 
     @Override
     public List<PdpGroup> updatePdpGroups(@NonNull List<PdpGroup> pdpGroups) throws PfModelException {
-        return null;
+        return Collections.emptyList();
     }
 
     @Override
-    public void updatePdp(@NonNull String pdpGroupName, @NonNull String pdpSubGroup,
-            @NonNull Pdp pdp) throws PfModelException {}
+    public void updatePdp(@NonNull String pdpGroupName, @NonNull String pdpSubGroup, @NonNull Pdp pdp)
+            throws PfModelException {
+        // do nothing
+    }
 
     @Override
     public PdpGroup deletePdpGroup(@NonNull String name) throws PfModelException {
@@ -172,7 +183,7 @@ public class DummyBadProviderImpl implements PolicyModelsProvider {
 
     @Override
     public List<ToscaPolicyType> getPolicyTypeList(String name, String version) throws PfModelException {
-        return null;
+        return Collections.emptyList();
     }
 
     @Override
@@ -183,12 +194,12 @@ public class DummyBadProviderImpl implements PolicyModelsProvider {
     @Override
     public List<ToscaPolicyType> getFilteredPolicyTypeList(@NonNull ToscaPolicyTypeFilter filter)
             throws PfModelException {
-        return null;
+        return Collections.emptyList();
     }
 
     @Override
     public List<ToscaPolicy> getPolicyList(String name, String version) throws PfModelException {
-        return null;
+        return Collections.emptyList();
     }
 
     @Override
@@ -198,24 +209,49 @@ public class DummyBadProviderImpl implements PolicyModelsProvider {
 
     @Override
     public List<ToscaPolicy> getFilteredPolicyList(@NonNull ToscaPolicyFilter filter) throws PfModelException {
-        return null;
+        return Collections.emptyList();
     }
 
     @Override
     public List<PdpGroup> getFilteredPdpGroups(@NonNull PdpGroupFilter filter) throws PfModelException {
-        return null;
+        return Collections.emptyList();
     }
 
     @Override
-    public void updatePdpSubGroup(@NonNull String pdpGroupName,
-            @NonNull PdpSubGroup pdpSubGroup) throws PfModelException {}
+    public void updatePdpSubGroup(@NonNull String pdpGroupName, @NonNull PdpSubGroup pdpSubGroup)
+            throws PfModelException {
+        // do nothing
+    }
 
     @Override
-    public List<PdpStatistics> getPdpStatistics(String name) throws PfModelException {
-        return null;
+    public List<PdpStatistics> getPdpStatistics(final String name, final Date timestamp) throws PfModelException {
+        return new ArrayList<>();
+    }
+
+    @Override
+    public List<PdpStatistics> getFilteredPdpStatistics(String name, String pdpGroupName, String pdpSubGroup,
+            Date startTimeStamp, Date endTimeStamp) {
+        // Not implemented
+        return new ArrayList<>();
+    }
+
+    @Override
+    public List<PdpStatistics> createPdpStatistics(final List<PdpStatistics> pdpStatisticsList)
+            throws PfModelException {
+        // Not implemented
+        return new ArrayList<>();
+    }
+
+    @Override
+    public List<PdpStatistics> updatePdpStatistics(final List<PdpStatistics> pdpStatisticsList)
+            throws PfModelException {
+        // Not implemented
+        return new ArrayList<>();
     }
 
     @Override
-    public void updatePdpStatistics(@NonNull String pdpGroupName,
-            @NonNull String pdpType, @NonNull String pdpInstanceId, @NonNull PdpStatistics pdppStatistics) {}
+    public List<PdpStatistics> deletePdpStatistics(final String name, final Date timestamp) {
+        // Not implemented
+        return null;
+    }
 }