I am migrating my project to Spring Boot and am getting the following error in Test classes: java.jang.NoClassDefFoundError: javax/servlet/DispatcherType
my gradle:
plugins {
id 'java'
id 'jacoco'
id 'org.sonarqube' version '4.0.0.2929'
id 'io.spring.dependency-management' version '1.1.0'
id 'org.springframework.boot' version '3.0.5'
}
repositories {
mavenCentral{
url '********'
}
}
group = '*****'
sourceCompatibility = '17'
apply from: 'gradle/sonar.gradle'
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-security'
// OAuth 2.0 Resource Server support
implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server'
// Lombok
implementation 'org.projectlombok:lombok:1.18.26'
annotationProcessor 'org.projectlombok:lombok:1.18.26'`
// Actuator
implementation 'org.springframework.boot:spring-boot-starter-actuator'
// Micrometer
implementation 'io.micrometer:micrometer-registry-prometheus:1.10.6'
// Logger
implementation 'net.logstash.logback:logstash-logback-encoder:7.3'
// Test
testImplementation 'org`your text`.springframework.boot:spring-boot-starter-test'
testImplementation 'com.github.tomakehurst:wiremock-jre8:2.35.0'
testImplementation 'org.bitbucket.b_c:jose4j:0.7.6'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.26'
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}`