aboutsummaryrefslogtreecommitdiffstats
path: root/asdc-controller/src/test/java/org/onap
diff options
context:
space:
mode:
Diffstat (limited to 'asdc-controller/src/test/java/org/onap')
-rw-r--r--asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsITTest.java10
-rw-r--r--asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsTest.java2
2 files changed, 10 insertions, 2 deletions
diff --git a/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsITTest.java b/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsITTest.java
index b41fbaf658..75ab089719 100644
--- a/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsITTest.java
+++ b/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsITTest.java
@@ -29,7 +29,9 @@ import static com.github.tomakehurst.wiremock.client.WireMock.verify;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.when;
import org.junit.Test;
+import org.mockito.InjectMocks;
import org.mockito.Mock;
+import org.mockito.Spy;
import org.onap.so.asdc.BaseTest;
import org.onap.so.asdc.activity.DeployActivitySpecs;
import org.onap.so.asdc.activity.beans.ActivitySpecCreateResponse;
@@ -50,6 +52,10 @@ public class DeployActivitySpecsITTest extends BaseTest {
@Autowired
private DeployActivitySpecs deployActivitySpecs;
+ @InjectMocks
+ @Spy
+ DeployActivitySpecs deployActivitySpecsM;
+
@Test
public void deployActivitySpecsIT_Test() throws Exception {
ActivitySpecCreateResponse activitySpecCreateResponse = new ActivitySpecCreateResponse();
@@ -100,7 +106,9 @@ public class DeployActivitySpecsITTest extends BaseTest {
put(urlPathMatching(urlPath)).willReturn(aResponse().withHeader("Content-Type", "application/json")
.withStatus(org.springframework.http.HttpStatus.OK.value())));
- deployActivitySpecs.deployActivities();
+ String host = "http://localhost:8090";
+ when(deployActivitySpecsM.checkHttpServerUp(host)).thenReturn(false);
+ deployActivitySpecsM.deployActivities();
verify(0, putRequestedFor(urlEqualTo(urlPath)));
}
diff --git a/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsTest.java b/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsTest.java
index 7a876a67a2..6d88ab6630 100644
--- a/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsTest.java
+++ b/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsTest.java
@@ -71,7 +71,7 @@ public class DeployActivitySpecsTest {
new ArrayList<org.onap.so.db.catalog.beans.ActivitySpec>();
catalogActivitySpecList.add(catalogActivitySpec);
when(env.getProperty("mso.asdc.config.activity.endpoint")).thenReturn("http://testEndpoint");
- doReturn(true).when(deployActivitySpecs).checkHttpOk("http://testEndpoint");
+ doReturn(true).when(deployActivitySpecs).checkHttpServerUp("http://testEndpoint");
when(activitySpecRepository.findAll()).thenReturn(catalogActivitySpecList);
doReturn("testActivityId").when(activitySpecsActions).createActivitySpec(Mockito.any(), Mockito.any());
doReturn(true).when(activitySpecsActions).certifyActivitySpec(Mockito.any(), Mockito.any());