Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: FEST-Assert 1.3
-
Fix Version/s: FEST-Assert 1.4
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
Under FEST-Assertions 1.3 a new assertThat() method was added that takes an Iterable, in my custom extension I have:
public LdapEntryAssertion doesNotExist() { assertThat(entry) .describedAs(entryName + " doe not exist in LDAP") .isNull(); return this; }
In this instance, the entry variable may or may not be null. It turns out the Class of this object implements Iterable and whilst previous would fall under the assertThat(Object) method, it nows hits assertThat(Iterable).
assertThat(Iterable) eagerly calls #iterator inorder to create a collection. This should probably be null safe with something like:
public static CollectionAssert assertThat(Iterable<?> actual) { return actual != null ? assertThat(asCollection(actual.iterator())) : assertThat(actual); }
Activity
Yvonne Wang
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Assignee | Alex Ruiz [ alexruiz ] | |
| Fix Version/s | FEST-Assert 1.3.1 [ 16677 ] |
Alex Ruiz
made changes -
| Original Estimate | 0 minutes [ 0 ] | |
| Remaining Estimate | 0 minutes [ 0 ] |
Alex Ruiz
made changes -
| Status | Open [ 1 ] | In Progress [ 3 ] |
Alex Ruiz
made changes -
| Status | In Progress [ 3 ] | Resolved [ 5 ] |
| Resolution | Fixed [ 1 ] |
Fix can be viewed at GitHub.