diff options
author | Bonkur, Venkat (vb8416) <vb8416@att.com> | 2019-09-18 02:22:37 -0400 |
---|---|---|
committer | Bonkur, Venkat (vb8416) <vb8416@att.com> | 2019-09-18 02:26:01 -0400 |
commit | 1ad915ff0a4678d6a5f918f39ea42c18b620f7bb (patch) | |
tree | 11228f1bd5f37b50db3d2018329a5f6ed28dfd4c /asdc-controller/src/test/java/org/onap/asdc | |
parent | e288bedf6a7b83c6127cbb1bc4281084cdbc218e (diff) |
Add SO Update Check if SDC activities deployment end point server Up for custom worlflows
Make changes to verify if SDC activities deployment
end point(mso.asdc.config.activity.endpoint) server up
for custom workflows
Issue-ID: SO-2348
Signed-off-by: Bonkur, Venkat (vb8416) <vb8416@att.com>
Change-Id: I3b90b6d8e95681a685b23dfaa2f65596532e5b0e
Diffstat (limited to 'asdc-controller/src/test/java/org/onap/asdc')
-rw-r--r-- | asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsITTest.java | 10 | ||||
-rw-r--r-- | asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsTest.java | 2 |
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()); |