Skip to content

Commit

Permalink
fix: Dependency conflict with org.slf4j:slf4j-api was causing Spring …
Browse files Browse the repository at this point in the history
…tests to fail
  • Loading branch information
rholshausen committed Dec 4, 2024
1 parent 38c0d27 commit 2d20163
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 4 additions & 2 deletions provider/junit5spring/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -24,7 +23,6 @@
@WebMvcTest
@Provider("myAwesomeService")
@PactFolder("pacts")
@Disabled // TODO: this fails with NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
class MockMvcTestTargetWebMvcTestJava {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion provider/spring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 2d20163

Please sign in to comment.