Interface OutputStreamDelegateTests

    • Method Detail

      • wrapOutputStream

        OutputStream wrapOutputStream​(OutputStream delegate)
        Creates the output stream to test.

        This method will be called only once for each test. This makes it possible to capture the output stream to test and its delegate, and perform additional tests after the pre-defined test has finished.

        Parameters:
        delegate - The delegate to test against.
        Returns:
        The created output stream.
      • expectedContent

        byte[] expectedContent​(byte[] written)
        Returns the expected content written to a delegate, based on the content that was written to a created output stream.
        Parameters:
        written - The content that was written.
        Returns:
        The expected content.
      • contentToWrite

        default byte[] contentToWrite()
        Returns the content to write for most tests. This default implementation returns a lorem ipsum text.
        Returns:
        The content to write.
      • longContentToWrite

        default byte[] longContentToWrite()
        Returns the content to write when testing writing large chunks. this default implementation returns contentToWrite() concatenated 1000 times.
        Returns:
        The content to write when testing writing large pieces of text.