summaryrefslogtreecommitdiffstats
path: root/holmes-actions/src/test/java
diff options
context:
space:
mode:
authorGuangrongFu <fu.guangrong@zte.com.cn>2022-04-28 11:46:53 +0800
committerGuangrongFu <fu.guangrong@zte.com.cn>2022-04-28 14:50:27 +0800
commitf9d58145927896ee8239d646500c1ad376146ddd (patch)
treeed203fd9937cc58162f5dd22181e85b492aaa788 /holmes-actions/src/test/java
parent4573a82249a185aad65dc2b86ce8c5ae71bd43f4 (diff)
Made the retry interval longer during MSB reg.
Issue-ID: HOLMES-536 Signed-off-by: GuangrongFu <fu.guangrong@zte.com.cn> Change-Id: Ib1be1e8b8d193a7a4bb6bdb63f55dcbda8bc029c
Diffstat (limited to 'holmes-actions/src/test/java')
-rw-r--r--holmes-actions/src/test/java/org/onap/holmes/common/utils/MsbRegisterTest.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/holmes-actions/src/test/java/org/onap/holmes/common/utils/MsbRegisterTest.java b/holmes-actions/src/test/java/org/onap/holmes/common/utils/MsbRegisterTest.java
index cf40c17..0201935 100644
--- a/holmes-actions/src/test/java/org/onap/holmes/common/utils/MsbRegisterTest.java
+++ b/holmes-actions/src/test/java/org/onap/holmes/common/utils/MsbRegisterTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright 2017-2020 ZTE Corporation.
+ * Copyright 2017-2022 ZTE Corporation.
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -85,13 +85,14 @@ public class MsbRegisterTest {
}
@Test
- public void test_register2Msb_fail_once() {
- expect(mockedJerseyClient.header("Accept", MediaType.APPLICATION_JSON)).andReturn(mockedJerseyClient).times(2);
- expect(mockedJerseyClient.queryParam("createOrUpdate", true)).andReturn(mockedJerseyClient).times(2);
+ public void test_register2Msb_fail_n_times() {
+ int requestTimes = 3;
+ expect(mockedJerseyClient.header("Accept", MediaType.APPLICATION_JSON)).andReturn(mockedJerseyClient).times(requestTimes);
+ expect(mockedJerseyClient.queryParam("createOrUpdate", true)).andReturn(mockedJerseyClient).times(requestTimes);
expect(mockedJerseyClient.post(anyObject(String.class),
anyObject(Entity.class),
anyObject(Class.class)))
- .andReturn(null);
+ .andReturn(null).times(requestTimes - 1);
expect(mockedJerseyClient.post(anyObject(String.class),
anyObject(Entity.class),
@@ -108,6 +109,7 @@ public class MsbRegisterTest {
PowerMock.replayAll();
MsbRegister msbRegister = new MsbRegister();
+ msbRegister.setInterval(1);
try {
msbRegister.register2Msb(msi);
} catch (CorrelationException e) {