Package org.assertj.core.internal
Class InputStreams
- java.lang.Object
-
- org.assertj.core.internal.InputStreams
-
public class InputStreams extends Object
Reusable assertions for
s.InputStream
- Author:
- Matthieu Baechler
-
-
Field Summary
Fields Modifier and Type Field Description (package private) BinaryDiff
binaryDiff
(package private) Diff
diff
(package private) Failures
failures
private static InputStreams
INSTANCE
-
Constructor Summary
Constructors Constructor Description InputStreams()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
assertHasBinaryContent(AssertionInfo info, InputStream actual, byte[] expected)
Asserts that the given InputStream has the given binary content.void
assertHasContent(AssertionInfo info, InputStream actual, String expected)
Asserts that the given InputStream has the same content as the given String.void
assertHasDigest(AssertionInfo info, InputStream actual, String algorithm, byte[] expected)
void
assertHasDigest(AssertionInfo info, InputStream actual, String algorithm, String expected)
void
assertHasDigest(AssertionInfo info, InputStream actual, MessageDigest digest, byte[] expected)
void
assertHasDigest(AssertionInfo info, InputStream actual, MessageDigest digest, String expected)
void
assertIsEmpty(AssertionInfo info, InputStream actual)
Asserts that the given InputStreams is empty.void
assertIsNotEmpty(AssertionInfo info, InputStream actual)
Asserts that the given InputStreams is not empty.private static void
assertNotNull(AssertionInfo info, InputStream stream)
void
assertSameContentAs(AssertionInfo info, InputStream actual, InputStream expected)
Asserts that the given InputStreams have same content.static InputStreams
instance()
Returns the singleton instance of this class.
-
-
-
Field Detail
-
INSTANCE
private static final InputStreams INSTANCE
-
diff
Diff diff
-
binaryDiff
BinaryDiff binaryDiff
-
failures
Failures failures
-
-
Method Detail
-
instance
public static InputStreams instance()
Returns the singleton instance of this class.- Returns:
- the singleton instance of this class.
-
assertSameContentAs
public void assertSameContentAs(AssertionInfo info, InputStream actual, InputStream expected)
Asserts that the given InputStreams have same content.- Parameters:
info
- contains information about the assertion.actual
- the "actual" InputStream.expected
- the "expected" InputStream.- Throws:
NullPointerException
- ifexpected
isnull
.AssertionError
- ifactual
isnull
.AssertionError
- if the given InputStreams do not have same content.InputStreamsException
- if an I/O error occurs.
-
assertIsEmpty
public void assertIsEmpty(AssertionInfo info, InputStream actual)
Asserts that the given InputStreams is empty.- Parameters:
info
- contains information about the assertion.actual
- the "actual" InputStream.- Throws:
AssertionError
- ifactual
is not empty.InputStreamsException
- if an I/O error occurs.
-
assertIsNotEmpty
public void assertIsNotEmpty(AssertionInfo info, InputStream actual)
Asserts that the given InputStreams is not empty.- Parameters:
info
- contains information about the assertion.actual
- the "actual" InputStream.- Throws:
AssertionError
- ifactual
is not empty.InputStreamsException
- if an I/O error occurs.
-
assertHasContent
public void assertHasContent(AssertionInfo info, InputStream actual, String expected)
Asserts that the given InputStream has the same content as the given String.- Parameters:
info
- contains information about the assertion.actual
- the actual InputStream.expected
- the expected String.- Throws:
NullPointerException
- ifexpected
isnull
.AssertionError
- ifactual
isnull
.AssertionError
- if the given InputStream does not have the same content as the given String.InputStreamsException
- if an I/O error occurs.
-
assertHasBinaryContent
public void assertHasBinaryContent(AssertionInfo info, InputStream actual, byte[] expected)
Asserts that the given InputStream has the given binary content.- Parameters:
info
- contains information about the assertion.actual
- the actual InputStream.expected
- the expected binary content.- Throws:
NullPointerException
- ifexpected
isnull
.AssertionError
- ifactual
isnull
.AssertionError
- if the given InputStream does not have the same content as the given String.InputStreamsException
- if an I/O error occurs.
-
assertNotNull
private static void assertNotNull(AssertionInfo info, InputStream stream)
-
assertHasDigest
public void assertHasDigest(AssertionInfo info, InputStream actual, MessageDigest digest, byte[] expected)
-
assertHasDigest
public void assertHasDigest(AssertionInfo info, InputStream actual, MessageDigest digest, String expected)
-
assertHasDigest
public void assertHasDigest(AssertionInfo info, InputStream actual, String algorithm, byte[] expected)
-
assertHasDigest
public void assertHasDigest(AssertionInfo info, InputStream actual, String algorithm, String expected)
-
-