I have an integration test class like this (but more complex)
@ExtendWith(SpringExtension::class)
@WebMvcTest(Controller::class)
class ScheduleControllerTest(@Autowired val mockMvc: MockMvc) {
val obj = object {
var b = 2
}
@Test
fun a(){
obj.b = 1
assertEquals(obj.b, 1)
}
@Test
fun b(){
assertEquals(obj.b, 2)
}
}
and all tests in this class pass as if after each test obj is reset to its initial value. No @Before functions are used here, so what is happening?