Initial commit
This commit is contained in:
commit
bfbe536886
59 files changed
+2540
No files matched your search
@@ -0,0 +1,29 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user