From f5d5c5e71d4def1da6e1d504571aba1e85d4ef81 Mon Sep 17 00:00:00 2001
From: petruki <31597636+petruki@users.noreply.github.com>
Date: Mon, 26 Oct 2026 18:47:49 -0700
Subject: [PATCH 1/2] chore(deps): bump gson@2.15.0, commons-lang3@3.21.0,
others, fixed test
---
.github/FUNDING.yml | 2 ++
.github/workflows/master-2.yml | 6 ++---
.github/workflows/master.yml | 6 ++---
.github/workflows/release.yml | 6 ++---
.github/workflows/sonar.yml | 2 +-
.github/workflows/staging.yml | 4 ++--
.gitignore | 5 ++++
pom.xml | 23 +++++++++++--------
.../client/model/SwitcherRequest.java | 2 +-
.../client/SwitcherThrottle1Test.java | 13 +++++++----
.../client/SwitcherThrottle2Test.java | 8 +++----
11 files changed, 46 insertions(+), 31 deletions(-)
create mode 100644 .github/FUNDING.yml
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
new file mode 100644
index 00000000..28caaaa6
--- /dev/null
+++ b/.github/FUNDING.yml
@@ -0,0 +1,2 @@
+ko_fi: petruki
+github: [petruki]
\ No newline at end of file
diff --git a/.github/workflows/master-2.yml b/.github/workflows/master-2.yml
index 8e640e01..a8880121 100644
--- a/.github/workflows/master-2.yml
+++ b/.github/workflows/master-2.yml
@@ -17,7 +17,7 @@ jobs:
fetch-depth: 0
- name: Set up JDK 17
- uses: actions/setup-java@v5
+ uses: actions/setup-java@v6
with:
java-version: 17
distribution: 'temurin'
@@ -42,7 +42,7 @@ jobs:
- uses: actions/checkout@v7
- name: Setup Java
- uses: actions/setup-java@v5
+ uses: actions/setup-java@v6
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
@@ -51,7 +51,7 @@ jobs:
run: mvn -version
- name: Cache Maven packages
- uses: actions/cache@v5
+ uses: actions/cache@v6
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ matrix.java }}
diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml
index c4a22012..4304e162 100644
--- a/.github/workflows/master.yml
+++ b/.github/workflows/master.yml
@@ -17,7 +17,7 @@ jobs:
fetch-depth: 0
- name: Set up JDK 17
- uses: actions/setup-java@v5
+ uses: actions/setup-java@v6
with:
java-version: 17
distribution: 'temurin'
@@ -42,7 +42,7 @@ jobs:
- uses: actions/checkout@v7
- name: Setup Java
- uses: actions/setup-java@v5
+ uses: actions/setup-java@v6
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
@@ -51,7 +51,7 @@ jobs:
run: mvn -version
- name: Cache Maven packages
- uses: actions/cache@v5
+ uses: actions/cache@v6
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ matrix.java }}
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 6bc7299d..0fef972a 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v7
- name: Setup Java
- uses: actions/setup-java@v5
+ uses: actions/setup-java@v6
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
@@ -27,7 +27,7 @@ jobs:
run: mvn -version
- name: Cache Maven packages
- uses: actions/cache@v5
+ uses: actions/cache@v6
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ matrix.java }}
@@ -44,7 +44,7 @@ jobs:
steps:
- uses: actions/checkout@v7
- name: Set up Apache Maven Central
- uses: actions/setup-java@v5
+ uses: actions/setup-java@v6
with:
distribution: 'temurin'
java-version: '17'
diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml
index e2b8e55d..6e55dc25 100644
--- a/.github/workflows/sonar.yml
+++ b/.github/workflows/sonar.yml
@@ -34,7 +34,7 @@ jobs:
fetch-depth: 0
- name: Set up JDK 17
- uses: actions/setup-java@v5
+ uses: actions/setup-java@v6
with:
java-version: 17
distribution: 'temurin'
diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml
index 2a541a8f..b28de871 100644
--- a/.github/workflows/staging.yml
+++ b/.github/workflows/staging.yml
@@ -26,7 +26,7 @@ jobs:
fetch-depth: 0
- name: Setup Java
- uses: actions/setup-java@v5
+ uses: actions/setup-java@v6
with:
distribution: 'temurin'
java-version: ${{ github.event.inputs.jdk }}
@@ -35,7 +35,7 @@ jobs:
run: mvn -version
- name: Cache Maven packages
- uses: actions/cache@v5
+ uses: actions/cache@v6
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ matrix.java }}
diff --git a/.gitignore b/.gitignore
index bde6020d..bb9e1793 100644
--- a/.gitignore
+++ b/.gitignore
@@ -46,3 +46,8 @@ local.properties
## OS X
##############################
.DS_Store
+
+##############################
+## Sonar
+##############################
+.sonar/
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 07a46b43..cfdded97 100644
--- a/pom.xml
+++ b/pom.xml
@@ -52,26 +52,26 @@
- 2.14.0
- 3.20.0
+ 2.15.0
+ 3.21.0
3.13.0
- 2.0.18
+ 2.0.20
- 5.4.0
- 6.1.2
+ 5.5.1
+ 6.1.3
+ 6.1.3
2.3.0
- 6.1.2
- 3.15.0
+ 3.16.0
3.4.0
3.12.0
- 3.5.6
+ 3.6.0
3.2.8
- 5.7.0.6970
+ 5.8.0.7211
0.8.15
- 0.11.0
+ 0.12.0
jacoco
@@ -184,6 +184,9 @@
switcherapi
switcherapi_switcher-client
${project.groupId}:${project.artifactId}
+ ${project.build.outputDirectory}
+ ${project.build.testOutputDirectory}
+ ${settings.localRepository}/**/*.jar
false
diff --git a/src/main/java/com/switcherapi/client/model/SwitcherRequest.java b/src/main/java/com/switcherapi/client/model/SwitcherRequest.java
index 4cafc8c8..9f3728e7 100644
--- a/src/main/java/com/switcherapi/client/model/SwitcherRequest.java
+++ b/src/main/java/com/switcherapi/client/model/SwitcherRequest.java
@@ -141,7 +141,7 @@ public boolean isBypassMetrics() {
}
private boolean canUseAsync() {
- return super.delay > 0 && !this.executionsMap.isEmpty();
+ return super.delay > 0L && !this.executionsMap.isEmpty();
}
@Override
diff --git a/src/test/java/com/switcherapi/client/SwitcherThrottle1Test.java b/src/test/java/com/switcherapi/client/SwitcherThrottle1Test.java
index 16888f0f..761f6411 100644
--- a/src/test/java/com/switcherapi/client/SwitcherThrottle1Test.java
+++ b/src/test/java/com/switcherapi/client/SwitcherThrottle1Test.java
@@ -12,6 +12,7 @@
import static com.switcherapi.client.remote.Constants.DEFAULT_ENV;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
class SwitcherThrottle1Test extends MockWebServerHelper {
@@ -40,11 +41,11 @@ static void tearDown() {
void shouldReturnTrue_withThrottle() {
// Initial remote call
givenResponse(generateMockAuth(10)); //auth
- givenResponse(generateCriteriaResponse("true", false)); //criteria - sync (cached)
+ givenResponse(generateCriteriaResponse("true", false)); //criteria - sync
// Throttle period - should use cache
- givenResponse(generateCriteriaResponse("false", false)); //criteria - async (background)
- givenResponse(generateCriteriaResponse("false", false)); //criteria - async after 1 sec (background)
+ givenResponse(generateCriteriaResponse("true", false)); //criteria - async (cached)
+ givenResponse(generateCriteriaResponse("false", false)); //criteria - async after 1.5 sec (background)
//test
Switcher switcher = SwitchersBase
@@ -52,7 +53,7 @@ void shouldReturnTrue_withThrottle() {
.flushExecutions()
.resetInputs()
.checkValue("value")
- .throttle(1000);
+ .throttle(1500);
for (int i = 0; i < 50; i++) {
assertTrue(switcher.isItOn());
@@ -60,6 +61,10 @@ void shouldReturnTrue_withThrottle() {
assertEquals(Boolean.FALSE,
CountDownHelper.waitUntil(10, false, switcher::isItOn));
+
+ for (int i = 0; i < 50; i++) {
+ assertFalse(switcher.isItOn());
+ }
}
}
diff --git a/src/test/java/com/switcherapi/client/SwitcherThrottle2Test.java b/src/test/java/com/switcherapi/client/SwitcherThrottle2Test.java
index 8c3e0a95..348ec80c 100644
--- a/src/test/java/com/switcherapi/client/SwitcherThrottle2Test.java
+++ b/src/test/java/com/switcherapi/client/SwitcherThrottle2Test.java
@@ -39,18 +39,18 @@ static void tearDown() {
void shouldRetrieveNewResponse_whenStrategyInputChanged() {
// Initial remote call
givenResponse(generateMockAuth(10)); //auth
- givenResponse(generateCriteriaResponse("true", false)); //criteria - sync (cached)
- givenResponse(generateCriteriaResponse("false", false)); //criteria - async (cached)
+ givenResponse(generateCriteriaResponse("true", false)); //criteria - sync
// Throttle period - should use cache
- givenResponse(generateCriteriaResponse("false", false)); //criteria - async after 1 sec (background)
+ givenResponse(generateCriteriaResponse("true", false)); //criteria - async (cached)
+ givenResponse(generateCriteriaResponse("false", false)); //criteria - async after 1.5 sec (background)
//test
SwitcherBuilder switcher = SwitchersBase
.getSwitcher(SwitchersBase.USECASE11)
.flushExecutions()
.resetInputs()
- .throttle(1000);
+ .throttle(1500);
for (int i = 0; i < 100; i++) {
assertTrue(switcher.checkValue("value").isItOn());
From 85b86e148ff6fec01bf83caf8f74f1052891c7bf Mon Sep 17 00:00:00 2001
From: petruki <31597636+petruki@users.noreply.github.com>
Date: Mon, 26 Oct 2026 19:02:44 -0700
Subject: [PATCH 2/2] fix(pom): removed unnecessary sonar settings
---
pom.xml | 1 -
1 file changed, 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index cfdded97..43a129d3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -186,7 +186,6 @@
${project.groupId}:${project.artifactId}
${project.build.outputDirectory}
${project.build.testOutputDirectory}
- ${settings.localRepository}/**/*.jar
false