Skip to content

Conversation

@petruki
Copy link
Member

@petruki petruki commented Oct 14, 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.

Environment configuration improvements

  • Replaced all instances of the hardcoded "default" environment string with the DEFAULT_ENV constant from com.switcherapi.client.remote.Constants across all test classes, improving maintainability and reducing duplication. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16]

SwitcherBuilder and execution history refactor

  • Moved the historyExecution map from SwitcherRequest to the base SwitcherBuilder class, centralizing execution history management for all builder subclasses. [1] [2] [3]
  • Ensured that the flush() method in SwitcherBuilder now clears both entries and execution history, improving the reset logic for builder state.

Test and usage updates

  • Refactored SwitcherThrottleTest to use SwitcherBase and the new environment configuration, and removed unnecessary test ordering and initialization calls for clarity and consistency. [1] [2] [3] [4] [5]

@petruki petruki added this to the v1.9.2 milestone Oct 14, 2025
@petruki petruki self-assigned this Oct 14, 2025
@petruki petruki added the enhancement New feature or request label Oct 14, 2025
@sonarqubecloud
Copy link

@petruki petruki merged commit efc6bec into master Oct 14, 2025
23 of 24 checks passed
@petruki petruki deleted the staging branch October 14, 2025 00:30
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