@@ -1067,6 +1067,7 @@ func Test_NonDeterministicCheck(t *testing.T) {
10671067func Test_IsDecisionMatchEvent_UpsertWorkflowSearchAttributes (t * testing.T ) {
10681068 diType := s .DecisionTypeUpsertWorkflowSearchAttributes
10691069 eType := s .EventTypeUpsertWorkflowSearchAttributes
1070+ strictMode := false
10701071
10711072 testCases := []struct {
10721073 name string
@@ -1097,7 +1098,7 @@ func Test_IsDecisionMatchEvent_UpsertWorkflowSearchAttributes(t *testing.T) {
10971098 EventType : & eType ,
10981099 UpsertWorkflowSearchAttributesEventAttributes : & s.UpsertWorkflowSearchAttributesEventAttributes {},
10991100 },
1100- expected : false ,
1101+ expected : true ,
11011102 },
11021103 {
11031104 name : "attributes match" ,
@@ -1119,7 +1120,37 @@ func Test_IsDecisionMatchEvent_UpsertWorkflowSearchAttributes(t *testing.T) {
11191120
11201121 for _ , testCase := range testCases {
11211122 t .Run (testCase .name , func (t * testing.T ) {
1122- require .Equal (t , testCase .expected , isDecisionMatchEvent (testCase .decision , testCase .event , false ))
1123+ require .Equal (t , testCase .expected , isDecisionMatchEvent (testCase .decision , testCase .event , strictMode ))
1124+ })
1125+ }
1126+
1127+ strictMode = true
1128+
1129+ testCases = []struct {
1130+ name string
1131+ decision * s.Decision
1132+ event * s.HistoryEvent
1133+ expected bool
1134+ }{
1135+ {
1136+ name : "attributes not match" ,
1137+ decision : & s.Decision {
1138+ DecisionType : & diType ,
1139+ UpsertWorkflowSearchAttributesDecisionAttributes : & s.UpsertWorkflowSearchAttributesDecisionAttributes {
1140+ SearchAttributes : & s.SearchAttributes {},
1141+ },
1142+ },
1143+ event : & s.HistoryEvent {
1144+ EventType : & eType ,
1145+ UpsertWorkflowSearchAttributesEventAttributes : & s.UpsertWorkflowSearchAttributesEventAttributes {},
1146+ },
1147+ expected : false ,
1148+ },
1149+ }
1150+
1151+ for _ , testCase := range testCases {
1152+ t .Run (testCase .name , func (t * testing.T ) {
1153+ require .Equal (t , testCase .expected , isDecisionMatchEvent (testCase .decision , testCase .event , strictMode ))
11231154 })
11241155 }
11251156}
0 commit comments