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

public Class ShouldBeCloseTo

extends BasicErrorMessageFactory
Class Inheritance
Static Imports
java.lang.String.format, org.assertj.core.util.DateUtil.formatAsDatetimeWithMs

Creates an error message indicating that an assertion that verifies that a Date is close to another one from some delta failed.
Author
Joel Costigliola

Field Summary

Inherited from org.assertj.core.error.BasicErrorMessageFactory:
argumentsformatformatter

Constructor Summary

AccessConstructor and Description
private
ShouldBeCloseTo(Date actual, Date other, long deltaInMilliseconds, long difference)

private
ShouldBeCloseTo(Temporal actual, Temporal other, String differenceDescription)

private

Method Summary

Modifier and TypeMethod and Description
public static ErrorMessageFactory

Returns:

the created ErrorMessageFactory.
shouldBeCloseTo
(Date
the actual value in the failed assertion.
actual
,
Date
the value used in the failed assertion to compare the actual value to.
other
,
long
the delta used for date comparison, expressed in milliseconds.
deltaInMilliseconds
,
long
the difference in milliseconds between actual and other dates.
difference
)

Creates a new ShouldBeCloseTo.

public static ErrorMessageFactory

Returns:

the created ErrorMessageFactory.
shouldBeCloseTo
(Temporal
the actual value in the failed assertion.
actual
,
Temporal
the value used in the failed assertion to compare the actual value to.
other
,
String
detailed difference description message.
differenceDescription
)

Creates a new ShouldBeCloseTo.

public static ErrorMessageFactory
shouldBeCloseTo(TemporalAmount actual, TemporalAmount other, TemporalAmount allowedDifference, TemporalAmount difference)

Inherited from org.assertj.core.error.BasicErrorMessageFactory:
createcreatecreateequalshashCodetoStringunquotedString

Constructor Detail

ShouldBeCloseToback to summary
private ShouldBeCloseTo(Date actual, Date other, long deltaInMilliseconds, long difference)
ShouldBeCloseToback to summary
private ShouldBeCloseTo(Temporal actual, Temporal other, String differenceDescription)
ShouldBeCloseToback to summary
private ShouldBeCloseTo(TemporalAmount actual, TemporalAmount other, TemporalAmount offset, TemporalAmount difference)

Method Detail

shouldBeCloseToback to summary
public static ErrorMessageFactory shouldBeCloseTo(Date actual, Date other, long deltaInMilliseconds, long difference)

Creates a new ShouldBeCloseTo.

Parameters
actual:Date

the actual value in the failed assertion.

other:Date

the value used in the failed assertion to compare the actual value to.

deltaInMilliseconds:long

the delta used for date comparison, expressed in milliseconds.

difference:long

the difference in milliseconds between actual and other dates.

Returns:ErrorMessageFactory

the created ErrorMessageFactory.

shouldBeCloseToback to summary
public static ErrorMessageFactory shouldBeCloseTo(Temporal actual, Temporal other, String differenceDescription)

Creates a new ShouldBeCloseTo.

Parameters
actual:Temporal

the actual value in the failed assertion.

other:Temporal

the value used in the failed assertion to compare the actual value to.

differenceDescription:String

detailed difference description message.

Returns:ErrorMessageFactory

the created ErrorMessageFactory.

Since
3.7.0
shouldBeCloseToback to summary
public static ErrorMessageFactory shouldBeCloseTo(TemporalAmount actual, TemporalAmount other, TemporalAmount allowedDifference, TemporalAmount difference)