use of com.optimizely.ab.config.ProjectConfig in project java-sdk by optimizely.
the class GsonConfigParserTest method parseFeatureVariablesWithJsonNative.
@Test
public void parseFeatureVariablesWithJsonNative() throws Exception {
JsonSimpleConfigParser parser = new JsonSimpleConfigParser();
ProjectConfig actual = parser.parseProjectConfig(validConfigJsonV4());
// native "json" type
FeatureFlag featureFlag = actual.getFeatureKeyMapping().get("multi_variate_future_feature");
FeatureVariable variable = featureFlag.getVariableKeyToFeatureVariableMap().get("json_native");
assertEquals(variable.getType(), "json");
}
use of com.optimizely.ab.config.ProjectConfig in project java-sdk by optimizely.
the class JsonSimpleConfigParserTest method parseProjectConfigV2.
@Test
public void parseProjectConfigV2() throws Exception {
JsonSimpleConfigParser parser = new JsonSimpleConfigParser();
ProjectConfig actual = parser.parseProjectConfig(validConfigJsonV2());
ProjectConfig expected = validProjectConfigV2();
verifyProjectConfig(actual, expected);
}
use of com.optimizely.ab.config.ProjectConfig in project java-sdk by optimizely.
the class JsonSimpleConfigParserTest method parseProjectConfigV4.
@Test
public void parseProjectConfigV4() throws Exception {
JsonSimpleConfigParser parser = new JsonSimpleConfigParser();
ProjectConfig actual = parser.parseProjectConfig(validConfigJsonV4());
ProjectConfig expected = validProjectConfigV4();
verifyProjectConfig(actual, expected);
}
use of com.optimizely.ab.config.ProjectConfig in project java-sdk by optimizely.
the class JsonSimpleConfigParserTest method parseFeatureVariablesWithJsonPatched.
@Test
public void parseFeatureVariablesWithJsonPatched() throws Exception {
JsonSimpleConfigParser parser = new JsonSimpleConfigParser();
ProjectConfig actual = parser.parseProjectConfig(validConfigJsonV4());
// "string" type + "json" subType
FeatureFlag featureFlag = actual.getFeatureKeyMapping().get("multi_variate_feature");
FeatureVariable variable = featureFlag.getVariableKeyToFeatureVariableMap().get("json_patched");
assertEquals(variable.getType(), "json");
}
use of com.optimizely.ab.config.ProjectConfig in project java-sdk by optimizely.
the class JsonSimpleConfigParserTest method parseNullFeatureEnabledProjectConfigV4.
@Test
public void parseNullFeatureEnabledProjectConfigV4() throws Exception {
JsonSimpleConfigParser parser = new JsonSimpleConfigParser();
ProjectConfig actual = parser.parseProjectConfig(nullFeatureEnabledConfigJsonV4());
assertNotNull(actual);
assertNotNull(actual.getExperiments());
assertNotNull(actual.getFeatureFlags());
}
Aggregations