Skip to content

Commit ba6f5ca

Browse files
authored
Merge pull request #470 from splitio/SDKS-7889
[SDKS-7889] Add YML in FileTypeEnum
2 parents 051be70 + ffd4de4 commit ba6f5ca

File tree

10 files changed

+36
-5
lines changed

10 files changed

+36
-5
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
4.11.0 (Jan 9, 2024)
22
- Added impressionsListener method in the IntegrationConfig builder to set Sync or Async Listener execution.
3+
- Fixed localhost to read files with yml ending.
34

45
4.10.2 (Dec 1, 2023)
56
- Added getTreatmentsByFlagSets without attributes.

client/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>io.split.client</groupId>
77
<artifactId>java-client-parent</artifactId>
8-
<version>4.10.2</version>
8+
<version>4.11.0</version>
99
</parent>
1010
<artifactId>java-client</artifactId>
1111
<packaging>jar</packaging>

client/src/main/java/io/split/client/SplitFactoryImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,7 @@ private SplitChangeFetcher createSplitChangeFetcher(SplitClientConfig splitClien
674674
case JSON:
675675
return new JsonLocalhostSplitChangeFetcher(inputStreamProvider);
676676
case YAML:
677+
case YML:
677678
return new YamlLocalhostSplitChangeFetcher(inputStreamProvider);
678679
default:
679680
_log.warn(LEGACY_LOG_MESSAGE);

client/src/main/java/io/split/client/utils/FileTypeEnum.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
public enum FileTypeEnum {
44
LEGACY,
55
YAML,
6+
YML,
67
JSON
78
}

client/src/test/java/io/split/client/LocalhostSplitFactoryYamlCompactSampleTest.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,29 @@ public void works() throws IOException, URISyntaxException {
4242
assertThat(client.getTreatmentWithConfig("user_e", "split_2").treatment(), is(equalTo("off")));
4343
assertThat(client.getTreatmentWithConfig("user_e", "split_2").config(), is(equalTo("{ \"size\" : 55 }")));
4444
}
45+
46+
@Test
47+
public void worksYML() throws IOException, URISyntaxException {
48+
49+
String file = getClass().getClassLoader().getResource("split_compact.yml").getFile();
50+
51+
SplitClientConfig config = SplitClientConfig.builder().splitFile(file).build();
52+
SplitFactory splitFactory = SplitFactoryBuilder.build("localhost", config);
53+
SplitClient client = splitFactory.client();
54+
55+
assertThat(client.getTreatment(null, "foo"), is(equalTo(Treatments.CONTROL)));
56+
assertThat(client.getTreatment("user_c", "foo"), is(equalTo(Treatments.CONTROL)));
57+
58+
assertThat(client.getTreatment("user_c", "split_1"), is(equalTo("off")));
59+
assertThat(client.getTreatmentWithConfig("user_c", "split_1").treatment(), is(equalTo("off")));
60+
assertThat(client.getTreatmentWithConfig("user_c", "split_1").config(), is(equalTo("{ \"size\" : 10 }")));
61+
62+
assertThat(client.getTreatment("user_d", "split_1"), is(equalTo("on")));
63+
assertThat(client.getTreatmentWithConfig("user_d", "split_1").treatment(), is(equalTo("on")));
64+
assertThat(client.getTreatmentWithConfig("user_d", "split_1").config(), is(nullValue()));
65+
66+
assertThat(client.getTreatment("user_e", "split_2"), is(equalTo("off")));
67+
assertThat(client.getTreatmentWithConfig("user_e", "split_2").treatment(), is(equalTo("off")));
68+
assertThat(client.getTreatmentWithConfig("user_e", "split_2").config(), is(equalTo("{ \"size\" : 55 }")));
69+
}
4570
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- split_1: {keys: user_c, treatment: 'off', config: '{ "size" : 10 }'}
2+
- split_1: {keys: user_d, treatment: 'on'}
3+
- split_2: {keys: user_e, treatment: 'off', config: '{ "size" : 55 }'}

pluggable-storage/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>java-client-parent</artifactId>
88
<groupId>io.split.client</groupId>
9-
<version>4.10.2</version>
9+
<version>4.11.0</version>
1010
</parent>
1111

1212
<version>2.1.0</version>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>io.split.client</groupId>
66
<artifactId>java-client-parent</artifactId>
7-
<version>4.10.2</version>
7+
<version>4.11.0</version>
88
<dependencyManagement>
99
<dependencies>
1010
<dependency>

redis-wrapper/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>java-client-parent</artifactId>
88
<groupId>io.split.client</groupId>
9-
<version>4.10.2</version>
9+
<version>4.11.0</version>
1010
</parent>
1111
<artifactId>redis-wrapper</artifactId>
1212
<version>3.1.0</version>

testing/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>io.split.client</groupId>
77
<artifactId>java-client-parent</artifactId>
8-
<version>4.10.2</version>
8+
<version>4.11.0</version>
99
</parent>
1010
<artifactId>java-client-testing</artifactId>
1111
<packaging>jar</packaging>

0 commit comments

Comments
 (0)