summaryrefslogtreecommitdiffstats
path: root/dcaedt_be/src
diff options
context:
space:
mode:
Diffstat (limited to 'dcaedt_be/src')
-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
7 files changed, 17 insertions, 17 deletions
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\"}");