11/**
2- * Copyright 2025, Optimizely
2+ * Copyright 2025-2026 , Optimizely
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -142,8 +142,8 @@ public void testIgnoresCacheWhenOptionGiven() {
142142 assertNotNull (decision .getCmabUuid ());
143143
144144 Map <String , Object > expectedAttributes = new HashMap <>();
145- expectedAttributes .put ("age " , 25 );
146- expectedAttributes .put ("location " , "USA" );
145+ expectedAttributes .put ("66 " , 25 );
146+ expectedAttributes .put ("77 " , "USA" );
147147 verify (mockCmabClient ).fetchDecision (eq ("exp1" ), eq ("user123" ), eq (expectedAttributes ), anyString ());
148148 }
149149
@@ -199,8 +199,8 @@ public void testNewDecisionWhenHashChanges() {
199199 assertEquals ("varE" , decision .getVariationId ());
200200
201201 Map <String , Object > expectedAttributes = new HashMap <>();
202- expectedAttributes .put ("age " , 25 );
203- expectedAttributes .put ("location " , "USA" );
202+ expectedAttributes .put ("66 " , 25 );
203+ expectedAttributes .put ("77 " , "USA" );
204204 verify (mockCmabClient ).fetchDecision (eq ("exp1" ), eq ("user123" ), eq (expectedAttributes ), anyString ());
205205 }
206206
@@ -221,12 +221,11 @@ public void testOnlyCmabAttributesPassedToClient() {
221221 List <OptimizelyDecideOption > options = Arrays .asList (OptimizelyDecideOption .IGNORE_CMAB_CACHE );
222222 CmabDecision decision = cmabService .getDecision (mockProjectConfig , mockUserContext , "exp1" , options );
223223
224- // Verify only age and location are passed (attributes configured in setUp)
225224 Map <String , Object > expectedAttributes = new HashMap <>();
226- expectedAttributes .put ("age " , 25 );
227- expectedAttributes .put ("location " , "USA" );
225+ expectedAttributes .put ("66 " , 25 );
226+ expectedAttributes .put ("77 " , "USA" );
228227 verify (mockCmabClient ).fetchDecision (eq ("exp1" ), eq ("user123" ), eq (expectedAttributes ), anyString ());
229-
228+
230229 assertEquals ("varF" , decision .getVariationId ());
231230 assertNotNull (decision .getCmabUuid ());
232231 }
@@ -275,10 +274,9 @@ public void testAttributeFilteringBehavior() {
275274 List <OptimizelyDecideOption > options = Arrays .asList (OptimizelyDecideOption .IGNORE_CMAB_CACHE );
276275 cmabService .getDecision (mockProjectConfig , mockUserContext , "exp1" , options );
277276
278- // Verify only the configured attributes (age, location) are passed
279277 Map <String , Object > expectedAttributes = new HashMap <>();
280- expectedAttributes .put ("age " , 25 );
281- expectedAttributes .put ("location " , "USA" );
278+ expectedAttributes .put ("66 " , 25 );
279+ expectedAttributes .put ("77 " , "USA" );
282280 verify (mockCmabClient ).fetchDecision (eq ("exp1" ), eq ("user123" ), eq (expectedAttributes ), anyString ());
283281 }
284282
@@ -306,9 +304,8 @@ public void testMissingAttributeMappingBehavior() {
306304 List <OptimizelyDecideOption > options = Arrays .asList (OptimizelyDecideOption .IGNORE_CMAB_CACHE );
307305 cmabService .getDecision (mockProjectConfig , mockUserContext , "exp1" , options );
308306
309- // Should only include the attribute that exists (age with ID 66)
310307 Map <String , Object > expectedAttributes = new HashMap <>();
311- expectedAttributes .put ("age " , 25 );
308+ expectedAttributes .put ("66 " , 25 );
312309 verify (mockCmabClient ).fetchDecision (eq ("exp1" ), eq ("user123" ), eq (expectedAttributes ), anyString ());
313310
314311 // Verify debug log was called for missing attribute
@@ -328,13 +325,9 @@ public void testMissingUserAttributeBehavior() {
328325 List <OptimizelyDecideOption > options = Arrays .asList (OptimizelyDecideOption .IGNORE_CMAB_CACHE );
329326 cmabService .getDecision (mockProjectConfig , mockUserContext , "exp1" , options );
330327
331- // Should only include the attribute the user has
332328 Map <String , Object > expectedAttributes = new HashMap <>();
333- expectedAttributes .put ("age " , 25 );
329+ expectedAttributes .put ("66 " , 25 );
334330 verify (mockCmabClient ).fetchDecision (eq ("exp1" ), eq ("user123" ), eq (expectedAttributes ), anyString ());
335-
336- // Remove the logger verification if it's causing issues
337- // verify(mockLogger).debug(anyString(), eq("location"), eq("exp1"));
338331 }
339332
340333 @ Test
0 commit comments