Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2651858
Bump org.sonatype.central:central-publishing-maven-plugin
dependabot[bot] Sep 23, 2025
aaaa232
Bump io.split.client:java-client from 4.17.0 to 4.18.1
dependabot[bot] Sep 30, 2025
42fbf71
Merge pull request #42 from splitio/dependabot/maven/development/io.s…
ZamoraEmmanuel Oct 3, 2025
cf7c6cb
Merge branch 'development' into dependabot/maven/development/org.sona…
ZamoraEmmanuel Oct 3, 2025
e34809a
Bump dev.openfeature:sdk from 1.17.0 to 1.18.1
dependabot[bot] Oct 3, 2025
39eda40
Merge pull request #41 from splitio/dependabot/maven/development/org.…
ZamoraEmmanuel Oct 3, 2025
23ab8a2
Merge branch 'development' into dependabot/maven/development/dev.open…
ZamoraEmmanuel Oct 3, 2025
87fa64c
Bump org.apache.maven.plugins:maven-surefire-plugin from 3.5.3 to 3.5.4
dependabot[bot] Oct 3, 2025
a596802
Merge pull request #40 from splitio/dependabot/maven/development/dev.…
ZamoraEmmanuel Oct 3, 2025
52eb59d
Merge branch 'development' into dependabot/maven/development/org.apac…
ZamoraEmmanuel Oct 3, 2025
11acec0
Merge pull request #38 from splitio/dependabot/maven/development/org.…
ZamoraEmmanuel Oct 3, 2025
3c80803
Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.11.3 to 3.12.0
dependabot[bot] Oct 3, 2025
285189e
Bump org.mockito:mockito-core from 5.19.0 to 5.20.0
dependabot[bot] Oct 3, 2025
7685575
[FME-10341] fix vulns, update versions and add shutdown
ZamoraEmmanuel Oct 3, 2025
7892e4a
restore value in test
ZamoraEmmanuel Oct 3, 2025
e677c72
prepare release
ZamoraEmmanuel Oct 6, 2025
3cf8834
Merge pull request #44 from splitio/dependabot/maven/development/org.…
ZamoraEmmanuel Oct 6, 2025
c84d65c
Merge branch 'development' into dependabot/maven/development/org.mock…
ZamoraEmmanuel Oct 6, 2025
7922d9c
Bump org.apache.maven.plugins:maven-compiler-plugin
dependabot[bot] Oct 6, 2025
4a5eaa3
Merge pull request #46 from splitio/dependabot/maven/development/org.…
ZamoraEmmanuel Oct 6, 2025
ebf5957
Merge branch 'development' into dependabot/maven/development/org.apac…
ZamoraEmmanuel Oct 6, 2025
a801da1
Merge pull request #45 from splitio/dependabot/maven/development/org.…
ZamoraEmmanuel Oct 6, 2025
2f1165b
Merge branch 'development' into fme-10341
ZamoraEmmanuel Oct 6, 2025
a4a4c5c
Update CHANGES.txt
ZamoraEmmanuel Oct 6, 2025
8d39da6
Merge pull request #47 from splitio/fme-10341
ZamoraEmmanuel Oct 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
1.2.1 (October 6, 2025)
- Updated dependencies to fix vulnerabilities.
- Added support for the shutdown feature.

