Files
scribe-java/src/test/java/org/scribe/utils/StreamUtilsTest.java
T
2010-09-05 17:01:30 -03:00

30 lines
663 B
Java

package org.scribe.utils;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import org.junit.Test;
import static org.junit.Assert.*;
public class StreamUtilsTest
{
@Test
public void shouldCorrectlyDecodeAStream()
{
String value = "expected";
InputStream is = new ByteArrayInputStream(value.getBytes());
String decoded = StreamUtils.getStreamContents(is);
assertEquals("expected", decoded);
}
@Test(expected = IllegalArgumentException.class)
public void shouldFailForNullParameter()
{
InputStream is = null;
StreamUtils.getStreamContents(is);
fail("Must throw exception before getting here");
}
}