lettuce icon indicating copy to clipboard operation
lettuce copied to clipboard

.equals() override missing from XReadArgs, among others

Open JamesBurnsCanva opened this issue 1 year ago • 2 comments

Bug Report

XReadArgs doesn't override the .equals() method. This problem extends to many other classes in the library, but the specific instance that motivated this bug report was the one in XReadArgs.

Current Behavior

Example code
var x = XReadArgs.Builder.block(Duration.ofSeconds(10));
var y = XReadArgs.Builder.block(Duration.ofSeconds(10));
assertEquals(x, y);

Expectation: x and y are equal, the assertion succeeds. Reality: x and y are not equal, the assertion fails.

Environment

  • Lettuce version(s): 6.1.8.RELEASE

Possible Solution

Override .equals() in XReadArgs, and possibly others too.

Additional Context

I discovered this when I was trying to write unit tests and found a bunch of them were failing because of it. I'd like to fix it so that I can write those unit tests without needing a refactor.

JamesBurnsCanva avatar Dec 21 '22 12:12 JamesBurnsCanva