Package org.assertj.core.api
Class AbstractInputStreamAssert<SELF extends AbstractInputStreamAssert<SELF,ACTUAL>,ACTUAL extends InputStream>
- java.lang.Object
-
- org.assertj.core.api.AbstractAssert<SELF,ACTUAL>
-
- org.assertj.core.api.AbstractInputStreamAssert<SELF,ACTUAL>
-
- Type Parameters:
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.
- All Implemented Interfaces:
Assert<SELF,ACTUAL>,Descriptable<SELF>,ExtensionPoints<SELF,ACTUAL>
- Direct Known Subclasses:
InputStreamAssert
public abstract class AbstractInputStreamAssert<SELF extends AbstractInputStreamAssert<SELF,ACTUAL>,ACTUAL extends InputStream> extends AbstractAssert<SELF,ACTUAL>
Base class for all implementations of assertions forInputStreams.- Author:
- Matthieu Baechler, Mikhail Mazursky
-
-
Field Summary
-
Fields inherited from class org.assertj.core.api.AbstractAssert
actual, info, myself
-
-
Constructor Summary
Constructors Constructor Description AbstractInputStreamAssert(ACTUAL actual, Class<?> selfType)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description SELFhasContentEqualTo(InputStream expected)Deprecated.usehasSameContentAs(InputStream)insteadSELFhasSameContentAs(InputStream expected)Verifies that the content of the actualInputStreamis equal to the content of the given one.-
Methods inherited from class org.assertj.core.api.AbstractAssert
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
-
-
-
-
Method Detail
-
hasContentEqualTo
@Deprecated public SELF hasContentEqualTo(InputStream expected)
Deprecated.usehasSameContentAs(InputStream)insteadVerifies that the content of the actualInputStreamis equal to the content of the given one.- Parameters:
expected- the givenInputStreamto compare the actualInputStreamto.- Returns:
thisassertion object.- Throws:
NullPointerException- if the givenInputStreamisnull.AssertionError- if the actualInputStreamisnull.AssertionError- if the content of the actualInputStreamis not equal to the content of the given one.InputStreamsException- if an I/O error occurs.
-
hasSameContentAs
public SELF hasSameContentAs(InputStream expected)
Verifies that the content of the actualInputStreamis 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}));- Parameters:
expected- the givenInputStreamto compare the actualInputStreamto.- Returns:
thisassertion object.- Throws:
NullPointerException- if the givenInputStreamisnull.AssertionError- if the actualInputStreamisnull.AssertionError- if the content of the actualInputStreamis not equal to the content of the given one.InputStreamsException- if an I/O error occurs.
-
-