Spring Security Mock MVC Test

Hi I am trying to use Spring to test my controller but here is the definition of my test class:
@SpringBootTest(
    webEnvironment = SpringBootTest.WebEnvironment.MOCK,
    classes = [ProfileController::class]
)
@AutoConfigureMockMvc(addFilters = false)
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@TestMethodOrder(MethodOrderer.OrderAnnotation::class)
@ActiveProfiles("test", REST_API_PROFILE_NAME)
@DisplayName("Profile Controller Test")
class ProfileControllerTest


In the SpringBootTest#classes method I specified my controller but when I run it, Spring doesn't automatically create all needed beans for example ProfileService or ProfileDao
Was this page helpful?