Skip to content

Failed String Comparisons for List of Strings while attempting to upgrade to 1.4.8 #62

@Carlos-Alonzo

Description

@Carlos-Alonzo

As stated on the title we are seeing failures on the comparison of Lists of String objects, in our case, due to omission of double quotes. We tried to pass in a String formatter to add the double quotes but issue remains. We think this stems from this fix #24. Here is how to replicate it:

@test
void testListOfStrings() {
ToStringVerifier.forClass(HasListField.class)
.withPreset(Presets.APACHE_TO_STRING_BUILDER_JSON_STYLE)
.verify();
}

class HasListField{
private List strings;

public HasListField(List<String> strings) {
  this.strings = strings;
}

public List<String> getStrings() {
  return strings;
}

@Override
public String toString() {
  return new Gson().toJson(this);
}

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions