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 for InputStreams.
  • Field Details

  • Constructor Details

    • AbstractInputStreamAssert

      public AbstractInputStreamAssert(ACTUAL actual, Class<?> selfType)
  • Method Details

    • hasContentEqualTo

      @Deprecated public SELF hasContentEqualTo(InputStream expected)
      Deprecated.
      Verifies that the content of the actual InputStream is equal to the content of the given one.
      Parameters:
      expected - the given InputStream to compare the actual InputStream to.
      Returns:
      this assertion object.
      Throws:
      NullPointerException - if the given InputStream is null.
      AssertionError - if the actual InputStream is null.
      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.
    • hasSameContentAs

      public SELF hasSameContentAs(InputStream expected)
      Verifies that the content of the actual 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}));
      Parameters:
      expected - the given InputStream to compare the actual InputStream to.
      Returns:
      this assertion object.
      Throws:
      NullPointerException - if the given InputStream is null.
      AssertionError - if the actual InputStream is null.
      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.