Skip to content

BAH- 5152/5324 | Fix. Sonar quality gate: remove duplicate Odoo DTOs, add handler tests - #365

Open
devsingh05298 wants to merge 3 commits into
omrs-2.8-localfrom
BAH-5152/5324-fix
Open

devsingh05298 wants to merge 3 commits into
omrs-2.8-localfrom
BAH-5152/5324-fix

Conversation

@devsingh05298

Copy link
Copy Markdown

What

Fixes the SonarCloud quality gate that is failing on #361 (new code coverage 75% vs 80%, duplication 3.8% vs 3%).

Commit 1: BAH-5152 | Add. Unit tests for ImageUrlHandler and VideoUrlHandler

  • New ImageUrlHandlerTest and VideoUrlHandlerTest (3 tests each): sets complex data from storage metadata, wraps IOException in UncheckedIOException, saveObs returns the obs unchanged.
  • Covers the 14 new handler lines that had no tests.

Commit 2: BAH-5324 | Refactor. Read Odoo snake_case with a naming strategy, removing duplicate Odoo DTO classes

  • Removed OdooStockData and OdooAvailableStockResponse; they duplicated StockData / AvailableStockResponse (48 duplicated lines) and left one uncovered mapping line.
  • InventoryStockServiceImpl now reads Odoo's snake_case JSON with a SNAKE_CASE naming strategy and ignores unknown keys (e.g. manufacturer).
  • StockData / AvailableStockResponse stay annotation-free, so /availableStocks still returns camelCase (batchNumber, expiryDate, stockLocationName, ...) regardless of the Jackson version.
  • No change to the REST contract.

Why

Sonar's file-level report for #361: duplication came from OdooStockData; uncovered lines came from the two handlers and one mapping line.

Testing

  • bahmnicore-api: 366 tests, 0 failures. InventoryStockControllerTest (omod): 11 pass.

Notes

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ddb85829-3546-4033-9004-611d8fa37fcc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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