Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
muralov committed Jan 10, 2024
1 parent 2e42cbd commit a627132
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions internal/controller/operator/eventing/eventmesh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ const (
)

var (
ErrFailedToStart = errors.New("failed to start")
ErrFailedToStop = errors.New("failed to stop")
ErrFailedToRemove = errors.New("failed to remove")
errNotFound = errors.New("secret not found")
ErrFailedToStart = errors.New("failed to start")
ErrFailedToStop = errors.New("failed to stop")
ErrFailedToRemove = errors.New("failed to remove")
errNotFound = errors.New("secret not found")
ErrFailedToApplyPatch = errors.New("failed to apply patch")
ErrFailedToSyncEPPSecret = errors.New("failed to sync Publisher Proxy secret: failed to apply patch")
)

func Test_reconcileEventMeshSubManager(t *testing.T) {
Expand Down Expand Up @@ -123,10 +125,10 @@ func Test_reconcileEventMeshSubManager(t *testing.T) {
mockKubeClient := new(k8smocks.Client)
mockKubeClient.On("GetSecret", ctx, mock.Anything, mock.Anything).Return(
utils.NewOAuthSecret("test-secret", givenEventing.Namespace), nil).Once()
mockKubeClient.On("PatchApply", ctx, mock.Anything).Return(errors.New("failed to apply patch")).Once()
mockKubeClient.On("PatchApply", ctx, mock.Anything).Return(ErrFailedToApplyPatch).Once()
return mockKubeClient
},
wantError: errors.New("failed to sync Publisher Proxy secret: failed to apply patch"),
wantError: ErrFailedToSyncEPPSecret,
},
{
name: "it should do nothing because subscription manager is already started",
Expand Down Expand Up @@ -195,7 +197,7 @@ func Test_reconcileEventMeshSubManager(t *testing.T) {
givenEventMeshSubManagerMock: func() *submgrmanagermocks.Manager {
eventMeshSubManagerMock := new(submgrmanagermocks.Manager)
eventMeshSubManagerMock.On("Init", mock.Anything).Return(nil).Once()
eventMeshSubManagerMock.On("Start", mock.Anything, mock.Anything).Return(errors.New("failed to start")).Twice()
eventMeshSubManagerMock.On("Start", mock.Anything, mock.Anything).Return(ErrFailedToStart).Twice()
return eventMeshSubManagerMock
},
givenEventingManagerMock: func() *eventingmocks.Manager {
Expand All @@ -217,7 +219,7 @@ func Test_reconcileEventMeshSubManager(t *testing.T) {
},
wantAssertCheck: true,
givenShouldRetry: true,
wantError: errors.New("failed to start"),
wantError: ErrFailedToStart,
wantHashAfter: int64(0),
},
{
Expand Down

0 comments on commit a627132

Please sign in to comment.