Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

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: 2 additions & 2 deletions providers/configcat/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>
<groupId>dev.openfeature.contrib.providers</groupId>
<artifactId>configcat</artifactId>
<version>0.0.2</version> <!--x-release-please-version -->
<version>0.1.0</version> <!--x-release-please-version -->

<name>configcat</name>
<description>configcat provider for Java</description>
Expand All @@ -20,7 +20,7 @@
<dependency>
<groupId>com.configcat</groupId>
<artifactId>configcat-java-client</artifactId>
<version>8.4.0</version>
<version>9.0.0</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class ContextTransformer {

protected static User transform(EvaluationContext ctx) {
User.Builder userBuilder = User.newBuilder();
Map<String, String> customMap = new HashMap<>();
Map<String, Object> customMap = new HashMap<>();
ctx.asObjectMap().forEach((k, v) -> {
switch (k) {
case CONTEXT_COUNTRY:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ void contextTransformTest() {
evaluationContext.add("Email", email);
evaluationContext.add(customPropertyKey, customPropertyValue);

HashMap<String, String > customMap = new HashMap<>();
HashMap<String, Object > customMap = new HashMap<>();
customMap.put(customPropertyKey, customPropertyValue);
User expectedUser = User.newBuilder().email(email).country(country).custom(customMap).build(userId);
User transformedUser = ContextTransformer.transform(evaluationContext);
Expand Down
221 changes: 175 additions & 46 deletions providers/configcat/src/test/resources/features.json
Original file line number Diff line number Diff line change
@@ -1,88 +1,217 @@
{
"p": {
"s": "80xCU/SlDz1lCiWFaxIBjyJeJecWjq46T4eu6GtozkM="
},
"f": {
"enabledFeature": {
"v": true
"t": 0,
"v": {
"b": true
}
},
"intSetting": {
"v": 5
"t": 2,
"v": {
"i": 5
}
},
"doubleSetting": {
"v": 3.14
"t": 3,
"v": {
"d": 3.14
}
},
"stringSetting": {
"v": "test"
"t": 1,
"v": {
"s": "test"
}
},
"userIdMatching": {
"v": false,
"t": 0,
"r": [
{
"o": 0,
"a": "Identifier",
"t": 2,
"c": "@matching.com",
"v": true
"c": [
{
"u": {
"a": "Identifier",
"c": 2,
"l": [
"@matching.com"
]
}
}
],
"p": [
{
"p": 100,
"v": {
"b": true
},
"i": "bcfb84a7"
}
]
}
]
],
"v": {
"b": false
},
"i": "430bded3"
},
"emailMatching": {
"v": false,
"t": 0,
"r": [
{
"o": 0,
"a": "Email",
"t": 2,
"c": "@matching.com",
"v": true
"c": [
{
"u": {
"a": "Email",
"c": 2,
"l": [
"@matching.com"
]
}
}
],
"p": [
{
"p": 100,
"v": {
"b": true
},
"i": "bcfb84a7"
}
]
}
]
],
"v": {
"b": false
},
"i": "430bded3"
},
"countryMatching": {
"v": false,
"t": 0,
"r": [
{
"o": 0,
"a": "Country",
"t": 2,
"c": "country1",
"v": true
"c": [
{
"u": {
"a": "Country",
"c": 2,
"l": [
"country1"
]
}
}
],
"p": [
{
"p": 100,
"v": {
"b": true
},
"i": "bcfb84a7"
}
]
}
]
],
"v": {
"b": false
},
"i": "430bded3"
},
"userIdMatchingInt": {
"v": 111,
"t": 2,
"r": [
{
"o": 0,
"a": "Identifier",
"t": 2,
"c": "@matching.com",
"v": 123
"c": [
{
"u": {
"a": "Identifier",
"c": 2,
"l": [
"@matching.com"
]
}
}
],
"p": [
{
"p": 100,
"v": {
"i": 123
},
"i": "bcfb84a7"
}
]
}
]
],
"v": {
"i": 111
},
"i": "430bded3"
},
"userIdMatchingDouble": {
"v": 0.1,
"t": 3,
"r": [
{
"o": 0,
"a": "Identifier",
"t": 2,
"c": "@matching.com",
"v": 1.23
"c": [
{
"u": {
"a": "Identifier",
"c": 2,
"l": [
"@matching.com"
]
}
}
],
"p": [
{
"p": 100,
"v": {
"d": 1.23
},
"i": "bcfb84a7"
}
]
}
]
],
"v": {
"d": 0.1
},
"i": "430bded3"
},
"userIdMatchingStr": {
"v": "fallback",
"t": 1,
"r": [
{
"o": 0,
"a": "Identifier",
"t": 2,
"c": "@matching.com",
"v": "expected"
"c": [
{
"u": {
"a": "Identifier",
"c": 2,
"l": [
"@matching.com"
]
}
}
],
"p": [
{
"p": 100,
"v": {
"s": "expected"
},
"i": "bcfb84a7"
}
]
}
]
],
"v": {
"s": "fallback"
},
"i": "430bded3"
}
}
}