OrderIntegrationTest tag does not match surefire/failsafe configuration

Open Beginner friendly
#144 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
java, spring-boot

Research direction

Start with OrderIntegrationTest and the surefire and failsafe sections of order-service/pom.xml, and compare the @Tag value with the excludedGroups and groups settings. Pick one tag name and use it in both places so surefire skips the test and failsafe runs it. Done when mvn verify runs the test under failsafe and the unit test run no longer includes it. The IntegrationTest interface and the redundant includes can go in the same change.

Written by the indexing model from the issue text.

Description

bug

Problem

OrderIntegrationTest is annotated with @Tag("integration"), but order-service/pom.xml filters on pl.piomin.services.order.IntegrationTest (excludedGroups in surefire, groups in failsafe). The tag never matches, so:

  • surefire runs the test as a regular unit test (it needs the dev profile and MongoDB),
  • failsafe runs no tests.

The test also only calls System.out.println and has no assertions. <include>**/*.class</include> in surefire is unnecessary, and IntegrationTest is an empty interface used only in the pom.

Suggested solution

  • Use @Tag("integration") consistently and set surefire excludedGroups / failsafe groups to integration.
  • Remove the empty IntegrationTest interface and the redundant includes.
  • Consider naming it OrderIntegrationIT so failsafe picks it up by default.
  • Add real assertions (e.g. on the withdrawn account balance).
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from piomin/sample-spring-cloud-testing

All issues in piomin/sample-spring-cloud-testing

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.