Skip to content

Conversation

@technologic-technologic
Copy link
Owner

  • Updated the test to be more compliant

More info below.

- Updated the test to be more compliant

Signed-off-by: Leonardo Trevizo <leonardo.trevizo@encora.com>
@github-actions
Copy link

PR Summary

WHAT Changed

  • ProductRepository.java: Updated the findCategoriesSummary query to count products in stock instead of summing stock quantities.
  • application.yml: Added show-sql: true to enable SQL logging.
  • InventoryManagerControllerTests.java: Expanded test coverage for product management endpoints, including creating, updating, deleting, and fetching products and categories.
  • ProductMapperTests.java: Added tests to verify mapping functionality for product responses.
  • InventoryProductsFilterTests.java: Added tests for filtering specifications related to product queries.

WHY It Matters

  • The change in the findCategoriesSummary method improves the accuracy of inventory metrics by counting products instead of summing stock quantities, which is crucial for inventory management.
  • Enabling SQL logging aids in debugging and performance monitoring.
  • Enhanced test coverage ensures that the product management functionality is robust and reliable, reducing the risk of regressions in future changes.

RISKS

  • Potential performance impact if the new counting logic in the database query is less efficient than the previous summation.
  • Changes in the query logic may affect existing functionality if not properly tested.

TESTS to Add

  • Ensure that the new counting logic in findCategoriesSummary returns expected results.
  • Validate that SQL logging does not expose sensitive information in production environments.
  • Additional edge case tests for the new filtering specifications in InventoryProductsFilterTests.

BREAKING CHANGES

  • None identified in this PR.

Changed File Paths

  • src/main/java/com/encorazone/inventory_manager/repository/ProductRepository.java
  • src/main/resources/application.yml
  • src/test/java/com/encorazone/inventory_manager/controller/InventoryManagerControllerTests.java
  • src/test/java/com/encorazone/inventory_manager/mapper/ProductMapperTests.java
  • src/test/java/com/encorazone/inventory_manager/service/InventoryProductsFilterTests.java

@technologic-technologic technologic-technologic added this to the Major fixes milestone Oct 17, 2025
@technologic-technologic technologic-technologic added the attention Important requirements. Attention to details here label Oct 17, 2025
@technologic-technologic technologic-technologic merged commit eca633d into gen-ai Oct 17, 2025
1 check passed
@technologic-technologic technologic-technologic deleted the 18-improve-testing-compliance branch October 17, 2025 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

attention Important requirements. Attention to details here

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve security compliance tests for production readiness

2 participants