Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

Note that FEST & JUnit assertions can coexist together, you don't have to migrate all in one time.

Changing

Highlight
coloryellow
Wiki Markup
{highlight:yellow}{*}assertEquals(0, myList.size())*{highlight}
to
Highlight
coloryellow
Wiki Markup
{highlight:yellow}{*}assertThat(myList).isEmpty()*{highlight}

Code Block
assertEquals(0,(.*).size()); -> assertThat(\1).isEmpty();

It's important to run this one before the assertEquals -> isEqualTo, to avoid ending with : assertThat(myList.size()).isEqualTo(0)

Changing

Highlight
coloryellow
Wiki Markup
{highlight:yellow}{*}assertEquals(expectedSize, myList.size())*{highlight}
to
Highlight
coloryellow
Wiki Markup
{highlight:yellow}{*}assertThat(myList).hasSize(expectedSize)*{highlight}

Code Block
assertEquals((.*),(*.).size()); -> assertThat(\2).hasSize(\1);

It's important to run this one before the assertEquals -> isEqualTo, to avoid ending with : assertThat(myList.size()).isEqualTo(expectedSize)

Changing

Highlight
coloryellow
Wiki Markup
{highlight:yellow}{*}assertEquals(value, valueUnderTest)*{highlight}
to
Highlight
coloryellow
Wiki Markup
{highlight:yellow}{*}assertThat(valueUnderTest).isEqualTo(value)*{highlight}

Code Block
assertEquals((.),(.)); -> assertThat(\2).isEqualTo(\1);

Changing

Highlight
coloryellow
Wiki Markup
{highlight:yellow}{*}assertNotEquals(value, valueUnderTest)*{highlight}
to
Highlight
coloryellow
Wiki Markup
{highlight:yellow}{*}assertThat(valueUnderTest).isNotEqualTo(value)*{highlight}

Code Block
assertNotEquals((.),(.)); -> assertThat(\2).isNotEqualTo(\1);

Changing

Highlight
coloryellow
Wiki Markup
{highlight:yellow}{*}assertNull(objectUnderTest)*{highlight}
to
Highlight
coloryellow
Wiki Markup
{highlight:yellow}{*}assertThat(objectUnderTest).isNull()*{highlight}

Code Block
assertNull((.*)); -> assertThat(\1).isNull();

Changing

Highlight
coloryellow
Wiki Markup
{highlight:yellow}{*}assertNotNull(objectUnderTest)*{highlight}
to
Highlight
coloryellow
Wiki Markup
{highlight:yellow}{*}assertThat(objectUnderTest).isNotNull()*{highlight}

Code Block
assertNotNull((.*)); -> assertThat(\1).isNotNull();

Changing

Highlight
coloryellow
Wiki Markup
{highlight:yellow}{*}assertTrue(logicalCondition)*{highlight}
to
Highlight
coloryellow
Wiki Markup
{highlight:yellow}{*}assertThat(logicalCondition).isTrue()*{highlight}

Code Block
assertTrue((.*)); -> assertThat(\1).isTrue();

Changing

Highlight
coloryellow
Wiki Markup
{highlight:yellow}{*}assertFalse(logicalCondition)*{highlight}
to
Highlight
coloryellow
Wiki Markup
{highlight:yellow}{*}assertThat(logicalCondition).isFalse()*{highlight}

Code Block
assertFalse((.*)); -> assertThat(\1).isFalse();