Remove or rewrite commented-out tests (OrderComponentTest, GatewayControllerTest)

Open
#145 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
62/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
docker, java, mongodb, spring-boot
Domain
testing-qa

Research direction

Start with order-service's commented-out OrderComponentTest and customer-service's CustomerComponentTest as the model to copy from. The gateway-service GatewayControllerTest is a manual load script, so decide whether to delete it or move it out of src/test. Done means OrderComponentTest runs with @SpringBootTest(RANDOM_PORT), a Testcontainers MongoDB, and covers testAccept and testPrepare, and the gateway test no longer sits in the test sources.

Written by the indexing model from the issue text.

Description

enhancement

Problem

  • order-service: OrderComponentTest is entirely commented out and based on JUnit 4 (SpringRunner, HoverflyRule, @ClassRule). order-service therefore has no component test, unlike account-service and customer-service.
  • gateway-service: GatewayControllerTest has its @Test commented out; it is a manual load script that sends 100 orders to localhost:8080.

Suggested solution

  • Rewrite OrderComponentTest in the style of CustomerComponentTest (@SpringBootTest(RANDOM_PORT), Testcontainers MongoDB with @ServiceConnection, @ExtendWith(HoverflyExtension.class)), covering testAccept and testPrepare.
  • Remove GatewayControllerTest from src/test (or move the load generator outside the test sources) if it is not meant to run.
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.