abendt
11/30/2023, 10:06 AMabendt
11/30/2023, 10:08 AMinstall(TestContainerExtension(BrowserWebDriverContainer())) {
val that: BrowserWebDriverContainer<*> = this
// configure container
You can see here that in the configure Block the container can be configured in a type-safe way.
As TestComtainerExtension is deprecated i tried to switch to ContainerExtension.
Unfortunately this breaks some code as the type information for the container is not available anymore.
install(ContainerExtension(BrowserWebDriverContainer())) {
var that: GenericContainer<*> = this
Is it possible to restore the previous typing to avoid needing casts here?LeoColman
11/30/2023, 12:47 PMLeoColman
11/30/2023, 12:48 PMLeoColman
11/30/2023, 12:48 PMabendt
11/30/2023, 3:03 PMclass ContainerExtension<T : GenericContainer<*>>(
class TestContainerExtension<T : GenericContainer<out T>>(
i am no expert in generics but maybe this explains the difference?LeoColman
11/30/2023, 5:48 PMLeoColman
11/30/2023, 5:48 PMout T
on ContainerExtension