diff --git a/buildSrc/src/main/groovy/au.com.dius.pact.kotlin-common-conventions.gradle b/buildSrc/src/main/groovy/au.com.dius.pact.kotlin-common-conventions.gradle index 5d3e9bf6f..af9721489 100644 --- a/buildSrc/src/main/groovy/au.com.dius.pact.kotlin-common-conventions.gradle +++ b/buildSrc/src/main/groovy/au.com.dius.pact.kotlin-common-conventions.gradle @@ -41,7 +41,7 @@ dependencies { implementation 'org.apache.commons:commons-collections4:4.4' implementation 'org.apache.tika:tika-core:2.9.1' implementation 'com.google.guava:guava:31.1-jre' - implementation 'org.slf4j:slf4j-api:1.7.36' + implementation 'org.slf4j:slf4j-api:2.0.4' implementation 'io.ktor:ktor-http-jvm:2.3.8' implementation 'io.ktor:ktor-server-netty:2.3.8' implementation 'io.ktor:ktor-network-tls-certificates:2.3.8' diff --git a/provider/junit5spring/build.gradle b/provider/junit5spring/build.gradle index e46c2c8e6..e96a1c644 100644 --- a/provider/junit5spring/build.gradle +++ b/provider/junit5spring/build.gradle @@ -17,7 +17,9 @@ dependencies { implementation 'org.apache.commons:commons-lang3' implementation 'javax.mail:mail:1.5.0-b01' - testImplementation 'org.springframework.boot:spring-boot-starter-test:2.5.14' - testImplementation 'org.springframework.boot:spring-boot-starter-web:2.5.14' + testImplementation 'org.springframework.boot:spring-boot-test:2.5.14' + testImplementation 'org.springframework.boot:spring-boot-test-autoconfigure:2.5.14' + testImplementation 'org.springframework:spring-webmvc:5.3.20' testImplementation 'org.apache.groovy:groovy' + testImplementation 'org.yaml:snakeyaml:1.33' } diff --git a/provider/junit5spring/src/test/java/au/com/dius/pact/provider/spring/junit5/MockMvcTestTargetWebMvcTestJava.java b/provider/junit5spring/src/test/java/au/com/dius/pact/provider/spring/junit5/MockMvcTestTargetWebMvcTestJava.java index 9a8126bab..379859991 100644 --- a/provider/junit5spring/src/test/java/au/com/dius/pact/provider/spring/junit5/MockMvcTestTargetWebMvcTestJava.java +++ b/provider/junit5spring/src/test/java/au/com/dius/pact/provider/spring/junit5/MockMvcTestTargetWebMvcTestJava.java @@ -5,7 +5,6 @@ import au.com.dius.pact.provider.junitsupport.Provider; import au.com.dius.pact.provider.junitsupport.loader.PactFolder; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.TestTemplate; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; @@ -24,7 +23,6 @@ @WebMvcTest @Provider("myAwesomeService") @PactFolder("pacts") -@Disabled // TODO: this fails with NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder class MockMvcTestTargetWebMvcTestJava { @Autowired diff --git a/provider/junit5spring/src/test/java/au/com/dius/pact/provider/spring/junit5/WebTestClientPactTest.java b/provider/junit5spring/src/test/java/au/com/dius/pact/provider/spring/junit5/WebTestClientPactTest.java index 39762977b..0c55c023a 100644 --- a/provider/junit5spring/src/test/java/au/com/dius/pact/provider/spring/junit5/WebTestClientPactTest.java +++ b/provider/junit5spring/src/test/java/au/com/dius/pact/provider/spring/junit5/WebTestClientPactTest.java @@ -4,7 +4,6 @@ import au.com.dius.pact.provider.junitsupport.Provider; import au.com.dius.pact.provider.junitsupport.loader.PactFolder; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.TestTemplate; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.boot.test.context.SpringBootTest; @@ -18,7 +17,6 @@ @SpringBootTest @Provider("myAwesomeService") @PactFolder("pacts") -@Disabled // TODO: this fails with NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder class WebTestClientPactTest { public static class Handler { diff --git a/provider/spring/README.md b/provider/spring/README.md index 5125919cb..01cc7d539 100644 --- a/provider/spring/README.md +++ b/provider/spring/README.md @@ -198,7 +198,7 @@ public class PactVerificationTest { ``` #### JUnit5 -You actually don't need to dependend on `pact-jvm-provider-spring` for this. It's sufficient to depend on `pact-jvm-provider-junit5`. +You actually don't need to depend on `pact-jvm-provider-spring` for this. It's sufficient to depend on `pact-jvm-provider-junit5`. You can set the port to the `HttpTestTarget` object in the before method.