summaryrefslogtreecommitdiffstats
path: root/wfenginemgrservice/src
diff options
context:
space:
mode:
Diffstat (limited to 'wfenginemgrservice/src')
-rw-r--r--wfenginemgrservice/src/main/docker/wfenginemgrservice-docker-build_image.sh3
-rw-r--r--wfenginemgrservice/src/test/java/org/onap/workflow/externalservice/service/activitiservice/ActivitiServiceConsumerTest.java5
-rw-r--r--wfenginemgrservice/src/test/java/org/onap/workflow/resources/WorkflowInstanceWrapperTest.java3
-rw-r--r--wfenginemgrservice/src/test/java/org/onap/workflow/resources/WorkflowResourceTest.java10
4 files changed, 19 insertions, 2 deletions
diff --git a/wfenginemgrservice/src/main/docker/wfenginemgrservice-docker-build_image.sh b/wfenginemgrservice/src/main/docker/wfenginemgrservice-docker-build_image.sh
index b4cdc47..c3d321e 100644
--- a/wfenginemgrservice/src/main/docker/wfenginemgrservice-docker-build_image.sh
+++ b/wfenginemgrservice/src/main/docker/wfenginemgrservice-docker-build_image.sh
@@ -76,7 +76,8 @@ echo "CURLPROXY=${CURLPROXY}"
rm -f ./bin/workflow-engine-mgr-service*.jar
echo "${CURLPROXY}" -m 300 -O -J -L "${NEXUS_REPOS_URL}/service/local/artifact/maven/content?r=${NEXUSREPONAME}&g=org.onap.vfc.nfvo.wfengine&a=workflow-engine-mgr-service&e=jar&v=${VERSION}" LATEST
#curl "${CURLPROXY}" -m 300 -O -J -L "${NEXUS_REPOS_URL}/service/local/artifact/maven/content?r=${NEXUSREPONAME}&g=org.onap.vfc.nfvo.wfengine&a=workflow-engine-mgr-service&e=jar&v=${VERSION}"
-wget -O workflow-engine-mgr-service.jar "${NEXUS_REPOS_URL}/service/local/artifact/maven/content?r=${NEXUSREPONAME}&g=org.onap.vfc.nfvo.wfengine&a=workflow-engine-mgr-service&e=jar&v=${VERSION}"
+#wget -O workflow-engine-mgr-service.jar "${NEXUS_REPOS_URL}/service/local/artifact/maven/content?r=${NEXUSREPONAME}&g=org.onap.vfc.nfvo.wfengine&a=workflow-engine-mgr-service&e=jar&v=${VERSION}"
+wget -O workflow-engine-mgr-service.jar "${NEXUS_REPOS_URL}/service/local/artifact/maven/content?r=snapshots&g=org.onap.vfc.nfvo.wfengine&a=workflow-engine-mgr-service&e=jar&v=1.0.0-SNAPSHOT"
mv workflow-engine-mgr-service*.jar ./bin/workflow-engine-mgr-service.jar
function build_image {
diff --git a/wfenginemgrservice/src/test/java/org/onap/workflow/externalservice/service/activitiservice/ActivitiServiceConsumerTest.java b/wfenginemgrservice/src/test/java/org/onap/workflow/externalservice/service/activitiservice/ActivitiServiceConsumerTest.java
index e644626..af90c41 100644
--- a/wfenginemgrservice/src/test/java/org/onap/workflow/externalservice/service/activitiservice/ActivitiServiceConsumerTest.java
+++ b/wfenginemgrservice/src/test/java/org/onap/workflow/externalservice/service/activitiservice/ActivitiServiceConsumerTest.java
@@ -16,13 +16,16 @@
package org.onap.workflow.externalservice.service.activitiservice;
import static org.mockito.Mockito.mock;
+import static org.powermock.api.mockito.PowerMockito.when;
+import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import org.apache.http.client.ClientProtocolException;
import org.junit.Assert;
import org.junit.Test;
+import org.mockito.Mockito;
import org.onap.workflow.WorkflowAppConfig;
import org.onap.workflow.common.Config;
import org.onap.workflow.common.RestClient;
@@ -95,6 +98,8 @@ public class ActivitiServiceConsumerTest {
workflowAppConfig.setMsbClientConfig(msbClientConfig);
Config.setWorkflowAppConfig(workflowAppConfig);
InputStream ins = mock(InputStream.class);
+ // Byte b[]=(Byte) mock(Byte.class);
+ when(ins.read(Mockito.anyObject())).thenReturn(-21);
ActivitiDeployResponse result = ActivitiServiceConsumer.deploybpmnfile(ins, "result");
Assert.assertTrue(result == null);
RestClient.isTest = false;
diff --git a/wfenginemgrservice/src/test/java/org/onap/workflow/resources/WorkflowInstanceWrapperTest.java b/wfenginemgrservice/src/test/java/org/onap/workflow/resources/WorkflowInstanceWrapperTest.java
index ea84226..487051f 100644
--- a/wfenginemgrservice/src/test/java/org/onap/workflow/resources/WorkflowInstanceWrapperTest.java
+++ b/wfenginemgrservice/src/test/java/org/onap/workflow/resources/WorkflowInstanceWrapperTest.java
@@ -16,6 +16,7 @@
package org.onap.workflow.resources;
import static org.powermock.api.mockito.PowerMockito.mock;
+import static org.powermock.api.mockito.PowerMockito.when;
import java.io.InputStream;
@@ -25,6 +26,7 @@ import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
+import org.mockito.Mockito;
import org.onap.workflow.common.RestClient;
import org.onap.workflow.common.RestResponse;
import org.onap.workflow.entity.StartProcessRequest;
@@ -46,6 +48,7 @@ public class WorkflowInstanceWrapperTest {
InputStream fileInputStream = mock(InputStream.class);
FormDataContentDisposition f = mock(FormDataContentDisposition.class);
String filename = "test";
+ when(fileInputStream.read(Mockito.anyObject())).thenReturn(-21);
Response reponse = workflowInstanceWrapper.deployBpmnFile(filename, fileInputStream, f);
Assert.assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), reponse.getStatus());
RestClient.isTest = false;
diff --git a/wfenginemgrservice/src/test/java/org/onap/workflow/resources/WorkflowResourceTest.java b/wfenginemgrservice/src/test/java/org/onap/workflow/resources/WorkflowResourceTest.java
index e7d6523..7d8b194 100644
--- a/wfenginemgrservice/src/test/java/org/onap/workflow/resources/WorkflowResourceTest.java
+++ b/wfenginemgrservice/src/test/java/org/onap/workflow/resources/WorkflowResourceTest.java
@@ -21,6 +21,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
import static org.powermock.api.mockito.PowerMockito.mock;
import static org.powermock.api.mockito.PowerMockito.when;
+import java.io.IOException;
import java.io.InputStream;
import javax.ws.rs.core.Response;
@@ -55,7 +56,14 @@ public class WorkflowResourceTest {
FormDataContentDisposition fileDetail = mock(FormDataContentDisposition.class);
Response result = Response.ok("success").build();
-
+ // when(fileInputStream.read()).thenReturn(-1);
+ try {
+ when(fileInputStream.read(Mockito.anyObject())).thenReturn(-21);
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
when(workflowInstanceWrapper.deployBpmnFile(Mockito.anyString(), Mockito.anyObject(), Mockito.anyObject())).thenReturn(result);
assertThat(workflowResource.deployBpmnFile(fileInputStream,fileDetail), is(result));