Skip to content

Commit

Permalink
removed unexpected calls
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekj720 committed Mar 11, 2024
1 parent d379532 commit 43c034d
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions common/domain/replicationTaskExecutor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,14 +352,6 @@ func TestHandleDomainCreationReplicationTask(t *testing.T) {
mockDomainManager.EXPECT().
CreateDomain(gomock.Any(), gomock.Any()).
Return(nil, ErrNameUUIDCollision).Times(1)

mockDomainManager.EXPECT().
GetDomain(gomock.Any(), gomock.Any()).
Return(nil, &types.EntityNotExistsError{}).Times(1) // Simulate no domain found by name

mockDomainManager.EXPECT().
GetDomain(gomock.Any(), gomock.Any()).
Return(nil, &types.EntityNotExistsError{}).Times(1) // Simulate no domain found by ID
},
task: validTask,
wantError: true,
Expand Down Expand Up @@ -415,10 +407,6 @@ func TestHandleDomainCreationReplicationTask(t *testing.T) {
mockDomainManager.EXPECT().
CreateDomain(gomock.Any(), gomock.Any()).
Return(nil, ErrInvalidDomainStatus).Times(1)

mockDomainManager.EXPECT().
GetDomain(gomock.Any(), gomock.Any()).
Return(nil, types.InternalServiceError{Message: "unexpected internal error"}).Times(1)
},
task: validTask,
wantError: true,
Expand All @@ -439,21 +427,6 @@ func TestHandleDomainCreationReplicationTask(t *testing.T) {
task: validTask,
wantError: true, // Expect an error because of the name/UUID collision
},
{
name: "Unexpected Error Type from GetDomain Leads to Default Error Handling",
setup: func() {
mockDomainManager.EXPECT().
CreateDomain(gomock.Any(), gomock.Any()).
Return(nil, ErrNameUUIDCollision).Times(1)

// Trigger an unexpected error type from GetDomain
mockDomainManager.EXPECT().
GetDomain(gomock.Any(), gomock.Any()).
Return(nil, types.InternalServiceError{Message: "unexpected internal error"}).Times(1)
},
task: validTask,
wantError: true,
},
}

for _, tt := range tests {
Expand Down

0 comments on commit 43c034d

Please sign in to comment.