1.2.0 (September 3, 2025)
- Updated `io.split.client` dependency to 4.16.1
- Updated `dev.openfeature` dependency to 1.17.0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This SDK is compatible with Java 11 and higher.
<dependency>
<groupId>io.split.openfeature</groupId>
<artifactId>split-openfeature-provider</artifactId>
<version>1.2.0</version>
<version>1.2.1</version>
</dependency>
```
### Configure it
Expand Down
49 changes: 25 additions & 24 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.split.openfeature</groupId>
<artifactId>split-openfeature-provider</artifactId>
<version>1.2.0</version>
<version>1.2.1</version>
<name>split-openfeature-provider-java</name>
<description>Split OpenFeature Java Provider</description>
<url>www.split.io</url>
Expand Down Expand Up @@ -47,33 +47,18 @@
<dependency>
<groupId>io.split.client</groupId>
<artifactId>java-client</artifactId>
<version>4.17.0</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.14</version>
<version>4.18.1</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>5.19.0</version>
<version>5.20.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>dev.openfeature</groupId>
<artifactId>sdk</artifactId>
<version>1.17.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.20.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.20.0</version>
<version>1.18.1</version>
</dependency>
</dependencies>
<build>
Expand All @@ -85,18 +70,34 @@
<artifactId>maven-clean-plugin</artifactId>
<version>3.5.0</version>
</plugin>
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>12.1.6</version>
<configuration>
<nvdApiKey>41aa3456-48f3-466a-a8ea-db1e84caba36</nvdApiKey>
<failBuildOnCVSS>7</failBuildOnCVSS>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.0</version>
<version>3.14.1</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.3</version>
<version>3.5.4</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
Expand Down Expand Up @@ -125,7 +126,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.0</version>
<version>3.14.1</version>
<configuration>
<source>11</source>
<target>11</target>
Expand All @@ -134,7 +135,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.11.3</version>
<version>3.12.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand Down Expand Up @@ -178,7 +179,7 @@
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.7.0</version>
<version>0.9.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/io/split/openfeature/SplitProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ public Map<String, Object> transformContext(EvaluationContext context) {
return context.asObjectMap();
}

@Override
public void shutdown() {
client.destroy();
}

private SplitResult evaluateTreatment(String key, EvaluationContext evaluationContext) {
String id = evaluationContext.getTargetingKey();
if (id == null || id.isEmpty()) {
Expand Down
14 changes: 5 additions & 9 deletions src/main/java/io/split/openfeature/utils/Serialization.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package io.split.openfeature.utils;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.Map;

import dev.openfeature.sdk.ErrorCode;
import dev.openfeature.sdk.exceptions.ParseError;

import java.util.Map;
import io.split.client.utils.Json;

public class Serialization {

Expand All @@ -15,10 +13,8 @@ private Serialization() {

public static Map<String, Object> stringToMap(final String obj) {
try {
return new ObjectMapper()
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
.readValue(obj, Map.class);
} catch (JsonProcessingException e) {
return Json.fromJson(obj, Map.class);
} catch (Exception e) {
throw new ParseError(ErrorCode.PARSE_ERROR.name());
}
}
Expand Down
12 changes: 10 additions & 2 deletions src/test/java/io/split/openfeature/ClientTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@
public class ClientTest {
OpenFeatureAPI openFeatureAPI;
Client client;
SplitClient splitClient;

@BeforeEach
public void init() {
openFeatureAPI = OpenFeatureAPI.getInstance();
try {
SplitClientConfig config = SplitClientConfig.builder().splitFile("src/test/resources/split.yaml").build();
SplitClient client = SplitFactoryBuilder.build("localhost", config).client();
openFeatureAPI.setProviderAndWait(new SplitProvider(client));
splitClient = SplitFactoryBuilder.build("localhost", config).client();
openFeatureAPI.setProviderAndWait(new SplitProvider(splitClient));
} catch (URISyntaxException | IOException e) {
System.out.println("Unexpected Exception occurred initializing Split Provider.");
}
Expand Down Expand Up @@ -267,6 +268,13 @@ public void getObjectFailTest() {
assertNull(details.getVariant());
}

@Test
public void destroySplitClientTest() {
assertEquals("32", splitClient.getTreatment("key","int_feature"));
openFeatureAPI.shutdown();
assertEquals("control", splitClient.getTreatment("key","int_feature"));
}

private Value mapToValue(Map<String, Value> map) {
return new Value(new MutableStructure(map));
}
Expand Down
15 changes: 11 additions & 4 deletions src/test/java/io/split/openfeature/SplitProviderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -420,23 +420,23 @@ public void evalStructureComplexTest() {
Instant instant = Instant.ofEpochMilli(1665698754828L);
Value treatment = mapToValue(Map.of(
"string", new Value("blah"),
"int", new Value(10),
"int", new Value(10D),
"double", new Value(100D),
"bool", new Value(true),
"struct", mapToValue(Map.of(
"foo", new Value("bar"),
"baz", new Value(10),
"baz", new Value(10D),
"innerMap", mapToValue(Map.of(
"aa", new Value("bb"))))),
"list", new Value(
List.of(
new Value(1),
new Value(1D),
new Value(true),
mapToValue(Map.of(
"cc", new Value("dd")
)),
mapToValue(Map.of(
"ee", new Value(1)
"ee", new Value(1D)
)))),
"dateTime", new Value(instant)
));
Expand Down Expand Up @@ -525,6 +525,13 @@ public void trackTrafficTypeErrorTest() {
verifyNoInteractions(mockSplitClient);
}

@Test
public void destroySplitClientTest() {
SplitProvider provider = new SplitProvider(mockSplitClient);
provider.shutdown();
verify(mockSplitClient).destroy();
}

private Value mapToValue(Map<String, Value> map) {
return new Value(new MutableStructure(map));
}
Expand Down
Loading