I am currently studying the usage of these two annotations:
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
@AutoConfigureMockMvc
I saw a code base which looks like:
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
@AutoConfigureMockMvc
class LoginEndToEndTest {
@Autowired protected MockMvc mvc;
isn't it an bad/anti pattern?
In fact,
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
seems to be used to launch a real embedded servlet container, while @AutoConfigureMockMvc is used to make... mocks!
So, are these 2 annotations are compatible at the same time?
thanks.