summaryrefslogtreecommitdiffstats
path: root/engine-d/src/test
diff options
context:
space:
mode:
authorGuangrongFu <fu.guangrong@zte.com.cn>2022-03-03 11:34:32 +0800
committerGuangrongFu <fu.guangrong@zte.com.cn>2022-03-03 11:34:32 +0800
commitd070fcda2258da7dde32bd56f6d62a6d03742617 (patch)
tree5bd4b20c31c49de56154a77d828e84bca18d6255 /engine-d/src/test
parent3ec3a8e1980c1c1bd08f9f0e28b76f46d11ba9f6 (diff)
bugfix - fixed the healthcheck problem
Issue-ID: HOLMES-512 Signed-off-by: GuangrongFu <fu.guangrong@zte.com.cn> Change-Id: I95891f918b0abb2ea74caf8f1d39aed92c80624c
Diffstat (limited to 'engine-d/src/test')
-rw-r--r--engine-d/src/test/java/org/onap/holmes/engine/InitializerTest.java17
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