assertj icon indicating copy to clipboard operation
assertj copied to clipboard

Rename public API methods containing 'NewLine' to 'Newline'

Open icod opened this issue 3 years ago • 0 comments

Check List:

  • Fixes #2754
  • Unit tests : NO (see below)
  • Javadoc with a code example (on API only) : NO (Updated existing JavaDoc on lowercase methods, no duplicate JavaDoc on deprecated uppercase methods)
  • PR meets the contributing guidelines, I think. This is my first PR for this project. If not, let me know 🙂

Changes:

  • Strings:
    • Renamed assertContainsIgnoringNewLines (uppercase) to assertContainsIgnoringNewlines (lowercase). I thought that since this classes is in the internal package, I could safely rename the method, instead of keeping the uppercase one around for backward compatibility.
  • AbstractCharSequenceAssert:
    • Added containsIgnoringNewlines (lowercase)
    • Deprecated containsIgnoringNewLines (uppercase), keeping this one around for backward compatibility
    • Added isEqualIgnoringNewlines (lowercase)
    • Deprecated isEqualIgnoringNewLines (uppercase), keeping this one around for backward compatibility
  • Unit tests: Updated for the exisiting public methods, didn't add any new unit tests for the deprecated methods. If required, I can add them.

Please note

  • SonarLint throws up warnings about blocking issues: the uppercase and lowercase method names are confusing.
  • I have not copied the JavaDoc from the lowercase methods to the uppercase methods.

Not changed:

  • Errors concerning the aforementioned assertions:
    • Class ShouldBeEqualIgnoringNewLines and its factory method shouldBeEqualIgnoringNewLines;
    • Class ShouldBeEqualIgnoringNewLineDifferences and its factory method shouldBeEqualIgnoringNewLineDifferences.

These can be changed, but I'm not sure how to name them. Change only the factory methods? Add a lowercase factory method? Duplicate the entire class (to lowercase) and deprecate the uppercase one?

icod avatar Sep 13 '22 06:09 icod