Skip to content

Conversation

@petruki
Copy link
Member

@petruki petruki commented Oct 13, 2025

This pull request introduces improvements to the handling of execution history in the SwitcherBuilder class and refactors test code to use a constant for the default environment, improving maintainability and consistency. The most significant change is the centralization of the historyExecution map in SwitcherBuilder, along with updates to test setup and usage patterns.

Core library improvements

  • Moved the historyExecution map from SwitcherRequest to SwitcherBuilder, ensuring execution history is managed at the builder level and simplifying the class hierarchy. The flush() method now clears both entries and execution history. (src/main/java/com/switcherapi/client/model/SwitcherBuilder.java, src/main/java/com/switcherapi/client/model/SwitcherRequest.java) [1] [2] [3] [4] [5]

Test infrastructure modernization

  • Refactored SwitcherThrottleTest to use SwitchersBase instead of Switchers, updated initialization and reset logic, and removed unnecessary test method annotations for better clarity and reliability. (src/test/java/com/switcherapi/client/SwitcherThrottleTest.java) [1] [2] [3] [4] [5]

@petruki petruki added this to the v2.5.2 milestone Oct 13, 2025
@petruki petruki self-assigned this Oct 13, 2025
@petruki petruki added the enhancement New feature or request label Oct 13, 2025
@sonarqubecloud
Copy link

@petruki petruki merged commit 5c0a2cb into master-2 Oct 14, 2025
9 checks passed
@petruki petruki deleted the staging branch October 14, 2025 00:03
petruki added a commit that referenced this pull request Oct 14, 2025
* feat: changed flush to clean execution history too (#379)

* chore: added back TestMethodOrder (for windows agent test)

* test: moved throttle tests to suite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants