https://kotlinlang.org logo
#kotest
Title
# kotest
m

mickeelm

03/13/2024, 9:36 AM
I'm a bit confused regardning the documentation and deprecation strategies for
Extension
and
Listener
.
Listener
is deprecated in favor of
Extension
, but the documentation for
Extension
promotes
Listener
. I also don't follow the
@SoftDeprecated("Use beforeAny")
on the
BeforeTestListener
. I mean, I follow/understand the same annotation on
beforeTest
, but I don't get why it's on the interface itself.
s

sam

03/13/2024, 9:50 AM
I think just a documentation issue. Extension is a superset of Listener. Even things like BeforeTestListener are extensions.
As for beforeTest, you can use it, it's never going to be removed.
m

mickeelm

03/13/2024, 9:56 AM
Right, so
BeforeTestListener
(and friends) is still the way to go, even though it extends the deprecated
Listener
interface? And the soft deprecation on the interface itself (
BeforeTestListener
) should possibly be removed (it doesn't really make sense, or am I missing something?)
s

sam

03/13/2024, 11:55 AM
The soft deprecation just means, we're preferring the name beforeAny, but beforeTest is never going away.
I may remove that soft deprecation entirely
And BeforeTestListener is an extension, the name Listener will remain, but there is no longer any functional difference between listeners and extensions
m

mickeelm

03/13/2024, 11:56 AM
Gotcha, thanks!