Class AtomicReferenceAssert<V>

All Implemented Interfaces:
Assert<AtomicReferenceAssert<V>,AtomicReference<V>>, Descriptable<AtomicReferenceAssert<V>>, ExtensionPoints<AtomicReferenceAssert<V>,AtomicReference<V>>

public class AtomicReferenceAssert<V> extends AbstractAssert<AtomicReferenceAssert<V>,AtomicReference<V>>
  • Constructor Details

    • AtomicReferenceAssert

      public AtomicReferenceAssert(AtomicReference<V> actual)
  • Method Details

    • hasValue

      public AtomicReferenceAssert<V> hasValue(V expectedValue)
      Verifies that the actual atomic has the given value.

      Example:

       // assertion will pass
       assertThat(new AtomicReference("foo")).hasValue("foo");
      
       // assertion will fail
       assertThat(new AtomicReference("foo")).hasValue("bar");
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual atomic is null.
      AssertionError - if the actual atomic does not have the given value.
      Since:
      2.7.0 / 3.7.0
    • doesNotHaveValue

      public AtomicReferenceAssert<V> doesNotHaveValue(V expectedValue)
      Verifies that the actual atomic has not the given value.

      Example:

       // assertion will pass
       assertThat(new AtomicReference("foo")).doesNotHaveValue("bar");
      
       // assertion will fail
       assertThat(new AtomicReference("foo")).doesNotHaveValue("foo");
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual atomic is null.
      AssertionError - if the actual atomic has the given value.
      Since:
      2.7.0 / 3.7.0