Skip to content

Add unit tests for cart services and update CI configuration#1503

Open
akus176 wants to merge 2 commits intonashtech-garage:mainfrom
longtoZ:test/cart
Open

Add unit tests for cart services and update CI configuration#1503
akus176 wants to merge 2 commits intonashtech-garage:mainfrom
longtoZ:test/cart

Conversation

@akus176
Copy link
Copy Markdown

@akus176 akus176 commented Apr 29, 2026

This pull request makes several improvements to the cart service's CI pipeline and enhances test coverage for the cart service. The CI workflow is refactored for better structure and maintainability, and new unit tests are added for improved code reliability. Additionally, some configuration values are updated.

CI/CD Pipeline Improvements:

  • The .github/workflows/cart-ci.yaml workflow is refactored to split the build process into separate Test and Build jobs, improve job naming, and use consistent YAML formatting. Unused or redundant steps (like Docker image build/push and OWASP Dependency Check) are removed, and coverage thresholds are updated to 70%.

Test Coverage Enhancements:

  • Adds a new test class AbstractCircuitBreakFallbackHandlerTest to verify fallback handler behavior.
  • Expands ProductServiceTest with additional test cases for product retrieval, existence checks, and fallback handling.
  • Introduces a test class ConstantsTest to validate the instantiability of the Constants class and the correctness of error code values.

Configuration Changes:

  • Updates SonarCloud organization and project key values in cart/pom.xml to reflect the new organization and project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant