assertj-db icon indicating copy to clipboard operation
assertj-db copied to clipboard

Possibility to use Condition in hasValues of row assertions

Open soezen opened this issue 5 years ago • 3 comments

I would like to include condition objects when I call the hasValue method of a row assertion

softAssertions.assertThat(changes)
                .changeOnTableWithPks(tableName, primaryKeyValue)
                .isCreation()
                .rowAtEndPoint()
                .hasValues(1, 'Test', new HamcrestCondition<>(Matchers.greaterThan(2)));

soezen avatar Oct 20 '20 13:10 soezen

Hi @soezen , thanks for your report and your PR. It's a good idea. However, I think it would be better to implement this feature with different method name and implement some tests. I can handle this, and I also plan to support Consumer in addition to Condition for many assertj-db methods. I'll let you know quickly.

VanRoy avatar Nov 01 '20 21:11 VanRoy

Wow, super. Yes this was just a quick implementation for something I would like to use. Thanks

On Sun, Nov 1, 2020 at 10:36 PM Julien Roy [email protected] wrote:

Hi @soezen https://github.com/soezen , thanks for your report and your PR. It a good idea. However, I think it will be better to implement this feature with other method name and implement some tests. I can handle this, and I also plan to support Consumer in addition of Condition on many assertj-db methods. I'll let you know quickly.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/assertj/assertj-db/issues/110#issuecomment-720155483, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2WGMOULU4335N7AIJBNFTSNXIFXANCNFSM4SYKSEAA .

soezen avatar Nov 02 '20 06:11 soezen

Hi @soezen , a first implementation of hasValuesSatisfying with Condition is pushed on main. It wil be available soon in the next release. Sorry for the delay.

VanRoy avatar Feb 23 '21 21:02 VanRoy