@@ -525,24 +525,15 @@ func TestLocalResolverProvider_Init_StateProviderError(t *testing.T) {
525525 }
526526}
527527
528- // TestLocalResolverProvider_Init_EmptyAccountID verifies Init handles empty accountID
528+ // TestLocalResolverProvider_Init_EmptyAccountID verifies Init fails when accountID is empty
529529func TestLocalResolverProvider_Init_EmptyAccountID (t * testing.T ) {
530- updateStateCalled := false
531- receivedAccountID := ""
532-
533530 mockStateProvider := & mockStateProviderForInit {
534531 provideFunc : func (ctx context.Context ) ([]byte , string , error ) {
535532 return []byte ("test-state" ), "" , nil // Empty accountID
536533 },
537534 }
538535
539- mockResolverAPI := & mockResolverAPIForInit {
540- updateStateFunc : func (state []byte , accountID string ) error {
541- updateStateCalled = true
542- receivedAccountID = accountID
543- return nil
544- },
545- }
536+ mockResolverAPI := & mockResolverAPIForInit {}
546537
547538 provider := NewLocalResolverProvider (
548539 mockResolverAPI ,
@@ -553,17 +544,11 @@ func TestLocalResolverProvider_Init_EmptyAccountID(t *testing.T) {
553544 )
554545
555546 err := provider .Init (openfeature.EvaluationContext {})
556- if err != nil {
557- t .Fatalf ("Expected no error, got: %v" , err )
558- }
559-
560- if ! updateStateCalled {
561- t .Error ("Expected UpdateStateAndFlushLogs to be called" )
547+ if err == nil {
548+ t .Fatal ("Expected error when accountID is empty" )
562549 }
563-
564- // Should use "unknown" when accountID is empty
565- if receivedAccountID != "unknown" {
566- t .Errorf ("Expected accountID to be 'unknown', got: %s" , receivedAccountID )
550+ if err .Error () != "AccountID is empty in the initial state" {
551+ t .Errorf ("Expected specific error message, got: %v" , err )
567552 }
568553}
569554
0 commit comments