SELF
- the "self" type of this assertion class. Please read "Emulating 'self types' using Java Generics to simplify fluent API implementation"
for more details.ACTUAL
- the type of the "actual" value.public abstract class AbstractInputStreamAssert<SELF extends AbstractInputStreamAssert<SELF,ACTUAL>,ACTUAL extends java.io.InputStream> extends AbstractAssert<SELF,ACTUAL>
InputStream
s.Modifier and Type | Field and Description |
---|---|
(package private) InputStreams |
inputStreams |
actual, conditions, info, myself, objects
Constructor and Description |
---|
AbstractInputStreamAssert(ACTUAL actual,
java.lang.Class<?> selfType) |
Modifier and Type | Method and Description |
---|---|
SELF |
hasContentEqualTo(java.io.InputStream expected)
Deprecated.
use
hasSameContentAs(InputStream) instead |
SELF |
hasSameContentAs(java.io.InputStream expected)
Verifies that the content of the actual
InputStream is equal to the content of the given one. |
as, as, asList, asString, describedAs, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, equals, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasToString, inBinary, inHexadecimal, is, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, overridingErrorMessage, satisfies, setCustomRepresentation, throwAssertionError, usingComparator, usingDefaultComparator, withFailMessage, withRepresentation, withThreadDumpOnError
InputStreams inputStreams
public AbstractInputStreamAssert(ACTUAL actual, java.lang.Class<?> selfType)
@Deprecated public SELF hasContentEqualTo(java.io.InputStream expected)
hasSameContentAs(InputStream)
insteadInputStream
is equal to the content of the given one.expected
- the given InputStream
to compare the actual InputStream
to.this
assertion object.java.lang.NullPointerException
- if the given InputStream
is null
.java.lang.AssertionError
- if the actual InputStream
is null
.java.lang.AssertionError
- if the content of the actual InputStream
is not equal to the content of the given one.InputStreamsException
- if an I/O error occurs.public SELF hasSameContentAs(java.io.InputStream expected)
InputStream
is equal to the content of the given one.
Example:
// assertion will pass
assertThat(new ByteArrayInputStream(new byte[] {0xa})).hasSameContentAs(new ByteArrayInputStream(new byte[] {0xa}));
// assertions will fail
assertThat(new ByteArrayInputStream(new byte[] {0xa})).hasSameContentAs(new ByteArrayInputStream(new byte[] {}));
assertThat(new ByteArrayInputStream(new byte[] {0xa})).hasSameContentAs(new ByteArrayInputStream(new byte[] {0xa, 0xc, 0xd}));
expected
- the given InputStream
to compare the actual InputStream
to.this
assertion object.java.lang.NullPointerException
- if the given InputStream
is null
.java.lang.AssertionError
- if the actual InputStream
is null
.java.lang.AssertionError
- if the content of the actual InputStream
is not equal to the content of the given one.InputStreamsException
- if an I/O error occurs.