Skip to content

Commit 712e04e

Browse files
committed
tests: try to prevent random npe for watcher test
1 parent 3f61ed8 commit 712e04e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

internal/cli/atlas/networking/peering/watch_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ func TestWatchBuilder(t *testing.T) {
3131
}
3232

3333
func TestWatchOpts_Run(t *testing.T) {
34-
ctrl := gomock.NewController(t)
35-
mockStore := mocks.NewMockPeeringConnectionDescriber(ctrl)
36-
defer ctrl.Finish()
37-
3834
tests := []struct {
3935
name string
4036
expected *mongodbatlas.Peer
@@ -56,6 +52,10 @@ func TestWatchOpts_Run(t *testing.T) {
5652
expected := tt.expected
5753
t.Run(tt.name, func(t *testing.T) {
5854
t.Parallel()
55+
56+
ctrl := gomock.NewController(t)
57+
mockStore := mocks.NewMockPeeringConnectionDescriber(ctrl)
58+
defer ctrl.Finish()
5959
describeOpts := &WatchOpts{
6060
id: "test",
6161
store: mockStore,

0 commit comments

Comments
 (0)