Add unit test for vfc-nfvo-wfengine
[vfc/nfvo/wfengine.git] / wfenginemgrservice / src / test / java / org / onap / workflow / common / ToolUtilTest.java
index 2c6e175..4407a24 100644 (file)
@@ -19,11 +19,28 @@ package org.onap.workflow.common;
 import org.junit.Assert;
 import org.junit.Test;
 
+import java.io.InputStream;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+
 /**
  * @author 10175158
  *
  */
 public class ToolUtilTest {
+  @Test
+  public void testCloseInputStream() throws Exception {
+    InputStream inputStream = mock(InputStream.class);
+    ToolUtil.closeInputStream(inputStream);
+    verify(inputStream).close();
+  }
+
+  @Test
+  public void testCloseInputStreamWhenGivenNullInputStream() throws Exception {
+    ToolUtil.closeInputStream(null);
+  }
+
   @Test
   public void testgetHeader() {
     String actual = "Basic a2VybWl0Omtlcm1pdA==";