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.
26 lines
861 B
Java
26 lines
861 B
Java
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
public class StringIsEmpty {
|
|
|
|
private void stringIsEmpty() {
|
|
String string = "string";
|
|
StringBuilder stringBuilder = new StringBuilder();
|
|
|
|
assertThat(string).isEqualTo("foo");
|
|
assertThat(string).as("foo").isEmpty();
|
|
assertThat(string).as("bar").isEmpty();
|
|
|
|
assertThat(stringBuilder).isEqualTo("foo");
|
|
assertThat(stringBuilder).as("foo").isEmpty();
|
|
assertThat(stringBuilder).as("bar").isEmpty();
|
|
|
|
assertThat(new Object()).isEqualTo("");
|
|
|
|
assertThat(string).as("foo").isEqualTo("").as("bar").hasSize(0).hasSameSizeAs("foo").isEmpty();
|
|
assertThat(string).as("foo").isEqualTo("").as("bar").hasSize(0).hasSameSizeAs("foo").isEmpty();
|
|
|
|
org.junit.Assert.assertThat(foo, null);
|
|
fail("oh no!");
|
|
}
|
|
}
|