@@ -237,3 +237,35 @@ func Test_LruAssignmentLogger_variationOscillationLogsAll(t *testing.T) {
237237
238238 innerLogger .AssertNumberOfCalls (t , "LogAssignment" , 4 )
239239}
240+
241+ func Test_LruAssignmentLogger_proxyLogBanditAction (t * testing.T ) {
242+ innerLogger := new (mockLogger )
243+ innerLogger .On ("LogAssignment" , mock .Anything ).Return ()
244+ innerLogger .On ("LogBanditAction" , mock .Anything ).Return ()
245+
246+ logger , err := NewLruAssignmentLogger (innerLogger , 1000 )
247+ assert .NoError (t , err )
248+
249+ event := BanditEvent {
250+ FlagKey : "flag" ,
251+ BanditKey : "bandit" ,
252+ Subject : "subject" ,
253+ Action : "action" ,
254+ ActionProbability : 0.1 ,
255+ OptimalityGap : 0.1 ,
256+ ModelVersion : "model-version" ,
257+ Timestamp : "timestamp" ,
258+ SubjectNumericAttributes : map [string ]float64 {},
259+ SubjectCategoricalAttributes : map [string ]string {},
260+ ActionNumericAttributes : map [string ]float64 {},
261+ ActionCategoricalAttributes : map [string ]string {},
262+ MetaData : map [string ]string {},
263+ }
264+
265+ banditLogger := logger .(BanditActionLogger )
266+
267+ banditLogger .LogBanditAction (event )
268+ banditLogger .LogBanditAction (event )
269+
270+ innerLogger .AssertNumberOfCalls (t , "LogBanditAction" , 2 )
271+ }
0 commit comments