Open svametcalf opened 3 years ago
There is a similar issue for Kotlin https://github.com/assertj/assertj-core/issues/2357 which is going to be fixed in the language (https://youtrack.jetbrains.com/issue/KT-17765).
AssertJ is meant for Java mainly, when we can we try to make things easy for other JVM languages but we don't want to reduce the java functionalities because a JVM language does not support them well.
Have you had a look if there is an improvement raised for this specific case in the Groovy project?
^ Sorry to mentioned issue here. Please ignore it.
Kotlin clients which rely on this API are affected by the same problem (OVERLOAD_RESOLUTION_AMBIGUITY
, #2357), due to the bug in the Kotlin compiler: KT-17765.
As mentioned in https://github.com/assertj/assertj-core/issues/2357#issuecomment-1181387367, we will analyze how to better support these use cases in version 4 as they will most likely require breaking changes.
Summary
Greetings! Thanks for a great library!
When upgrading to the newest version of assertj-core (3.21.0), I am getting a number of the following exceptions when using assertj in Groovy.
I use a number of assertions with Groovy
Closure
s that now need an explicit cast. For example:I believe this is caused by the Groovy interpreter attempting to implicitly cast the
Closure
to ajava.util.function.Consumer
but is unable to pick between thesatisfies
methods to call, becauseThrowingConsumer
extendsConsumer
.