Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Carlos-Alonzo opened this issue Nov 30, 2023 · 0 comments

Comments

@Carlos-Alonzo
Copy link

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);
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant