summaryrefslogtreecommitdiffstats
path: root/dcaedt_be
diff options
context:
space:
mode:
authorEran (ev672n), Vosk <ev672n@att.com>2018-10-29 18:10:13 +0200
committerEran (ev672n), Vosk <ev672n@att.com>2018-10-29 18:15:30 +0200
commitf94a95f9db9e843671f480efd6227f7c72d47532 (patch)
treee7a9043a0bff3c0da258cec4f9fe299c7c83b1fd /dcaedt_be
parentb4b7410445f359ad265c5e912d092bd275ba19e7 (diff)
Sync the code between repositories Change-Id: I3e570c9c8b090adc5520381019a22e8a46d66beb Issue-ID: SDC-1874 Signed-off-by: Eran (ev672n), Vosk <ev672n@att.com>
Diffstat (limited to 'dcaedt_be')
-rw-r--r--dcaedt_be/pom.xml14
-rw-r--r--dcaedt_be/src/main/java/org/onap/sdc/dcae/composition/CompositionEngine.java2
-rw-r--r--dcaedt_be/src/main/java/org/onap/sdc/dcae/composition/impl/CompositionBusinessLogic.java2
-rw-r--r--dcaedt_be/src/main/java/org/onap/sdc/dcae/rule/editor/translators/StringTransformTranslator.java2
-rw-r--r--dcaedt_be/src/test/java/org/onap/sdc/dcae/composition/impl/BlueprintBusinessLogicTest.java2
-rw-r--r--dcaedt_be/src/test/java/org/onap/sdc/dcae/composition/impl/CompositionBusinessLogicTest.java4
-rw-r--r--dcaedt_be/src/test/java/org/onap/sdc/dcae/composition/impl/ServiceBusinessLogicTest.java4
-rw-r--r--dcaedt_be/src/test/java/org/onap/sdc/dcae/composition/impl/VfcmtBusinessLogicTest.java18
8 files changed, 24 insertions, 24 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 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
- <version>3.5</version>
+ <version>3.7</version>
</dependency>
<dependency>
<groupId>commons-net</groupId>
@@ -51,7 +51,7 @@
<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>
@@ -86,13 +86,13 @@
<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>
@@ -109,7 +109,7 @@
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
- <version>2.6.1</version>
+ <version>2.8.0</version>
<scope>compile</scope>
</dependency>
<dependency>
@@ -135,7 +135,7 @@
<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>
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<StringTransformA
targetCase = action.targetCase();
trim = String.valueOf(action.trim());
toField = action.getTarget();
- value = action.fromValue();
+ value = action.startValue();
}
}
diff --git a/dcaedt_be/src/test/java/org/onap/sdc/dcae/composition/impl/BlueprintBusinessLogicTest.java b/dcaedt_be/src/test/java/org/onap/sdc/dcae/composition/impl/BlueprintBusinessLogicTest.java
index d04a92e..9480de0 100644
--- a/dcaedt_be/src/test/java/org/onap/sdc/dcae/composition/impl/BlueprintBusinessLogicTest.java
+++ b/dcaedt_be/src/test/java/org/onap/sdc/dcae/composition/impl/BlueprintBusinessLogicTest.java
@@ -13,7 +13,7 @@ import org.springframework.http.ResponseEntity;
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;
diff --git a/dcaedt_be/src/test/java/org/onap/sdc/dcae/composition/impl/CompositionBusinessLogicTest.java b/dcaedt_be/src/test/java/org/onap/sdc/dcae/composition/impl/CompositionBusinessLogicTest.java
index fbecd71..60ab07c 100644
--- a/dcaedt_be/src/test/java/org/onap/sdc/dcae/composition/impl/CompositionBusinessLogicTest.java
+++ b/dcaedt_be/src/test/java/org/onap/sdc/dcae/composition/impl/CompositionBusinessLogicTest.java
@@ -21,8 +21,8 @@ import java.util.Arrays;
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;
diff --git a/dcaedt_be/src/test/java/org/onap/sdc/dcae/composition/impl/ServiceBusinessLogicTest.java b/dcaedt_be/src/test/java/org/onap/sdc/dcae/composition/impl/ServiceBusinessLogicTest.java
index 671927c..69f940d 100644
--- a/dcaedt_be/src/test/java/org/onap/sdc/dcae/composition/impl/ServiceBusinessLogicTest.java
+++ b/dcaedt_be/src/test/java/org/onap/sdc/dcae/composition/impl/ServiceBusinessLogicTest.java
@@ -28,9 +28,9 @@ import java.util.stream.Collectors;
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 {
diff --git a/dcaedt_be/src/test/java/org/onap/sdc/dcae/composition/impl/VfcmtBusinessLogicTest.java b/dcaedt_be/src/test/java/org/onap/sdc/dcae/composition/impl/VfcmtBusinessLogicTest.java
index bf1cbbe..c8f7287 100644
--- a/dcaedt_be/src/test/java/org/onap/sdc/dcae/composition/impl/VfcmtBusinessLogicTest.java
+++ b/dcaedt_be/src/test/java/org/onap/sdc/dcae/composition/impl/VfcmtBusinessLogicTest.java
@@ -21,7 +21,6 @@ import org.onap.sdc.dcae.errormng.RequestError;
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;
@@ -30,13 +29,14 @@ import java.util.List;
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();
@@ -46,7 +46,7 @@ public class VfcmtBusinessLogicTest {
@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");
@@ -91,7 +91,7 @@ public class VfcmtBusinessLogicTest {
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");
@@ -292,7 +292,7 @@ public class VfcmtBusinessLogicTest {
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\"}");
@@ -303,7 +303,7 @@ public class VfcmtBusinessLogicTest {
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\"}\"");
@@ -313,8 +313,8 @@ public class VfcmtBusinessLogicTest {
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\"}");