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

public abstract Class AbstractFileSizeAssert<SELF extends AbstractFileAssert<SELF>>

extends AbstractLongAssert<AbstractFileSizeAssert<SELF extends AbstractFileAssert<SELF>>>
Class Inheritance
Known Direct Subclasses
org.assertj.core.api.FileSizeAssert

Base class for file size assertions.
Since
3.22.0

Field Summary

Inherited from org.assertj.core.api.AbstractLongAssert:
longs

Constructor Summary

AccessConstructor and Description
protected
AbstractFileSizeAssert(Long actualFileSize, Class<?> selfType)

Method Summary

Modifier and TypeMethod and Description
public abstract AbstractFileAssert<SELF>

Returns:

file assertions.
returnToFile
()

Returns to the file on which we ran size assertions on.

Inherited from org.assertj.core.api.AbstractLongAssert:
isBetweenisCloseToisCloseToisCloseToisCloseToisEqualToisEvenisGreaterThanisGreaterThanOrEqualToisLessThanisLessThanOrEqualToisNegativeisNotCloseToisNotCloseToisNotCloseToisNotCloseToisNotEqualToisNotNegativeisNotPositiveisNotZeroisOddisOneisPositiveisStrictlyBetweenisZerousingComparatorusingComparatorusingDefaultComparator

Constructor Detail

AbstractFileSizeAssertback to summary
protected AbstractFileSizeAssert(Long actualFileSize, Class<?> selfType)

Method Detail

returnToFileback to summary
public abstract AbstractFileAssert<SELF> returnToFile()

Returns to the file on which we ran size assertions on.

Example:

 File file = File.createTempFile("tmp", "bin");
Files.write(file.toPath(), new byte[] {1, 1});

assertThat(file).size().isGreaterThan(1L).isLessThan(5L)
                .returnToFile().hasBinaryContent(new byte[] {1, 1});
Returns:AbstractFileAssert<SELF>

file assertions.