use of com.optimizely.ab.config.FeatureVariable in project java-sdk by optimizely.
the class JacksonConfigParserTest 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.FeatureVariable in project java-sdk by optimizely.
the class GsonConfigParserTest 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.FeatureVariable in project java-sdk by optimizely.
the class JsonConfigParserTest method parseFeatureVariablesWithFutureType.
@Test
public void parseFeatureVariablesWithFutureType() throws Exception {
JsonSimpleConfigParser parser = new JsonSimpleConfigParser();
ProjectConfig actual = parser.parseProjectConfig(validConfigJsonV4());
// unknown type
FeatureFlag featureFlag = actual.getFeatureKeyMapping().get("multi_variate_future_feature");
FeatureVariable variable = featureFlag.getVariableKeyToFeatureVariableMap().get("future_variable");
assertEquals(variable.getType(), "future_type");
}
use of com.optimizely.ab.config.FeatureVariable in project java-sdk by optimizely.
the class JsonConfigParserTest 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.FeatureVariable in project java-sdk by optimizely.
the class JacksonConfigParserTest method parseFeatureVariablesWithFutureType.
@Test
public void parseFeatureVariablesWithFutureType() throws Exception {
JsonSimpleConfigParser parser = new JsonSimpleConfigParser();
ProjectConfig actual = parser.parseProjectConfig(validConfigJsonV4());
// unknown type
FeatureFlag featureFlag = actual.getFeatureKeyMapping().get("multi_variate_future_feature");
FeatureVariable variable = featureFlag.getVariableKeyToFeatureVariableMap().get("future_variable");
assertEquals(variable.getType(), "future_type");
}
Aggregations