Unit test instability fix 19/86819/1
authorTamasBakai <tamas.bakai@est.tech>
Thu, 2 May 2019 13:31:57 +0000 (13:31 +0000)
committerTamasBakai <tamas.bakai@est.tech>
Thu, 2 May 2019 13:31:57 +0000 (13:31 +0000)
simulator_should_send_fileready_message test was failing in maven, but
working well in eclipse. Duration and Interval are now equal, and
exactly 1 trigger should occur regardless of the execution environment.

Change-Id: I9f283364d4717c6e4aa45b88ee7e9da393fa11c4
Issue-ID: DCAEGEN2-1434
Signed-off-by: TamasBakai <tamas.bakai@est.tech>
test/mocks/mass-pnf-sim/pnf-sim-lightweight/src/test/java/org/onap/pnfsimulator/simulator/SimulatorTest.java

index 7ed9f04..fb812b5 100644 (file)
@@ -109,7 +109,7 @@ public class SimulatorTest {
     void should_throw_noropfiles_exception_given_empty_filelist() {
         Simulator simulator = Simulator.builder()
                 .withDuration(Duration.ofMillis(100))
-                .withInterval(Duration.ofMillis(10))
+                .withInterval(Duration.ofMillis(100))
                 .withCommonEventHeaderParams(VALID_COMMON_EVENT_HEADER_PARAMS)
                 .withPnfRegistrationParams(VALID_PNF_REGISTRATION_PARAMS)
                 .withNotificationParams(Optional.empty())
@@ -127,7 +127,7 @@ public class SimulatorTest {
 
         Simulator simulator = Simulator.builder()
                 .withDuration(Duration.ofMillis(100))
-                .withInterval(Duration.ofMillis(10))
+                .withInterval(Duration.ofMillis(100))
                 .withCommonEventHeaderParams(VALID_COMMON_EVENT_HEADER_PARAMS)
                 .withPnfRegistrationParams(INVALID_PNF_REGISTRATION_PARAMS_1)
                 .withNotificationParams(Optional.empty())
@@ -140,7 +140,7 @@ public class SimulatorTest {
 
         simulator = Simulator.builder()
                 .withDuration(Duration.ofMillis(100))
-                .withInterval(Duration.ofMillis(10))
+                .withInterval(Duration.ofMillis(100))
                 .withCommonEventHeaderParams(VALID_COMMON_EVENT_HEADER_PARAMS)
                 .withPnfRegistrationParams(INVALID_PNF_REGISTRATION_PARAMS_2)
                 .withNotificationParams(Optional.empty())
@@ -153,7 +153,7 @@ public class SimulatorTest {
 
         simulator = Simulator.builder()
                 .withDuration(Duration.ofMillis(100))
-                .withInterval(Duration.ofMillis(10))
+                .withInterval(Duration.ofMillis(100))
                 .withCommonEventHeaderParams(VALID_COMMON_EVENT_HEADER_PARAMS)
                 .withPnfRegistrationParams(INVALID_PNF_REGISTRATION_PARAMS_3)
                 .withNotificationParams(Optional.empty())
@@ -166,7 +166,7 @@ public class SimulatorTest {
 
         simulator = Simulator.builder()
                 .withDuration(Duration.ofMillis(100))
-                .withInterval(Duration.ofMillis(10))
+                .withInterval(Duration.ofMillis(100))
                 .withCommonEventHeaderParams(VALID_COMMON_EVENT_HEADER_PARAMS)
                 .withPnfRegistrationParams(VALID_PNF_REGISTRATION_PARAMS)
                 .withNotificationParams(INVALID_NOTIFICATION_PARAMS)
@@ -185,7 +185,7 @@ public class SimulatorTest {
         HttpClientAdapter httpClientMock = Mockito.mock(HttpClientAdapter.class);
         Simulator simulator = Simulator.builder()
                 .withDuration(Duration.ofMillis(100))
-                .withInterval(Duration.ofMillis(10))
+                .withInterval(Duration.ofMillis(100))
                 .withCommonEventHeaderParams(VALID_COMMON_EVENT_HEADER_PARAMS)
                 .withPnfRegistrationParams(Optional.empty())
                 .withNotificationParams(VALID_NOTIFICATION_PARAMS)