From f94a95f9db9e843671f480efd6227f7c72d47532 Mon Sep 17 00:00:00 2001 From: "Eran (ev672n), Vosk" Date: Mon, 29 Oct 2018 18:10:13 +0200 Subject: Sync code Sync the code between repositories Change-Id: I3e570c9c8b090adc5520381019a22e8a46d66beb Issue-ID: SDC-1874 Signed-off-by: Eran (ev672n), Vosk --- dcaedt_be/pom.xml | 14 +- .../sdc/dcae/composition/CompositionEngine.java | 2 +- .../composition/impl/CompositionBusinessLogic.java | 2 +- .../translators/StringTransformTranslator.java | 2 +- .../impl/BlueprintBusinessLogicTest.java | 2 +- .../impl/CompositionBusinessLogicTest.java | 4 +- .../composition/impl/ServiceBusinessLogicTest.java | 4 +- .../composition/impl/VfcmtBusinessLogicTest.java | 18 +- dcaedt_catalog/api/pom.xml | 28 +-- dcaedt_catalog/asdc/pom.xml | 46 +--- dcaedt_catalog/commons/pom.xml | 24 +- dcaedt_catalog/db/pom.xml | 12 +- dcaedt_catalog/service/pom.xml | 6 +- dcaedt_tools/pom.xml | 9 +- .../src/main/java/tools/DeployTemplate.java | 1 + dcaedt_tools/src/main/resources/conf/config.json | 245 +-------------------- .../src/main/resources/conf/environment.json | 2 +- dcaedt_tools/src/test/java/BaseTest.java | 3 +- dcaedt_tools/src/test/java/DeployTemplateTest.java | 3 +- .../src/test/java/TemplateContainerTest.java | 2 +- dcaedt_validator/checker/pom.xml | 2 +- pom.xml | 2 +- 22 files changed, 76 insertions(+), 357 deletions(-) diff --git a/dcaedt_be/pom.xml b/dcaedt_be/pom.xml index a33306a..950af26 100644 --- a/dcaedt_be/pom.xml +++ b/dcaedt_be/pom.xml @@ -36,7 +36,7 @@ org.apache.commons commons-lang3 - 3.5 + 3.7 commons-net @@ -51,7 +51,7 @@ com.google.code.gson gson - 2.8.0 + 2.8.5 org.json @@ -86,13 +86,13 @@ org.powermock powermock-module-junit4 - 2.0.0-beta.5 + 1.6.4 test org.powermock - powermock-api-mockito2 - 2.0.0-beta.5 + powermock-api-mockito + 1.6.4 test @@ -109,7 +109,7 @@ io.springfox springfox-swagger2 - 2.6.1 + 2.8.0 compile @@ -135,7 +135,7 @@ org.springframework.boot spring-boot-starter-jetty - 2.0.5.RELEASE + 2.0.6.RELEASE org.eclipse.jetty.websocket diff --git a/dcaedt_be/src/main/java/org/onap/sdc/dcae/composition/CompositionEngine.java b/dcaedt_be/src/main/java/org/onap/sdc/dcae/composition/CompositionEngine.java index f07358a..c633c59 100644 --- a/dcaedt_be/src/main/java/org/onap/sdc/dcae/composition/CompositionEngine.java +++ b/dcaedt_be/src/main/java/org/onap/sdc/dcae/composition/CompositionEngine.java @@ -14,7 +14,7 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.FilterRegistrationBean; -import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; +import org.springframework.boot.web.support.SpringBootServletInitializer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; diff --git a/dcaedt_be/src/main/java/org/onap/sdc/dcae/composition/impl/CompositionBusinessLogic.java b/dcaedt_be/src/main/java/org/onap/sdc/dcae/composition/impl/CompositionBusinessLogic.java index 43674fe..2791028 100644 --- a/dcaedt_be/src/main/java/org/onap/sdc/dcae/composition/impl/CompositionBusinessLogic.java +++ b/dcaedt_be/src/main/java/org/onap/sdc/dcae/composition/impl/CompositionBusinessLogic.java @@ -148,7 +148,7 @@ public class CompositionBusinessLogic extends BaseBusinessLogic { if (null != vfiRefs && 1 < vfiRefs.size()) { debugLogger.log(LogLevel.DEBUG, this.getClass().getName(), "Found {} external monitoring references for vfi {} on service {}:{}", vfiRefs.size(), newReferencedMc.getVfiName(), service.getUuid(), vfiRefs); Collections.synchronizedList(vfiRefs).parallelStream() - .filter(p -> !newReferencedMc.getUuid().equals(p)) + .filter(p -> !newReferencedMc.getUuid().equals(p) && !p.endsWith(REVERTED_REF)) .filter(p -> newReferencedMc.getInvariantUUID().equals(sdcRestClient.getResource(p, requestId).getInvariantUUID())) .forEach(id -> sdcRestClient.deleteExternalMonitoringReference(userId, context, service.getUuid(), normalizedInstanceName, id, requestId)); } else { diff --git a/dcaedt_be/src/main/java/org/onap/sdc/dcae/rule/editor/translators/StringTransformTranslator.java b/dcaedt_be/src/main/java/org/onap/sdc/dcae/rule/editor/translators/StringTransformTranslator.java index de326d1..146fc53 100644 --- a/dcaedt_be/src/main/java/org/onap/sdc/dcae/rule/editor/translators/StringTransformTranslator.java +++ b/dcaedt_be/src/main/java/org/onap/sdc/dcae/rule/editor/translators/StringTransformTranslator.java @@ -24,7 +24,7 @@ public class StringTransformTranslator extends ActionTranslator listOfArtifactCompositionYml = new ArrayList<>(); - Artifact compositionArtifact = Mockito.mock(Artifact.class); + Artifact compositionArtifact = mock(Artifact.class); when(compositionArtifact.getArtifactName()).thenReturn(DcaeBeConstants.Composition.fileNames.COMPOSITION_YML); when(compositionArtifact.getArtifactUUID()).thenReturn("compositionArtifactUuid"); when(compositionArtifact.getPayloadData()).thenReturn("{\"flowType\":\"don't override\"}"); @@ -303,7 +303,7 @@ public class VfcmtBusinessLogicTest { private void emulateCdumpArtifactWithoutFlowtype() { List listOfArtifactCompositionYml = new ArrayList<>(); - Artifact compositionArtifact = Mockito.mock(Artifact.class); + Artifact compositionArtifact = mock(Artifact.class); when(compositionArtifact.getArtifactName()).thenReturn(DcaeBeConstants.Composition.fileNames.COMPOSITION_YML); when(compositionArtifact.getArtifactUUID()).thenReturn("compositionArtifactUuid"); when(compositionArtifact.getPayloadData()).thenReturn("{\"cid\":\"xsssdaerrwr\"}\""); @@ -313,8 +313,8 @@ public class VfcmtBusinessLogicTest { private void emulateListOfArtifactsWithCompositionYmlAndSvcRef() { List listOfArtifactCompositionYml = new ArrayList<>(); - Artifact compositionArtifact = Mockito.mock(Artifact.class); - Artifact svcRefArtifact = Mockito.mock(Artifact.class); + Artifact compositionArtifact = mock(Artifact.class); + Artifact svcRefArtifact = mock(Artifact.class); when(compositionArtifact.getArtifactName()).thenReturn(DcaeBeConstants.Composition.fileNames.COMPOSITION_YML); when(compositionArtifact.getArtifactUUID()).thenReturn("compositionArtifactUuid"); when(compositionArtifact.getPayloadData()).thenReturn("{\"flowType\":\"don't override\"}"); diff --git a/dcaedt_catalog/api/pom.xml b/dcaedt_catalog/api/pom.xml index 950ced8..4f2ed0f 100644 --- a/dcaedt_catalog/api/pom.xml +++ b/dcaedt_catalog/api/pom.xml @@ -127,12 +127,12 @@ org.apache.commons commons-lang3 - 3.5 + 3.7 org.apache.httpcomponents httpasyncclient - 4.1 + 4.1.4 commons-io @@ -169,27 +169,9 @@ - junit - junit - 4.12 - test - - - - org.mockito - mockito-all - 2.0.2-beta - test - - - net.bytebuddy - byte-buddy - 1.8.16 - - - net.bytebuddy - byte-buddy-agent - 1.8.16 + org.mockito + mockito-core + 1.10.19 test diff --git a/dcaedt_catalog/asdc/pom.xml b/dcaedt_catalog/asdc/pom.xml index 2ecf3ff..6340f8c 100644 --- a/dcaedt_catalog/asdc/pom.xml +++ b/dcaedt_catalog/asdc/pom.xml @@ -41,22 +41,6 @@ - - org.springframework.boot - spring-boot-maven-plugin - 2.0.5.RELEASE - - org.onap.sdc.dcae.catalog.asdc.ASDCEngine - exec - - - - - repackage - - - - @@ -79,7 +63,7 @@ org.springframework.boot spring-boot-starter-web - 2.0.5.RELEASE + 2.0.6.RELEASE org.springframework @@ -89,12 +73,12 @@ org.springframework.boot spring-boot-autoconfigure - 2.0.5.RELEASE + 2.0.6.RELEASE org.apache.commons commons-lang3 - 3.5 + 3.7 commons-cli @@ -114,7 +98,7 @@ com.google.code.gson gson - 2.7 + 2.8.5 junit @@ -126,22 +110,10 @@ assertj-core test - - org.mockito - mockito-all - 2.0.2-beta - test - - - net.bytebuddy - byte-buddy - 1.8.16 - - - net.bytebuddy - byte-buddy-agent - 1.8.16 - test - + + org.mockito + mockito-core + test + diff --git a/dcaedt_catalog/commons/pom.xml b/dcaedt_catalog/commons/pom.xml index 6da23c2..e783d33 100644 --- a/dcaedt_catalog/commons/pom.xml +++ b/dcaedt_catalog/commons/pom.xml @@ -75,12 +75,12 @@ - - - - org.apache.httpcomponents - httpasyncclient - 4.1 + + + + org.apache.httpcomponents + httpasyncclient + 4.1.4 commons-io @@ -93,9 +93,9 @@ 1.3 - commons-beanutils - commons-beanutils - 1.9.3 + commons-beanutils + commons-beanutils + 1.9.3 commons-jxpath @@ -105,7 +105,7 @@ com.google.guava guava - 17.0 + 20.0 org.yaml @@ -115,7 +115,7 @@ org.json json - 20160212 + 20160810 com.fasterxml.jackson.core @@ -132,7 +132,7 @@ spring-web 5.0.9.RELEASE - + true diff --git a/dcaedt_catalog/db/pom.xml b/dcaedt_catalog/db/pom.xml index 2870d04..1c92e6e 100644 --- a/dcaedt_catalog/db/pom.xml +++ b/dcaedt_catalog/db/pom.xml @@ -128,7 +128,7 @@ com.google.guava guava - 17.0 + 20.0 org.yaml @@ -138,14 +138,14 @@ org.json json - 20160212 + 20160810 - com.github.wnameless - json-flattener - 0.2.2 + com.github.wnameless + json-flattener + 0.2.2 - + true diff --git a/dcaedt_catalog/service/pom.xml b/dcaedt_catalog/service/pom.xml index 85a3019..ccde7ad 100644 --- a/dcaedt_catalog/service/pom.xml +++ b/dcaedt_catalog/service/pom.xml @@ -26,7 +26,7 @@ org.springframework.boot spring-boot-maven-plugin - 2.0.5.RELEASE + 2.0.6.RELEASE exec @@ -60,7 +60,7 @@ org.springframework.boot spring-boot-starter-web - 2.0.5.RELEASE + 2.0.6.RELEASE org.springframework @@ -70,7 +70,7 @@ org.springframework.boot spring-boot-autoconfigure - 2.0.5.RELEASE + 2.0.6.RELEASE org.onap.sdc.dcae-d.dt-be-main diff --git a/dcaedt_tools/pom.xml b/dcaedt_tools/pom.xml index 96f641a..9817335 100644 --- a/dcaedt_tools/pom.xml +++ b/dcaedt_tools/pom.xml @@ -207,7 +207,7 @@ com.google.code.gson gson - 2.8.0 + 2.8.5 org.onap.sdc.dcae-d.dt-be-property @@ -217,13 +217,13 @@ org.powermock powermock-module-junit4 - 2.0.0-beta.5 + 1.6.4 test org.powermock - powermock-api-mockito2 - 2.0.0-beta.5 + powermock-api-mockito + 1.6.4 test @@ -265,7 +265,6 @@ org.springframework spring-web 5.0.9.RELEASE - compile diff --git a/dcaedt_tools/src/main/java/tools/DeployTemplate.java b/dcaedt_tools/src/main/java/tools/DeployTemplate.java index 41e5b6a..556316b 100644 --- a/dcaedt_tools/src/main/java/tools/DeployTemplate.java +++ b/dcaedt_tools/src/main/java/tools/DeployTemplate.java @@ -4,6 +4,7 @@ import json.templateInfo.TemplateInfo; import org.onap.sdc.dcae.composition.restmodels.CreateVFCMTRequest; import org.onap.sdc.dcae.composition.restmodels.sdc.ResourceDetailed; import org.onap.sdc.dcae.composition.util.DcaeBeConstants; +import org.springframework.web.client.HttpServerErrorException; import utilities.IDcaeRestClient; import utilities.IReport; diff --git a/dcaedt_tools/src/main/resources/conf/config.json b/dcaedt_tools/src/main/resources/conf/config.json index f7c07d7..7168853 100644 --- a/dcaedt_tools/src/main/resources/conf/config.json +++ b/dcaedt_tools/src/main/resources/conf/config.json @@ -1,250 +1,15 @@ { "templateInfo": [{ - "name": "Syslog Collector", - "flowType": "Syslog Collector", - "description": "Syslog Collector", + "name": "Tcadocker complex", + "flowType": "Tcadocker complex", + "description": "Tcadocker complex", "category": "Template", "subCategory":"Base Monitoring Template", "updateIfExist": "false", "composition": [{ - "type": "SyslogCollector", + "type": "tcadocker spec complex", "alias": "" }] - },{ - "name": "Syslog MSEA", - "flowType": "Syslog MSEA", - "description": "Syslog MSEA", - "category": "Template", - "subCategory":"Base Monitoring Template", - "updateIfExist": "false", - "composition": [{ - "type": "Map", - "alias": "" - }, { - "type": "Supplement", - "alias": "" - }, { - "type": "Enrich", - "alias": "" - }, { - "type": "Alert", - "alias": "" - }], - "relations": [{ - "fromComponent": "Supplement", - "fromRequirement": "dependency", - "toComponent": "Map", - "toCapability": "feature" - },{ - "fromComponent": "Enrich", - "fromRequirement": "dependency", - "toComponent": "Supplement", - "toCapability": "feature" - },{ - "fromComponent": "Alert", - "fromRequirement": "dependency", - "toComponent": "Enrich", - "toCapability": "feature" - }] - }, - - { - "name": "Status Poller MSE", - "flowType": "Status Poller MSE", - "description": "Status Poller MSE", - "category": "Template", - "subCategory":"Base Monitoring Template", - "updateIfExist": "false", - "composition": [{ - "type": "Map", - "alias": "" - }, { - "type": "Supplement", - "alias": "" - }, { - "type": "Enrich", - "alias": "" - }], - "relations": [{ - "fromComponent": "Supplement", - "fromRequirement": "dependency", - "toComponent": "Map", - "toCapability": "feature" - },{ - "fromComponent": "Enrich", - "fromRequirement": "dependency", - "toComponent": "Supplement", - "toCapability": "feature" - }] - }, { - "name": "FOI Collector", - "flowType": "FOI Collector", - "description": "FOI Collector", - "category": "Template", - "subCategory":"Base Monitoring Template", - "updateIfExist": "false", - "composition": [{ - "type": "FOICollector", - "alias": "" - }] - - }, { - "name": "SNMP MSE", - "flowType": "SNMP MSE", - "description": "SNMP MSE", - "category": "Template", - "subCategory":"Base Monitoring Template", - "updateIfExist": "false", - "composition": [{ - "type": "Map", - "alias": "" - }, { - "type": "Supplement", - "alias": "" - }, { - "type": "Enrich", - "alias": "" - }], - "relations": [{ - "fromComponent": "Supplement", - "fromRequirement": "dependency", - "toComponent": "Map", - "toCapability": "feature" - },{ - "fromComponent": "Enrich", - "fromRequirement": "dependency", - "toComponent": "Supplement", - "toCapability": "feature" - }] - }, { - "name": "Docker Map", - "flowType": "Docker Map", - "description": "Docker Map", - "category": "Template", - "subCategory":"Base Monitoring Template", - "updateIfExist": "false", - "composition": [{ - "type": "DockerMap", - "alias": "" - }] - }, - { - "name": "SAM Collector", - "flowType": "SAM Collector", - "description": "SAM Collector", - "category": "Template", - "subCategory":"Base Monitoring Template", - "updateIfExist": "false", - "composition": [{ - "type": "SAMCollector1806", - "alias": "" - }] - }, - { - "name": "SNMP PM Poller", - "flowType": "SNMP PM Poller", - "description": "SNMP PM Poller", - "category": "Template", - "subCategory":"Base Monitoring Template", - "updateIfExist": "false", - "composition": [{ - "type": "PM Poller", - "alias": "" - }] - }, - { - "name": "Status Poller Collector", - "flowType": "Status Poller Collector", - "description": "Status Poller Collector", - "category": "Template", - "subCategory": "Base Monitoring Template", - "updateIfExist": "false", - "composition": [ - { - "type": "StatusPoller", - "alias": "" - }] - }, - { - "name": "VES Collector", - "flowType": "VES Collector", - "description": "VES Collector", - "category": "Template", - "subCategory":"Base Monitoring Template", - "updateIfExist": "false", - "composition": [{ - "type": "VES Collector", - "alias": "" - }] - }, - { - "name": "VES Fault SE", - "flowType": "VES Fault SE", - "description": "VES Fault SE", - "category": "Template", - "subCategory":"Base Monitoring Template", - "updateIfExist": "false", - "composition": [{ - "type": "Supplement", - "alias": "" - }, { - "type": "Enrich", - "alias": "" - }], - "relations": [{ - "fromComponent": "Enrich", - "fromRequirement": "dependency", - "toComponent": "Supplement", - "toCapability": "feature" - }] - }, - { - "name": "Docker Supplement", - "flowType": "Docker Supplement", - "description": "Docker Supplement", - "category": "Template", - "subCategory":"Base Monitoring Template", - "updateIfExist": "false", - "composition": [{ - "type": "Docker_Supplement", - "alias": "" - }] - }, - { - "name": "Docker Enrich", - "flowType": "Docker Enrich", - "description": "Docker Enrich", - "category": "Template", - "subCategory":"Base Monitoring Template", - "updateIfExist": "false", - "composition": [{ - "type": "DockerEnrich", - "alias": "" - }] - }, - { - "name": "MIB Poller", - "flowType": "MIB Poller", - "description": "MIB Poller", - "category": "Template", - "subCategory":"Base Monitoring Template", - "updateIfExist": "false", - "composition": [{ - "type": "MIBPoller", - "alias": "" - }] - }, - { - "name": "Discovery Poller", - "flowType": "Discovery Poller", - "description": "Discovery Poller", - "category": "Template", - "subCategory":"Base Monitoring Template", - "updateIfExist": "false", - "composition": [{ - "type": "Discovery", - "alias": "" - }] - }] + }] } \ No newline at end of file diff --git a/dcaedt_tools/src/main/resources/conf/environment.json b/dcaedt_tools/src/main/resources/conf/environment.json index abf66b9..c5dd846 100644 --- a/dcaedt_tools/src/main/resources/conf/environment.json +++ b/dcaedt_tools/src/main/resources/conf/environment.json @@ -5,7 +5,7 @@ "credential" :{ "editor": "Carlos_Santana", "username": "cs0008", - "password": "", + "password": "123123a", "firstName": "", "lastName": "" } diff --git a/dcaedt_tools/src/test/java/BaseTest.java b/dcaedt_tools/src/test/java/BaseTest.java index 16372e0..8d163a4 100644 --- a/dcaedt_tools/src/test/java/BaseTest.java +++ b/dcaedt_tools/src/test/java/BaseTest.java @@ -11,7 +11,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Matchers.any; import static org.mockito.Mockito.when; abstract class BaseTest { @@ -42,7 +42,6 @@ abstract class BaseTest { @Before public void setup() { MockitoAnnotations.initMocks(this); - mockGetCatalog(); } diff --git a/dcaedt_tools/src/test/java/DeployTemplateTest.java b/dcaedt_tools/src/test/java/DeployTemplateTest.java index 0dc35f9..78d27c7 100644 --- a/dcaedt_tools/src/test/java/DeployTemplateTest.java +++ b/dcaedt_tools/src/test/java/DeployTemplateTest.java @@ -7,7 +7,7 @@ import tools.DeployTemplate; import java.util.*; -import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @@ -28,6 +28,7 @@ public class DeployTemplateTest extends BaseTest { super.mockCheckoutVfcmtAndCreateResource(); when(dcaeRestClient.getUserId()).thenReturn(USER_ID); when(dcaeRestClient.saveComposition(any(), any())).thenReturn("Composition Created"); + templateInfoToJsonObjectMap = new HashMap<>(); TemplateInfo templateInfo = new TemplateInfo(); templateInfo.setName(VFCMT_NAME1); diff --git a/dcaedt_tools/src/test/java/TemplateContainerTest.java b/dcaedt_tools/src/test/java/TemplateContainerTest.java index 906d32e..a68323a 100644 --- a/dcaedt_tools/src/test/java/TemplateContainerTest.java +++ b/dcaedt_tools/src/test/java/TemplateContainerTest.java @@ -11,7 +11,7 @@ import tools.TemplateContainer; import java.util.*; -import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; diff --git a/dcaedt_validator/checker/pom.xml b/dcaedt_validator/checker/pom.xml index 2cf5943..985c88f 100644 --- a/dcaedt_validator/checker/pom.xml +++ b/dcaedt_validator/checker/pom.xml @@ -125,7 +125,7 @@ com.google.guava guava - 17.0 + 20.0 org.yaml diff --git a/pom.xml b/pom.xml index 4598d24..f304f16 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.5.RELEASE + 1.5.9.RELEASE -- cgit 1.2.3-korg