@@ -24,10 +24,10 @@ import (
24
24
"path/filepath"
25
25
"testing"
26
26
27
+ jsoniter "github.com/json-iterator/go"
27
28
datafileEntities "github.com/optimizely/go-sdk/v2/pkg/config/datafileprojectconfig/entities"
28
29
"github.com/optimizely/go-sdk/v2/pkg/entities"
29
30
"github.com/optimizely/go-sdk/v2/pkg/logging"
30
- jsoniter "github.com/json-iterator/go"
31
31
32
32
"github.com/stretchr/testify/assert"
33
33
)
@@ -736,11 +736,11 @@ func TestHoldoutConfig_EmptyHoldouts(t *testing.T) {
736
736
datafile := & datafileEntities.Datafile {
737
737
Version : "4" ,
738
738
AccountID : "12345" ,
739
- ProjectID : "67890" ,
739
+ ProjectID : "67890" ,
740
740
Revision : "1" ,
741
741
Holdouts : []datafileEntities.Holdout {},
742
742
}
743
-
743
+
744
744
jsonBytes , err := jsoniter .Marshal (datafile )
745
745
assert .NoError (t , err )
746
746
@@ -786,7 +786,7 @@ func TestHoldoutConfig_HoldoutMapping(t *testing.T) {
786
786
},
787
787
{
788
788
ExperimentCore : datafileEntities.ExperimentCore {
789
- ID : "excluded_holdout" ,
789
+ ID : "excluded_holdout" ,
790
790
Key : "excluded_ho" ,
791
791
},
792
792
Status : datafileEntities .HoldoutStatusRunning ,
@@ -795,7 +795,7 @@ func TestHoldoutConfig_HoldoutMapping(t *testing.T) {
795
795
},
796
796
},
797
797
}
798
-
798
+
799
799
jsonBytes , err := jsoniter .Marshal (datafile )
800
800
assert .NoError (t , err )
801
801
@@ -840,7 +840,7 @@ func TestHoldoutConfig_GetHoldout(t *testing.T) {
840
840
},
841
841
},
842
842
}
843
-
843
+
844
844
jsonBytes , err := jsoniter .Marshal (datafile )
845
845
assert .NoError (t , err )
846
846
@@ -903,7 +903,7 @@ func TestGetHoldoutsForFlag_Logic(t *testing.T) {
903
903
},
904
904
},
905
905
}
906
-
906
+
907
907
jsonBytes , err := jsoniter .Marshal (datafile )
908
908
assert .NoError (t , err )
909
909
@@ -962,7 +962,7 @@ func TestGetHoldoutsForFlag_Caching(t *testing.T) {
962
962
},
963
963
},
964
964
}
965
-
965
+
966
966
jsonBytes , err := jsoniter .Marshal (datafile )
967
967
assert .NoError (t , err )
968
968
@@ -975,7 +975,7 @@ func TestGetHoldoutsForFlag_Caching(t *testing.T) {
975
975
// First call should populate cache
976
976
holdouts1 := config .GetHoldoutsForFlag ("feature_1" )
977
977
assert .Len (t , holdouts1 , 1 )
978
-
978
+
979
979
// Cache should now have entry
980
980
assert .Len (t , config .flagHoldoutsMap , 1 )
981
981
assert .Contains (t , config .flagHoldoutsMap , "flag_1" )
0 commit comments