Hi Kotest-ers :android-wave: I'm new to the concep...
# kotest
g
Hi Kotest-ers 👋 I'm new to the concept of Test Factories in Kotest. I wonder if it could relate to the "Test Suite" concept in other test frameworks. I mean, is it a proper use of it for a SpringBootTest starting an application, making a single call to a controller, and then
include
a list of spec execution? At the moment I have a bunch of SpringBootTest making always the same thing and I want to raise the context just once. 🙏
d
I try to avoid
@SpringBootTest
as much as possible, for controllers I use
@WebMvcTest
with a list of controllers, if I need other classes such as ControllerAdvice I add them as well
g
Interesting and thanks for your reply. simple smile Well, indeed it's a test Vs. a GraphQL-Kotlin endpoint and I only followed what they describe on their GitHub. Anyway, how is it related to my question on Kotest Test Factories? 🤔 🙏
d
Hmm, sorry I don't use test factories, I think they should be used for very similar things, like different implementations of an interface
a
Afaik spring boot caches the context across different test classes https://docs.spring.io/spring-framework/docs/current/reference/html/testing.html#testing-ctx-management So i dont think you need to use test factories for that @Giorgio Vespucci