Top Fields Constructors Methods
org.assertj.core.api

public abstract Class AbstractByteArrayAssert<SELF extends AbstractByteArrayAssert<SELF>>

extends AbstractArrayAssert<SELF extends AbstractByteArrayAssert<SELF>, byte[], Byte>
Class Inheritance
Known Direct Subclasses
org.assertj.core.api.ByteArrayAssert
Static Imports
java.util.stream.IntStream.range, org.assertj.core.api.Assertions.assertThat, org.assertj.core.util.Hexadecimals.toHexString

Field Summary

Modifier and TypeField and Description
protected ByteArrays

Constructor Summary

AccessConstructor and Description
protected
AbstractByteArrayAssert(byte[] actual, Class<?> selfType)

Method Summary

Modifier and TypeMethod and Description
public AbstractStringAssert<?>

Returns:

a new StringAssert instance whose string under test is the result of the encoding.
asBase64Encoded
()

Encodes the actual array into a Base64 string, the encoded string becoming the new object under test.

public AbstractStringAssert<?>

Returns:

a String assertion object
asHexString
()

Converts the actual byte array under test to an hexadecimal String and returns assertions for the computed String allowing String specific assertions from this call.

public AbstractStringAssert<?>

Returns:

a String assertion object
asString
()

Overrides org.assertj.core.api.AbstractAssert.asString.

Implements org.assertj.core.api.Assert.asString.

Converts the actual byte[] under test to a String and returns assertions for the computed String allowing String specific assertions from this call.
public AbstractStringAssert<?>

Returns:

a String assertion object
asString
(Charset
the Charset to interpret the bytes to a String
charset
)

Converts the actual byte[] under test to a String by decoding the specified bytes using the given charset and returns assertions for the computed String allowing String specific assertions from this call.

public SELF

Returns:

this assertion object.
contains
(byte...
the given values.
values
)

Verifies that the actual array contains the given values, in any order.

public SELF

Returns:

this assertion object.
contains
(Byte[]
the given values.
values
)

Verifies that the actual array contains the values of the given array, in any order.

public SELF

Returns:

this assertion object.
contains
(int...
the given values.
values
)

Verifies that the actual array contains the given values, in any order.

public SELF

Returns:

myself assertion object.
contains
(byte
the value to look for.
value
,
Index
the index where the value should be stored in the actual array.
index
)

Verifies that the actual array contains the given value at the given index.

public SELF

Returns:

myself assertion object.
contains
(int
the value to look for.
value
,
Index
the index where the value should be stored in the actual array.
index
)

Verifies that the actual array contains the given value at the given index.

public SELF

Returns:

this assertion object.
containsAnyOf
(byte...
the values whose at least one which is expected to be in the array under test.
values
)

Verifies that the actual array contains at least one of the given values.

public SELF

Returns:

this assertion object.
containsAnyOf
(Byte[]
the values whose at least one which is expected to be in the array under test.
values
)

Verifies that the actual array contains at least one of the values of the given array.

public SELF

Returns:

this assertion object.
containsAnyOf
(int...
the values whose at least one which is expected to be in the array under test.
values
)

Verifies that the actual array contains at least one of the given values.

public SELF

Returns:

this assertion object.
containsExactly
(byte...
the given values.
values
)

Verifies that the actual group contains only the given values and nothing else, in order.

public SELF

Returns:

this assertion object.
containsExactly
(Byte[]
the given values.
values
)

Verifies that the actual group contains only the values of the given array and nothing else, in order.

public SELF

Returns:

this assertion object.
containsExactly
(int...
the given values.
values
)

Verifies that the actual group contains only the given values and nothing else, in order.

public SELF

Returns:

this assertion object.
containsExactlyInAnyOrder
(byte...
the given values.
values
)

Verifies that the actual group contains exactly the given values and nothing else, in any order.

public SELF

Returns:

this assertion object.
containsExactlyInAnyOrder
(Byte[]
the given values.
values
)

Verifies that the actual group contains exactly the values of the given array and nothing else, in any order.

public SELF

