Skip to content

Commit 2c223ac

Browse files
committed
add more test for sem-version
1 parent 4e5ead9 commit 2c223ac

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

core-api/src/test/java/com/optimizely/ab/config/audience/AudienceConditionEvaluationTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,14 @@ public void missingAttribute() throws Exception {
203203
"Audience condition \"{name='browser_type', type='custom_attribute', match='gt', value=20}\" evaluated to UNKNOWN because no value was passed for user attribute \"browser_type\"");
204204
}
205205

206+
@Test
207+
public void missingAttribute_semVersion() throws Exception {
208+
UserAttribute testInstance = new UserAttribute("app_version", "custom_attribute", "semver_eq", "1.0.2");
209+
assertNull(testInstance.evaluate(null, Collections.EMPTY_MAP));
210+
logbackVerifier.expectMessage(Level.DEBUG,
211+
"Audience condition \"{name='app_version', type='custom_attribute', match='semver_eq', value='1.0.2'}\" evaluated to UNKNOWN because no value was passed for user attribute \"app_version\"");
212+
}
213+
206214
/**
207215
* Verify that UserAttribute.evaluate returns null on passing null attribute object.
208216
*/

0 commit comments

Comments
 (0)