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==";