Returns:

this assertion object.
containsExactlyInAnyOrder
(int...
the given values.
values
)

Verifies that the actual group contains exactly the given values and nothing else, in any order.

public SELF

Returns:

this assertion object.
containsOnly
(byte...
the given values.
values
)

Verifies that the actual array contains only the given values and nothing else, in any order.

public SELF

Returns:

this assertion object.
containsOnly
(Byte[]
the given values.
values
)

Verifies that the actual array contains only the values of the given array and nothing else, in any order.

public SELF

Returns:

this assertion object.
containsOnly
(int...
the given values.
values
)

Verifies that the actual array contains only the given values and nothing else, in any order.

public SELF

Returns:

this assertion object.
containsOnlyOnce
(byte...
the given values.
values
)

Verifies that the actual array contains the given values only once.

public SELF

Returns:

this assertion object.
containsOnlyOnce
(Byte[]
the given values.
values
)

Verifies that the actual array contains the values of the given array only once.

public SELF

Returns:

this assertion object.
containsOnlyOnce
(int...
the given values.
values
)

Verifies that the actual array contains the given values only once.

public SELF

Returns:

myself assertion object.
containsSequence
(byte...
the sequence of values to look for.
sequence
)

Verifies that the actual array contains the given sequence, without any other values between them.

public SELF

Returns:

myself assertion object.
containsSequence
(Byte[]
the sequence of values to look for.
sequence
)

Verifies that the actual array contains the given sequence, without any other values between them.

public SELF

Returns:

myself assertion object.
containsSequence
(int...
the sequence of values to look for.
sequence
)

Verifies that the actual array contains the given sequence, without any other values between them.

public SELF

Returns:

myself assertion object.
containsSubsequence
(byte...
the subsequence of values to look for.
subsequence
)

Verifies that the actual array contains the given subsequence (possibly with other values between them).

public SELF

Returns:

myself assertion object.
containsSubsequence
(Byte[]
the subsequence of values to look for.
subsequence
)

Verifies that the actual array contains the given subsequence (possibly with other values between them).

public SELF

Returns:

myself assertion object.
containsSubsequence
(int...
the subsequence of values to look for.
subsequence
)

Verifies that the actual array contains the given subsequence (possibly with other values between them).

public SELF

Returns:

this assertion object.
doesNotContain
(byte...
the given values.
values
)

Verifies that the actual array does not contain the given values.

public SELF

Returns:

this assertion object.
doesNotContain
(Byte[]
the given values.
values
)

Verifies that the actual array does not contain the values of the given array.

public SELF

Returns:

this assertion object.
doesNotContain
(int...
the given values.
values
)

Verifies that the actual array does not contain the given values.

public SELF

Returns:

myself assertion object.
doesNotContain
(byte
the value to look for.
value
,
Index
the index where the value should be stored in the actual array.
index
)

Verifies that the actual array does not contain the given value at the given index.

public SELF

Returns:

myself assertion object.
doesNotContain
(int
the value to look for.
value
,
Index
the index where the value should be stored in the actual array.
index
)

Verifies that the actual array does not contain the given value at the given index.

public SELF

Returns:

this assertion object.
doesNotHaveDuplicates
()

Verifies that the actual array does not contain duplicates.

public AbstractStringAssert<?>

Returns:

a new StringAssert instance whose string under test is the result of the encoding.
encodedAsBase64
()

Deprecated use asBase64Encoded() instead.
public SELF

Returns:

myself assertion object.
endsWith
(byte...
the sequence of values to look for.
sequence
)

Verifies that the actual array ends with the given sequence of values, without any other values between them.

public SELF

Returns:

myself assertion object.
endsWith
(Byte[]
the sequence of values to look for.
sequence
)

Verifies that the actual array ends with the given sequence of values, without any other values between them.

public SELF

Returns:

myself assertion object.
endsWith
(int...
the sequence of values to look for.
sequence
)

Verifies that the actual array ends with the given sequence of values, without any other values between them.

