Top Description Fields Constructors Methods
org.assertj.core.internal

public Class InputStreams

extends Object
Class Inheritance
Static Imports
java.lang.String.format, java.util.Objects.requireNonNull, org.assertj.core.error.ShouldHaveBinaryContent.shouldHaveBinaryContent, .ShouldHaveDigest.shouldHaveDigest, .ShouldHaveSameContent.shouldHaveSameContent, org.assertj.core.internal.Digests.digestDiff

Reusable assertions for InputStreams.
Author
Matthieu Baechler

Field Summary

Modifier and TypeField and Description
pack-priv BinaryDiff
pack-priv Diff
pack-priv Failures
private static final InputStreams

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
assertHasBinaryContent(AssertionInfo
contains information about the assertion.
info
,
InputStream
the actual InputStream.
actual
,
byte[]
the expected binary content.
expected
)

Asserts that the given InputStream has the given binary content.

public void
assertHasContent(AssertionInfo
contains information about the assertion.
info
,
InputStream
the actual InputStream.
actual
,
String
the expected String.
expected
)

Asserts that the given InputStream has the same content as the given String.

public void
assertHasDigest(AssertionInfo info, InputStream actual, MessageDigest digest, byte[] expected)

public void
public void
assertHasDigest(AssertionInfo info, InputStream actual, String algorithm, byte[] expected)

public void
assertHasDigest(AssertionInfo info, InputStream actual, String algorithm, String expected)

private static void
public void
assertSameContentAs(AssertionInfo
contains information about the assertion.
info
,
InputStream
the "actual" InputStream.
actual
,
InputStream
the "expected" InputStream.
expected
)

Asserts that the given InputStreams have same content.

public static InputStreams

Returns:

the singleton instance of this class.
instance
()

Returns the singleton instance of this class.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

binaryDiffback to summary
pack-priv BinaryDiff binaryDiff
Annotations
@VisibleForTesting
diffback to summary
pack-priv Diff diff
Annotations
@VisibleForTesting
failuresback to summary
pack-priv Failures failures
Annotations
@VisibleForTesting
INSTANCEback to summary
private static final InputStreams INSTANCE

Constructor Detail

InputStreamsback to summary
pack-priv InputStreams()
Annotations
@VisibleForTesting

Method Detail

assertHasBinaryContentback to summary
public void assertHasBinaryContent(AssertionInfo info, InputStream actual, byte[] expected)

Asserts that the given InputStream has the given binary content.

Parameters
info:AssertionInfo

contains information about the assertion.

actual:InputStream

the actual InputStream.

expected:byte[]

the expected binary content.

Exceptions
NullPointerException:
if expected is null.
AssertionError:
  • if actual is null.
  • if the given InputStream does not have the same content as the given String.
InputStreamsException:
if an I/O error occurs.
assertHasContentback to summary
public void assertHasContent(AssertionInfo info, InputStream actual, String expected)

Asserts that the given InputStream has the same content as the given String.

Parameters
info:AssertionInfo

contains information about the assertion.

actual:InputStream

the actual InputStream.

expected:String

the expected String.

Exceptions
NullPointerException:
if expected is null.
AssertionError:
  • if actual is null.
  • if the given InputStream does not have the same content as the given String.
InputStreamsException:
if an I/O error occurs.
assertHasDigestback to summary
public void assertHasDigest(AssertionInfo info, InputStream actual, MessageDigest digest, byte[] expected)
assertHasDigestback to summary
public void assertHasDigest(AssertionInfo info, InputStream actual, MessageDigest digest, String expected)
assertHasDigestback to summary
public void assertHasDigest(AssertionInfo info, InputStream actual, String algorithm, byte[] expected)
assertHasDigestback to summary
public void assertHasDigest(AssertionInfo info, InputStream actual, String algorithm, String expected)
assertNotNullback to summary
private static void assertNotNull(AssertionInfo info, InputStream stream)
assertSameContentAsback to summary
public void assertSameContentAs(AssertionInfo info, InputStream actual, InputStream expected)

Asserts that the given InputStreams have same content.

Parameters
info:AssertionInfo

contains information about the assertion.

actual:InputStream

the "actual" InputStream.

expected:InputStream

the "expected" InputStream.

Exceptions
NullPointerException:
if expected is null.
AssertionError:
  • if actual is null.
  • if the given InputStreams do not have same content.
InputStreamsException:
if an I/O error occurs.
instanceback to summary
public static InputStreams instance()

Returns the singleton instance of this class.

Returns:InputStreams

the singleton instance of this class.