The JoinAssertThatStatements inspection will now add line breaks on joining statements.
Unrelated: Upgraded Gradle to 5.4.1. Upgraded kotlin to 1.3.40. Upgraded jacoco to 0.8.4. Minor style change for immediate returns. Increased test/branch coverage.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import java.util.*;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.fail;
|
||||
|
||||
public class JoinStatements {
|
||||
|
||||
@@ -24,21 +25,28 @@ public class JoinStatements {
|
||||
.doesNotContain("foobar");
|
||||
|
||||
assertThat("narf").isNotEqualTo("puit");
|
||||
assertThat(list).as("bar").contains("barbar").as("foo").hasSize(2);
|
||||
assertThat(list).as("bar").contains("barbar")
|
||||
.as("foo").hasSize(2);
|
||||
assertThat(list).as("evil").extracting(String::length).contains(2);
|
||||
|
||||
assertThat(list).as("bar").contains("barbar");
|
||||
assertThat(otherList).contains("puit");
|
||||
assertThat(list).as("foo").hasSize(2);
|
||||
if (true) {
|
||||
assertThat(list).doesNotContain("narf").as("bar").contains("barbar");
|
||||
assertThat(list).doesNotContain("narf")
|
||||
.as("bar").contains("barbar");
|
||||
}
|
||||
assertThat(list.get(0)).isNotEmpty().hasSize(3).isEqualTo("bar");
|
||||
assertThat(list.get(0)).isNotEmpty()
|
||||
.hasSize(3)
|
||||
.isEqualTo("bar");
|
||||
|
||||
assertThat(otherList.get(0)).isNotEmpty();
|
||||
assertThat(list.get(0)).hasSize(3);
|
||||
|
||||
assertThat(list.get(0) + "foo").isEqualTo("bar").doesNotStartWith("foo");
|
||||
assertThat(list.get(0) + "foo").isNotNull()
|
||||
// hey, a comment mixed with line breaks due to too many joins
|
||||
.isEqualTo("bar")
|
||||
.doesNotStartWith("foo");
|
||||
|
||||
assertThat(otherList.get(0) + "foo").isEqualTo("bar");
|
||||
assertThat(list.get(0) + "foo").doesNotStartWith("foo");
|
||||
@@ -57,5 +65,8 @@ public class JoinStatements {
|
||||
assertThat(list.get(i++).toLowerCase()).isEqualTo("foo");
|
||||
assertThat(list.get(--i)).isEqualTo("foo");
|
||||
assertThat(list.get(--i)).isEqualTo("foo");
|
||||
|
||||
org.junit.Assert.assertThat(foo, null);
|
||||
fail("oh no!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import java.util.*;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.fail;
|
||||
|
||||
public class JoinStatements {
|
||||
|
||||
@@ -39,6 +40,8 @@ public class JoinStatements {
|
||||
assertThat(otherList.get(0)).isNotEmpty();
|
||||
assertThat(list.get(0)).hasSize(3);
|
||||
|
||||
assertThat(list.get(0) + "foo").isNotNull();
|
||||
// hey, a comment mixed with line breaks due to too many joins
|
||||
assertThat(list.get(0) + "foo").isEqualTo("bar");
|
||||
assertThat(list.get(0) + "foo").doesNotStartWith("foo");
|
||||
|
||||
@@ -59,5 +62,8 @@ public class JoinStatements {
|
||||
assertThat(list.get(i++).toLowerCase()).isEqualTo("foo");
|
||||
assertThat(list.get(--i)).isEqualTo("foo");
|
||||
assertThat(list.get(--i)).isEqualTo("foo");
|
||||
|
||||
org.junit.Assert.assertThat(foo, null);
|
||||
fail("oh no!");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user