summaryrefslogtreecommitdiffstats
path: root/models-pdp/src
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-07-23 15:14:12 -0400
committerJim Hahn <jrh3@att.com>2021-07-23 15:15:33 -0400
commit07be24fc1c3b87f6aae0d52a26283ec18d33e772 (patch)
tree31e5f209099313575d200dd2c11fc694bc135c88 /models-pdp/src
parent1d3521c4106d5ad96df4e26d31d50cfdbc4148a7 (diff)
Remove unused statistics methods
The getPdpStatistics method should be removed as they're functionality has been subsumed by getFilteredPdpStatistics. Issue-ID: POLICY-3511 Change-Id: I98da98ac483705bea46ebaa0619257195be6b518 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-pdp/src')
-rw-r--r--models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/provider/PdpStatisticsProvider.java28
-rw-r--r--models-pdp/src/test/java/org/onap/policy/models/pdp/persistence/provider/PdpStatisticsProviderTest.java39
2 files changed, 0 insertions, 67 deletions
diff --git a/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/provider/PdpStatisticsProvider.java b/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/provider/PdpStatisticsProvider.java
index 8e3f0128e..0b3f32cf5 100644
--- a/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/provider/PdpStatisticsProvider.java
+++ b/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/provider/PdpStatisticsProvider.java
@@ -50,34 +50,6 @@ public class PdpStatisticsProvider {
private static final int MAX_RECORD_COUNT = 100;
/**
- * Get PDP statistics.
- *
- * @param dao the DAO to use to access the database
- * @param name the name of the PDP statistics to get, null to get all PDPs
- * @return the PDP statistics found
- * @throws PfModelException on errors getting PDP statistics
- */
- public List<PdpStatistics> getPdpStatistics(@NonNull final PfDao dao, final String name, final Instant timeStamp)
- throws PfModelException {
- return asPdpStatisticsList(dao.getFiltered(JpaPdpStatistics.class, PdpFilterParameters.builder().name(name)
- .startTime(timeStamp).endTime(timeStamp).recordNum(MAX_RECORD_COUNT).build()));
- }
-
- /**
- * Get PDP statistics.
- *
- * @param dao the DAO to use to access the database
- * @param name the name of the PDP statistics to get, null to get all PDPs
- * @return the PDP statistics found
- * @throws PfModelException on errors getting PDP statistics
- */
- public List<PdpStatistics> getPdpStatistics(@NonNull final PfDao dao, final String name)
- throws PfModelException {
- return asPdpStatisticsList(dao.getFiltered(JpaPdpStatistics.class,
- PdpFilterParameters.builder().name(name).recordNum(MAX_RECORD_COUNT).build()));
- }
-
- /**
* Get filtered PDP statistics.
*
* @param dao the DAO to use to access the database
diff --git a/models-pdp/src/test/java/org/onap/policy/models/pdp/persistence/provider/PdpStatisticsProviderTest.java b/models-pdp/src/test/java/org/onap/policy/models/pdp/persistence/provider/PdpStatisticsProviderTest.java
index b308dbdcd..57f364336 100644
--- a/models-pdp/src/test/java/org/onap/policy/models/pdp/persistence/provider/PdpStatisticsProviderTest.java
+++ b/models-pdp/src/test/java/org/onap/policy/models/pdp/persistence/provider/PdpStatisticsProviderTest.java
@@ -187,45 +187,6 @@ public class PdpStatisticsProviderTest {
}
@Test
- public void testGetPdpStatisticsName() throws Exception {
- assertThatThrownBy(() -> {
- new PdpStatisticsProvider().createPdpStatistics(null, null);
- }).hasMessageMatching(DAO_IS_NULL);
- assertThatThrownBy(() -> {
- new PdpStatisticsProvider().getPdpStatistics(null, null);
- }).hasMessageMatching(DAO_IS_NULL);
-
- List<PdpStatistics> getPdpStatisticsList = new PdpStatisticsProvider().getPdpStatistics(pfDao, NAME);
- verifyEquals(getPdpStatisticsList, List.of(pdpStatistics12, pdpStatistics11));
-
- // name is null
- getPdpStatisticsList = new PdpStatisticsProvider().getPdpStatistics(pfDao, null);
- verifyEquals(getPdpStatisticsList, List.of(pdpStatistics12, pdpStatistics22, pdpStatistics11, pdpStatistics31));
- }
-
- @Test
- public void testGetPdpStatisticsNameTimestamp() throws Exception {
- assertThatThrownBy(() -> {
- new PdpStatisticsProvider().createPdpStatistics(null, null);
- }).hasMessageMatching(DAO_IS_NULL);
- assertThatThrownBy(() -> {
- new PdpStatisticsProvider().getPdpStatistics(null, null, null);
- }).hasMessageMatching(DAO_IS_NULL);
-
- List<PdpStatistics> getPdpStatisticsList;
- getPdpStatisticsList = new PdpStatisticsProvider().getPdpStatistics(pfDao, NAME, TIMESTAMP1);
- verifyEquals(getPdpStatisticsList, List.of(pdpStatistics11));
-
- // name is null
- getPdpStatisticsList = new PdpStatisticsProvider().getPdpStatistics(pfDao, null, TIMESTAMP1);
- verifyEquals(getPdpStatisticsList, List.of(pdpStatistics11, pdpStatistics31));
-
- // timestamp is null
- getPdpStatisticsList = new PdpStatisticsProvider().getPdpStatistics(pfDao, NAME, null);
- verifyEquals(getPdpStatisticsList, List.of(pdpStatistics11, pdpStatistics12));
- }
-
- @Test
public void testGetFilteredPdpStatistics() throws Exception {
assertThatThrownBy(() -> {