Skip to content

Conversation

kuntal1461
Copy link
Contributor

Summary

  • Refactors OpenAiChatModelMutateTests to enhance readability and maintainability.
  • Addresses Sonar warnings (naming, assertions clarity, minor duplication) without changing behavior.

Motivation

  • Make the test intent clearer and reduce future review/debug time.
  • Keep the codebase aligned with Spring’s quality guidelines and Sonar recommendations.

Changes

  • Clarified test names to express “given/when/then” intent.
  • Extracted repeated literals into constants.
  • Replaced broad assertions with precise, self-describing assertions.
  • Removed minor duplication; simplified setup/teardown where safe.
  • No production code touched; no functional behavior change.

Testing

  • Unit tests updated where needed.

  • Local build green:

    ./mvnw -T1C -DskipTests=false clean verify
    # or run just the module:
    ./mvnw -T1C -DskipTests=false -pl models/spring-ai-openai -am clean verify
  • Verified the modified tests pass consistently.

Compatibility / Risk

  • No API changes, no behavioral changes.
  • Scope limited to tests.

Contributor Checklist (per guide)

  • DCO: Commits include Signed-off-by: Your Name <[email protected]> (git commit -s)
  • Rebased on latest main and squashed to a single coherent commit
  • Added/updated unit tests as needed
  • Built locally; all tests pass

@kuntal1461 kuntal1461 force-pushed the chore/sonar-readability-fixes branch from 79887e3 to db267aa Compare October 11, 2025 10:02
@kuntal1461 kuntal1461 force-pushed the chore/sonar-readability-fixes branch from db267aa to 7f4cd2e Compare October 11, 2025 11:47
@ilayaperumalg ilayaperumalg added this to the 1.1.0.M4 milestone Oct 13, 2025
@ilayaperumalg ilayaperumalg self-assigned this Oct 13, 2025
@ilayaperumalg
Copy link
Member

@kuntal1461 Thanks for the PR cleaning up! LGTM, rebased and merged as fa68d1e

@kuntal1461
Copy link
Contributor Author

hi @ilayaperumalg Thanks for merging!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants