Class AbstractInputStreamAssert<SELF extends AbstractInputStreamAssert<SELF,​ACTUAL>,​ACTUAL extends InputStream>

    • Constructor Detail

      • AbstractInputStreamAssert

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

      • 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.