@@ -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,49 +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
706- 	mW .Reset ()
715+ 	mLocal .Reset ()
707716	clientNotReady .Treatment ("test" , "feature" , nil )
708- 	if  ! mW .Matches (strings .Replace (expectedMessage1 , "{operation}" , "Treatment" , 1 )) {
717+ 	if  ! mLocal .Matches (strings .Replace (expectedMessage1 , "{operation}" , "Treatment" , 1 )) {
709718		t .Error ("Wrong message" )
710719	}
711720
712- 	mW .Reset ()
721+ 	mLocal .Reset ()
713722	clientNotReady .Treatments ("test" , []string {"feature" , "feature_2" }, nil )
714- 	if  ! mW .Matches (strings .Replace (expectedMessage2 , "{operation}" , "Treatments" , 1 )) {
723+ 	if  ! mLocal .Matches (strings .Replace (expectedMessage2 , "{operation}" , "Treatments" , 1 )) {
715724		t .Error ("Wrong message" )
716725	}
717726
718- 	mW .Reset ()
727+ 	mLocal .Reset ()
719728	clientNotReady .TreatmentWithConfig ("test" , "feature" , nil )
720- 	if  ! mW .Matches (strings .Replace (expectedMessage1 , "{operation}" , "TreatmentWithConfig" , 1 )) {
729+ 	if  ! mLocal .Matches (strings .Replace (expectedMessage1 , "{operation}" , "TreatmentWithConfig" , 1 )) {
721730		t .Error ("Wrong message" )
722731	}
723732
724- 	mW .Reset ()
733+ 	mLocal .Reset ()
725734	clientNotReady .TreatmentsWithConfig ("test" , []string {"feature" , "feature_2" }, nil )
726- 	if  ! mW .Matches (strings .Replace (expectedMessage2 , "{operation}" , "TreatmentsWithConfig" , 1 )) {
727- 		t .Error ("Wrong message" , mW .messages )
735+ 	if  ! mLocal .Matches (strings .Replace (expectedMessage2 , "{operation}" , "TreatmentsWithConfig" , 1 )) {
736+ 		t .Error ("Wrong message" , mLocal .messages )
728737	}
729738
730- 	mW .Reset ()
739+ 	mLocal .Reset ()
731740	expected  :=  "Track: the SDK is not ready, results may be incorrect. Make sure to wait for SDK readiness before using this method" 
732- 	expectedTrack (clientNotReady .Track ("key" , "traffic" , "eventType" , nil , nil ), expected , t )
733741
734- 	mW .Reset ()
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 ()
735749	maganerNotReady .Split ("feature" )
736- 	if  ! mW .Matches (strings .Replace (expectedMessage , "{operation}" , "Split" , 1 )) {
750+ 	if  ! mLocal .Matches (strings .Replace (expectedMessage , "{operation}" , "Split" , 1 )) {
737751		t .Error ("Wrong message" )
738752	}
739753
740- 	mW .Reset ()
754+ 	mLocal .Reset ()
741755	maganerNotReady .Splits ()
742- 	if  ! mW .Matches (strings .Replace (expectedMessage , "{operation}" , "Splits" , 1 )) {
756+ 	if  ! mLocal .Matches (strings .Replace (expectedMessage , "{operation}" , "Splits" , 1 )) {
743757		t .Error ("Wrong message" )
744758	}
745759
746- 	mW .Reset ()
760+ 	mLocal .Reset ()
747761	maganerNotReady .SplitNames ()
748- 	if  ! mW .Matches (strings .Replace (expectedMessage , "{operation}" , "SplitNames" , 1 )) {
762+ 	if  ! mLocal .Matches (strings .Replace (expectedMessage , "{operation}" , "SplitNames" , 1 )) {
749763		t .Error ("Wrong message" )
750764	}
751765
0 commit comments