OBJECT
- the type of the object holding the updatable field.public class AtomicLongFieldUpdaterAssert<OBJECT> extends AbstractAtomicFieldUpdaterAssert<AtomicLongFieldUpdaterAssert<OBJECT>,Long,AtomicLongFieldUpdater<OBJECT>,OBJECT>
AtomicLongFieldUpdater
s.
To create an instance of this class, invoke
.
Assertions.assertThat(AtomicLongFieldUpdater)
actual, info, myself
Constructor and Description |
---|
AtomicLongFieldUpdaterAssert(AtomicLongFieldUpdater<OBJECT> actual) |
Modifier and Type | Method and Description |
---|---|
protected Long |
getActualValue(OBJECT obj) |
AtomicLongFieldUpdaterAssert<OBJECT> |
hasValue(Long expectedValue,
OBJECT obj)
Verifies that the actual atomic field updater contains the given value at the given object.
|
validate
as, as, extracting, hasFieldOrProperty, hasFieldOrPropertyWithValue, hasNoNullFieldsOrProperties, hasNoNullFieldsOrPropertiesExcept, isEqualToComparingFieldByField, isEqualToComparingFieldByFieldRecursively, isEqualToComparingOnlyGivenFields, isEqualToIgnoringGivenFields, isEqualToIgnoringNullFields, usingComparatorForFields, usingComparatorForType
asList, asString, describedAs, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, equals, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, inBinary, inHexadecimal, is, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, overridingErrorMessage, setCustomRepresentation, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, withFailMessage, withRepresentation, withThreadDumpOnError
public AtomicLongFieldUpdaterAssert(AtomicLongFieldUpdater<OBJECT> actual)
public AtomicLongFieldUpdaterAssert<OBJECT> hasValue(Long expectedValue, OBJECT obj)
Example:
// person is an instance of a Person class holding a non-private volatile long field (age).
AtomicIntegerFieldUpdater<Person> ageUpdater = AtomicIntegerFieldUpdater.newUpdater(Person.class, "age");
// this assertion succeeds:
ageUpdater.set(person, 25);
assertThat(ageUpdater).hasValue(25, person);
// this assertion fails:
fieldUpdater.set(person, 28);
assertThat(fieldUpdater).hasValue(25, person);
hasValue
in class AbstractAtomicFieldUpdaterAssert<AtomicLongFieldUpdaterAssert<OBJECT>,Long,AtomicLongFieldUpdater<OBJECT>,OBJECT>
expectedValue
- the expected value inside the OBJECT
.obj
- the object holding the updatable field.protected Long getActualValue(OBJECT obj)
getActualValue
in class AbstractAtomicFieldUpdaterAssert<AtomicLongFieldUpdaterAssert<OBJECT>,Long,AtomicLongFieldUpdater<OBJECT>,OBJECT>
Copyright © 2013–2018 AssertJ. All rights reserved.