-
-
Notifications
You must be signed in to change notification settings - Fork 765
Closed
Labels
language: KotlinAn issue related to using AssertJ with KotlinAn issue related to using AssertJ with Kotlinstatus: ideal for contributionAn issue that a contributor can help us withAn issue that a contributor can help us with
Milestone
Description
Feature summary
Some assertions accept a functor:
public static <THROWABLE extends Throwable> THROWABLE catchThrowableOfType(ThrowingCallable shouldRaiseThrowable,
Class<THROWABLE> type) {
return AssertionsForClassTypes.catchThrowableOfType(shouldRaiseThrowable, type);
}Kotlin has a syntax for lambdas, so it could call:
catchThrowableOfType(NotFoundException::class.java) {
connectionService.findBy(hubId = "hub2", connId = "conn1")
}But as it is, it needs to stick with the less readable:
catchThrowableOfType( {
connectionService.findBy(hubId = "hub2", connId = "conn1")
}, NotFoundException::class.java)Could you please add some overrides, moving the functors to the last place? Like,
public static <THROWABLE extends Throwable> THROWABLE catchThrowableOfType(
Class<THROWABLE> type, ThrowingCallable shouldRaiseThrowable) {
return AssertionsForClassTypes.catchThrowableOfType(shouldRaiseThrowable, type);
}Thanks for considering.
AssertJ 3.23.1
Metadata
Metadata
Assignees
Labels
language: KotlinAn issue related to using AssertJ with KotlinAn issue related to using AssertJ with Kotlinstatus: ideal for contributionAn issue that a contributor can help us withAn issue that a contributor can help us with