Fixed isEmpty() for enumerables and strings and isNull() for object conversions to be applied only if it is the terminal method call as isEmpty() and isNull() return void.
This commit is contained in:
@@ -14,5 +14,7 @@ public class EnumerableIsEmpty {
|
||||
assertThat(new StringBuilder()).as("bar").hasSize(1);
|
||||
assertThat(new ArrayList<Long>()).as("etc").hasSize(1);
|
||||
assertThat(new Long[1]).as("etc").hasSize(1);
|
||||
|
||||
assertThat("string").as("foo").hasSize(0).hasSameSizeAs("foo").isEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,5 +14,7 @@ public class EnumerableIsEmpty {
|
||||
assertThat(new StringBuilder()).as("bar").hasSize(1);
|
||||
assertThat(new ArrayList<Long>()).as("etc").hasSize(1);
|
||||
assertThat(new Long[1]).as("etc").hasSize(1);
|
||||
|
||||
assertThat("string").as("foo").hasSize(0).hasSameSizeAs("foo").hasSize(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,5 +12,6 @@ public class ObjectIsNull {
|
||||
assertThat(new Object()).isNotNull();
|
||||
|
||||
assertThat(new Object()).as("foo").isNotNull().as("bar").isEqualTo(new Object()).as("etc").isNull();
|
||||
assertThat(new Object()).as("foo").isEqualTo(null).as("bar").isEqualTo(new Object()).as("etc").isNotNull();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,5 +12,6 @@ public class ObjectIsNull {
|
||||
assertThat(new Object()).isNotEqualTo(null);
|
||||
|
||||
assertThat(new Object()).as("foo").isNotEqualTo(null).as("bar").isEqualTo(new Object()).as("etc").isEqualTo(null);
|
||||
assertThat(new Object()).as("foo").isEqualTo(null).as("bar").isEqualTo(new Object()).as("etc").isNotEqualTo(null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,5 +15,8 @@ public class StringIsEmpty {
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,5 +15,8 @@ public class StringIsEmpty {
|
||||
assertThat(stringBuilder).as("bar").hasSize(0);
|
||||
|
||||
assertThat(new Object()).isEqualTo("");
|
||||
|
||||
assertThat(string).as("foo").isEqualTo("").as("bar").hasSize(0).hasSameSizeAs("foo").isEqualTo("");
|
||||
assertThat(string).as("foo").isEqualTo("").as("bar").hasSize(0).hasSameSizeAs("foo").hasSize(0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user