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

assertj-db SoftAssertion doesnt work with assertj-core 3.19.0

Open fafafifi123 opened this issue 4 years ago • 4 comments

This was ok if i use assertj-core 3.15.0 SoftAssertions , but it breaks in assertj-core 3.19.0 . Its due to generic return type

 public RequestAssert assertThat(Request actual) {
        return proxy(RequestAssert.class, Request.class, actual);
    }

fafafifi123 avatar Feb 15 '21 02:02 fafafifi123

@willyhalim Can you tell me wich version of assertj-db do you use ?

VanRoy avatar Feb 22 '21 20:02 VanRoy

Hi , I use assertj db version 2.0.2

My initial observation is the proxy method in assertjdb and assertj core now is returning different generic

Thanks

fafafifi123 avatar Feb 23 '21 02:02 fafafifi123

@willyhalim Thanks for the information, can you provide a little snippet of code that permit me to reproduce the issue ?

VanRoy avatar Feb 23 '21 21:02 VanRoy

Apologies for the delay

This works with assertj 3.14.0 and assertj db 2.0.2

import org.assertj.core.api.SoftAssertions;
import org.assertj.db.api.RequestAssert;
import org.assertj.db.type.Request;

public class DBAssertions extends SoftAssertions {
    public RequestAssert assertThat(Request actual) {
        return proxy(RequestAssert.class, Request.class, actual);
    }
}

But will have compilation error in assertj 3.19.0 ( due to generic return type is changed )

fafafifi123 avatar Mar 08 '21 12:03 fafafifi123