Is there a way to have a `beforeTest` in an init b...
# kotest
d
Is there a way to have a
beforeTest
in an init block in a base class? I need to drop and create the database contents before each test in the spec's base class so I don't have to do that in each spec... but I'm getting the warning:
Calling non-final function beforeTest in constructor
...? Should I just ignore that?
e
I would create an extension instead, and register it wherever you mean to use the base class
d
The base class has other things there...
An extension doesn't give me all the utility functions and objects I need for db tests
l
Overriding the function is not a nice option for you?
Maybe using test factories and separate them from your hierarchy is an idea
d
I tried overriding the function, i dont think it worked from the base class... and test factories dont work well with the intellij plugin (at least last time i tried them...)