FIELD
- the type of the field which gets updated by the AtomicReferenceFieldUpdater
.OBJECT
- the type of the object holding the updatable field.Assert<FIELD,OBJECT>
, Descriptable<FIELD>
, ExtensionPoints<FIELD,OBJECT>
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
Constructor | Description |
---|---|
AtomicReferenceFieldUpdaterAssert(AtomicReferenceFieldUpdater<OBJECT,FIELD> actual) |
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.
|
asList, asString, describedAs, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, equals, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, 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, overridingErrorMessage, satisfies, setCustomRepresentation, throwAssertionError, usingComparator, usingDefaultComparator, withFailMessage, withRepresentation, withThreadDumpOnError
validate
as, as, defaultTypeComparators, extracting, extracting, hasFieldOrProperty, hasFieldOrPropertyWithValue, hasNoNullFieldsOrProperties, hasNoNullFieldsOrPropertiesExcept, isEqualToComparingFieldByField, isEqualToComparingFieldByFieldRecursively, isEqualToComparingOnlyGivenFields, isEqualToIgnoringGivenFields, isEqualToIgnoringNullFields, returns, usingComparatorForFields, usingComparatorForType
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. All rights reserved.