diff options
author | Jim Hahn <jrh3@att.com> | 2021-07-30 16:06:49 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2021-08-02 09:42:54 -0400 |
commit | 038c19d4042de980d4adccbfa82c1534b53abe5f (patch) | |
tree | da447592a6a90c2d869e34642712edf4413dc6c1 /services/services-engine/src/test | |
parent | 1036206455218a4722079b749e628ca96825418d (diff) |
Use lombok annotations in apex-pdp
Updated projects: services-engine through utilities
Issue-ID: POLICY-3391
Change-Id: I35ebb40d86e9bda360f7819516290b3fea88335c
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'services/services-engine/src/test')
2 files changed, 8 insertions, 5 deletions
diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/event/ApexPeriodicEventGeneratorTest.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/event/ApexPeriodicEventGeneratorTest.java index e40e570cb..ee72e6ea4 100644 --- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/event/ApexPeriodicEventGeneratorTest.java +++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/event/ApexPeriodicEventGeneratorTest.java @@ -1,6 +1,7 @@ /* * ============LICENSE_START======================================================= * Copyright (C) 2021. Nordix Foundation. + * Modifications Copyright (C) 2021 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. @@ -33,7 +34,8 @@ public class ApexPeriodicEventGeneratorTest { public void run() throws ApexEventException { final EngineServiceEventInterface engineServiceEventInterface = Mockito.mock(EngineServiceEventInterface.class); - final int period = random.nextInt(200); + // don't want the timer to fire, so make it wait at least two seconds + final int period = random.nextInt(2000) + 2000; final ApexPeriodicEventGenerator generator = new ApexPeriodicEventGenerator(engineServiceEventInterface, period); diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/runtime/impl/EngineServiceImplTest.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/runtime/impl/EngineServiceImplTest.java index 3fe96a64f..ed1afe4da 100644 --- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/runtime/impl/EngineServiceImplTest.java +++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/runtime/impl/EngineServiceImplTest.java @@ -3,6 +3,7 @@ * Copyright (C) 2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2020-2021 Nordix Foundation. * Modifications Copyright (C) 2020 Bell Canada. All rights reserved. + * Modifications Copyright (C) 2021 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. @@ -243,13 +244,13 @@ public class EngineServiceImplTest { esImpl.startPeriodicEvents(100000); assertThatThrownBy(() -> esImpl.startPeriodicEvents(100000)).isInstanceOf(ApexException.class) - .hasMessage("Peiodic event geneation already running on engine Engine:0.0.1, ApexPeriodicEventGenerator " + .hasMessage("Periodic event geneation already running on engine Engine:0.0.1, ApexPeriodicEventGenerator " + "[period=100000, firstEventTime=0, lastEventTime=0, eventCount=0]"); esImpl.stopPeriodicEvents(); assertThatThrownBy(() -> esImpl.stopPeriodicEvents()).isInstanceOf(ApexException.class) - .hasMessage("Peiodic event geneation not running on engine Engine:0.0.1"); + .hasMessage("Periodic event geneation not running on engine Engine:0.0.1"); assertThatThrownBy(() -> esImpl.clear(null)).isInstanceOf(ApexException.class) .hasMessage("engine key must be specified and may not be null"); @@ -395,7 +396,7 @@ public class EngineServiceImplTest { esImpl.startPeriodicEvents(100000); fail("test should throw an exception"); } catch (ApexException apEx) { - assertEquals("Peiodic event geneation already running on engine Engine:0.0.1, ApexPeriodicEventGenerator " + assertEquals("Periodic event geneation already running on engine Engine:0.0.1, ApexPeriodicEventGenerator " + "[period=100000, firstEventTime=0, lastEventTime=0, eventCount=0]", apEx.getMessage()); } @@ -404,7 +405,7 @@ public class EngineServiceImplTest { esImpl.stopPeriodicEvents(); fail("test should throw an exception"); } catch (ApexException apEx) { - assertEquals("Peiodic event geneation not running on engine Engine:0.0.1", apEx.getMessage()); + assertEquals("Periodic event geneation not running on engine Engine:0.0.1", apEx.getMessage()); } try { |