Made these changes as part of java 17 and spring boot 3.0.6 upgrade.
Used these imports:
import org.springframework.test.context.junit.jupiter.SpringExtension; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.boot.test.context.SpringBootTest;
And these annotations:
@ExtendWith(SpringExtension.class) @SpringBootTest(classes = Application.class) @TestPropertySource(locations = "classpath:test.properties") @AutoConfigureMockMvc
Made changes dependencies in settings.gradle
testImplementation('org.springframework.boot:spring-boot-starter-test') { exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' }
Also tried without
@ExtendWith(SpringExtension.class)
This the error : enter image description here