question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tests concerning PUTs can't coexist with other JUnit 5 tests with pact-jvm-consumer-junit5_2.12

See original GitHub issue

It would appear that having consumer code that issue PUT requests on Pact’s mock server cause issues if tests co-exist in the same JUnit test class.

I’ve created a simple exemplar project to replicate this issue. To replicate, follow these instructions:

git clone git@github.com:paulspencerwilliams/BugExampleWithPactAndPutRequests.git
./gradlew test -i
git checkout works-with-posts
./gradlew test -i

The second test on the works-with-posts branch would appear to prove this is PUT related.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
DrongoXcommented, Apr 24, 2019

Hi guys, just had the same issue with HTTP PATCH, so not only PUT

2reactions
paulspencerwilliamscommented, Jul 11, 2018

Hey @minhdoan159, a colleague also discovered the timeout hack, and we’ve temporarily worked around this issue using @BeforeEach public void pause() throws InterruptedException { Thread.sleep(5000L); }

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tests concerning PUTs can't coexist with other JUnit 5 tests ...
It would appear that having consumer code that issue PUT requests on Pact's mock server cause issues if tests co-exist in the same...
Read more >
Maven not running JUnit 5 tests - Stack Overflow
According to the annotation ( import org.junit.jupiter.api.Test ), you are trying to run JUnit 5 tests with Maven. According to the documentation, ...
Read more >
JUnit 5 User Guide
The junit5-samples repository hosts a collection of sample projects based on JUnit Jupiter, JUnit Vintage, and other testing frameworks.
Read more >
Why Your JUnit 5 Tests Are Not Running Under Maven
There is a very common issue preventing your JUnit 5 tests from running under Maven. In this post, I explain why and provide...
Read more >
How to specify test order in JUnit 5 | by Alonso Del Arte
There is no good reason to specify test order in this toy example, other than to illustrate how it's done. We will need...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found