diff options
Diffstat (limited to 'wfenginemgrservice/src/test/java/org/onap/workflow/resources/WorkflowResourceTest.java')
-rw-r--r-- | wfenginemgrservice/src/test/java/org/onap/workflow/resources/WorkflowResourceTest.java | 10 |
1 files changed, 9 insertions, 1 deletions
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));
|