summaryrefslogtreecommitdiffstats
path: root/asdc-controller/src/test/java/org
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2019-01-11 21:54:58 -0500
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2019-01-11 21:55:51 -0500
commitcd85fa3ff3322c0990430efe55dedc2f7577ee6b (patch)
tree95c7d8c2694cd8eca5a305a98e55974a2d375e51 /asdc-controller/src/test/java/org
parentde5958dddd97b086ec8b603974f434fd814386ac (diff)
Miscellaneous fixes
updated common pom to use aai schema version 1.4.1 removed handle sync error from SDNCHandler bpmn flow added mso-request-id to in mapping of delete vnf flows moved temporary test file to temporary folder Removed obsolete genericVnfNode parameter from updateGenericVnfNode sorted vfmodules by base last for negative action reqs Change-Id: I7a5018d67292cfaac8d923ac3bd9b27ed037be57 Issue-ID: SO-1382 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'asdc-controller/src/test/java/org')
-rw-r--r--asdc-controller/src/test/java/org/onap/so/asdc/installer/bpmn/BpmnInstallerTest.java19
1 files changed, 15 insertions, 4 deletions
diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/installer/bpmn/BpmnInstallerTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/installer/bpmn/BpmnInstallerTest.java
index 5d35ea30f1..c572097103 100644
--- a/asdc-controller/src/test/java/org/onap/so/asdc/installer/bpmn/BpmnInstallerTest.java
+++ b/asdc-controller/src/test/java/org/onap/so/asdc/installer/bpmn/BpmnInstallerTest.java
@@ -28,6 +28,9 @@ import static org.mockito.Mockito.mock;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
import javax.transaction.Transactional;
@@ -40,23 +43,31 @@ import org.apache.http.client.methods.HttpPost;
import org.apache.http.message.BasicHttpResponse;
import org.apache.http.message.BasicStatusLine;
import org.junit.Before;
+import org.junit.Rule;
import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
@Transactional
public class BpmnInstallerTest {
private BpmnInstaller bpmnInstaller = new BpmnInstaller();
+ @Rule
+ public TemporaryFolder folder= new TemporaryFolder();
+
@Before
public void init() throws Exception {
- System.setProperty("mso.config.path", "src/test/resources");
+ System.setProperty("mso.config.path", folder.getRoot().toString());
}
@Test
public void buildMimeMultiPart_Test() throws Exception {
-
+ Path tempDirectoryPath = Paths.get(folder.getRoot().toString(), "ASDC");
+ Path tempFilePath = Paths.get(tempDirectoryPath.toAbsolutePath().toString(), "TestBB.bpmn");
+ Files.createDirectories(tempDirectoryPath);
+ Files.createFile(tempFilePath);
HttpEntity entity = bpmnInstaller.buildMimeMultipart("TestBB.bpmn");
- String mimeMultipartBodyFilePath = System.getProperty("mso.config.path") + "/mime-multipart-body.txt";
+ String mimeMultipartBodyFilePath = "src/test/resources" + "/mime-multipart-body.txt";
File mimeMultipartBody = new File(mimeMultipartBodyFilePath);
InputStream expectedContent = new FileInputStream(mimeMultipartBody);
@@ -70,7 +81,7 @@ public class BpmnInstallerTest {
public void installBpmn_Test() throws Exception {
HttpResponse response = new BasicHttpResponse(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, ""));
HttpClient httpClient = mock(HttpClient.class);
- String csarPath = System.getProperty("mso.config.path") + "/resource-examples/WorkflowBpmn/service-CxSvc-csar.csar";
+ String csarPath = "src/test/resources" + "/resource-examples/WorkflowBpmn/service-CxSvc-csar.csar";
doReturn(response).when(httpClient).execute(any(HttpPost.class));
bpmnInstaller.installBpmn(csarPath);
}