diff options
Diffstat (limited to 'main/src/test')
-rw-r--r-- | main/src/test/java/org/onap/policy/pap/main/comm/PdpHeartbeatListenerTest.java | 5 | ||||
-rw-r--r-- | main/src/test/java/org/onap/policy/pap/main/rest/e2e/StatisticsTest.java | 6 |
2 files changed, 6 insertions, 5 deletions
diff --git a/main/src/test/java/org/onap/policy/pap/main/comm/PdpHeartbeatListenerTest.java b/main/src/test/java/org/onap/policy/pap/main/comm/PdpHeartbeatListenerTest.java index 1fdbfe65..01edbdcf 100644 --- a/main/src/test/java/org/onap/policy/pap/main/comm/PdpHeartbeatListenerTest.java +++ b/main/src/test/java/org/onap/policy/pap/main/comm/PdpHeartbeatListenerTest.java @@ -25,6 +25,7 @@ import static org.junit.Assert.assertEquals; import java.text.ParseException; import java.text.SimpleDateFormat; +import java.time.Instant; import java.util.Arrays; import java.util.Date; import java.util.List; @@ -57,7 +58,7 @@ public class PdpHeartbeatListenerTest extends End2EndBase { private static final CommInfrastructure INFRA = CommInfrastructure.NOOP; private static final String TOPIC = "my-topic"; - private Date timeStamp; + private Instant timeStamp; private PdpHeartbeatListener pdpHeartbeatListener; @Test @@ -207,7 +208,7 @@ public class PdpHeartbeatListenerTest extends End2EndBase { public void testPdpStatistics() throws CoderException, PfModelException, ParseException { addGroups("PdpGroups.json"); pdpHeartbeatListener = new PdpHeartbeatListener(new PdpParameters()); - timeStamp = new SimpleDateFormat("yyyy-MM-dd").parse("2020-01-01"); + timeStamp = Instant.parse("2021-02-12T17:48:01.029211400Z"); // init default pdp group final PdpStatus status1 = new PdpStatus(); diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/e2e/StatisticsTest.java b/main/src/test/java/org/onap/policy/pap/main/rest/e2e/StatisticsTest.java index 75aafba6..2f6cc3a1 100644 --- a/main/src/test/java/org/onap/policy/pap/main/rest/e2e/StatisticsTest.java +++ b/main/src/test/java/org/onap/policy/pap/main/rest/e2e/StatisticsTest.java @@ -3,7 +3,7 @@ * ONAP PAP * ================================================================================ * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2020 Nordix Foundation. + * Modifications Copyright (C) 2020-2021 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,8 +24,8 @@ package org.onap.policy.pap.main.rest.e2e; import static org.junit.Assert.assertEquals; import java.net.HttpURLConnection; +import java.time.Instant; import java.util.ArrayList; -import java.util.Date; import java.util.List; import java.util.Map; import javax.ws.rs.client.Invocation; @@ -117,7 +117,7 @@ public class StatisticsTest extends End2EndBase { pdpStatisticsRecord.setPdpGroupName("defaultGroup"); pdpStatisticsRecord.setPdpSubGroupName("apex"); pdpStatisticsRecord.setPdpInstanceId("pdp1"); - pdpStatisticsRecord.setTimeStamp(new Date()); + pdpStatisticsRecord.setTimeStamp(Instant.now()); pdpStatisticsRecord.setPolicyDeployCount(1); pdpStatisticsRecord.setPolicyDeployFailCount(0); pdpStatisticsRecord.setPolicyDeploySuccessCount(1); |