Package org.assertj.core.api
Class AtomicReferenceFieldUpdaterAssert<FIELD,OBJECT>
- java.lang.Object
-
- org.assertj.core.api.AbstractAssert<SELF,ACTUAL>
-
- org.assertj.core.api.AbstractObjectAssert<SELF,ATOMIC>
-
- org.assertj.core.api.AbstractAtomicFieldUpdaterAssert<AtomicReferenceFieldUpdaterAssert<FIELD,OBJECT>,FIELD,AtomicReferenceFieldUpdater<OBJECT,FIELD>,OBJECT>
-
- org.assertj.core.api.AtomicReferenceFieldUpdaterAssert<FIELD,OBJECT>
-
- Type Parameters:
FIELD
- the type of the field which gets updated by theAtomicReferenceFieldUpdater
.OBJECT
- the type of the object holding the updatable field.
- All Implemented Interfaces:
Assert<AtomicReferenceFieldUpdaterAssert<FIELD,OBJECT>,AtomicReferenceFieldUpdater<OBJECT,FIELD>>
,Descriptable<AtomicReferenceFieldUpdaterAssert<FIELD,OBJECT>>
,ExtensionPoints<AtomicReferenceFieldUpdaterAssert<FIELD,OBJECT>,AtomicReferenceFieldUpdater<OBJECT,FIELD>>
public class AtomicReferenceFieldUpdaterAssert<FIELD,OBJECT> extends AbstractAtomicFieldUpdaterAssert<AtomicReferenceFieldUpdaterAssert<FIELD,OBJECT>,FIELD,AtomicReferenceFieldUpdater<OBJECT,FIELD>,OBJECT>
Assertion methods forAtomicReferenceFieldUpdater
s.To create an instance of this class, invoke
.Assertions.assertThat(AtomicReferenceFieldUpdater)
- Since:
- 2.7.0 / 3.7.0
- Author:
- epeee
-
-
Field Summary
-
Fields inherited from class org.assertj.core.api.AbstractAssert
actual, assertionErrorCreator, conditions, info, myself, objects, throwUnsupportedExceptionOnEquals
-
-
Constructor Summary
Constructors Constructor Description AtomicReferenceFieldUpdaterAssert(AtomicReferenceFieldUpdater<OBJECT,FIELD> actual)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FIELD
getActualValue(OBJECT obj)
AtomicReferenceFieldUpdaterAssert<FIELD,OBJECT>
hasValue(FIELD expectedValue, OBJECT obj)
Verifies that the actual atomic field updater contains the given value at the given object.-
Methods inherited from class org.assertj.core.api.AbstractAtomicFieldUpdaterAssert
validate
-
Methods inherited from class org.assertj.core.api.AbstractObjectAssert
as, as, extracting, extracting, extracting, extracting, extracting, extracting, getComparatorsByType, hasAllNullFieldsOrProperties, hasAllNullFieldsOrPropertiesExcept, hasFieldOrProperty, hasFieldOrPropertyWithValue, hasNoNullFieldsOrProperties, hasNoNullFieldsOrPropertiesExcept, isEqualToComparingFieldByField, isEqualToComparingFieldByFieldRecursively, isEqualToComparingOnlyGivenFields, isEqualToIgnoringGivenFields, isEqualToIgnoringNullFields, newObjectAssert, returns, usingComparatorForFields, usingComparatorForType, usingRecursiveComparison, usingRecursiveComparison, withAssertionState, withComparatorByPropertyOrField, withTypeComparator
-
Methods inherited from class org.assertj.core.api.AbstractAssert
asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, equals, extracting, extracting, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, inBinary, inHexadecimal, is, 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, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOf, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, 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
describedAs
-
-
-
-
Constructor Detail
-
AtomicReferenceFieldUpdaterAssert
public AtomicReferenceFieldUpdaterAssert(AtomicReferenceFieldUpdater<OBJECT,FIELD> actual)
-
-
Method Detail
-
hasValue
public AtomicReferenceFieldUpdaterAssert<FIELD,OBJECT> hasValue(FIELD expectedValue, OBJECT obj)
Verifies that the actual atomic field updater contains the given value at the given object.Example:
// person is an instance of a Person class holding a non-private volatile String field (name). AtomicReferenceFieldUpdater<Person,String> fieldUpdater = AtomicReferenceFieldUpdater.newUpdater(Person.class, String.class, "name"); // this assertion succeeds: ageUpdater.set(person, "Superman"); assertThat(ageUpdater).hasValue("Superman", person); // this assertion fails: fieldUpdater.set(person, "Batman"); assertThat(fieldUpdater).hasValue("Superman", person);
- Overrides:
hasValue
in classAbstractAtomicFieldUpdaterAssert<AtomicReferenceFieldUpdaterAssert<FIELD,OBJECT>,FIELD,AtomicReferenceFieldUpdater<OBJECT,FIELD>,OBJECT>
- Parameters:
expectedValue
- the expected value inside theOBJECT
.obj
- the object holding the updatable field.- Returns:
- this assertion object.
- Since:
- 2.7.0 / 3.7.0
-
getActualValue
protected FIELD getActualValue(OBJECT obj)
- Specified by:
getActualValue
in classAbstractAtomicFieldUpdaterAssert<AtomicReferenceFieldUpdaterAssert<FIELD,OBJECT>,FIELD,AtomicReferenceFieldUpdater<OBJECT,FIELD>,OBJECT>
-
-