diff options
Diffstat (limited to 'engine-d/src/test')
-rw-r--r-- | engine-d/src/test/java/org/onap/holmes/engine/InitializerTest.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/engine-d/src/test/java/org/onap/holmes/engine/InitializerTest.java b/engine-d/src/test/java/org/onap/holmes/engine/InitializerTest.java index d6d0b67..788c3ae 100644 --- a/engine-d/src/test/java/org/onap/holmes/engine/InitializerTest.java +++ b/engine-d/src/test/java/org/onap/holmes/engine/InitializerTest.java @@ -25,6 +25,8 @@ import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; import org.powermock.reflect.internal.WhiteboxImpl; +import java.util.concurrent.TimeUnit; + @RunWith(PowerMockRunner.class) @PrepareForTest(MicroServiceConfig.class) public class InitializerTest { @@ -43,8 +45,23 @@ public class InitializerTest { PowerMock.replayAll(); + setReadyFlagAfter(3); + WhiteboxImpl.invokeMethod(initializer, "init"); + TimeUnit.SECONDS.sleep(6); + PowerMock.verifyAll(); } + + private void setReadyFlagAfter(final int second) { + new Thread(() -> { + try { + TimeUnit.SECONDS.sleep(second); + } catch (InterruptedException e) { + e.printStackTrace(); + } + Initializer.setReadyForMsbReg(true); + }).start(); + } }
\ No newline at end of file |