<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
- <version>3.5</version>
+ <version>3.7</version>
</dependency>
<dependency>
<groupId>commons-net</groupId>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
- <version>2.8.0</version>
+ <version>2.8.5</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
- <version>2.0.0-beta.5</version>
+ <version>1.6.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
- <artifactId>powermock-api-mockito2</artifactId>
- <version>2.0.0-beta.5</version>
+ <artifactId>powermock-api-mockito</artifactId>
+ <version>1.6.4</version>
<scope>test</scope>
</dependency>
<dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
- <version>2.6.1</version>
+ <version>2.8.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
- <version>2.0.5.RELEASE</version>
+ <version>2.0.6.RELEASE</version>
<exclusions>
<exclusion>
<groupId>org.eclipse.jetty.websocket</groupId>
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;
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 {
targetCase = action.targetCase();
trim = String.valueOf(action.trim());
toField = action.getTarget();
- value = action.fromValue();
+ value = action.startValue();
}
}
import org.mockito.MockitoAnnotations;
import java.util.ArrayList;
-import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.when;
import static org.onap.sdc.dcae.composition.util.DcaeBeConstants.Composition.fileNames.COMPOSITION_YML;
import java.util.List;
import static org.junit.Assert.assertEquals;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertEquals;
-import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.when;
-import static org.mockito.ArgumentMatchers.any;
import static org.testng.Assert.assertNotEquals;
public class ServiceBusinessLogicTest {
import org.onap.sdc.dcae.errormng.ResponseFormat;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
-import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import java.util.ArrayList;
import java.util.Arrays;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.*;
+import static org.mockito.MockitoAnnotations.initMocks;
import static org.onap.sdc.dcae.composition.util.DcaeBeConstants.LifecycleStateEnum.CERTIFIED;
import static org.onap.sdc.dcae.composition.util.DcaeBeConstants.LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT;
public class VfcmtBusinessLogicTest {
- private ISdcClient sdcClientMock = Mockito.mock(ISdcClient.class);
- private ResourceDetailed templateMC = Mockito.mock(ResourceDetailed.class);
+ private ISdcClient sdcClientMock = mock(ISdcClient.class);
+ private ResourceDetailed templateMC = mock(ResourceDetailed.class);
private VfcmtBusinessLogic vfcmtBusinessLogic = new VfcmtBusinessLogic();
private ImportVFCMTRequest request = new ImportVFCMTRequest();
@Before
public void setup(){
- MockitoAnnotations.initMocks(this);
+ initMocks(this);
new ErrorConfigurationLoader(System.getProperty("user.dir")+"/src/main/webapp/WEB-INF");
vfcmtBusinessLogic.setSdcRestClient(sdcClientMock);
request.setTemplateUuid("577");
public void successfulCreationAndAttachmentOfVfcmt() throws Exception {
when(templateMC.getUuid()).thenReturn("3");
when(sdcClientMock.getResource(anyString(),anyString())).thenReturn(templateMC);
- ResourceDetailed mockedVfcmt = Mockito.mock(ResourceDetailed.class);
+ ResourceDetailed mockedVfcmt = mock(ResourceDetailed.class);
when(mockedVfcmt.getUuid()).thenReturn("5");
when(sdcClientMock.createResource(anyString(),any(),anyString())).thenReturn(mockedVfcmt);
when(sdcClientMock.getResourceArtifact(anyString(),anyString(),anyString())).thenReturn("3243324");
private void emulateListOfArtifactsWithCompositionYml() {
List<Artifact> 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\"}");
private void emulateCdumpArtifactWithoutFlowtype() {
List<Artifact> 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\"}\"");
private void emulateListOfArtifactsWithCompositionYmlAndSvcRef() {
List<Artifact> 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\"}");
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
- <version>3.5</version>
+ <version>3.7</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpasyncclient</artifactId>
- <version>4.1</version>
+ <version>4.1.4</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
</dependency>
<dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.12</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <version>2.0.2-beta</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>net.bytebuddy</groupId>
- <artifactId>byte-buddy</artifactId>
- <version>1.8.16</version>
- </dependency>
- <dependency>
- <groupId>net.bytebuddy</groupId>
- <artifactId>byte-buddy-agent</artifactId>
- <version>1.8.16</version>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <version>1.10.19</version>
<scope>test</scope>
</dependency>
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- <version>2.0.5.RELEASE</version>
- <configuration>
- <mainClass>org.onap.sdc.dcae.catalog.asdc.ASDCEngine</mainClass>
- <classifier>exec</classifier>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>repackage</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
- <version>2.0.5.RELEASE</version>
+ <version>2.0.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
- <version>2.0.5.RELEASE</version>
+ <version>2.0.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
- <version>3.5</version>
+ <version>3.7</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
- <version>2.7</version>
+ <version>2.8.5</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <version>2.0.2-beta</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>net.bytebuddy</groupId>
- <artifactId>byte-buddy</artifactId>
- <version>1.8.16</version>
- </dependency>
- <dependency>
- <groupId>net.bytebuddy</groupId>
- <artifactId>byte-buddy-agent</artifactId>
- <version>1.8.16</version>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
</configuration>
</plugin>
</plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpasyncclient</artifactId>
- <version>4.1</version>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpasyncclient</artifactId>
+ <version>4.1.4</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<version>1.3</version>
</dependency>
<dependency>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- <version>1.9.3</version>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <version>1.9.3</version>
</dependency>
<dependency>
<groupId>commons-jxpath</groupId>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
- <version>17.0</version>
+ <version>20.0</version>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
- <version>20160212</version>
+ <version>20160810</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>spring-web</artifactId>
<version>5.0.9.RELEASE</version>
</dependency>
- </dependencies>
+ </dependencies>
<properties>
<sonar.skip>true</sonar.skip>
</properties>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
- <version>17.0</version>
+ <version>20.0</version>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
- <version>20160212</version>
+ <version>20160810</version>
</dependency>
<dependency>
- <groupId>com.github.wnameless</groupId>
- <artifactId>json-flattener</artifactId>
- <version>0.2.2</version>
+ <groupId>com.github.wnameless</groupId>
+ <artifactId>json-flattener</artifactId>
+ <version>0.2.2</version>
</dependency>
- </dependencies>
+ </dependencies>
<properties>
<sonar.skip>true</sonar.skip>
</properties>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
- <version>2.0.5.RELEASE</version>
+ <version>2.0.6.RELEASE</version>
<configuration>
<classifier>exec</classifier>
</configuration>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
- <version>2.0.5.RELEASE</version>
+ <version>2.0.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
- <version>2.0.5.RELEASE</version>
+ <version>2.0.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.onap.sdc.dcae-d.dt-be-main</groupId>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
- <version>2.8.0</version>
+ <version>2.8.5</version>
</dependency>
<dependency>
<groupId>org.onap.sdc.dcae-d.dt-be-property</groupId>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
- <version>2.0.0-beta.5</version>
+ <version>1.6.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
- <artifactId>powermock-api-mockito2</artifactId>
- <version>2.0.0-beta.5</version>
+ <artifactId>powermock-api-mockito</artifactId>
+ <version>1.6.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>5.0.9.RELEASE</version>
- <scope>compile</scope>
</dependency>
</dependencies>
</project>
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;
{
"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
"credential" :{
"editor": "Carlos_Santana",
"username": "cs0008",
- "password": "",
+ "password": "123123a",
"firstName": "",
"lastName": ""
}
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 {
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
-
mockGetCatalog();
}
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;
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);
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;
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
- <version>17.0</version>
+ <version>20.0</version>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
- <version>2.0.5.RELEASE</version>
+ <version>1.5.9.RELEASE</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>