public SELF
hasSameSizeAs(Iterable<?>
the Iterable to compare size with actual group.
other
)

Implements org.assertj.core.api.EnumerableAssert.hasSameSizeAs.

Verifies that the actual group has the same size as given Iterable.
public SELF
hasSize(int
the expected number of values in the actual group.
expected
)

Implements org.assertj.core.api.EnumerableAssert.hasSize.

Verifies that the number of values in the actual group is equal to the given one.
public SELF

Returns:

this assertion object.
hasSizeBetween
(int
the lower boundary compared to which actual size should be greater than or equal to.
lowerBoundary
,
int
the higher boundary compared to which actual size should be less than or equal to.
higherBoundary
)

Implements org.assertj.core.api.EnumerableAssert.hasSizeBetween.

Verifies that the number of values in the actual array is between the given boundaries (inclusive).
public SELF

Returns:

this assertion object.
hasSizeGreaterThan
(int
the given value to compare the actual size to.
boundary
)

Implements org.assertj.core.api.EnumerableAssert.hasSizeGreaterThan.

Verifies that the number of values in the actual array is greater than the given boundary.
public SELF

Returns:

this assertion object.
hasSizeGreaterThanOrEqualTo
(int
the given value to compare the actual size to.
boundary
)

Implements org.assertj.core.api.EnumerableAssert.hasSizeGreaterThanOrEqualTo.

Verifies that the number of values in the actual group is greater than or equal to the given boundary.
public SELF

Returns:

this assertion object.
hasSizeLessThan
(int
the given value to compare the actual size to.
boundary
)

Implements org.assertj.core.api.EnumerableAssert.hasSizeLessThan.

Verifies that the number of values in the actual array is less than the given boundary.
public SELF

Returns:

this assertion object.
hasSizeLessThanOrEqualTo
(int
the given value to compare the actual size to.
boundary
)

Implements org.assertj.core.api.EnumerableAssert.hasSizeLessThanOrEqualTo.

Verifies that the number of values in the actual array is less than or equal to the given boundary.
public void
isEmpty()

Implements org.assertj.core.api.EnumerableAssert.isEmpty.

Verifies that the actual group of values is empty.
public SELF
isNotEmpty()

Implements org.assertj.core.api.EnumerableAssert.isNotEmpty.

Verifies that the actual group of values is not empty.
public void
isNullOrEmpty()

Implements org.assertj.core.api.EnumerableAssert.isNullOrEmpty.

Verifies that the actual group of values is null or empty.
public SELF
isSorted()

Implements org.assertj.core.api.ArraySortedAssert.isSorted.

Verifies that the actual array is sorted in ascending order according to the natural ordering of its elements.
public SELF
isSortedAccordingTo(Comparator<? super Byte>
the Comparator used to compare array elements
comparator
)

Implements org.assertj.core.api.ArraySortedAssert.isSortedAccordingTo.

Verifies that the actual array is sorted according to the given comparator.
public SELF

Returns:

myself assertion object.
startsWith
(byte...
the sequence of values to look for.
sequence
)

Verifies that the actual array starts with the given sequence of values, without any other values between them.

public SELF

Returns:

myself assertion object.
startsWith
(Byte[]
the sequence of values to look for.
sequence
)

Verifies that the actual array starts with the given sequence of values, without any other values between them.

public SELF

Returns:

myself assertion object.
startsWith
(int...
the sequence of values to look for.
sequence
)

Verifies that the actual array starts with the given sequence of values, without any other values between them.

private static byte[]
public SELF
usingDefaultElementComparator()

Implements org.assertj.core.api.EnumerableAssert.usingDefaultElementComparator.

Revert to standard comparison for incoming assertion group element checks.
public SELF
usingElementComparator(Comparator<? super Byte>
the comparator to use for incoming assertion checks.
customComparator
)

Implements org.assertj.core.api.EnumerableAssert.usingElementComparator.

Use given custom comparator instead of relying on actual type A equals method to compare group elements for incoming assertion checks.
Inherited from org.assertj.core.api.AbstractArrayAssert:
requireNonNullParameter