aboutsummaryrefslogtreecommitdiffstats
path: root/asdc-controller/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'asdc-controller/src/test')
-rw-r--r--asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCControllerITTest.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCControllerITTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCControllerITTest.java
index 301ef14637..51559c2ffe 100644
--- a/asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCControllerITTest.java
+++ b/asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCControllerITTest.java
@@ -23,6 +23,7 @@ import static com.github.tomakehurst.wiremock.client.WireMock.ok;
import static com.github.tomakehurst.wiremock.client.WireMock.post;
import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail;
@@ -58,6 +59,8 @@ import org.onap.so.db.catalog.data.repository.ServiceRepository;
import org.onap.so.db.catalog.data.repository.ToscaCsarRepository;
import org.onap.so.db.catalog.data.repository.VnfCustomizationRepository;
import org.onap.so.db.catalog.data.repository.VnfResourceRepository;
+import org.onap.so.db.request.beans.WatchdogComponentDistributionStatus;
+import org.onap.so.db.request.data.repository.WatchdogComponentDistributionStatusRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -107,6 +110,9 @@ public class ASDCControllerITTest extends BaseTest {
@Autowired
private ServiceRepository serviceRepository;
+ @Autowired
+ protected WatchdogComponentDistributionStatusRepository watchdogCDStatusRepository;
+
private DistributionClientEmulator distributionClient;
@Before
@@ -263,6 +269,18 @@ public class ASDCControllerITTest extends BaseTest {
assertEquals("PNF resource customization entity", 1, pnfCustList.size());
assertEquals(pnfCustomizationKey, pnfCustList.get(0).getModelCustomizationUUID());
+ /**
+ * Check the watchdog for component distribution status
+ */
+ List<WatchdogComponentDistributionStatus> distributionList = watchdogCDStatusRepository
+ .findByDistributionId(this.distributionId);
+ assertNotNull(distributionList);
+ assertEquals(1, distributionList.size());
+ WatchdogComponentDistributionStatus distributionStatus = distributionList.get(0);
+ assertEquals("COMPONENT_DONE_OK", distributionStatus.getComponentDistributionStatus());
+ assertEquals("SO", distributionStatus.getComponentName());
+
+
} catch (Exception e) {
logger.info(e.getMessage(), e);
fail(e.getMessage());
@@ -411,6 +429,17 @@ public class ASDCControllerITTest extends BaseTest {
List<VnfResourceCustomization> vnfCustList = service.getVnfCustomizations();
assertEquals("VNF resource customization entity", 1, vnfCustList.size());
assertEquals(vnfCustomizationKey, vnfCustList.get(0).getModelCustomizationUUID());
+
+ /**
+ * Check the watchdog for component distribution status
+ */
+ List<WatchdogComponentDistributionStatus> distributionList = watchdogCDStatusRepository
+ .findByDistributionId(this.distributionId);
+ assertNotNull(distributionList);
+ assertEquals(1, distributionList.size());
+ WatchdogComponentDistributionStatus distributionStatus = distributionList.get(0);
+ assertEquals("COMPONENT_DONE_OK", distributionStatus.getComponentDistributionStatus());
+ assertEquals("SO", distributionStatus.getComponentName());
} catch (Exception e) {
logger.info(e.getMessage(), e);
fail(e.getMessage());