@@ -666,7 +666,16 @@ func TestConsumerFactoryFlagSets(t *testing.T) {
666666
667667func  TestNotReadyYet (t  * testing.T ) {
668668	nonReadyUsages  :=  0 
669- 	logger  :=  getMockedLogger ()
669+ 	mLocal  :=  MockWriter {}
670+ 	logger  :=  logging .NewLogger (& logging.LoggerOptions {
671+ 		LogLevel :      logging .LevelInfo ,
672+ 		ErrorWriter :   & mLocal ,
673+ 		WarningWriter : & mLocal ,
674+ 		InfoWriter :    & mLocal ,
675+ 		DebugWriter :   nil ,
676+ 		VerboseWriter : nil ,
677+ 	})
678+ 	//logger := getMockedLogger() 
670679	telemetryStorage  :=  mocks.MockTelemetryStorage {
671680		RecordNonReadyUsageCall : func () {
672681			nonReadyUsages ++ 
@@ -703,40 +712,54 @@ func TestNotReadyYet(t *testing.T) {
703712	expectedMessage1  :=  "{operation}: the SDK is not ready, results may be incorrect for feature flag feature. Make sure to wait for SDK readiness before using this method" 
704713	expectedMessage2  :=  "{operation}: the SDK is not ready, results may be incorrect for feature flags feature, feature_2. Make sure to wait for SDK readiness before using this method" 
705714
715+ 	mLocal .Reset ()
706716	clientNotReady .Treatment ("test" , "feature" , nil )
707- 	if  ! mW .Matches (strings .Replace (expectedMessage1 , "{operation}" , "Treatment" , 1 )) {
717+ 	if  ! mLocal .Matches (strings .Replace (expectedMessage1 , "{operation}" , "Treatment" , 1 )) {
708718		t .Error ("Wrong message" )
709719	}
710720
721+ 	mLocal .Reset ()
711722	clientNotReady .Treatments ("test" , []string {"feature" , "feature_2" }, nil )
712- 	if  ! mW .Matches (strings .Replace (expectedMessage2 , "{operation}" , "Treatments" , 1 )) {
723+ 	if  ! mLocal .Matches (strings .Replace (expectedMessage2 , "{operation}" , "Treatments" , 1 )) {
713724		t .Error ("Wrong message" )
714725	}
715726
727+ 	mLocal .Reset ()
716728	clientNotReady .TreatmentWithConfig ("test" , "feature" , nil )
717- 	if  ! mW .Matches (strings .Replace (expectedMessage1 , "{operation}" , "TreatmentWithConfig" , 1 )) {
729+ 	if  ! mLocal .Matches (strings .Replace (expectedMessage1 , "{operation}" , "TreatmentWithConfig" , 1 )) {
718730		t .Error ("Wrong message" )
719731	}
720732
733+ 	mLocal .Reset ()
721734	clientNotReady .TreatmentsWithConfig ("test" , []string {"feature" , "feature_2" }, nil )
722- 	if  ! mW .Matches (strings .Replace (expectedMessage2 , "{operation}" , "TreatmentsWithConfig" , 1 )) {
723- 		t .Error ("Wrong message" , mW .messages )
735+ 	if  ! mLocal .Matches (strings .Replace (expectedMessage2 , "{operation}" , "TreatmentsWithConfig" , 1 )) {
736+ 		t .Error ("Wrong message" , mLocal .messages )
724737	}
738+ 
739+ 	mLocal .Reset ()
725740	expected  :=  "Track: the SDK is not ready, results may be incorrect. Make sure to wait for SDK readiness before using this method" 
726- 	expectedTrack (clientNotReady .Track ("key" , "traffic" , "eventType" , nil , nil ), expected , t )
727741
742+ 	clientNotReady .Track ("key" , "traffic" , "eventType" , nil , nil )
743+ 	if  ! mLocal .Matches (expected ) {
744+ 		t .Error ("Wrong message" )
745+ 	}
746+ 	//expectedTrack(clientNotReady.Track("key", "traffic", "eventType", nil, nil), expected, t) 
747+ 
748+ 	mLocal .Reset ()
728749	maganerNotReady .Split ("feature" )
729- 	if  ! mW .Matches (strings .Replace (expectedMessage , "{operation}" , "Split" , 1 )) {
750+ 	if  ! mLocal .Matches (strings .Replace (expectedMessage , "{operation}" , "Split" , 1 )) {
730751		t .Error ("Wrong message" )
731752	}
732753
754+ 	mLocal .Reset ()
733755	maganerNotReady .Splits ()
734- 	if  ! mW .Matches (strings .Replace (expectedMessage , "{operation}" , "Splits" , 1 )) {
756+ 	if  ! mLocal .Matches (strings .Replace (expectedMessage , "{operation}" , "Splits" , 1 )) {
735757		t .Error ("Wrong message" )
736758	}
737759
760+ 	mLocal .Reset ()
738761	maganerNotReady .SplitNames ()
739- 	if  ! mW .Matches (strings .Replace (expectedMessage , "{operation}" , "SplitNames" , 1 )) {
762+ 	if  ! mLocal .Matches (strings .Replace (expectedMessage , "{operation}" , "SplitNames" , 1 )) {
740763		t .Error ("Wrong message" )
741764	}
742765
0 commit comments