OBJECT
- the type of the object holding the updatable field.public class AtomicIntegerFieldUpdaterAssert<OBJECT> extends AbstractAtomicFieldUpdaterAssert<AtomicIntegerFieldUpdaterAssert<OBJECT>,Integer,AtomicIntegerFieldUpdater<OBJECT>,OBJECT>
AtomicIntegerFieldUpdater
s.
To create an instance of this class, invoke
.
Assertions.assertThat(AtomicIntegerFieldUpdater)
actual, info, myself, throwUnsupportedExceptionOnEquals
Constructor and Description |
---|
AtomicIntegerFieldUpdaterAssert(AtomicIntegerFieldUpdater<OBJECT> actual) |
Modifier and Type | Method and Description |
---|---|
protected Integer |
getActualValue(OBJECT obj) |
AtomicIntegerFieldUpdaterAssert<OBJECT> |
hasValue(Integer 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 AtomicIntegerFieldUpdaterAssert(AtomicIntegerFieldUpdater<OBJECT> actual)
public AtomicIntegerFieldUpdaterAssert<OBJECT> hasValue(Integer expectedValue, OBJECT obj)
Example:
// person is an instance of a Person class holding a non-private volatile int 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<AtomicIntegerFieldUpdaterAssert<OBJECT>,Integer,AtomicIntegerFieldUpdater<OBJECT>,OBJECT>
expectedValue
- the expected value inside the OBJECT
.obj
- the object holding the updatable field.protected Integer getActualValue(OBJECT obj)
getActualValue
in class AbstractAtomicFieldUpdaterAssert<AtomicIntegerFieldUpdaterAssert<OBJECT>,Integer,AtomicIntegerFieldUpdater<OBJECT>,OBJECT>
Copyright © 2014–2019 AssertJ. All rights reserved.