From 6b62c5e9ff2398d5e8591aeb8da09d8927e1c15a Mon Sep 17 00:00:00 2001 From: Nithunikzz Date: Wed, 8 May 2024 15:09:22 +0530 Subject: [PATCH] kubescore testing --- .../plugins/kubescore/kubescore_test.go | 130 +++ agent/kubviz/plugins/trivy/trivy_image.go | 8 + go.mod | 14 +- go.sum | 26 +- mocks/trivy_client_mock.go | 840 ++++++++++++++++++ 5 files changed, 991 insertions(+), 27 deletions(-) create mode 100644 agent/kubviz/plugins/kubescore/kubescore_test.go create mode 100644 mocks/trivy_client_mock.go diff --git a/agent/kubviz/plugins/kubescore/kubescore_test.go b/agent/kubviz/plugins/kubescore/kubescore_test.go new file mode 100644 index 00000000..63e5d321 --- /dev/null +++ b/agent/kubviz/plugins/kubescore/kubescore_test.go @@ -0,0 +1,130 @@ +package kubescore + +import ( + "errors" + "testing" + + "bou.ke/monkey" + "github.com/golang/mock/gomock" + "github.com/intelops/kubviz/constants" + "github.com/intelops/kubviz/mocks" + "github.com/stretchr/testify/assert" + "github.com/zegl/kube-score/renderer/json_v2" +) + +func TestPublishKubescoreMetrics(t *testing.T) { + // Define the report data + report := []json_v2.ScoredObject{ + { + ObjectName: "object1", + // Define other fields as needed + }, + { + ObjectName: "object2", + // Define other fields as needed + }, + } + + // Initialize the MockJetStreamContextInterface + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + js := mocks.NewMockJetStreamContextInterface(ctrl) + + // Test case: Testing successful publishing of kube-score metrics + t.Run("Successful publishing", func(t *testing.T) { + + // Set the mock expectation for Publish + js.EXPECT().Publish(constants.KUBESCORE_SUBJECT, gomock.Any()).Return(nil, nil) + + // Call the function under test + err := publishKubescoreMetrics(report, js) + + // Assert that no error occurred during the function call + assert.NoError(t, err) + }) + // Test case: Error handling for Publish failure + t.Run("Error handling for Publish failure", func(t *testing.T) { + js.EXPECT().Publish(constants.KUBESCORE_SUBJECT, gomock.Any()).Return(nil, errors.New("publish error")) + err := publishKubescoreMetrics(report, js) + assert.Error(t, err) + }) + + // Test case: Nil input report + t.Run("Nil input report", func(t *testing.T) { + js.EXPECT().Publish(constants.KUBESCORE_SUBJECT, gomock.Any()).Return(nil, errors.New("publish error")) + + err := publishKubescoreMetrics(nil, js) + assert.Error(t, err) // Assuming this is the desired behavior for nil input + }) + + // Test case: Empty report + t.Run("Empty report", func(t *testing.T) { + js.EXPECT().Publish(constants.KUBESCORE_SUBJECT, gomock.Any()).Return(nil, errors.New("publish error")) + + err := publishKubescoreMetrics([]json_v2.ScoredObject{}, js) + assert.Error(t, err) // Assuming this is the desired behavior for an empty report + }) + +} +func TestExecuteCommand(t *testing.T) { + t.Run("Successful command execution", func(t *testing.T) { + command := "echo 'Hello, World!'" + output, err := ExecuteCommand(command) + + assert.NoError(t, err) + assert.Equal(t, "Hello, World!\n", output) + }) + + t.Run("Command execution error", func(t *testing.T) { + command := "non_existing_command" + _, err := ExecuteCommand(command) + + assert.Error(t, err) + }) + +} + +func TestPublish(t *testing.T) { + // Mock the ExecuteCommand function + var mockOutput = []byte(`[{"ObjectName":"test-object","TypeMeta":{"Kind":"Pod"},"ObjectMeta":{"Name":"test-pod"},"Checks":[{"ID":"check-id","Severity":"info","Message":"test message"}],"FileName":"test-file","FileRow":1}]`) + monkey.Patch(ExecuteCommand, func(command string) (string, error) { + return string(mockOutput), nil + }) + defer monkey.Unpatch(ExecuteCommand) + + // Create a new gomock controller + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + // Create a JetStreamContext mock + jsMock := mocks.NewMockJetStreamContextInterface(ctrl) + + // Subtest for successful publish + t.Run("Successful publish", func(t *testing.T) { + jsMock.EXPECT().Publish(gomock.Any(), gomock.Any()).Return(nil, nil) + ns := "test-namespace" + err := publish(ns, jsMock) + if err != nil { + t.Errorf("publish returned an error: %v", err) + } + }) + + // Subtest for error in ExecuteCommand + t.Run("Error in ExecuteCommand", func(t *testing.T) { + // Mock ExecuteCommand to return an error + monkey.Patch(ExecuteCommand, func(command string) (string, error) { + return "", errors.New("command execution error") + }) + defer monkey.Unpatch(ExecuteCommand) + + ns := "test-namespace" + err := publish(ns, jsMock) + if err == nil { + t.Errorf("publish did not return an error") + } + + // Since ExecuteCommand failed, Publish should not be called + jsMock.EXPECT().Publish(gomock.Any(), gomock.Any()).Times(0) + }) +} diff --git a/agent/kubviz/plugins/trivy/trivy_image.go b/agent/kubviz/plugins/trivy/trivy_image.go index c4919a18..9628e31d 100644 --- a/agent/kubviz/plugins/trivy/trivy_image.go +++ b/agent/kubviz/plugins/trivy/trivy_image.go @@ -24,6 +24,14 @@ import ( "k8s.io/client-go/rest" ) +type JetStreamContextInterface interface { + nats.JetStream + nats.JetStreamManager + nats.KeyValueManager + nats.ObjectStoreManager + AccountInfo(opts ...nats.JSOpt) (*nats.AccountInfo, error) +} + func RunTrivyImageScans(config *rest.Config, js nats.JetStreamContext) error { pvcMountPath := "/mnt/agent/kbz" trivyImageCacheDir := fmt.Sprintf("%s/trivy-imagecache", pvcMountPath) diff --git a/go.mod b/go.mod index cbb62157..e666b12a 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,9 @@ module github.com/intelops/kubviz go 1.20 require ( - github.com/99designs/gqlgen v0.17.42 + bou.ke/monkey v1.0.2 github.com/ClickHouse/clickhouse-go/v2 v2.10.1 + github.com/agiledragon/gomonkey v2.0.2+incompatible github.com/aquasecurity/trivy v0.43.1 github.com/aws/aws-sdk-go v1.44.245 github.com/blang/semver v3.5.1+incompatible @@ -17,6 +18,7 @@ require ( github.com/go-co-op/gocron v1.30.1 github.com/go-playground/webhooks/v6 v6.2.0 github.com/golang-migrate/migrate/v4 v4.16.2 + github.com/golang/mock v1.5.0 github.com/google/uuid v1.3.1 github.com/hashicorp/go-version v1.6.0 github.com/intelops/go-common v1.0.19 @@ -27,7 +29,7 @@ require ( github.com/robfig/cron/v3 v3.0.1 github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.7.0 - github.com/vektah/gqlparser/v2 v2.5.10 + github.com/stretchr/testify v1.8.4 github.com/zegl/kube-score v1.17.0 go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin v0.46.1 go.opentelemetry.io/otel v1.21.0 @@ -48,7 +50,6 @@ require ( cloud.google.com/go/storage v1.30.1 // indirect github.com/ClickHouse/ch-go v0.52.1 // indirect github.com/CycloneDX/cyclonedx-go v0.7.2-0.20230625092137-07e2f29defc3 // indirect - github.com/agnivade/levenshtein v1.1.1 // indirect github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092 // indirect github.com/andybalholm/brotli v1.0.5 // indirect github.com/aquasecurity/go-dep-parser v0.0.0-20230626110909-e7ea5097483b // indirect @@ -89,12 +90,10 @@ require ( github.com/google/gofuzz v1.2.0 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/googleapis/gax-go/v2 v2.11.0 // indirect - github.com/gorilla/websocket v1.5.0 // indirect github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/golang-lru/v2 v2.0.3 // indirect github.com/imdario/mergo v0.3.15 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/invopop/yaml v0.1.0 // indirect @@ -111,7 +110,6 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-runewidth v0.0.13 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect @@ -133,13 +131,12 @@ require ( github.com/rivo/uniseg v0.2.0 // indirect github.com/samber/lo v1.38.1 // indirect github.com/segmentio/asm v1.2.0 // indirect + github.com/sergi/go-diff v1.3.1 // indirect github.com/shopspring/decimal v1.3.1 // indirect github.com/showa-93/go-mask v0.6.0 // indirect - github.com/sosodev/duration v1.1.0 // indirect github.com/spdx/tools-golang v0.5.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.0 // indirect - github.com/stretchr/testify v1.8.4 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.11 // indirect github.com/xlab/treeprint v1.1.0 // indirect @@ -159,6 +156,7 @@ require ( golang.org/x/sys v0.14.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.3.0 // indirect + golang.org/x/tools v0.9.3 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/api v0.126.0 // indirect google.golang.org/appengine v1.6.7 // indirect diff --git a/go.sum b/go.sum index 4e586f75..e04eec7e 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +bou.ke/monkey v1.0.2 h1:kWcnsrCNUatbxncxR/ThdYqbytgOIArtYWqcQLQzKLI= +bou.ke/monkey v1.0.2/go.mod h1:OqickVX3tNx6t33n1xvtTtu85YN5s6cKwVug+oHMaIA= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -44,8 +46,6 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 cloud.google.com/go/storage v1.30.1 h1:uOdMxAs8HExqBlnLtnQyP0YkvbiDpdGShGKtx6U/oNM= cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7BiccwkR7+P7gN8E= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/99designs/gqlgen v0.17.42 h1:BVWDOb2VVHQC5k3m6oa0XhDnxltLLrU4so7x/u39Zu4= -github.com/99designs/gqlgen v0.17.42/go.mod h1:GQ6SyMhwFbgHR0a8r2Wn8fYgEwPxxmndLFPhU63+cJE= github.com/AdaLogics/go-fuzz-headers v0.0.0-20230106234847-43070de90fa1 h1:EKPd1INOIyr5hWOWhvpmQpY6tKjeG0hT1s3AMC/9fic= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= @@ -79,20 +79,18 @@ github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb0 github.com/OneOfOne/xxhash v1.2.8 h1:31czK/TI9sNkxIKfaUfGlU47BAxQ0ztGgd9vPyqimf8= github.com/Pallinder/go-randomdata v1.1.0/go.mod h1:yHmJgulpD2Nfrm0cR9tI/+oAgRqCQQixsA8HyRZfV9Y= github.com/ProtonMail/go-crypto v0.0.0-20230518184743-7afd39499903 h1:ZK3C5DtzV2nVAQTx5S5jQvMeDqWtD1By5mOoyY/xJek= -github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAcwmWM= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ= github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= +github.com/agiledragon/gomonkey v2.0.2+incompatible h1:eXKi9/piiC3cjJD1658mEE2o3NjkJ5vDLgYjCQu0Xlw= +github.com/agiledragon/gomonkey v2.0.2+incompatible/go.mod h1:2NGfXu1a80LLr2cmWXGBDaHEjb1idR6+FVlX5T3D9hw= github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8= -github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= github.com/alecthomas/chroma v0.10.0 h1:7XDcGkCQopCNKjZHfYrNLraA+M7e0fMiJ/Mfikbfjek= github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092 h1:aM1rlcoLz8y5B2r4tTLMiVTrMtpfY0O8EScKJxaSaEc= github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092/go.mod h1:rYqSE9HbjzpHTI74vwPvae4ZVYZd1lue2ta6xHPdblA= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c= github.com/apparentlymart/go-cidr v1.1.0 h1:2mAhrMoF+nhXqxTzSZMUzDHkLjmIHC+Zzn4tdgBZjnU= github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= github.com/aquasecurity/bolt-fixtures v0.0.0-20200903104109-d34e7f983986 h1:2a30xLN2sUZcMXl50hg+PJCIDdJgIvIbVcKqLJ/ZrtM= @@ -109,8 +107,6 @@ github.com/aquasecurity/trivy-db v0.0.0-20230703082116-dc52e83376ce h1:swoQLWQoZ github.com/aquasecurity/trivy-db v0.0.0-20230703082116-dc52e83376ce/go.mod h1:cXuqKo+FaMY0ixJNoUcyDHdfCBRPWOysI2Td8N4fRsg= github.com/aquasecurity/trivy-kubernetes v0.5.7-0.20230628140707-dae3bdb6ee81 h1:5/tKpCr861auON/CMHSXnRzNixx1FTWAeHSwV0PtA0U= github.com/aquasecurity/trivy-kubernetes v0.5.7-0.20230628140707-dae3bdb6ee81/go.mod h1:GCm7uq++jz7Ij8cA9mAorpKJ9/qSBCl7v6EKYA8DxJ8= -github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= -github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= github.com/aws/aws-sdk-go v1.25.24/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= @@ -163,8 +159,6 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/deckarep/golang-set v1.7.1/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= github.com/denverdino/aliyungo v0.0.0-20191023002520-dba750c0c223/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= -github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48 h1:fRzb/w+pyskVMQ+UbP35JkH8yB7MYb4q/qhBarqZE6g= -github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= github.com/dhui/dktest v0.3.16 h1:i6gq2YQEtcrjKbeJpBkWjE8MmLZPYllcjOFbTZuPDnw= github.com/dlclark/regexp2 v1.4.0 h1:F1rxgk7p4uKjwIQxBs9oAXe5CqrXlCduYEJvrF4u93E= github.com/docker/cli v0.0.0-20190913211141-95327f4e6241/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= @@ -295,6 +289,7 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0 h1:jlYHihg//f7RRwuPfptm04yp4s7O6Kw8EZiVYIGcH0g= github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -380,8 +375,6 @@ github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2z github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gosuri/uitable v0.0.4 h1:IG2xLKRvErL3uhY6e1BylFzG+aJiwQviDDTfOKeKTpY= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= @@ -401,8 +394,6 @@ github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mO github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru/v2 v2.0.3 h1:kmRrRLlInXvng0SmLxmQpQkpbYAvcXm7NPDrgxJa9mE= -github.com/hashicorp/golang-lru/v2 v2.0.3/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl/v2 v2.14.1 h1:x0BpjfZ+CYdbiz+8yZTQ+gdLO7IXvOut7Da+XJayx34= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -499,7 +490,6 @@ github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQ github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= -github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/moby/buildkit v0.11.6 h1:VYNdoKk5TVxN7k4RvZgdeM4GOyRvIi4Z8MXOY7xvyUs= github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= @@ -607,6 +597,7 @@ github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXn github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys= github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs= github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= +github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/showa-93/go-mask v0.6.0 h1:nNW3dgEocYB7QCGzgRx9wlYrepEg+tRw/keg7u1ftY8= @@ -620,8 +611,6 @@ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVs github.com/skeema/knownhosts v1.1.1 h1:MTk78x9FPgDFVFkDLTrsnnfCJl7g1C/nnKvePgrIngE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/sosodev/duration v1.1.0 h1:kQcaiGbJaIsRqgQy7VGlZrVw1giWO+lDoX3MCPnpVO4= -github.com/sosodev/duration v1.1.0/go.mod h1:RQIBBX0+fMLc/D9+Jb/fwvVmo0eZvDDEERAikUR6SDg= github.com/spdx/gordf v0.0.0-20201111095634-7098f93598fb/go.mod h1:uKWaldnbMnjsSAXRurWqqrdyZen1R7kxl8TkmWk2OyM= github.com/spdx/tools-golang v0.5.0 h1:/fqihV2Jna7fmow65dHpgKNsilgLK7ICpd2tkCnPEyY= github.com/spdx/tools-golang v0.5.0/go.mod h1:kkGlrSXXfHwuSzHQZJRV3aKu9ZXCq/MSf2+xyiJH1lM= @@ -662,8 +651,6 @@ github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95 github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8= -github.com/vektah/gqlparser/v2 v2.5.10 h1:6zSM4azXC9u4Nxy5YmdmGu4uKamfwsdKTwp5zsEealU= -github.com/vektah/gqlparser/v2 v2.5.10/go.mod h1:1rCcfwB2ekJofmluGWXMSEnPMZgbxzwj6FaZ/4OT8Cc= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= @@ -994,6 +981,7 @@ golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM= +golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/mocks/trivy_client_mock.go b/mocks/trivy_client_mock.go new file mode 100644 index 00000000..8d6ba59c --- /dev/null +++ b/mocks/trivy_client_mock.go @@ -0,0 +1,840 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: /home/nithu/go/src/testing/kubviz/agent/kubviz/plugins/trivy/trivy_image.go + +// Package mocks is a generated GoMock package. +package mocks + +import ( + reflect "reflect" + + gomock "github.com/golang/mock/gomock" + nats_go "github.com/nats-io/nats.go" +) + +// MockJetStreamContextInterface is a mock of JetStreamContextInterface interface. +type MockJetStreamContextInterface struct { + ctrl *gomock.Controller + recorder *MockJetStreamContextInterfaceMockRecorder +} + +// MockJetStreamContextInterfaceMockRecorder is the mock recorder for MockJetStreamContextInterface. +type MockJetStreamContextInterfaceMockRecorder struct { + mock *MockJetStreamContextInterface +} + +// NewMockJetStreamContextInterface creates a new mock instance. +func NewMockJetStreamContextInterface(ctrl *gomock.Controller) *MockJetStreamContextInterface { + mock := &MockJetStreamContextInterface{ctrl: ctrl} + mock.recorder = &MockJetStreamContextInterfaceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockJetStreamContextInterface) EXPECT() *MockJetStreamContextInterfaceMockRecorder { + return m.recorder +} + +// AccountInfo mocks base method. +func (m *MockJetStreamContextInterface) AccountInfo(opts ...nats_go.JSOpt) (*nats_go.AccountInfo, error) { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "AccountInfo", varargs...) + ret0, _ := ret[0].(*nats_go.AccountInfo) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AccountInfo indicates an expected call of AccountInfo. +func (mr *MockJetStreamContextInterfaceMockRecorder) AccountInfo(opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AccountInfo", reflect.TypeOf((*MockJetStreamContextInterface)(nil).AccountInfo), opts...) +} + +// AddConsumer mocks base method. +func (m *MockJetStreamContextInterface) AddConsumer(stream string, cfg *nats_go.ConsumerConfig, opts ...nats_go.JSOpt) (*nats_go.ConsumerInfo, error) { + m.ctrl.T.Helper() + varargs := []interface{}{stream, cfg} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "AddConsumer", varargs...) + ret0, _ := ret[0].(*nats_go.ConsumerInfo) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AddConsumer indicates an expected call of AddConsumer. +func (mr *MockJetStreamContextInterfaceMockRecorder) AddConsumer(stream, cfg interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{stream, cfg}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddConsumer", reflect.TypeOf((*MockJetStreamContextInterface)(nil).AddConsumer), varargs...) +} + +// AddStream mocks base method. +func (m *MockJetStreamContextInterface) AddStream(cfg *nats_go.StreamConfig, opts ...nats_go.JSOpt) (*nats_go.StreamInfo, error) { + m.ctrl.T.Helper() + varargs := []interface{}{cfg} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "AddStream", varargs...) + ret0, _ := ret[0].(*nats_go.StreamInfo) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AddStream indicates an expected call of AddStream. +func (mr *MockJetStreamContextInterfaceMockRecorder) AddStream(cfg interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{cfg}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddStream", reflect.TypeOf((*MockJetStreamContextInterface)(nil).AddStream), varargs...) +} + +// ChanQueueSubscribe mocks base method. +func (m *MockJetStreamContextInterface) ChanQueueSubscribe(subj, queue string, ch chan *nats_go.Msg, opts ...nats_go.SubOpt) (*nats_go.Subscription, error) { + m.ctrl.T.Helper() + varargs := []interface{}{subj, queue, ch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ChanQueueSubscribe", varargs...) + ret0, _ := ret[0].(*nats_go.Subscription) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ChanQueueSubscribe indicates an expected call of ChanQueueSubscribe. +func (mr *MockJetStreamContextInterfaceMockRecorder) ChanQueueSubscribe(subj, queue, ch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{subj, queue, ch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChanQueueSubscribe", reflect.TypeOf((*MockJetStreamContextInterface)(nil).ChanQueueSubscribe), varargs...) +} + +// ChanSubscribe mocks base method. +func (m *MockJetStreamContextInterface) ChanSubscribe(subj string, ch chan *nats_go.Msg, opts ...nats_go.SubOpt) (*nats_go.Subscription, error) { + m.ctrl.T.Helper() + varargs := []interface{}{subj, ch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ChanSubscribe", varargs...) + ret0, _ := ret[0].(*nats_go.Subscription) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ChanSubscribe indicates an expected call of ChanSubscribe. +func (mr *MockJetStreamContextInterfaceMockRecorder) ChanSubscribe(subj, ch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{subj, ch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChanSubscribe", reflect.TypeOf((*MockJetStreamContextInterface)(nil).ChanSubscribe), varargs...) +} + +// ConsumerInfo mocks base method. +func (m *MockJetStreamContextInterface) ConsumerInfo(stream, name string, opts ...nats_go.JSOpt) (*nats_go.ConsumerInfo, error) { + m.ctrl.T.Helper() + varargs := []interface{}{stream, name} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ConsumerInfo", varargs...) + ret0, _ := ret[0].(*nats_go.ConsumerInfo) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ConsumerInfo indicates an expected call of ConsumerInfo. +func (mr *MockJetStreamContextInterfaceMockRecorder) ConsumerInfo(stream, name interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{stream, name}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConsumerInfo", reflect.TypeOf((*MockJetStreamContextInterface)(nil).ConsumerInfo), varargs...) +} + +// ConsumerNames mocks base method. +func (m *MockJetStreamContextInterface) ConsumerNames(stream string, opts ...nats_go.JSOpt) <-chan string { + m.ctrl.T.Helper() + varargs := []interface{}{stream} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ConsumerNames", varargs...) + ret0, _ := ret[0].(<-chan string) + return ret0 +} + +// ConsumerNames indicates an expected call of ConsumerNames. +func (mr *MockJetStreamContextInterfaceMockRecorder) ConsumerNames(stream interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{stream}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConsumerNames", reflect.TypeOf((*MockJetStreamContextInterface)(nil).ConsumerNames), varargs...) +} + +// Consumers mocks base method. +func (m *MockJetStreamContextInterface) Consumers(stream string, opts ...nats_go.JSOpt) <-chan *nats_go.ConsumerInfo { + m.ctrl.T.Helper() + varargs := []interface{}{stream} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "Consumers", varargs...) + ret0, _ := ret[0].(<-chan *nats_go.ConsumerInfo) + return ret0 +} + +// Consumers indicates an expected call of Consumers. +func (mr *MockJetStreamContextInterfaceMockRecorder) Consumers(stream interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{stream}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Consumers", reflect.TypeOf((*MockJetStreamContextInterface)(nil).Consumers), varargs...) +} + +// ConsumersInfo mocks base method. +func (m *MockJetStreamContextInterface) ConsumersInfo(stream string, opts ...nats_go.JSOpt) <-chan *nats_go.ConsumerInfo { + m.ctrl.T.Helper() + varargs := []interface{}{stream} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ConsumersInfo", varargs...) + ret0, _ := ret[0].(<-chan *nats_go.ConsumerInfo) + return ret0 +} + +// ConsumersInfo indicates an expected call of ConsumersInfo. +func (mr *MockJetStreamContextInterfaceMockRecorder) ConsumersInfo(stream interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{stream}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConsumersInfo", reflect.TypeOf((*MockJetStreamContextInterface)(nil).ConsumersInfo), varargs...) +} + +// CreateKeyValue mocks base method. +func (m *MockJetStreamContextInterface) CreateKeyValue(cfg *nats_go.KeyValueConfig) (nats_go.KeyValue, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateKeyValue", cfg) + ret0, _ := ret[0].(nats_go.KeyValue) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateKeyValue indicates an expected call of CreateKeyValue. +func (mr *MockJetStreamContextInterfaceMockRecorder) CreateKeyValue(cfg interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateKeyValue", reflect.TypeOf((*MockJetStreamContextInterface)(nil).CreateKeyValue), cfg) +} + +// CreateObjectStore mocks base method. +func (m *MockJetStreamContextInterface) CreateObjectStore(cfg *nats_go.ObjectStoreConfig) (nats_go.ObjectStore, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateObjectStore", cfg) + ret0, _ := ret[0].(nats_go.ObjectStore) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateObjectStore indicates an expected call of CreateObjectStore. +func (mr *MockJetStreamContextInterfaceMockRecorder) CreateObjectStore(cfg interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateObjectStore", reflect.TypeOf((*MockJetStreamContextInterface)(nil).CreateObjectStore), cfg) +} + +// DeleteConsumer mocks base method. +func (m *MockJetStreamContextInterface) DeleteConsumer(stream, consumer string, opts ...nats_go.JSOpt) error { + m.ctrl.T.Helper() + varargs := []interface{}{stream, consumer} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteConsumer", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteConsumer indicates an expected call of DeleteConsumer. +func (mr *MockJetStreamContextInterfaceMockRecorder) DeleteConsumer(stream, consumer interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{stream, consumer}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteConsumer", reflect.TypeOf((*MockJetStreamContextInterface)(nil).DeleteConsumer), varargs...) +} + +// DeleteKeyValue mocks base method. +func (m *MockJetStreamContextInterface) DeleteKeyValue(bucket string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteKeyValue", bucket) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteKeyValue indicates an expected call of DeleteKeyValue. +func (mr *MockJetStreamContextInterfaceMockRecorder) DeleteKeyValue(bucket interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteKeyValue", reflect.TypeOf((*MockJetStreamContextInterface)(nil).DeleteKeyValue), bucket) +} + +// DeleteMsg mocks base method. +func (m *MockJetStreamContextInterface) DeleteMsg(name string, seq uint64, opts ...nats_go.JSOpt) error { + m.ctrl.T.Helper() + varargs := []interface{}{name, seq} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteMsg", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteMsg indicates an expected call of DeleteMsg. +func (mr *MockJetStreamContextInterfaceMockRecorder) DeleteMsg(name, seq interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{name, seq}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteMsg", reflect.TypeOf((*MockJetStreamContextInterface)(nil).DeleteMsg), varargs...) +} + +// DeleteObjectStore mocks base method. +func (m *MockJetStreamContextInterface) DeleteObjectStore(bucket string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteObjectStore", bucket) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteObjectStore indicates an expected call of DeleteObjectStore. +func (mr *MockJetStreamContextInterfaceMockRecorder) DeleteObjectStore(bucket interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteObjectStore", reflect.TypeOf((*MockJetStreamContextInterface)(nil).DeleteObjectStore), bucket) +} + +// DeleteStream mocks base method. +func (m *MockJetStreamContextInterface) DeleteStream(name string, opts ...nats_go.JSOpt) error { + m.ctrl.T.Helper() + varargs := []interface{}{name} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteStream", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteStream indicates an expected call of DeleteStream. +func (mr *MockJetStreamContextInterfaceMockRecorder) DeleteStream(name interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{name}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteStream", reflect.TypeOf((*MockJetStreamContextInterface)(nil).DeleteStream), varargs...) +} + +// GetLastMsg mocks base method. +func (m *MockJetStreamContextInterface) GetLastMsg(name, subject string, opts ...nats_go.JSOpt) (*nats_go.RawStreamMsg, error) { + m.ctrl.T.Helper() + varargs := []interface{}{name, subject} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetLastMsg", varargs...) + ret0, _ := ret[0].(*nats_go.RawStreamMsg) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetLastMsg indicates an expected call of GetLastMsg. +func (mr *MockJetStreamContextInterfaceMockRecorder) GetLastMsg(name, subject interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{name, subject}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLastMsg", reflect.TypeOf((*MockJetStreamContextInterface)(nil).GetLastMsg), varargs...) +} + +// GetMsg mocks base method. +func (m *MockJetStreamContextInterface) GetMsg(name string, seq uint64, opts ...nats_go.JSOpt) (*nats_go.RawStreamMsg, error) { + m.ctrl.T.Helper() + varargs := []interface{}{name, seq} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetMsg", varargs...) + ret0, _ := ret[0].(*nats_go.RawStreamMsg) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetMsg indicates an expected call of GetMsg. +func (mr *MockJetStreamContextInterfaceMockRecorder) GetMsg(name, seq interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{name, seq}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMsg", reflect.TypeOf((*MockJetStreamContextInterface)(nil).GetMsg), varargs...) +} + +// KeyValue mocks base method. +func (m *MockJetStreamContextInterface) KeyValue(bucket string) (nats_go.KeyValue, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "KeyValue", bucket) + ret0, _ := ret[0].(nats_go.KeyValue) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// KeyValue indicates an expected call of KeyValue. +func (mr *MockJetStreamContextInterfaceMockRecorder) KeyValue(bucket interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "KeyValue", reflect.TypeOf((*MockJetStreamContextInterface)(nil).KeyValue), bucket) +} + +// KeyValueStoreNames mocks base method. +func (m *MockJetStreamContextInterface) KeyValueStoreNames() <-chan string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "KeyValueStoreNames") + ret0, _ := ret[0].(<-chan string) + return ret0 +} + +// KeyValueStoreNames indicates an expected call of KeyValueStoreNames. +func (mr *MockJetStreamContextInterfaceMockRecorder) KeyValueStoreNames() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "KeyValueStoreNames", reflect.TypeOf((*MockJetStreamContextInterface)(nil).KeyValueStoreNames)) +} + +// KeyValueStores mocks base method. +func (m *MockJetStreamContextInterface) KeyValueStores() <-chan nats_go.KeyValueStatus { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "KeyValueStores") + ret0, _ := ret[0].(<-chan nats_go.KeyValueStatus) + return ret0 +} + +// KeyValueStores indicates an expected call of KeyValueStores. +func (mr *MockJetStreamContextInterfaceMockRecorder) KeyValueStores() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "KeyValueStores", reflect.TypeOf((*MockJetStreamContextInterface)(nil).KeyValueStores)) +} + +// ObjectStore mocks base method. +func (m *MockJetStreamContextInterface) ObjectStore(bucket string) (nats_go.ObjectStore, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ObjectStore", bucket) + ret0, _ := ret[0].(nats_go.ObjectStore) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ObjectStore indicates an expected call of ObjectStore. +func (mr *MockJetStreamContextInterfaceMockRecorder) ObjectStore(bucket interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ObjectStore", reflect.TypeOf((*MockJetStreamContextInterface)(nil).ObjectStore), bucket) +} + +// ObjectStoreNames mocks base method. +func (m *MockJetStreamContextInterface) ObjectStoreNames(opts ...nats_go.ObjectOpt) <-chan string { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ObjectStoreNames", varargs...) + ret0, _ := ret[0].(<-chan string) + return ret0 +} + +// ObjectStoreNames indicates an expected call of ObjectStoreNames. +func (mr *MockJetStreamContextInterfaceMockRecorder) ObjectStoreNames(opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ObjectStoreNames", reflect.TypeOf((*MockJetStreamContextInterface)(nil).ObjectStoreNames), opts...) +} + +// ObjectStores mocks base method. +func (m *MockJetStreamContextInterface) ObjectStores(opts ...nats_go.ObjectOpt) <-chan nats_go.ObjectStoreStatus { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ObjectStores", varargs...) + ret0, _ := ret[0].(<-chan nats_go.ObjectStoreStatus) + return ret0 +} + +// ObjectStores indicates an expected call of ObjectStores. +func (mr *MockJetStreamContextInterfaceMockRecorder) ObjectStores(opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ObjectStores", reflect.TypeOf((*MockJetStreamContextInterface)(nil).ObjectStores), opts...) +} + +// Publish mocks base method. +func (m *MockJetStreamContextInterface) Publish(subj string, data []byte, opts ...nats_go.PubOpt) (*nats_go.PubAck, error) { + m.ctrl.T.Helper() + varargs := []interface{}{subj, data} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "Publish", varargs...) + ret0, _ := ret[0].(*nats_go.PubAck) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Publish indicates an expected call of Publish. +func (mr *MockJetStreamContextInterfaceMockRecorder) Publish(subj, data interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{subj, data}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Publish", reflect.TypeOf((*MockJetStreamContextInterface)(nil).Publish), varargs...) +} + +// PublishAsync mocks base method. +func (m *MockJetStreamContextInterface) PublishAsync(subj string, data []byte, opts ...nats_go.PubOpt) (nats_go.PubAckFuture, error) { + m.ctrl.T.Helper() + varargs := []interface{}{subj, data} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PublishAsync", varargs...) + ret0, _ := ret[0].(nats_go.PubAckFuture) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// PublishAsync indicates an expected call of PublishAsync. +func (mr *MockJetStreamContextInterfaceMockRecorder) PublishAsync(subj, data interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{subj, data}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PublishAsync", reflect.TypeOf((*MockJetStreamContextInterface)(nil).PublishAsync), varargs...) +} + +// PublishAsyncComplete mocks base method. +func (m *MockJetStreamContextInterface) PublishAsyncComplete() <-chan struct{} { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "PublishAsyncComplete") + ret0, _ := ret[0].(<-chan struct{}) + return ret0 +} + +// PublishAsyncComplete indicates an expected call of PublishAsyncComplete. +func (mr *MockJetStreamContextInterfaceMockRecorder) PublishAsyncComplete() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PublishAsyncComplete", reflect.TypeOf((*MockJetStreamContextInterface)(nil).PublishAsyncComplete)) +} + +// PublishAsyncPending mocks base method. +func (m *MockJetStreamContextInterface) PublishAsyncPending() int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "PublishAsyncPending") + ret0, _ := ret[0].(int) + return ret0 +} + +// PublishAsyncPending indicates an expected call of PublishAsyncPending. +func (mr *MockJetStreamContextInterfaceMockRecorder) PublishAsyncPending() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PublishAsyncPending", reflect.TypeOf((*MockJetStreamContextInterface)(nil).PublishAsyncPending)) +} + +// PublishMsg mocks base method. +func (m_2 *MockJetStreamContextInterface) PublishMsg(m *nats_go.Msg, opts ...nats_go.PubOpt) (*nats_go.PubAck, error) { + m_2.ctrl.T.Helper() + varargs := []interface{}{m} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m_2.ctrl.Call(m_2, "PublishMsg", varargs...) + ret0, _ := ret[0].(*nats_go.PubAck) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// PublishMsg indicates an expected call of PublishMsg. +func (mr *MockJetStreamContextInterfaceMockRecorder) PublishMsg(m interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{m}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PublishMsg", reflect.TypeOf((*MockJetStreamContextInterface)(nil).PublishMsg), varargs...) +} + +// PublishMsgAsync mocks base method. +func (m_2 *MockJetStreamContextInterface) PublishMsgAsync(m *nats_go.Msg, opts ...nats_go.PubOpt) (nats_go.PubAckFuture, error) { + m_2.ctrl.T.Helper() + varargs := []interface{}{m} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m_2.ctrl.Call(m_2, "PublishMsgAsync", varargs...) + ret0, _ := ret[0].(nats_go.PubAckFuture) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// PublishMsgAsync indicates an expected call of PublishMsgAsync. +func (mr *MockJetStreamContextInterfaceMockRecorder) PublishMsgAsync(m interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{m}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PublishMsgAsync", reflect.TypeOf((*MockJetStreamContextInterface)(nil).PublishMsgAsync), varargs...) +} + +// PullSubscribe mocks base method. +func (m *MockJetStreamContextInterface) PullSubscribe(subj, durable string, opts ...nats_go.SubOpt) (*nats_go.Subscription, error) { + m.ctrl.T.Helper() + varargs := []interface{}{subj, durable} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PullSubscribe", varargs...) + ret0, _ := ret[0].(*nats_go.Subscription) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// PullSubscribe indicates an expected call of PullSubscribe. +func (mr *MockJetStreamContextInterfaceMockRecorder) PullSubscribe(subj, durable interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{subj, durable}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PullSubscribe", reflect.TypeOf((*MockJetStreamContextInterface)(nil).PullSubscribe), varargs...) +} + +// PurgeStream mocks base method. +func (m *MockJetStreamContextInterface) PurgeStream(name string, opts ...nats_go.JSOpt) error { + m.ctrl.T.Helper() + varargs := []interface{}{name} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PurgeStream", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PurgeStream indicates an expected call of PurgeStream. +func (mr *MockJetStreamContextInterfaceMockRecorder) PurgeStream(name interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{name}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PurgeStream", reflect.TypeOf((*MockJetStreamContextInterface)(nil).PurgeStream), varargs...) +} + +// QueueSubscribe mocks base method. +func (m *MockJetStreamContextInterface) QueueSubscribe(subj, queue string, cb nats_go.MsgHandler, opts ...nats_go.SubOpt) (*nats_go.Subscription, error) { + m.ctrl.T.Helper() + varargs := []interface{}{subj, queue, cb} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "QueueSubscribe", varargs...) + ret0, _ := ret[0].(*nats_go.Subscription) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// QueueSubscribe indicates an expected call of QueueSubscribe. +func (mr *MockJetStreamContextInterfaceMockRecorder) QueueSubscribe(subj, queue, cb interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{subj, queue, cb}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueueSubscribe", reflect.TypeOf((*MockJetStreamContextInterface)(nil).QueueSubscribe), varargs...) +} + +// QueueSubscribeSync mocks base method. +func (m *MockJetStreamContextInterface) QueueSubscribeSync(subj, queue string, opts ...nats_go.SubOpt) (*nats_go.Subscription, error) { + m.ctrl.T.Helper() + varargs := []interface{}{subj, queue} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "QueueSubscribeSync", varargs...) + ret0, _ := ret[0].(*nats_go.Subscription) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// QueueSubscribeSync indicates an expected call of QueueSubscribeSync. +func (mr *MockJetStreamContextInterfaceMockRecorder) QueueSubscribeSync(subj, queue interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{subj, queue}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueueSubscribeSync", reflect.TypeOf((*MockJetStreamContextInterface)(nil).QueueSubscribeSync), varargs...) +} + +// SecureDeleteMsg mocks base method. +func (m *MockJetStreamContextInterface) SecureDeleteMsg(name string, seq uint64, opts ...nats_go.JSOpt) error { + m.ctrl.T.Helper() + varargs := []interface{}{name, seq} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "SecureDeleteMsg", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// SecureDeleteMsg indicates an expected call of SecureDeleteMsg. +func (mr *MockJetStreamContextInterfaceMockRecorder) SecureDeleteMsg(name, seq interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{name, seq}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SecureDeleteMsg", reflect.TypeOf((*MockJetStreamContextInterface)(nil).SecureDeleteMsg), varargs...) +} + +// StreamInfo mocks base method. +func (m *MockJetStreamContextInterface) StreamInfo(stream string, opts ...nats_go.JSOpt) (*nats_go.StreamInfo, error) { + m.ctrl.T.Helper() + varargs := []interface{}{stream} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "StreamInfo", varargs...) + ret0, _ := ret[0].(*nats_go.StreamInfo) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// StreamInfo indicates an expected call of StreamInfo. +func (mr *MockJetStreamContextInterfaceMockRecorder) StreamInfo(stream interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{stream}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StreamInfo", reflect.TypeOf((*MockJetStreamContextInterface)(nil).StreamInfo), varargs...) +} + +// StreamNameBySubject mocks base method. +func (m *MockJetStreamContextInterface) StreamNameBySubject(arg0 string, arg1 ...nats_go.JSOpt) (string, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0} + for _, a := range arg1 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "StreamNameBySubject", varargs...) + ret0, _ := ret[0].(string) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// StreamNameBySubject indicates an expected call of StreamNameBySubject. +func (mr *MockJetStreamContextInterfaceMockRecorder) StreamNameBySubject(arg0 interface{}, arg1 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0}, arg1...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StreamNameBySubject", reflect.TypeOf((*MockJetStreamContextInterface)(nil).StreamNameBySubject), varargs...) +} + +// StreamNames mocks base method. +func (m *MockJetStreamContextInterface) StreamNames(opts ...nats_go.JSOpt) <-chan string { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "StreamNames", varargs...) + ret0, _ := ret[0].(<-chan string) + return ret0 +} + +// StreamNames indicates an expected call of StreamNames. +func (mr *MockJetStreamContextInterfaceMockRecorder) StreamNames(opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StreamNames", reflect.TypeOf((*MockJetStreamContextInterface)(nil).StreamNames), opts...) +} + +// Streams mocks base method. +func (m *MockJetStreamContextInterface) Streams(opts ...nats_go.JSOpt) <-chan *nats_go.StreamInfo { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "Streams", varargs...) + ret0, _ := ret[0].(<-chan *nats_go.StreamInfo) + return ret0 +} + +// Streams indicates an expected call of Streams. +func (mr *MockJetStreamContextInterfaceMockRecorder) Streams(opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Streams", reflect.TypeOf((*MockJetStreamContextInterface)(nil).Streams), opts...) +} + +// StreamsInfo mocks base method. +func (m *MockJetStreamContextInterface) StreamsInfo(opts ...nats_go.JSOpt) <-chan *nats_go.StreamInfo { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "StreamsInfo", varargs...) + ret0, _ := ret[0].(<-chan *nats_go.StreamInfo) + return ret0 +} + +// StreamsInfo indicates an expected call of StreamsInfo. +func (mr *MockJetStreamContextInterfaceMockRecorder) StreamsInfo(opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StreamsInfo", reflect.TypeOf((*MockJetStreamContextInterface)(nil).StreamsInfo), opts...) +} + +// Subscribe mocks base method. +func (m *MockJetStreamContextInterface) Subscribe(subj string, cb nats_go.MsgHandler, opts ...nats_go.SubOpt) (*nats_go.Subscription, error) { + m.ctrl.T.Helper() + varargs := []interface{}{subj, cb} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "Subscribe", varargs...) + ret0, _ := ret[0].(*nats_go.Subscription) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Subscribe indicates an expected call of Subscribe. +func (mr *MockJetStreamContextInterfaceMockRecorder) Subscribe(subj, cb interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{subj, cb}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Subscribe", reflect.TypeOf((*MockJetStreamContextInterface)(nil).Subscribe), varargs...) +} + +// SubscribeSync mocks base method. +func (m *MockJetStreamContextInterface) SubscribeSync(subj string, opts ...nats_go.SubOpt) (*nats_go.Subscription, error) { + m.ctrl.T.Helper() + varargs := []interface{}{subj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "SubscribeSync", varargs...) + ret0, _ := ret[0].(*nats_go.Subscription) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SubscribeSync indicates an expected call of SubscribeSync. +func (mr *MockJetStreamContextInterfaceMockRecorder) SubscribeSync(subj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{subj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubscribeSync", reflect.TypeOf((*MockJetStreamContextInterface)(nil).SubscribeSync), varargs...) +} + +// UpdateConsumer mocks base method. +func (m *MockJetStreamContextInterface) UpdateConsumer(stream string, cfg *nats_go.ConsumerConfig, opts ...nats_go.JSOpt) (*nats_go.ConsumerInfo, error) { + m.ctrl.T.Helper() + varargs := []interface{}{stream, cfg} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateConsumer", varargs...) + ret0, _ := ret[0].(*nats_go.ConsumerInfo) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateConsumer indicates an expected call of UpdateConsumer. +func (mr *MockJetStreamContextInterfaceMockRecorder) UpdateConsumer(stream, cfg interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{stream, cfg}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateConsumer", reflect.TypeOf((*MockJetStreamContextInterface)(nil).UpdateConsumer), varargs...) +} + +// UpdateStream mocks base method. +func (m *MockJetStreamContextInterface) UpdateStream(cfg *nats_go.StreamConfig, opts ...nats_go.JSOpt) (*nats_go.StreamInfo, error) { + m.ctrl.T.Helper() + varargs := []interface{}{cfg} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateStream", varargs...) + ret0, _ := ret[0].(*nats_go.StreamInfo) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateStream indicates an expected call of UpdateStream. +func (mr *MockJetStreamContextInterfaceMockRecorder) UpdateStream(cfg interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{cfg}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateStream", reflect.TypeOf((*MockJetStreamContextInterface)(nil).UpdateStream), varargs...) +}