OBJECT
- the type of the object holding the updatable field.Assert<SELF,ACTUAL>
, Descriptable<OBJECT>
, ExtensionPoints<SELF,ACTUAL>
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
Constructor | Description |
---|---|
AtomicIntegerFieldUpdaterAssert(AtomicIntegerFieldUpdater<OBJECT> actual) |
Modifier and Type | Method | 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.
|
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 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. All rights reserved.