Java testing framework for testing pojo methods. It tests equals, hashCode, toString, getters, setters, constructors and whatever you report in issues ;)
There is already a similar issue about Intellij IDEA generated toString, however that one is very specific about a String property, so I opted to create a new one for this:
public class SearchResult
{
private final Object[] lastRecordSortValues;
private final int pageTotal;
public Object[] getLastRecordSortValues()
{
return lastRecordSortValues;
}
public int getPageTotal()
{
return pageTotal;
}
@Override
public boolean equals(final Object o)
{
...
}
@Override
public int hashCode()
{
...
}
@Override
public String toString()
{
return "SearchResult{" +
"lastRecordSortValues=" + Arrays.toString(lastRecordSortValues) +
", pageTotal=" + pageTotal +
'}';
}
}
It seems it dislikes this: lastRecordSortValues=" + Arrays.toString(lastRecordSortValues)
This is the full message I get:
Class com.myapp.SearchResult has bad 'toString' method implementation.
The toString method should contain:
lastRecordSortValues=[Ljava.lang.Object;@26f09a1c
But does not.
Result of toString:
SearchResult{lastRecordSortValues=[], pageTotal=0}
There is already a similar issue about Intellij IDEA generated toString, however that one is very specific about a String property, so I opted to create a new one for this:
It seems it dislikes this:
lastRecordSortValues=" + Arrays.toString(lastRecordSortValues)
This is the full message I get: