Pact consumer tests (customer-service, order-service) do not use the Pact mock server
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- Half a day
- Newbie friendliness
- 62/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- java, spring-boot
- Domain
- testing-qa
Research direction
Start with CustomerConsumerContractTest and OrderConsumerContractTest in the customer-service and order-service modules; the @Pact method is present but @PactTestFor and @PactVerification are missing or commented out. Check the account-service.ribbon properties in the test configuration and replace them with current client settings pointing at the mock server. Done when running the consumer tests generates pact files under the pact.rootDir location that account-service provider tests can read.
Written by the indexing model from the issue text.
Description
Problem
CustomerConsumerContractTest and OrderConsumerContractTest define a @Pact method, but there is no @PactTestFor and @PactVerification is commented out. The contract is therefore not verified and no pact file is generated from it. The tests only pass if something happens to respond on port 8092.
The properties account-service.ribbon.listOfServers / account-service.ribbon.eureka.enabled are leftovers from Ribbon, which no longer exists in Spring Cloud 2025.x.
Suggested solution
- Add
@PactTestFor(providerName = ..., port = ...)(or injectMockServer) so the test calls the Pact mock server. - Point the client at the mock server through current properties (no Ribbon).
- Make sure the generated pacts are written to a known location (
pact.rootDir) so provider tests in account-service can consume them.
- Dominant language
- Java
- Stars
- 12
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from piomin/sample-spring-cloud-testing
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
question
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 62/100
-
enhancement
Difficulty 3/5 Half a day Newbie friendliness 62/100
All issues in piomin/sample-spring-cloud-testing
Similar issues
-
5.0.x backport enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
spring-cloud/spring-cloud-function#1507 ·
Maintainers usually reply within 1 day
-
ai-driven-fuzzing bug claude Minor
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
linagora/twake-calendar-side-service#1417 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
line/armeria#7109 · 3 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
a2aproject/a2a-java#1275 ·
Maintainers usually reply within 1 day
-
module/ftp Type/Bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ballerina-platform/ballerina-library#9476 ·
Maintainers usually reply within 1 day