FIELD
- the type of the field which gets updated by the AtomicReferenceFieldUpdater
.OBJECT
- the type of the object holding the updatable field.public class AtomicReferenceFieldUpdaterAssert<FIELD,OBJECT> extends AbstractAtomicFieldUpdaterAssert<AtomicReferenceFieldUpdaterAssert<FIELD,OBJECT>,FIELD,AtomicReferenceFieldUpdater<OBJECT,FIELD>,OBJECT>
AtomicReferenceFieldUpdater
s.
To create an instance of this class, invoke
.
Assertions.assertThat(AtomicReferenceFieldUpdater)
actual, info, myself, throwUnsupportedExceptionOnEquals
Constructor and Description |
---|
AtomicReferenceFieldUpdaterAssert(AtomicReferenceFieldUpdater<OBJECT,FIELD> actual) |
Modifier and Type | Method and 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.
|
validate
as, as, extracting, extracting, extracting, getComparatorsByType, hasAllNullFieldsOrProperties, hasAllNullFieldsOrPropertiesExcept, hasFieldOrProperty, hasFieldOrPropertyWithValue, hasNoNullFieldsOrProperties, hasNoNullFieldsOrPropertiesExcept, isEqualToComparingFieldByField, isEqualToComparingFieldByFieldRecursively, isEqualToComparingOnlyGivenFields, isEqualToIgnoringGivenFields, isEqualToIgnoringNullFields, newObjectAssert, returns, usingComparatorForFields, usingComparatorForType, usingRecursiveComparison, usingRecursiveComparison
asList, asString, describedAs, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, equals, 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, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, setCustomRepresentation, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, withFailMessage, withRepresentation, withThreadDumpOnError
public AtomicReferenceFieldUpdaterAssert(AtomicReferenceFieldUpdater<OBJECT,FIELD> actual)
public AtomicReferenceFieldUpdaterAssert<FIELD,OBJECT> hasValue(FIELD expectedValue, OBJECT obj)
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);
hasValue
in class AbstractAtomicFieldUpdaterAssert<AtomicReferenceFieldUpdaterAssert<FIELD,OBJECT>,FIELD,AtomicReferenceFieldUpdater<OBJECT,FIELD>,OBJECT>
expectedValue
- the expected value inside the OBJECT
.obj
- the object holding the updatable field.protected FIELD getActualValue(OBJECT obj)
getActualValue
in class AbstractAtomicFieldUpdaterAssert<AtomicReferenceFieldUpdaterAssert<FIELD,OBJECT>,FIELD,AtomicReferenceFieldUpdater<OBJECT,FIELD>,OBJECT>
Copyright © 2014–2019 AssertJ. All rights reserved.