Add tests for default representation of AtomicStampedReference, AtomicReference and AtomicMarkableReference
@@ -29,6 +29,16 @@ import org.junit.Test;
@SuppressWarnings({ "serial", "unused" })
public class StandardRepresentation_toStringOf_AtomicReferences_Test {
+ @Test
+ public void should_use_assertj_representation_for_AtomicReference() {
+ // GIVEN
+ Object myData = new AtomicReference<String>("value");
+ // WHEN
+ String stringOf = STANDARD_REPRESENTATION.toStringOf(myData);
+ // THEN
+ then(stringOf).isEqualTo("AtomicReference[\"value\"]");
+ }
+
@Test
public void should_use_overridden_toString_in_AtomicReference_subclass() {
class MyData extends AtomicReference<String> {
@@ -132,6 +142,16 @@ public class StandardRepresentation_toStringOf_AtomicReferences_Test {
then(stringOf).isEqualTo("MyData[\"value\"]");
}
+ @Test
+ public void should_use_assertj_representation_for_AtomicMarkableReference() {
+ // GIVEN
+ Object myData = new AtomicMarkableReference<String>("value", true);
+ // WHEN
+ String stringOf = STANDARD_REPRESENTATION.toStringOf(myData);
+ // THEN
+ then(stringOf).isEqualTo("AtomicMarkableReference[marked=true, reference=\"value\"]");
+ }
+
@Test
public void should_use_overridden_toString_in_AtomicMarkableReference_subclass() {
class MyData extends AtomicMarkableReference<String> {
@@ -175,6 +195,16 @@ public class StandardRepresentation_toStringOf_AtomicReferences_Test {
then(stringOf).isEqualTo("MyData[marked=true, reference=\"Description\"]");
}
+ @Test
+ public void should_use_assertj_representation_for_AtomicStampedReference() {
+ // GIVEN
+ Object myData = new AtomicStampedReference<String>("value", 1);
+ // WHEN
+ String stringOf = STANDARD_REPRESENTATION.toStringOf(myData);
+ // THEN
+ then(stringOf).isEqualTo("AtomicStampedReference[stamp=1, reference=\"value\"]");
+ }
+
@Test
public void should_use_overridden_toString_AtomicStampedReference() {
class MyData extends AtomicStampedReference<String> {
