Package org.assertj.core.api
Class TemporalAssert
java.lang.Object
org.assertj.core.api.AbstractAssert<TemporalAssert,Temporal>
org.assertj.core.api.AbstractTemporalAssert<TemporalAssert,Temporal>
org.assertj.core.api.TemporalAssert
- All Implemented Interfaces:
Assert<TemporalAssert,
,Temporal> Descriptable<TemporalAssert>
,ExtensionPoints<TemporalAssert,
Temporal>
-
Field Summary
Fields inherited from class org.assertj.core.api.AbstractTemporalAssert
comparables
Fields inherited from class org.assertj.core.api.AbstractAssert
actual, assertionErrorCreator, conditions, customRepresentation, info, myself, objects, printAssertionsDescription, throwUnsupportedExceptionOnEquals
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionisCloseTo
(String otherAsString, TemporalOffset<? super Temporal> offset) Same assertion asAbstractTemporalAssert.isCloseTo(Temporal, TemporalOffset)
but theTEMPORAL
is built from a given String that follows predefined ISO date format Predefined Formatters to allow callingAbstractTemporalAssert.parse(String)
)} method.Obtains an instance ofTEMPORAL
from a string representation in ISO date format.Methods inherited from class org.assertj.core.api.AbstractTemporalAssert
isCloseTo, usingComparator, usingComparator, usingDefaultComparator
Methods inherited from class org.assertj.core.api.AbstractAssert
areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, hasToString, inBinary, inHexadecimal, is, isElementOfCustomAssert, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, withAssertionState, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.assertj.core.api.Descriptable
as, as, as, describedAs, describedAs
-
Constructor Details
-
TemporalAssert
-
-
Method Details
-
parse
Description copied from class:AbstractTemporalAssert
Obtains an instance ofTEMPORAL
from a string representation in ISO date format.- Specified by:
parse
in classAbstractTemporalAssert<TemporalAssert,
Temporal> - Parameters:
temporalAsString
- the string to parse, not null- Returns:
- the parsed
TEMPORAL
, not null
-
isCloseTo
Description copied from class:AbstractTemporalAssert
Same assertion asAbstractTemporalAssert.isCloseTo(Temporal, TemporalOffset)
but theTEMPORAL
is built from a given String that follows predefined ISO date format Predefined Formatters to allow callingAbstractTemporalAssert.parse(String)
)} method.Example :
assertThat(LocalTime.parse("07:10:30")).isCloseTo("07:12:11", within(5, ChronoUnit.MINUTES));
- Overrides:
isCloseTo
in classAbstractTemporalAssert<TemporalAssert,
Temporal> - Parameters:
otherAsString
- String representing aTEMPORAL
.offset
- the offset used for comparison- Returns:
- this assertion object.
-