Code Review
/
holmes
/
rule-management.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
bugfix - fixed the healthcheck problem
[holmes/rule-management.git]
/
rulemgt
/
src
/
test
/
java
/
org
/
onap
/
holmes
/
rulemgt
/
InitializerTest.java
diff --git
a/rulemgt/src/test/java/org/onap/holmes/rulemgt/InitializerTest.java
b/rulemgt/src/test/java/org/onap/holmes/rulemgt/InitializerTest.java
index
120aba2
..
f658d35
100644
(file)
--- a/
rulemgt/src/test/java/org/onap/holmes/rulemgt/InitializerTest.java
+++ b/
rulemgt/src/test/java/org/onap/holmes/rulemgt/InitializerTest.java
@@
-26,6
+26,8
@@
import org.powermock.core.classloader.annotations.SuppressStaticInitializationFo
import org.powermock.modules.junit4.PowerMockRunner;
import org.powermock.reflect.internal.WhiteboxImpl;
import org.powermock.modules.junit4.PowerMockRunner;
import org.powermock.reflect.internal.WhiteboxImpl;
+import java.util.concurrent.TimeUnit;
+
@RunWith(PowerMockRunner.class)
@PrepareForTest(MicroServiceConfig.class)
@SuppressStaticInitializationFor("org.onap.holmes.common.utils.CommonUtils")
@RunWith(PowerMockRunner.class)
@PrepareForTest(MicroServiceConfig.class)
@SuppressStaticInitializationFor("org.onap.holmes.common.utils.CommonUtils")
@@
-45,8
+47,21
@@
public class InitializerTest {
PowerMock.replayAll();
PowerMock.replayAll();
+ setReadyFlagAfter(3);
+
WhiteboxImpl.invokeMethod(initializer, "init");
PowerMock.verifyAll();
}
WhiteboxImpl.invokeMethod(initializer, "init");
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
}
\ No newline at end of file