Skip to content

Commit

Permalink
test(mock): Removing useless call to Finish
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <bob@vibioh.fr>
  • Loading branch information
ViBiOh committed May 3, 2024
1 parent 84aa857 commit 65587c7
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 39 deletions.
1 change: 0 additions & 1 deletion pkg/middleware/middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ func TestMiddleware(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

userService := mocks.NewUserService(ctrl)
if intention == "simple" {
Expand Down
3 changes: 0 additions & 3 deletions pkg/notifier/notifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ func TestGetNewRepositoryReleases(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockRepositoryService := mocks.NewRepositoryService(ctrl)

Expand Down Expand Up @@ -243,7 +242,6 @@ func TestGetKetchupToNotify(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockKetchupService := mocks.NewKetchupService(ctrl)

Expand Down Expand Up @@ -439,7 +437,6 @@ func TestSendNotification(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mailerService := mocks.NewMailer(ctrl)
testCase.instance.mailer = mailerService
Expand Down
2 changes: 0 additions & 2 deletions pkg/notifier/releases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ func TestGetNewStandardReleases(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockRepositoryService := mocks.NewRepositoryService(ctrl)

Expand Down Expand Up @@ -185,7 +184,6 @@ func TestGetNewHelmReleases(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockRepositoryService := mocks.NewRepositoryService(ctrl)
mockHelmProvider := mocks.NewHelmProvider(ctrl)
Expand Down
6 changes: 0 additions & 6 deletions pkg/service/ketchup/ketchup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ func TestList(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockKetchupStore := mocks.NewKetchupStore(ctrl)

Expand Down Expand Up @@ -126,7 +125,6 @@ func TestListForRepositories(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockKetchupStore := mocks.NewKetchupStore(ctrl)

Expand Down Expand Up @@ -221,7 +219,6 @@ func TestCreate(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockKetchupStore := mocks.NewKetchupStore(ctrl)
mockRepositoryService := mocks.NewRepositoryService(ctrl)
Expand Down Expand Up @@ -366,7 +363,6 @@ func TestUpdate(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockKetchupStore := mocks.NewKetchupStore(ctrl)
mockRepositoryService := mocks.NewRepositoryService(ctrl)
Expand Down Expand Up @@ -505,7 +501,6 @@ func TestDelete(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockKetchupStore := mocks.NewKetchupStore(ctrl)

Expand Down Expand Up @@ -631,7 +626,6 @@ func TestCheck(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockKetchupStore := mocks.NewKetchupStore(ctrl)

Expand Down
7 changes: 0 additions & 7 deletions pkg/service/repository/repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ func TestList(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockRepositoryStore := mocks.NewRepositoryStore(ctrl)

Expand Down Expand Up @@ -137,7 +136,6 @@ func TestSuggest(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockRepositoryStore := mocks.NewRepositoryStore(ctrl)

Expand Down Expand Up @@ -264,7 +262,6 @@ func TestGetOrCreate(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockRepositoryStore := mocks.NewRepositoryStore(ctrl)
mockGithub := mocks.NewGenericProvider(ctrl)
Expand Down Expand Up @@ -381,7 +378,6 @@ func TestCreate(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockRepositoryStore := mocks.NewRepositoryStore(ctrl)
mockGithub := mocks.NewGenericProvider(ctrl)
Expand Down Expand Up @@ -489,7 +485,6 @@ func TestUpdate(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockRepositoryStore := mocks.NewRepositoryStore(ctrl)

Expand Down Expand Up @@ -582,7 +577,6 @@ func TestClean(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockRepositoryStore := mocks.NewRepositoryStore(ctrl)

Expand Down Expand Up @@ -686,7 +680,6 @@ func TestCheck(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockRepositoryStore := mocks.NewRepositoryStore(ctrl)

Expand Down
3 changes: 0 additions & 3 deletions pkg/service/user/user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ func TestStoreInContext(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockUserStore := mocks.NewUserStore(ctrl)
testCase.instance.store = mockUserStore
Expand Down Expand Up @@ -163,7 +162,6 @@ func TestCreate(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

authService := mocks.NewAuthService(ctrl)
mockUserStore := mocks.NewUserStore(ctrl)
Expand Down Expand Up @@ -270,7 +268,6 @@ func TestCheck(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockUserStore := mocks.NewUserStore(ctrl)

Expand Down
6 changes: 0 additions & 6 deletions pkg/store/ketchup/ketchup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ func TestList(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockDatabase := mocks.NewDatabase(ctrl)

Expand Down Expand Up @@ -220,7 +219,6 @@ func TestListByRepositoriesIDAndFrequencies(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockDatabase := mocks.NewDatabase(ctrl)

Expand Down Expand Up @@ -326,7 +324,6 @@ func TestGetByRepository(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockDatabase := mocks.NewDatabase(ctrl)

Expand Down Expand Up @@ -413,7 +410,6 @@ func TestCreate(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockDatabase := mocks.NewDatabase(ctrl)

Expand Down Expand Up @@ -472,7 +468,6 @@ func TestUpdate(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockDatabase := mocks.NewDatabase(ctrl)

Expand Down Expand Up @@ -525,7 +520,6 @@ func TestDelete(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockDatabase := mocks.NewDatabase(ctrl)

Expand Down
6 changes: 0 additions & 6 deletions pkg/store/repository/repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ func TestList(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockDatabase := mocks.NewDatabase(ctrl)

Expand Down Expand Up @@ -238,7 +237,6 @@ func TestSuggest(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockDatabase := mocks.NewDatabase(ctrl)

Expand Down Expand Up @@ -362,7 +360,6 @@ func TestGet(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockDatabase := mocks.NewDatabase(ctrl)

Expand Down Expand Up @@ -491,7 +488,6 @@ func TestCreate(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockDatabase := mocks.NewDatabase(ctrl)

Expand Down Expand Up @@ -581,7 +577,6 @@ func TestDeleteUnused(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockDatabase := mocks.NewDatabase(ctrl)

Expand Down Expand Up @@ -623,7 +618,6 @@ func TestDeleteUnusedVersions(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockDatabase := mocks.NewDatabase(ctrl)

Expand Down
1 change: 0 additions & 1 deletion pkg/store/repository/repository_version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ func TestUpdateVersions(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockDatabase := mocks.NewDatabase(ctrl)

Expand Down
4 changes: 0 additions & 4 deletions pkg/store/user/user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ func TestGetByEmail(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockDatabase := mocks.NewDatabase(ctrl)

Expand Down Expand Up @@ -129,7 +128,6 @@ func TestGetByLoginID(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockDatabase := mocks.NewDatabase(ctrl)

Expand Down Expand Up @@ -207,7 +205,6 @@ func TestCreate(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockDatabase := mocks.NewDatabase(ctrl)

Expand Down Expand Up @@ -253,7 +250,6 @@ func TestCount(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockDatabase := mocks.NewDatabase(ctrl)

Expand Down

0 comments on commit 65587c7

Please sign in to comment.