Package org.assertj.core.api
Class TemporalAssert
- java.lang.Object
-
- org.assertj.core.api.AbstractAssert<SELF,TEMPORAL>
-
- org.assertj.core.api.AbstractTemporalAssert<TemporalAssert,java.time.temporal.Temporal>
-
- org.assertj.core.api.TemporalAssert
-
- All Implemented Interfaces:
Assert<TemporalAssert,java.time.temporal.Temporal>,Descriptable<TemporalAssert>,ExtensionPoints<TemporalAssert,java.time.temporal.Temporal>
public class TemporalAssert extends AbstractTemporalAssert<TemporalAssert,java.time.temporal.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 Constructor Description TemporalAssert(java.time.temporal.Temporal actual)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TemporalAssertisCloseTo(java.lang.String otherAsString, TemporalOffset<? super java.time.temporal.Temporal> offset)Same assertion asAbstractTemporalAssert.isCloseTo(Temporal, TemporalOffset)but theTEMPORALis built from a given String that follows predefined ISO date format Predefined Formatters to allow callingAbstractTemporalAssert.parse(String))} method.java.time.temporal.Temporalparse(java.lang.String temporalAsString)Obtains an instance ofTEMPORALfrom 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
actual, areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, doesNotMatch, doesNotMatch, 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, usingEquals, usingEquals, 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
-
-
-
-
Method Detail
-
parse
public java.time.temporal.Temporal parse(java.lang.String temporalAsString)
Description copied from class:AbstractTemporalAssertObtains an instance ofTEMPORALfrom a string representation in ISO date format.- Specified by:
parsein classAbstractTemporalAssert<TemporalAssert,java.time.temporal.Temporal>- Parameters:
temporalAsString- the string to parse, not null- Returns:
- the parsed
TEMPORAL, not null
-
isCloseTo
public TemporalAssert isCloseTo(java.lang.String otherAsString, TemporalOffset<? super java.time.temporal.Temporal> offset)
Description copied from class:AbstractTemporalAssertSame assertion asAbstractTemporalAssert.isCloseTo(Temporal, TemporalOffset)but theTEMPORALis 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:
isCloseToin classAbstractTemporalAssert<TemporalAssert,java.time.temporal.Temporal>- Parameters:
otherAsString- String representing aTEMPORAL.offset- the offset used for comparison- Returns:
- this assertion object.
-
-