From 38e1ac97226eff1d5f4312a8ead13ae1b998382f Mon Sep 17 00:00:00 2001 From: 06kellyjac Date: Wed, 18 Jun 2025 12:49:47 +0100 Subject: [PATCH 1/4] chore: Apply .editorconfig rules to both yml and yaml --- .editorconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index bc321db7b2..d20e3a9a5e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -19,7 +19,7 @@ indent_size = 4 indent_style = space indent_size = 2 -[*.yml] +[*.{yml,yaml}] indent_style = space indent_size = 2 From 0630d4552aff7ff5af3af7522b94a0c1f55fc5fd Mon Sep 17 00:00:00 2001 From: 06kellyjac Date: Wed, 18 Jun 2025 12:51:16 +0100 Subject: [PATCH 2/4] chore: bump mockery to 3.4.0 --- .bingo/Variables.mk | 6 +- .bingo/mockery.mod | 6 +- .bingo/mockery.sum | 594 ++++--------------------------------------- .bingo/variables.env | 2 +- 4 files changed, 58 insertions(+), 550 deletions(-) diff --git a/.bingo/Variables.mk b/.bingo/Variables.mk index c25ce5e136..2b523831a6 100644 --- a/.bingo/Variables.mk +++ b/.bingo/Variables.mk @@ -65,11 +65,11 @@ $(GOVULNCHECK): $(BINGO_DIR)/govulncheck.mod @echo "(re)installing $(GOBIN)/govulncheck-v1.1.4" @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=govulncheck.mod -o=$(GOBIN)/govulncheck-v1.1.4 "golang.org/x/vuln/cmd/govulncheck" -MOCKERY := $(GOBIN)/mockery-v2.53.2 +MOCKERY := $(GOBIN)/mockery-v3.4.0 $(MOCKERY): $(BINGO_DIR)/mockery.mod @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. - @echo "(re)installing $(GOBIN)/mockery-v2.53.2" - @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=mockery.mod -o=$(GOBIN)/mockery-v2.53.2 "github.com/vektra/mockery/v2" + @echo "(re)installing $(GOBIN)/mockery-v3.4.0" + @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=mockery.mod -o=$(GOBIN)/mockery-v3.4.0 "github.com/vektra/mockery/v3" MUTAGEN := $(GOBIN)/mutagen-v0.18.1 $(MUTAGEN): $(BINGO_DIR)/mutagen.mod diff --git a/.bingo/mockery.mod b/.bingo/mockery.mod index 448afe1c88..8b25958776 100644 --- a/.bingo/mockery.mod +++ b/.bingo/mockery.mod @@ -1,7 +1,5 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT -go 1.24 +go 1.24.0 -toolchain go1.24.0 - -require github.com/vektra/mockery/v2 v2.53.2 +require github.com/vektra/mockery/v3 v3.4.0 diff --git a/.bingo/mockery.sum b/.bingo/mockery.sum index 85d023852c..2ee42ea8f1 100644 --- a/.bingo/mockery.sum +++ b/.bingo/mockery.sum @@ -1,577 +1,87 @@ -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= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/chigopher/pathlib v0.19.1 h1:RoLlUJc0CqBGwq239cilyhxPNLXTK+HXoASGyGznx5A= -github.com/chigopher/pathlib v0.19.1/go.mod h1:tzC1dZLW8o33UQpWkNkhvPwL5n4yyFRFm/jL1YGWFvY= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/brunoga/deep v1.2.4 h1:Aj9E9oUbE+ccbyh35VC/NHlzzjfIVU69BXu2mt2LmL8= +github.com/brunoga/deep v1.2.4/go.mod h1:GDV6dnXqn80ezsLSZ5Wlv1PdKAWAO4L5PnKYtv2dgaI= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= +github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -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/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= -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/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU= -github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= -github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= -github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/huandu/xstrings v1.5.0 h1:2ag3IFq9ZDANvthTwTiqSSZLjDc+BedvHPAp5tJy2TI= +github.com/huandu/xstrings v1.5.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/jinzhu/copier v0.3.5 h1:GlvfUwHk62RokgqVNvYsku0TATCF7bAHVwEXoBh3iJg= -github.com/jinzhu/copier v0.3.5/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg= -github.com/jinzhu/copier v0.4.0 h1:w3ciUoD19shMCRargcpm0cm91ytaBhDvuRpz1ODO/U8= -github.com/jinzhu/copier v0.4.0/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= -github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/magiconair/properties v1.8.9 h1:nWcCbLq1N2v/cpNsy5WvQ37Fb+YElfq20WJ/a8RkpQM= -github.com/magiconair/properties v1.8.9/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/jedib0t/go-pretty/v6 v6.6.7 h1:m+LbHpm0aIAPLzLbMfn8dc3Ht8MW7lsSO4MPItz/Uuo= +github.com/jedib0t/go-pretty/v6 v6.6.7/go.mod h1:YwC5CE4fJ1HFUDeivSV1r//AmANFHyqczZk+U6BDALU= +github.com/knadh/koanf/maps v0.1.2 h1:RBfmAW5CnZT+PJ1CVc1QSJKf4Xu9kxfQgYVQSu8hpbo= +github.com/knadh/koanf/maps v0.1.2/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= +github.com/knadh/koanf/parsers/yaml v0.1.0 h1:ZZ8/iGfRLvKSaMEECEBPM1HQslrZADk8fP1XFUxVI5w= +github.com/knadh/koanf/parsers/yaml v0.1.0/go.mod h1:cvbUDC7AL23pImuQP0oRw/hPuccrNBS2bps8asS0CwY= +github.com/knadh/koanf/providers/env v1.0.0 h1:ufePaI9BnWH+ajuxGGiJ8pdTG0uLEUWC7/HDDPGLah0= +github.com/knadh/koanf/providers/env v1.0.0/go.mod h1:mzFyRZueYhb37oPmC1HAv/oGEEuyvJDA98r3XAa8Gak= +github.com/knadh/koanf/providers/file v1.1.2 h1:aCC36YGOgV5lTtAFz2qkgtWdeQsgfxUkxDOe+2nQY3w= +github.com/knadh/koanf/providers/file v1.1.2/go.mod h1:/faSBcv2mxPVjFrXck95qeoyoZ5myJ6uxN8OOVNJJCI= +github.com/knadh/koanf/providers/posflag v0.1.0 h1:mKJlLrKPcAP7Ootf4pBZWJ6J+4wHYujwipe7Ie3qW6U= +github.com/knadh/koanf/providers/posflag v0.1.0/go.mod h1:SYg03v/t8ISBNrMBRMlojH8OsKowbkXV7giIbBVgbz0= +github.com/knadh/koanf/providers/structs v0.1.0 h1:wJRteCNn1qvLtE5h8KQBvLJovidSdntfdyIbbCzEyE0= +github.com/knadh/koanf/providers/structs v0.1.0/go.mod h1:sw2YZ3txUcqA3Z27gPlmmBzWn1h8Nt9O6EP/91MkcWE= +github.com/knadh/koanf/v2 v2.2.1 h1:jaleChtw85y3UdBnI0wCqcg1sj1gPoz6D3caGNHtrNE= +github.com/knadh/koanf/v2 v2.2.1/go.mod h1:PSFru3ufQgTsI7IF+95rf9s8XA1+aHxKuO/W+dPoHEY= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= -github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -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/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU= -github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= -github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= -github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= +github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.29.0 h1:Zes4hju04hjbvkVkOhdl2HpZa+0PmVwigmo8XoORE5w= -github.com/rs/zerolog v1.29.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sagikazarmark/locafero v0.7.0 h1:5MqpDsTGNDhY8sGp0Aowyf0qKsPrhewaLSsFaodPcyo= -github.com/sagikazarmark/locafero v0.7.0/go.mod h1:2za3Cg5rMaTMoG/2Ulr9AwtFaIppKXTRYnozin4aB5k= -github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= -github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= -github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= -github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= -github.com/spf13/afero v1.9.3 h1:41FoI0fD7OR7mGcKE/aOiLkGreyf8ifIOQmJANWogMk= -github.com/spf13/afero v1.9.3/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= -github.com/spf13/afero v1.12.0 h1:UcOPyRBYczmFn6yvphxkn9ZEOY65cpwGKb5mL36mrqs= -github.com/spf13/afero v1.12.0/go.mod h1:ZTlWwG4/ahT8W7T0WQ5uYmjI9duaLQGy3Q2OAl4sk/4= -github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= -github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= -github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= -github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= -github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= -github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= -github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= -github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= -github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= -github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= -github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= -github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= -github.com/vektra/mockery/v2 v2.40.1 h1:8D01rBqloDLDHKZGXkyUD9Yj5Z+oDXBqDZ+tRXYM/oA= -github.com/vektra/mockery/v2 v2.40.1/go.mod h1:dPzGtjT0/Uu4hqpF6QNHwz+GLago7lq1bxdj9wHbGKo= -github.com/vektra/mockery/v2 v2.40.2 h1:JKuQ74IXibMCGKG6F0yvH/s2sNs1CHy/nGBP0We5DJ8= -github.com/vektra/mockery/v2 v2.40.2/go.mod h1:KYBZF/7sqOa86BaOZPYsoCZWEWLS90a5oBLg2pVudxY= -github.com/vektra/mockery/v2 v2.43.2 h1:OdivAsQL/uoQ55UnTt25tliRI8kaj5j6caHk9xaAUD0= -github.com/vektra/mockery/v2 v2.43.2/go.mod h1:XNTE9RIu3deGAGQRVjP1VZxGpQNm0YedZx4oDs3prr8= -github.com/vektra/mockery/v2 v2.53.0 h1:QyZI8V2c+7oOEP/OnZjMMPlONXTgSsiLtaszzUz0yz0= -github.com/vektra/mockery/v2 v2.53.0/go.mod h1:d0FVY5GgakIHczpYNVMLpYF2DttDgc97fHFTMcT3xlE= -github.com/vektra/mockery/v2 v2.53.2 h1:4G/4fl9x722Yb8hLqH1YU3XZNRJFwl5KUMvpkmAyuC8= -github.com/vektra/mockery/v2 v2.53.2/go.mod h1:UJT+mgXhCcOCHXTnM5cJHCZL+d76BYB+EbY1sFztEB8= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= -go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20250210185358-939b2ce775ac h1:l5+whBCLH3iH2ZNHYLbAe58bo7yrN4mVcnkHDYz5vvs= -golang.org/x/exp v0.0.0-20250210185358-939b2ce775ac/go.mod h1:hH+7mtFmImwwcMvScyxUhjuVHR3HGaDPMn9rMSUUbxo= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= -golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM= -golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= -golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/vektra/mockery/v3 v3.4.0 h1:PqaVrJASwCeW+zuLIIrTD1ripo7SZlUqOi+uVtU4RLw= +github.com/vektra/mockery/v3 v3.4.0/go.mod h1:nHEhwwFt+3/CD3XdeklPWnRpDL96KNZgRiGuMPZNjN8= +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= +github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= +github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= +golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= +golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= +golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ= +golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= -golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= +golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= -golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= -golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= -golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= -golang.org/x/tools v0.30.0 h1:BgcpHewrV5AUp2G9MebG4XPFI1E2W41zU1SaqVA9vJY= -golang.org/x/tools v0.30.0/go.mod h1:c347cR/OJfw5TI+GfX7RUPNMdDRRbjvYTS0jPyvsVtY= -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= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +golang.org/x/tools v0.33.0 h1:4qz2S3zmRxbGIhDIAgjxvFutSvH5EfnsYrRBj0UI0bc= +golang.org/x/tools v0.33.0/go.mod h1:CIJMaWEY88juyUfo7UbgPqbC8rU2OqfAV1h2Qp0oMYI= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= -gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/.bingo/variables.env b/.bingo/variables.env index 307fc694cd..5107cf10b6 100644 --- a/.bingo/variables.env +++ b/.bingo/variables.env @@ -24,7 +24,7 @@ GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.64.6" GOVULNCHECK="${GOBIN}/govulncheck-v1.1.4" -MOCKERY="${GOBIN}/mockery-v2.53.2" +MOCKERY="${GOBIN}/mockery-v3.4.0" MUTAGEN="${GOBIN}/mutagen-v0.18.1" From 2a3a20693a11355c2a6a5ba871bf254ef45287e0 Mon Sep 17 00:00:00 2001 From: 06kellyjac Date: Wed, 18 Jun 2025 12:53:22 +0100 Subject: [PATCH 3/4] build: Modify mockery config to work with v3 Maintaining the positioning of the files from v2 to reduce cognitive load. Indentation of yaml files now matches `.editorconfig`. All mock files regenerated. Added empty `{}` following convention from `mockery init` etc. Removed directory specification where it would already match. --- pkg/.mockery.yaml | 19 +- pkg/oidc/mocks/oidc_client.go | 164 +-- protogen/.mockery.yaml | 43 +- .../v0/mocks/event_history_service.go | 318 +++--- .../v0/mocks/policies_provider_service.go | 178 ++-- .../v0/mocks/search_provider_service.go | 318 +++--- .../settings/v0/mocks/value_service.go | 598 ++++++----- .../thumbnails/v0/mocks/thumbnail_service.go | 178 ++-- services/antivirus/.mockery.yaml | 19 +- .../antivirus/pkg/scanners/mocks/scanner.go | 68 +- services/collaboration/.mockery.yaml | 48 +- .../collaboration/mocks/connector_service.go | 64 +- .../mocks/content_connector_service.go | 122 ++- .../mocks/file_connector_service.go | 421 +++++--- .../collaboration/mocks/gateway_selector.go | 84 +- services/collaboration/mocks/lock_parser.go | 61 +- services/graph/.mockery.yaml | 88 +- services/graph/mocks/base_graph_provider.go | 121 ++- .../mocks/drive_item_permissions_provider.go | 572 +++++++---- .../graph/mocks/drives_drive_item_provider.go | 286 ++++-- services/graph/mocks/gateway_selector.go | 84 +- services/graph/mocks/http_client.go | 68 +- services/graph/mocks/permissions.go | 223 ++-- services/graph/mocks/publisher.go | 166 +-- services/graph/mocks/role_service.go | 348 ++++--- services/graph/mocks/storage.go | 483 +++++---- .../users_user_profile_photo_provider.go | 140 ++- services/graph/pkg/identity/mocks/backend.go | 622 ++++++++---- .../pkg/identity/mocks/education_backend.go | 961 +++++++++++------- .../graph/pkg/identity/mocks/ldapclient.go | 900 +++++++++------- services/invitations/.mockery.yaml | 22 +- .../pkg/backends/keycloak/mocks/client.go | 216 ++-- services/proxy/.mockery.yaml | 28 +- .../pkg/user/backend/mocks/user_backend.go | 243 +++-- .../pkg/userroles/mocks/user_role_assigner.go | 120 ++- services/search/.mockery.yaml | 33 +- .../search/pkg/content/mocks/extractor.go | 79 +- .../search/pkg/content/mocks/retriever.go | 78 +- services/search/pkg/engine/mocks/engine.go | 242 +++-- services/search/pkg/search/mocks/searcher.go | 171 ++-- services/settings/.mockery.yaml | 20 +- .../settings/pkg/settings/mocks/manager.go | 640 +++++++----- 42 files changed, 5647 insertions(+), 4010 deletions(-) diff --git a/pkg/.mockery.yaml b/pkg/.mockery.yaml index 1861862ac5..e7417d5e58 100644 --- a/pkg/.mockery.yaml +++ b/pkg/.mockery.yaml @@ -1,12 +1,11 @@ -issue-845-fix: True -resolve-type-alias: False -with-expecter: true -disable-version-string: True +# maintain v2 separate mocks dir +dir: "{{.InterfaceDir}}/mocks" +structname: "{{.InterfaceName}}" filename: "{{.InterfaceName | snakecase }}.go" -dir: "{{.PackageName}}/mocks" -mockname: "{{.InterfaceName}}" -outpkg: "mocks" +pkgname: mocks + +template: testify packages: - github.com/opencloud-eu/opencloud/pkg/oidc: - interfaces: - OIDCClient: + github.com/opencloud-eu/opencloud/pkg/oidc: + interfaces: + OIDCClient: {} diff --git a/pkg/oidc/mocks/oidc_client.go b/pkg/oidc/mocks/oidc_client.go index 10f8ad8a39..dd0c1ad59e 100644 --- a/pkg/oidc/mocks/oidc_client.go +++ b/pkg/oidc/mocks/oidc_client.go @@ -1,18 +1,32 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" + "context" - jwt "github.com/golang-jwt/jwt/v5" + "github.com/golang-jwt/jwt/v5" + "github.com/opencloud-eu/opencloud/pkg/oidc" mock "github.com/stretchr/testify/mock" - - oauth2 "golang.org/x/oauth2" - - oidc "github.com/opencloud-eu/opencloud/pkg/oidc" + "golang.org/x/oauth2" ) +// NewOIDCClient creates a new instance of OIDCClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewOIDCClient(t interface { + mock.TestingT + Cleanup(func()) +}) *OIDCClient { + mock := &OIDCClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // OIDCClient is an autogenerated mock type for the OIDCClient type type OIDCClient struct { mock.Mock @@ -26,9 +40,9 @@ func (_m *OIDCClient) EXPECT() *OIDCClient_Expecter { return &OIDCClient_Expecter{mock: &_m.Mock} } -// UserInfo provides a mock function with given fields: ctx, ts -func (_m *OIDCClient) UserInfo(ctx context.Context, ts oauth2.TokenSource) (*oidc.UserInfo, error) { - ret := _m.Called(ctx, ts) +// UserInfo provides a mock function for the type OIDCClient +func (_mock *OIDCClient) UserInfo(ctx context.Context, ts oauth2.TokenSource) (*oidc.UserInfo, error) { + ret := _mock.Called(ctx, ts) if len(ret) == 0 { panic("no return value specified for UserInfo") @@ -36,23 +50,21 @@ func (_m *OIDCClient) UserInfo(ctx context.Context, ts oauth2.TokenSource) (*oid var r0 *oidc.UserInfo var r1 error - if rf, ok := ret.Get(0).(func(context.Context, oauth2.TokenSource) (*oidc.UserInfo, error)); ok { - return rf(ctx, ts) + if returnFunc, ok := ret.Get(0).(func(context.Context, oauth2.TokenSource) (*oidc.UserInfo, error)); ok { + return returnFunc(ctx, ts) } - if rf, ok := ret.Get(0).(func(context.Context, oauth2.TokenSource) *oidc.UserInfo); ok { - r0 = rf(ctx, ts) + if returnFunc, ok := ret.Get(0).(func(context.Context, oauth2.TokenSource) *oidc.UserInfo); ok { + r0 = returnFunc(ctx, ts) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*oidc.UserInfo) } } - - if rf, ok := ret.Get(1).(func(context.Context, oauth2.TokenSource) error); ok { - r1 = rf(ctx, ts) + if returnFunc, ok := ret.Get(1).(func(context.Context, oauth2.TokenSource) error); ok { + r1 = returnFunc(ctx, ts) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -70,24 +82,35 @@ func (_e *OIDCClient_Expecter) UserInfo(ctx interface{}, ts interface{}) *OIDCCl func (_c *OIDCClient_UserInfo_Call) Run(run func(ctx context.Context, ts oauth2.TokenSource)) *OIDCClient_UserInfo_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(oauth2.TokenSource)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 oauth2.TokenSource + if args[1] != nil { + arg1 = args[1].(oauth2.TokenSource) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *OIDCClient_UserInfo_Call) Return(_a0 *oidc.UserInfo, _a1 error) *OIDCClient_UserInfo_Call { - _c.Call.Return(_a0, _a1) +func (_c *OIDCClient_UserInfo_Call) Return(userInfo *oidc.UserInfo, err error) *OIDCClient_UserInfo_Call { + _c.Call.Return(userInfo, err) return _c } -func (_c *OIDCClient_UserInfo_Call) RunAndReturn(run func(context.Context, oauth2.TokenSource) (*oidc.UserInfo, error)) *OIDCClient_UserInfo_Call { +func (_c *OIDCClient_UserInfo_Call) RunAndReturn(run func(ctx context.Context, ts oauth2.TokenSource) (*oidc.UserInfo, error)) *OIDCClient_UserInfo_Call { _c.Call.Return(run) return _c } -// VerifyAccessToken provides a mock function with given fields: ctx, token -func (_m *OIDCClient) VerifyAccessToken(ctx context.Context, token string) (oidc.RegClaimsWithSID, jwt.MapClaims, error) { - ret := _m.Called(ctx, token) +// VerifyAccessToken provides a mock function for the type OIDCClient +func (_mock *OIDCClient) VerifyAccessToken(ctx context.Context, token string) (oidc.RegClaimsWithSID, jwt.MapClaims, error) { + ret := _mock.Called(ctx, token) if len(ret) == 0 { panic("no return value specified for VerifyAccessToken") @@ -96,29 +119,26 @@ func (_m *OIDCClient) VerifyAccessToken(ctx context.Context, token string) (oidc var r0 oidc.RegClaimsWithSID var r1 jwt.MapClaims var r2 error - if rf, ok := ret.Get(0).(func(context.Context, string) (oidc.RegClaimsWithSID, jwt.MapClaims, error)); ok { - return rf(ctx, token) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) (oidc.RegClaimsWithSID, jwt.MapClaims, error)); ok { + return returnFunc(ctx, token) } - if rf, ok := ret.Get(0).(func(context.Context, string) oidc.RegClaimsWithSID); ok { - r0 = rf(ctx, token) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) oidc.RegClaimsWithSID); ok { + r0 = returnFunc(ctx, token) } else { r0 = ret.Get(0).(oidc.RegClaimsWithSID) } - - if rf, ok := ret.Get(1).(func(context.Context, string) jwt.MapClaims); ok { - r1 = rf(ctx, token) + if returnFunc, ok := ret.Get(1).(func(context.Context, string) jwt.MapClaims); ok { + r1 = returnFunc(ctx, token) } else { if ret.Get(1) != nil { r1 = ret.Get(1).(jwt.MapClaims) } } - - if rf, ok := ret.Get(2).(func(context.Context, string) error); ok { - r2 = rf(ctx, token) + if returnFunc, ok := ret.Get(2).(func(context.Context, string) error); ok { + r2 = returnFunc(ctx, token) } else { r2 = ret.Error(2) } - return r0, r1, r2 } @@ -136,24 +156,35 @@ func (_e *OIDCClient_Expecter) VerifyAccessToken(ctx interface{}, token interfac func (_c *OIDCClient_VerifyAccessToken_Call) Run(run func(ctx context.Context, token string)) *OIDCClient_VerifyAccessToken_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *OIDCClient_VerifyAccessToken_Call) Return(_a0 oidc.RegClaimsWithSID, _a1 jwt.MapClaims, _a2 error) *OIDCClient_VerifyAccessToken_Call { - _c.Call.Return(_a0, _a1, _a2) +func (_c *OIDCClient_VerifyAccessToken_Call) Return(regClaimsWithSID oidc.RegClaimsWithSID, mapClaims jwt.MapClaims, err error) *OIDCClient_VerifyAccessToken_Call { + _c.Call.Return(regClaimsWithSID, mapClaims, err) return _c } -func (_c *OIDCClient_VerifyAccessToken_Call) RunAndReturn(run func(context.Context, string) (oidc.RegClaimsWithSID, jwt.MapClaims, error)) *OIDCClient_VerifyAccessToken_Call { +func (_c *OIDCClient_VerifyAccessToken_Call) RunAndReturn(run func(ctx context.Context, token string) (oidc.RegClaimsWithSID, jwt.MapClaims, error)) *OIDCClient_VerifyAccessToken_Call { _c.Call.Return(run) return _c } -// VerifyLogoutToken provides a mock function with given fields: ctx, token -func (_m *OIDCClient) VerifyLogoutToken(ctx context.Context, token string) (*oidc.LogoutToken, error) { - ret := _m.Called(ctx, token) +// VerifyLogoutToken provides a mock function for the type OIDCClient +func (_mock *OIDCClient) VerifyLogoutToken(ctx context.Context, token string) (*oidc.LogoutToken, error) { + ret := _mock.Called(ctx, token) if len(ret) == 0 { panic("no return value specified for VerifyLogoutToken") @@ -161,23 +192,21 @@ func (_m *OIDCClient) VerifyLogoutToken(ctx context.Context, token string) (*oid var r0 *oidc.LogoutToken var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*oidc.LogoutToken, error)); ok { - return rf(ctx, token) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*oidc.LogoutToken, error)); ok { + return returnFunc(ctx, token) } - if rf, ok := ret.Get(0).(func(context.Context, string) *oidc.LogoutToken); ok { - r0 = rf(ctx, token) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) *oidc.LogoutToken); ok { + r0 = returnFunc(ctx, token) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*oidc.LogoutToken) } } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, token) + if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = returnFunc(ctx, token) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -195,31 +224,28 @@ func (_e *OIDCClient_Expecter) VerifyLogoutToken(ctx interface{}, token interfac func (_c *OIDCClient_VerifyLogoutToken_Call) Run(run func(ctx context.Context, token string)) *OIDCClient_VerifyLogoutToken_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *OIDCClient_VerifyLogoutToken_Call) Return(_a0 *oidc.LogoutToken, _a1 error) *OIDCClient_VerifyLogoutToken_Call { - _c.Call.Return(_a0, _a1) +func (_c *OIDCClient_VerifyLogoutToken_Call) Return(logoutToken *oidc.LogoutToken, err error) *OIDCClient_VerifyLogoutToken_Call { + _c.Call.Return(logoutToken, err) return _c } -func (_c *OIDCClient_VerifyLogoutToken_Call) RunAndReturn(run func(context.Context, string) (*oidc.LogoutToken, error)) *OIDCClient_VerifyLogoutToken_Call { +func (_c *OIDCClient_VerifyLogoutToken_Call) RunAndReturn(run func(ctx context.Context, token string) (*oidc.LogoutToken, error)) *OIDCClient_VerifyLogoutToken_Call { _c.Call.Return(run) return _c } - -// NewOIDCClient creates a new instance of OIDCClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewOIDCClient(t interface { - mock.TestingT - Cleanup(func()) -}) *OIDCClient { - mock := &OIDCClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/protogen/.mockery.yaml b/protogen/.mockery.yaml index e3b0bab5b7..2d7ae5fe85 100644 --- a/protogen/.mockery.yaml +++ b/protogen/.mockery.yaml @@ -1,24 +1,23 @@ -issue-845-fix: True -resolve-type-alias: False -with-expecter: true -disable-version-string: True -filename: "{{.InterfaceName | snakecase }}.go" +# maintain v2 separate mocks dir dir: "{{.InterfaceDir}}/mocks" -mockname: "{{.InterfaceName}}" -outpkg: "mocks" +structname: "{{.InterfaceName}}" +filename: "{{.InterfaceName | snakecase }}.go" +pkgname: mocks + +template: testify packages: - github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/eventhistory/v0: - interfaces: - EventHistoryService: - github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/policies/v0: - interfaces: - PoliciesProviderService: - github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/search/v0: - interfaces: - SearchProviderService: - github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/settings/v0: - interfaces: - ValueService: - github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/thumbnails/v0: - interfaces: - ThumbnailService: + github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/eventhistory/v0: + interfaces: + EventHistoryService: {} + github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/policies/v0: + interfaces: + PoliciesProviderService: {} + github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/search/v0: + interfaces: + SearchProviderService: {} + github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/settings/v0: + interfaces: + ValueService: {} + github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/thumbnails/v0: + interfaces: + ThumbnailService: {} diff --git a/protogen/gen/opencloud/services/eventhistory/v0/mocks/event_history_service.go b/protogen/gen/opencloud/services/eventhistory/v0/mocks/event_history_service.go index 1d755b0bf5..0aded2cded 100644 --- a/protogen/gen/opencloud/services/eventhistory/v0/mocks/event_history_service.go +++ b/protogen/gen/opencloud/services/eventhistory/v0/mocks/event_history_service.go @@ -1,178 +1,17 @@ -// Code generated by mockery v2.50.2. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" - - client "go-micro.dev/v4/client" + "context" + "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/eventhistory/v0" mock "github.com/stretchr/testify/mock" - - v0 "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/eventhistory/v0" + "go-micro.dev/v4/client" ) -// EventHistoryService is an autogenerated mock type for the EventHistoryService type -type EventHistoryService struct { - mock.Mock -} - -type EventHistoryService_Expecter struct { - mock *mock.Mock -} - -func (_m *EventHistoryService) EXPECT() *EventHistoryService_Expecter { - return &EventHistoryService_Expecter{mock: &_m.Mock} -} - -// GetEvents provides a mock function with given fields: ctx, in, opts -func (_m *EventHistoryService) GetEvents(ctx context.Context, in *v0.GetEventsRequest, opts ...client.CallOption) (*v0.GetEventsResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for GetEvents") - } - - var r0 *v0.GetEventsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v0.GetEventsRequest, ...client.CallOption) (*v0.GetEventsResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *v0.GetEventsRequest, ...client.CallOption) *v0.GetEventsResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*v0.GetEventsResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *v0.GetEventsRequest, ...client.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// EventHistoryService_GetEvents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEvents' -type EventHistoryService_GetEvents_Call struct { - *mock.Call -} - -// GetEvents is a helper method to define mock.On call -// - ctx context.Context -// - in *v0.GetEventsRequest -// - opts ...client.CallOption -func (_e *EventHistoryService_Expecter) GetEvents(ctx interface{}, in interface{}, opts ...interface{}) *EventHistoryService_GetEvents_Call { - return &EventHistoryService_GetEvents_Call{Call: _e.mock.On("GetEvents", - append([]interface{}{ctx, in}, opts...)...)} -} - -func (_c *EventHistoryService_GetEvents_Call) Run(run func(ctx context.Context, in *v0.GetEventsRequest, opts ...client.CallOption)) *EventHistoryService_GetEvents_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]client.CallOption, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(client.CallOption) - } - } - run(args[0].(context.Context), args[1].(*v0.GetEventsRequest), variadicArgs...) - }) - return _c -} - -func (_c *EventHistoryService_GetEvents_Call) Return(_a0 *v0.GetEventsResponse, _a1 error) *EventHistoryService_GetEvents_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *EventHistoryService_GetEvents_Call) RunAndReturn(run func(context.Context, *v0.GetEventsRequest, ...client.CallOption) (*v0.GetEventsResponse, error)) *EventHistoryService_GetEvents_Call { - _c.Call.Return(run) - return _c -} - -// GetEventsForUser provides a mock function with given fields: ctx, in, opts -func (_m *EventHistoryService) GetEventsForUser(ctx context.Context, in *v0.GetEventsForUserRequest, opts ...client.CallOption) (*v0.GetEventsResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for GetEventsForUser") - } - - var r0 *v0.GetEventsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v0.GetEventsForUserRequest, ...client.CallOption) (*v0.GetEventsResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *v0.GetEventsForUserRequest, ...client.CallOption) *v0.GetEventsResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*v0.GetEventsResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *v0.GetEventsForUserRequest, ...client.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// EventHistoryService_GetEventsForUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEventsForUser' -type EventHistoryService_GetEventsForUser_Call struct { - *mock.Call -} - -// GetEventsForUser is a helper method to define mock.On call -// - ctx context.Context -// - in *v0.GetEventsForUserRequest -// - opts ...client.CallOption -func (_e *EventHistoryService_Expecter) GetEventsForUser(ctx interface{}, in interface{}, opts ...interface{}) *EventHistoryService_GetEventsForUser_Call { - return &EventHistoryService_GetEventsForUser_Call{Call: _e.mock.On("GetEventsForUser", - append([]interface{}{ctx, in}, opts...)...)} -} - -func (_c *EventHistoryService_GetEventsForUser_Call) Run(run func(ctx context.Context, in *v0.GetEventsForUserRequest, opts ...client.CallOption)) *EventHistoryService_GetEventsForUser_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]client.CallOption, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(client.CallOption) - } - } - run(args[0].(context.Context), args[1].(*v0.GetEventsForUserRequest), variadicArgs...) - }) - return _c -} - -func (_c *EventHistoryService_GetEventsForUser_Call) Return(_a0 *v0.GetEventsResponse, _a1 error) *EventHistoryService_GetEventsForUser_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *EventHistoryService_GetEventsForUser_Call) RunAndReturn(run func(context.Context, *v0.GetEventsForUserRequest, ...client.CallOption) (*v0.GetEventsResponse, error)) *EventHistoryService_GetEventsForUser_Call { - _c.Call.Return(run) - return _c -} - // NewEventHistoryService creates a new instance of EventHistoryService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewEventHistoryService(t interface { @@ -186,3 +25,148 @@ func NewEventHistoryService(t interface { return mock } + +// EventHistoryService is an autogenerated mock type for the EventHistoryService type +type EventHistoryService struct { + mock.Mock +} + +type EventHistoryService_Expecter struct { + mock *mock.Mock +} + +func (_m *EventHistoryService) EXPECT() *EventHistoryService_Expecter { + return &EventHistoryService_Expecter{mock: &_m.Mock} +} + +// GetEvents provides a mock function for the type EventHistoryService +func (_mock *EventHistoryService) GetEvents(ctx context.Context, in *v0.GetEventsRequest, opts ...client.CallOption) (*v0.GetEventsResponse, error) { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(ctx, in, opts) + } else { + tmpRet = _mock.Called(ctx, in) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for GetEvents") + } + + var r0 *v0.GetEventsResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetEventsRequest, ...client.CallOption) (*v0.GetEventsResponse, error)); ok { + return returnFunc(ctx, in, opts...) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetEventsRequest, ...client.CallOption) *v0.GetEventsResponse); ok { + r0 = returnFunc(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v0.GetEventsResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.GetEventsRequest, ...client.CallOption) error); ok { + r1 = returnFunc(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// EventHistoryService_GetEvents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEvents' +type EventHistoryService_GetEvents_Call struct { + *mock.Call +} + +// GetEvents is a helper method to define mock.On call +// - ctx +// - in +// - opts +func (_e *EventHistoryService_Expecter) GetEvents(ctx interface{}, in interface{}, opts ...interface{}) *EventHistoryService_GetEvents_Call { + return &EventHistoryService_GetEvents_Call{Call: _e.mock.On("GetEvents", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *EventHistoryService_GetEvents_Call) Run(run func(ctx context.Context, in *v0.GetEventsRequest, opts ...client.CallOption)) *EventHistoryService_GetEvents_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := args[2].([]client.CallOption) + run(args[0].(context.Context), args[1].(*v0.GetEventsRequest), variadicArgs...) + }) + return _c +} + +func (_c *EventHistoryService_GetEvents_Call) Return(getEventsResponse *v0.GetEventsResponse, err error) *EventHistoryService_GetEvents_Call { + _c.Call.Return(getEventsResponse, err) + return _c +} + +func (_c *EventHistoryService_GetEvents_Call) RunAndReturn(run func(ctx context.Context, in *v0.GetEventsRequest, opts ...client.CallOption) (*v0.GetEventsResponse, error)) *EventHistoryService_GetEvents_Call { + _c.Call.Return(run) + return _c +} + +// GetEventsForUser provides a mock function for the type EventHistoryService +func (_mock *EventHistoryService) GetEventsForUser(ctx context.Context, in *v0.GetEventsForUserRequest, opts ...client.CallOption) (*v0.GetEventsResponse, error) { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(ctx, in, opts) + } else { + tmpRet = _mock.Called(ctx, in) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for GetEventsForUser") + } + + var r0 *v0.GetEventsResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetEventsForUserRequest, ...client.CallOption) (*v0.GetEventsResponse, error)); ok { + return returnFunc(ctx, in, opts...) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetEventsForUserRequest, ...client.CallOption) *v0.GetEventsResponse); ok { + r0 = returnFunc(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v0.GetEventsResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.GetEventsForUserRequest, ...client.CallOption) error); ok { + r1 = returnFunc(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// EventHistoryService_GetEventsForUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEventsForUser' +type EventHistoryService_GetEventsForUser_Call struct { + *mock.Call +} + +// GetEventsForUser is a helper method to define mock.On call +// - ctx +// - in +// - opts +func (_e *EventHistoryService_Expecter) GetEventsForUser(ctx interface{}, in interface{}, opts ...interface{}) *EventHistoryService_GetEventsForUser_Call { + return &EventHistoryService_GetEventsForUser_Call{Call: _e.mock.On("GetEventsForUser", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *EventHistoryService_GetEventsForUser_Call) Run(run func(ctx context.Context, in *v0.GetEventsForUserRequest, opts ...client.CallOption)) *EventHistoryService_GetEventsForUser_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := args[2].([]client.CallOption) + run(args[0].(context.Context), args[1].(*v0.GetEventsForUserRequest), variadicArgs...) + }) + return _c +} + +func (_c *EventHistoryService_GetEventsForUser_Call) Return(getEventsResponse *v0.GetEventsResponse, err error) *EventHistoryService_GetEventsForUser_Call { + _c.Call.Return(getEventsResponse, err) + return _c +} + +func (_c *EventHistoryService_GetEventsForUser_Call) RunAndReturn(run func(ctx context.Context, in *v0.GetEventsForUserRequest, opts ...client.CallOption) (*v0.GetEventsResponse, error)) *EventHistoryService_GetEventsForUser_Call { + _c.Call.Return(run) + return _c +} diff --git a/protogen/gen/opencloud/services/policies/v0/mocks/policies_provider_service.go b/protogen/gen/opencloud/services/policies/v0/mocks/policies_provider_service.go index 7c6f41d0bd..fc3ffb34ff 100644 --- a/protogen/gen/opencloud/services/policies/v0/mocks/policies_provider_service.go +++ b/protogen/gen/opencloud/services/policies/v0/mocks/policies_provider_service.go @@ -1,104 +1,17 @@ -// Code generated by mockery v2.50.2. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" - - client "go-micro.dev/v4/client" + "context" + "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/policies/v0" mock "github.com/stretchr/testify/mock" - - v0 "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/policies/v0" + "go-micro.dev/v4/client" ) -// PoliciesProviderService is an autogenerated mock type for the PoliciesProviderService type -type PoliciesProviderService struct { - mock.Mock -} - -type PoliciesProviderService_Expecter struct { - mock *mock.Mock -} - -func (_m *PoliciesProviderService) EXPECT() *PoliciesProviderService_Expecter { - return &PoliciesProviderService_Expecter{mock: &_m.Mock} -} - -// Evaluate provides a mock function with given fields: ctx, in, opts -func (_m *PoliciesProviderService) Evaluate(ctx context.Context, in *v0.EvaluateRequest, opts ...client.CallOption) (*v0.EvaluateResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for Evaluate") - } - - var r0 *v0.EvaluateResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v0.EvaluateRequest, ...client.CallOption) (*v0.EvaluateResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *v0.EvaluateRequest, ...client.CallOption) *v0.EvaluateResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*v0.EvaluateResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *v0.EvaluateRequest, ...client.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// PoliciesProviderService_Evaluate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Evaluate' -type PoliciesProviderService_Evaluate_Call struct { - *mock.Call -} - -// Evaluate is a helper method to define mock.On call -// - ctx context.Context -// - in *v0.EvaluateRequest -// - opts ...client.CallOption -func (_e *PoliciesProviderService_Expecter) Evaluate(ctx interface{}, in interface{}, opts ...interface{}) *PoliciesProviderService_Evaluate_Call { - return &PoliciesProviderService_Evaluate_Call{Call: _e.mock.On("Evaluate", - append([]interface{}{ctx, in}, opts...)...)} -} - -func (_c *PoliciesProviderService_Evaluate_Call) Run(run func(ctx context.Context, in *v0.EvaluateRequest, opts ...client.CallOption)) *PoliciesProviderService_Evaluate_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]client.CallOption, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(client.CallOption) - } - } - run(args[0].(context.Context), args[1].(*v0.EvaluateRequest), variadicArgs...) - }) - return _c -} - -func (_c *PoliciesProviderService_Evaluate_Call) Return(_a0 *v0.EvaluateResponse, _a1 error) *PoliciesProviderService_Evaluate_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *PoliciesProviderService_Evaluate_Call) RunAndReturn(run func(context.Context, *v0.EvaluateRequest, ...client.CallOption) (*v0.EvaluateResponse, error)) *PoliciesProviderService_Evaluate_Call { - _c.Call.Return(run) - return _c -} - // NewPoliciesProviderService creates a new instance of PoliciesProviderService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewPoliciesProviderService(t interface { @@ -112,3 +25,82 @@ func NewPoliciesProviderService(t interface { return mock } + +// PoliciesProviderService is an autogenerated mock type for the PoliciesProviderService type +type PoliciesProviderService struct { + mock.Mock +} + +type PoliciesProviderService_Expecter struct { + mock *mock.Mock +} + +func (_m *PoliciesProviderService) EXPECT() *PoliciesProviderService_Expecter { + return &PoliciesProviderService_Expecter{mock: &_m.Mock} +} + +// Evaluate provides a mock function for the type PoliciesProviderService +func (_mock *PoliciesProviderService) Evaluate(ctx context.Context, in *v0.EvaluateRequest, opts ...client.CallOption) (*v0.EvaluateResponse, error) { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(ctx, in, opts) + } else { + tmpRet = _mock.Called(ctx, in) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for Evaluate") + } + + var r0 *v0.EvaluateResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.EvaluateRequest, ...client.CallOption) (*v0.EvaluateResponse, error)); ok { + return returnFunc(ctx, in, opts...) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.EvaluateRequest, ...client.CallOption) *v0.EvaluateResponse); ok { + r0 = returnFunc(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v0.EvaluateResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.EvaluateRequest, ...client.CallOption) error); ok { + r1 = returnFunc(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// PoliciesProviderService_Evaluate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Evaluate' +type PoliciesProviderService_Evaluate_Call struct { + *mock.Call +} + +// Evaluate is a helper method to define mock.On call +// - ctx +// - in +// - opts +func (_e *PoliciesProviderService_Expecter) Evaluate(ctx interface{}, in interface{}, opts ...interface{}) *PoliciesProviderService_Evaluate_Call { + return &PoliciesProviderService_Evaluate_Call{Call: _e.mock.On("Evaluate", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *PoliciesProviderService_Evaluate_Call) Run(run func(ctx context.Context, in *v0.EvaluateRequest, opts ...client.CallOption)) *PoliciesProviderService_Evaluate_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := args[2].([]client.CallOption) + run(args[0].(context.Context), args[1].(*v0.EvaluateRequest), variadicArgs...) + }) + return _c +} + +func (_c *PoliciesProviderService_Evaluate_Call) Return(evaluateResponse *v0.EvaluateResponse, err error) *PoliciesProviderService_Evaluate_Call { + _c.Call.Return(evaluateResponse, err) + return _c +} + +func (_c *PoliciesProviderService_Evaluate_Call) RunAndReturn(run func(ctx context.Context, in *v0.EvaluateRequest, opts ...client.CallOption) (*v0.EvaluateResponse, error)) *PoliciesProviderService_Evaluate_Call { + _c.Call.Return(run) + return _c +} diff --git a/protogen/gen/opencloud/services/search/v0/mocks/search_provider_service.go b/protogen/gen/opencloud/services/search/v0/mocks/search_provider_service.go index 19d51b0be7..d2c6ec1124 100644 --- a/protogen/gen/opencloud/services/search/v0/mocks/search_provider_service.go +++ b/protogen/gen/opencloud/services/search/v0/mocks/search_provider_service.go @@ -1,178 +1,17 @@ -// Code generated by mockery v2.50.2. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" - - client "go-micro.dev/v4/client" + "context" + "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/search/v0" mock "github.com/stretchr/testify/mock" - - v0 "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/search/v0" + "go-micro.dev/v4/client" ) -// SearchProviderService is an autogenerated mock type for the SearchProviderService type -type SearchProviderService struct { - mock.Mock -} - -type SearchProviderService_Expecter struct { - mock *mock.Mock -} - -func (_m *SearchProviderService) EXPECT() *SearchProviderService_Expecter { - return &SearchProviderService_Expecter{mock: &_m.Mock} -} - -// IndexSpace provides a mock function with given fields: ctx, in, opts -func (_m *SearchProviderService) IndexSpace(ctx context.Context, in *v0.IndexSpaceRequest, opts ...client.CallOption) (*v0.IndexSpaceResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for IndexSpace") - } - - var r0 *v0.IndexSpaceResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v0.IndexSpaceRequest, ...client.CallOption) (*v0.IndexSpaceResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *v0.IndexSpaceRequest, ...client.CallOption) *v0.IndexSpaceResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*v0.IndexSpaceResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *v0.IndexSpaceRequest, ...client.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// SearchProviderService_IndexSpace_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IndexSpace' -type SearchProviderService_IndexSpace_Call struct { - *mock.Call -} - -// IndexSpace is a helper method to define mock.On call -// - ctx context.Context -// - in *v0.IndexSpaceRequest -// - opts ...client.CallOption -func (_e *SearchProviderService_Expecter) IndexSpace(ctx interface{}, in interface{}, opts ...interface{}) *SearchProviderService_IndexSpace_Call { - return &SearchProviderService_IndexSpace_Call{Call: _e.mock.On("IndexSpace", - append([]interface{}{ctx, in}, opts...)...)} -} - -func (_c *SearchProviderService_IndexSpace_Call) Run(run func(ctx context.Context, in *v0.IndexSpaceRequest, opts ...client.CallOption)) *SearchProviderService_IndexSpace_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]client.CallOption, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(client.CallOption) - } - } - run(args[0].(context.Context), args[1].(*v0.IndexSpaceRequest), variadicArgs...) - }) - return _c -} - -func (_c *SearchProviderService_IndexSpace_Call) Return(_a0 *v0.IndexSpaceResponse, _a1 error) *SearchProviderService_IndexSpace_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *SearchProviderService_IndexSpace_Call) RunAndReturn(run func(context.Context, *v0.IndexSpaceRequest, ...client.CallOption) (*v0.IndexSpaceResponse, error)) *SearchProviderService_IndexSpace_Call { - _c.Call.Return(run) - return _c -} - -// Search provides a mock function with given fields: ctx, in, opts -func (_m *SearchProviderService) Search(ctx context.Context, in *v0.SearchRequest, opts ...client.CallOption) (*v0.SearchResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for Search") - } - - var r0 *v0.SearchResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v0.SearchRequest, ...client.CallOption) (*v0.SearchResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *v0.SearchRequest, ...client.CallOption) *v0.SearchResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*v0.SearchResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *v0.SearchRequest, ...client.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// SearchProviderService_Search_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Search' -type SearchProviderService_Search_Call struct { - *mock.Call -} - -// Search is a helper method to define mock.On call -// - ctx context.Context -// - in *v0.SearchRequest -// - opts ...client.CallOption -func (_e *SearchProviderService_Expecter) Search(ctx interface{}, in interface{}, opts ...interface{}) *SearchProviderService_Search_Call { - return &SearchProviderService_Search_Call{Call: _e.mock.On("Search", - append([]interface{}{ctx, in}, opts...)...)} -} - -func (_c *SearchProviderService_Search_Call) Run(run func(ctx context.Context, in *v0.SearchRequest, opts ...client.CallOption)) *SearchProviderService_Search_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]client.CallOption, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(client.CallOption) - } - } - run(args[0].(context.Context), args[1].(*v0.SearchRequest), variadicArgs...) - }) - return _c -} - -func (_c *SearchProviderService_Search_Call) Return(_a0 *v0.SearchResponse, _a1 error) *SearchProviderService_Search_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *SearchProviderService_Search_Call) RunAndReturn(run func(context.Context, *v0.SearchRequest, ...client.CallOption) (*v0.SearchResponse, error)) *SearchProviderService_Search_Call { - _c.Call.Return(run) - return _c -} - // NewSearchProviderService creates a new instance of SearchProviderService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewSearchProviderService(t interface { @@ -186,3 +25,148 @@ func NewSearchProviderService(t interface { return mock } + +// SearchProviderService is an autogenerated mock type for the SearchProviderService type +type SearchProviderService struct { + mock.Mock +} + +type SearchProviderService_Expecter struct { + mock *mock.Mock +} + +func (_m *SearchProviderService) EXPECT() *SearchProviderService_Expecter { + return &SearchProviderService_Expecter{mock: &_m.Mock} +} + +// IndexSpace provides a mock function for the type SearchProviderService +func (_mock *SearchProviderService) IndexSpace(ctx context.Context, in *v0.IndexSpaceRequest, opts ...client.CallOption) (*v0.IndexSpaceResponse, error) { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(ctx, in, opts) + } else { + tmpRet = _mock.Called(ctx, in) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for IndexSpace") + } + + var r0 *v0.IndexSpaceResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.IndexSpaceRequest, ...client.CallOption) (*v0.IndexSpaceResponse, error)); ok { + return returnFunc(ctx, in, opts...) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.IndexSpaceRequest, ...client.CallOption) *v0.IndexSpaceResponse); ok { + r0 = returnFunc(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v0.IndexSpaceResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.IndexSpaceRequest, ...client.CallOption) error); ok { + r1 = returnFunc(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// SearchProviderService_IndexSpace_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IndexSpace' +type SearchProviderService_IndexSpace_Call struct { + *mock.Call +} + +// IndexSpace is a helper method to define mock.On call +// - ctx +// - in +// - opts +func (_e *SearchProviderService_Expecter) IndexSpace(ctx interface{}, in interface{}, opts ...interface{}) *SearchProviderService_IndexSpace_Call { + return &SearchProviderService_IndexSpace_Call{Call: _e.mock.On("IndexSpace", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *SearchProviderService_IndexSpace_Call) Run(run func(ctx context.Context, in *v0.IndexSpaceRequest, opts ...client.CallOption)) *SearchProviderService_IndexSpace_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := args[2].([]client.CallOption) + run(args[0].(context.Context), args[1].(*v0.IndexSpaceRequest), variadicArgs...) + }) + return _c +} + +func (_c *SearchProviderService_IndexSpace_Call) Return(indexSpaceResponse *v0.IndexSpaceResponse, err error) *SearchProviderService_IndexSpace_Call { + _c.Call.Return(indexSpaceResponse, err) + return _c +} + +func (_c *SearchProviderService_IndexSpace_Call) RunAndReturn(run func(ctx context.Context, in *v0.IndexSpaceRequest, opts ...client.CallOption) (*v0.IndexSpaceResponse, error)) *SearchProviderService_IndexSpace_Call { + _c.Call.Return(run) + return _c +} + +// Search provides a mock function for the type SearchProviderService +func (_mock *SearchProviderService) Search(ctx context.Context, in *v0.SearchRequest, opts ...client.CallOption) (*v0.SearchResponse, error) { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(ctx, in, opts) + } else { + tmpRet = _mock.Called(ctx, in) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for Search") + } + + var r0 *v0.SearchResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.SearchRequest, ...client.CallOption) (*v0.SearchResponse, error)); ok { + return returnFunc(ctx, in, opts...) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.SearchRequest, ...client.CallOption) *v0.SearchResponse); ok { + r0 = returnFunc(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v0.SearchResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.SearchRequest, ...client.CallOption) error); ok { + r1 = returnFunc(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// SearchProviderService_Search_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Search' +type SearchProviderService_Search_Call struct { + *mock.Call +} + +// Search is a helper method to define mock.On call +// - ctx +// - in +// - opts +func (_e *SearchProviderService_Expecter) Search(ctx interface{}, in interface{}, opts ...interface{}) *SearchProviderService_Search_Call { + return &SearchProviderService_Search_Call{Call: _e.mock.On("Search", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *SearchProviderService_Search_Call) Run(run func(ctx context.Context, in *v0.SearchRequest, opts ...client.CallOption)) *SearchProviderService_Search_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := args[2].([]client.CallOption) + run(args[0].(context.Context), args[1].(*v0.SearchRequest), variadicArgs...) + }) + return _c +} + +func (_c *SearchProviderService_Search_Call) Return(searchResponse *v0.SearchResponse, err error) *SearchProviderService_Search_Call { + _c.Call.Return(searchResponse, err) + return _c +} + +func (_c *SearchProviderService_Search_Call) RunAndReturn(run func(ctx context.Context, in *v0.SearchRequest, opts ...client.CallOption) (*v0.SearchResponse, error)) *SearchProviderService_Search_Call { + _c.Call.Return(run) + return _c +} diff --git a/protogen/gen/opencloud/services/settings/v0/mocks/value_service.go b/protogen/gen/opencloud/services/settings/v0/mocks/value_service.go index 940d6e64f1..e4c4852de9 100644 --- a/protogen/gen/opencloud/services/settings/v0/mocks/value_service.go +++ b/protogen/gen/opencloud/services/settings/v0/mocks/value_service.go @@ -1,326 +1,17 @@ -// Code generated by mockery v2.50.2. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" - - client "go-micro.dev/v4/client" + "context" + "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/settings/v0" mock "github.com/stretchr/testify/mock" - - v0 "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/settings/v0" + "go-micro.dev/v4/client" ) -// ValueService is an autogenerated mock type for the ValueService type -type ValueService struct { - mock.Mock -} - -type ValueService_Expecter struct { - mock *mock.Mock -} - -func (_m *ValueService) EXPECT() *ValueService_Expecter { - return &ValueService_Expecter{mock: &_m.Mock} -} - -// GetValue provides a mock function with given fields: ctx, in, opts -func (_m *ValueService) GetValue(ctx context.Context, in *v0.GetValueRequest, opts ...client.CallOption) (*v0.GetValueResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for GetValue") - } - - var r0 *v0.GetValueResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v0.GetValueRequest, ...client.CallOption) (*v0.GetValueResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *v0.GetValueRequest, ...client.CallOption) *v0.GetValueResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*v0.GetValueResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *v0.GetValueRequest, ...client.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ValueService_GetValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValue' -type ValueService_GetValue_Call struct { - *mock.Call -} - -// GetValue is a helper method to define mock.On call -// - ctx context.Context -// - in *v0.GetValueRequest -// - opts ...client.CallOption -func (_e *ValueService_Expecter) GetValue(ctx interface{}, in interface{}, opts ...interface{}) *ValueService_GetValue_Call { - return &ValueService_GetValue_Call{Call: _e.mock.On("GetValue", - append([]interface{}{ctx, in}, opts...)...)} -} - -func (_c *ValueService_GetValue_Call) Run(run func(ctx context.Context, in *v0.GetValueRequest, opts ...client.CallOption)) *ValueService_GetValue_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]client.CallOption, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(client.CallOption) - } - } - run(args[0].(context.Context), args[1].(*v0.GetValueRequest), variadicArgs...) - }) - return _c -} - -func (_c *ValueService_GetValue_Call) Return(_a0 *v0.GetValueResponse, _a1 error) *ValueService_GetValue_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ValueService_GetValue_Call) RunAndReturn(run func(context.Context, *v0.GetValueRequest, ...client.CallOption) (*v0.GetValueResponse, error)) *ValueService_GetValue_Call { - _c.Call.Return(run) - return _c -} - -// GetValueByUniqueIdentifiers provides a mock function with given fields: ctx, in, opts -func (_m *ValueService) GetValueByUniqueIdentifiers(ctx context.Context, in *v0.GetValueByUniqueIdentifiersRequest, opts ...client.CallOption) (*v0.GetValueResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for GetValueByUniqueIdentifiers") - } - - var r0 *v0.GetValueResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v0.GetValueByUniqueIdentifiersRequest, ...client.CallOption) (*v0.GetValueResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *v0.GetValueByUniqueIdentifiersRequest, ...client.CallOption) *v0.GetValueResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*v0.GetValueResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *v0.GetValueByUniqueIdentifiersRequest, ...client.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ValueService_GetValueByUniqueIdentifiers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValueByUniqueIdentifiers' -type ValueService_GetValueByUniqueIdentifiers_Call struct { - *mock.Call -} - -// GetValueByUniqueIdentifiers is a helper method to define mock.On call -// - ctx context.Context -// - in *v0.GetValueByUniqueIdentifiersRequest -// - opts ...client.CallOption -func (_e *ValueService_Expecter) GetValueByUniqueIdentifiers(ctx interface{}, in interface{}, opts ...interface{}) *ValueService_GetValueByUniqueIdentifiers_Call { - return &ValueService_GetValueByUniqueIdentifiers_Call{Call: _e.mock.On("GetValueByUniqueIdentifiers", - append([]interface{}{ctx, in}, opts...)...)} -} - -func (_c *ValueService_GetValueByUniqueIdentifiers_Call) Run(run func(ctx context.Context, in *v0.GetValueByUniqueIdentifiersRequest, opts ...client.CallOption)) *ValueService_GetValueByUniqueIdentifiers_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]client.CallOption, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(client.CallOption) - } - } - run(args[0].(context.Context), args[1].(*v0.GetValueByUniqueIdentifiersRequest), variadicArgs...) - }) - return _c -} - -func (_c *ValueService_GetValueByUniqueIdentifiers_Call) Return(_a0 *v0.GetValueResponse, _a1 error) *ValueService_GetValueByUniqueIdentifiers_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ValueService_GetValueByUniqueIdentifiers_Call) RunAndReturn(run func(context.Context, *v0.GetValueByUniqueIdentifiersRequest, ...client.CallOption) (*v0.GetValueResponse, error)) *ValueService_GetValueByUniqueIdentifiers_Call { - _c.Call.Return(run) - return _c -} - -// ListValues provides a mock function with given fields: ctx, in, opts -func (_m *ValueService) ListValues(ctx context.Context, in *v0.ListValuesRequest, opts ...client.CallOption) (*v0.ListValuesResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for ListValues") - } - - var r0 *v0.ListValuesResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v0.ListValuesRequest, ...client.CallOption) (*v0.ListValuesResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *v0.ListValuesRequest, ...client.CallOption) *v0.ListValuesResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*v0.ListValuesResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *v0.ListValuesRequest, ...client.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ValueService_ListValues_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListValues' -type ValueService_ListValues_Call struct { - *mock.Call -} - -// ListValues is a helper method to define mock.On call -// - ctx context.Context -// - in *v0.ListValuesRequest -// - opts ...client.CallOption -func (_e *ValueService_Expecter) ListValues(ctx interface{}, in interface{}, opts ...interface{}) *ValueService_ListValues_Call { - return &ValueService_ListValues_Call{Call: _e.mock.On("ListValues", - append([]interface{}{ctx, in}, opts...)...)} -} - -func (_c *ValueService_ListValues_Call) Run(run func(ctx context.Context, in *v0.ListValuesRequest, opts ...client.CallOption)) *ValueService_ListValues_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]client.CallOption, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(client.CallOption) - } - } - run(args[0].(context.Context), args[1].(*v0.ListValuesRequest), variadicArgs...) - }) - return _c -} - -func (_c *ValueService_ListValues_Call) Return(_a0 *v0.ListValuesResponse, _a1 error) *ValueService_ListValues_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ValueService_ListValues_Call) RunAndReturn(run func(context.Context, *v0.ListValuesRequest, ...client.CallOption) (*v0.ListValuesResponse, error)) *ValueService_ListValues_Call { - _c.Call.Return(run) - return _c -} - -// SaveValue provides a mock function with given fields: ctx, in, opts -func (_m *ValueService) SaveValue(ctx context.Context, in *v0.SaveValueRequest, opts ...client.CallOption) (*v0.SaveValueResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for SaveValue") - } - - var r0 *v0.SaveValueResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v0.SaveValueRequest, ...client.CallOption) (*v0.SaveValueResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *v0.SaveValueRequest, ...client.CallOption) *v0.SaveValueResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*v0.SaveValueResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *v0.SaveValueRequest, ...client.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ValueService_SaveValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveValue' -type ValueService_SaveValue_Call struct { - *mock.Call -} - -// SaveValue is a helper method to define mock.On call -// - ctx context.Context -// - in *v0.SaveValueRequest -// - opts ...client.CallOption -func (_e *ValueService_Expecter) SaveValue(ctx interface{}, in interface{}, opts ...interface{}) *ValueService_SaveValue_Call { - return &ValueService_SaveValue_Call{Call: _e.mock.On("SaveValue", - append([]interface{}{ctx, in}, opts...)...)} -} - -func (_c *ValueService_SaveValue_Call) Run(run func(ctx context.Context, in *v0.SaveValueRequest, opts ...client.CallOption)) *ValueService_SaveValue_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]client.CallOption, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(client.CallOption) - } - } - run(args[0].(context.Context), args[1].(*v0.SaveValueRequest), variadicArgs...) - }) - return _c -} - -func (_c *ValueService_SaveValue_Call) Return(_a0 *v0.SaveValueResponse, _a1 error) *ValueService_SaveValue_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ValueService_SaveValue_Call) RunAndReturn(run func(context.Context, *v0.SaveValueRequest, ...client.CallOption) (*v0.SaveValueResponse, error)) *ValueService_SaveValue_Call { - _c.Call.Return(run) - return _c -} - // NewValueService creates a new instance of ValueService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewValueService(t interface { @@ -334,3 +25,280 @@ func NewValueService(t interface { return mock } + +// ValueService is an autogenerated mock type for the ValueService type +type ValueService struct { + mock.Mock +} + +type ValueService_Expecter struct { + mock *mock.Mock +} + +func (_m *ValueService) EXPECT() *ValueService_Expecter { + return &ValueService_Expecter{mock: &_m.Mock} +} + +// GetValue provides a mock function for the type ValueService +func (_mock *ValueService) GetValue(ctx context.Context, in *v0.GetValueRequest, opts ...client.CallOption) (*v0.GetValueResponse, error) { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(ctx, in, opts) + } else { + tmpRet = _mock.Called(ctx, in) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for GetValue") + } + + var r0 *v0.GetValueResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetValueRequest, ...client.CallOption) (*v0.GetValueResponse, error)); ok { + return returnFunc(ctx, in, opts...) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetValueRequest, ...client.CallOption) *v0.GetValueResponse); ok { + r0 = returnFunc(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v0.GetValueResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.GetValueRequest, ...client.CallOption) error); ok { + r1 = returnFunc(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// ValueService_GetValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValue' +type ValueService_GetValue_Call struct { + *mock.Call +} + +// GetValue is a helper method to define mock.On call +// - ctx +// - in +// - opts +func (_e *ValueService_Expecter) GetValue(ctx interface{}, in interface{}, opts ...interface{}) *ValueService_GetValue_Call { + return &ValueService_GetValue_Call{Call: _e.mock.On("GetValue", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *ValueService_GetValue_Call) Run(run func(ctx context.Context, in *v0.GetValueRequest, opts ...client.CallOption)) *ValueService_GetValue_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := args[2].([]client.CallOption) + run(args[0].(context.Context), args[1].(*v0.GetValueRequest), variadicArgs...) + }) + return _c +} + +func (_c *ValueService_GetValue_Call) Return(getValueResponse *v0.GetValueResponse, err error) *ValueService_GetValue_Call { + _c.Call.Return(getValueResponse, err) + return _c +} + +func (_c *ValueService_GetValue_Call) RunAndReturn(run func(ctx context.Context, in *v0.GetValueRequest, opts ...client.CallOption) (*v0.GetValueResponse, error)) *ValueService_GetValue_Call { + _c.Call.Return(run) + return _c +} + +// GetValueByUniqueIdentifiers provides a mock function for the type ValueService +func (_mock *ValueService) GetValueByUniqueIdentifiers(ctx context.Context, in *v0.GetValueByUniqueIdentifiersRequest, opts ...client.CallOption) (*v0.GetValueResponse, error) { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(ctx, in, opts) + } else { + tmpRet = _mock.Called(ctx, in) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for GetValueByUniqueIdentifiers") + } + + var r0 *v0.GetValueResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetValueByUniqueIdentifiersRequest, ...client.CallOption) (*v0.GetValueResponse, error)); ok { + return returnFunc(ctx, in, opts...) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetValueByUniqueIdentifiersRequest, ...client.CallOption) *v0.GetValueResponse); ok { + r0 = returnFunc(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v0.GetValueResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.GetValueByUniqueIdentifiersRequest, ...client.CallOption) error); ok { + r1 = returnFunc(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// ValueService_GetValueByUniqueIdentifiers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValueByUniqueIdentifiers' +type ValueService_GetValueByUniqueIdentifiers_Call struct { + *mock.Call +} + +// GetValueByUniqueIdentifiers is a helper method to define mock.On call +// - ctx +// - in +// - opts +func (_e *ValueService_Expecter) GetValueByUniqueIdentifiers(ctx interface{}, in interface{}, opts ...interface{}) *ValueService_GetValueByUniqueIdentifiers_Call { + return &ValueService_GetValueByUniqueIdentifiers_Call{Call: _e.mock.On("GetValueByUniqueIdentifiers", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *ValueService_GetValueByUniqueIdentifiers_Call) Run(run func(ctx context.Context, in *v0.GetValueByUniqueIdentifiersRequest, opts ...client.CallOption)) *ValueService_GetValueByUniqueIdentifiers_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := args[2].([]client.CallOption) + run(args[0].(context.Context), args[1].(*v0.GetValueByUniqueIdentifiersRequest), variadicArgs...) + }) + return _c +} + +func (_c *ValueService_GetValueByUniqueIdentifiers_Call) Return(getValueResponse *v0.GetValueResponse, err error) *ValueService_GetValueByUniqueIdentifiers_Call { + _c.Call.Return(getValueResponse, err) + return _c +} + +func (_c *ValueService_GetValueByUniqueIdentifiers_Call) RunAndReturn(run func(ctx context.Context, in *v0.GetValueByUniqueIdentifiersRequest, opts ...client.CallOption) (*v0.GetValueResponse, error)) *ValueService_GetValueByUniqueIdentifiers_Call { + _c.Call.Return(run) + return _c +} + +// ListValues provides a mock function for the type ValueService +func (_mock *ValueService) ListValues(ctx context.Context, in *v0.ListValuesRequest, opts ...client.CallOption) (*v0.ListValuesResponse, error) { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(ctx, in, opts) + } else { + tmpRet = _mock.Called(ctx, in) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for ListValues") + } + + var r0 *v0.ListValuesResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListValuesRequest, ...client.CallOption) (*v0.ListValuesResponse, error)); ok { + return returnFunc(ctx, in, opts...) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListValuesRequest, ...client.CallOption) *v0.ListValuesResponse); ok { + r0 = returnFunc(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v0.ListValuesResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.ListValuesRequest, ...client.CallOption) error); ok { + r1 = returnFunc(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// ValueService_ListValues_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListValues' +type ValueService_ListValues_Call struct { + *mock.Call +} + +// ListValues is a helper method to define mock.On call +// - ctx +// - in +// - opts +func (_e *ValueService_Expecter) ListValues(ctx interface{}, in interface{}, opts ...interface{}) *ValueService_ListValues_Call { + return &ValueService_ListValues_Call{Call: _e.mock.On("ListValues", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *ValueService_ListValues_Call) Run(run func(ctx context.Context, in *v0.ListValuesRequest, opts ...client.CallOption)) *ValueService_ListValues_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := args[2].([]client.CallOption) + run(args[0].(context.Context), args[1].(*v0.ListValuesRequest), variadicArgs...) + }) + return _c +} + +func (_c *ValueService_ListValues_Call) Return(listValuesResponse *v0.ListValuesResponse, err error) *ValueService_ListValues_Call { + _c.Call.Return(listValuesResponse, err) + return _c +} + +func (_c *ValueService_ListValues_Call) RunAndReturn(run func(ctx context.Context, in *v0.ListValuesRequest, opts ...client.CallOption) (*v0.ListValuesResponse, error)) *ValueService_ListValues_Call { + _c.Call.Return(run) + return _c +} + +// SaveValue provides a mock function for the type ValueService +func (_mock *ValueService) SaveValue(ctx context.Context, in *v0.SaveValueRequest, opts ...client.CallOption) (*v0.SaveValueResponse, error) { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(ctx, in, opts) + } else { + tmpRet = _mock.Called(ctx, in) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for SaveValue") + } + + var r0 *v0.SaveValueResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.SaveValueRequest, ...client.CallOption) (*v0.SaveValueResponse, error)); ok { + return returnFunc(ctx, in, opts...) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.SaveValueRequest, ...client.CallOption) *v0.SaveValueResponse); ok { + r0 = returnFunc(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v0.SaveValueResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.SaveValueRequest, ...client.CallOption) error); ok { + r1 = returnFunc(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// ValueService_SaveValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveValue' +type ValueService_SaveValue_Call struct { + *mock.Call +} + +// SaveValue is a helper method to define mock.On call +// - ctx +// - in +// - opts +func (_e *ValueService_Expecter) SaveValue(ctx interface{}, in interface{}, opts ...interface{}) *ValueService_SaveValue_Call { + return &ValueService_SaveValue_Call{Call: _e.mock.On("SaveValue", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *ValueService_SaveValue_Call) Run(run func(ctx context.Context, in *v0.SaveValueRequest, opts ...client.CallOption)) *ValueService_SaveValue_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := args[2].([]client.CallOption) + run(args[0].(context.Context), args[1].(*v0.SaveValueRequest), variadicArgs...) + }) + return _c +} + +func (_c *ValueService_SaveValue_Call) Return(saveValueResponse *v0.SaveValueResponse, err error) *ValueService_SaveValue_Call { + _c.Call.Return(saveValueResponse, err) + return _c +} + +func (_c *ValueService_SaveValue_Call) RunAndReturn(run func(ctx context.Context, in *v0.SaveValueRequest, opts ...client.CallOption) (*v0.SaveValueResponse, error)) *ValueService_SaveValue_Call { + _c.Call.Return(run) + return _c +} diff --git a/protogen/gen/opencloud/services/thumbnails/v0/mocks/thumbnail_service.go b/protogen/gen/opencloud/services/thumbnails/v0/mocks/thumbnail_service.go index f61f331a60..4618562017 100644 --- a/protogen/gen/opencloud/services/thumbnails/v0/mocks/thumbnail_service.go +++ b/protogen/gen/opencloud/services/thumbnails/v0/mocks/thumbnail_service.go @@ -1,104 +1,17 @@ -// Code generated by mockery v2.50.2. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" - - client "go-micro.dev/v4/client" + "context" + "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/thumbnails/v0" mock "github.com/stretchr/testify/mock" - - v0 "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/thumbnails/v0" + "go-micro.dev/v4/client" ) -// ThumbnailService is an autogenerated mock type for the ThumbnailService type -type ThumbnailService struct { - mock.Mock -} - -type ThumbnailService_Expecter struct { - mock *mock.Mock -} - -func (_m *ThumbnailService) EXPECT() *ThumbnailService_Expecter { - return &ThumbnailService_Expecter{mock: &_m.Mock} -} - -// GetThumbnail provides a mock function with given fields: ctx, in, opts -func (_m *ThumbnailService) GetThumbnail(ctx context.Context, in *v0.GetThumbnailRequest, opts ...client.CallOption) (*v0.GetThumbnailResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for GetThumbnail") - } - - var r0 *v0.GetThumbnailResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v0.GetThumbnailRequest, ...client.CallOption) (*v0.GetThumbnailResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *v0.GetThumbnailRequest, ...client.CallOption) *v0.GetThumbnailResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*v0.GetThumbnailResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *v0.GetThumbnailRequest, ...client.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ThumbnailService_GetThumbnail_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetThumbnail' -type ThumbnailService_GetThumbnail_Call struct { - *mock.Call -} - -// GetThumbnail is a helper method to define mock.On call -// - ctx context.Context -// - in *v0.GetThumbnailRequest -// - opts ...client.CallOption -func (_e *ThumbnailService_Expecter) GetThumbnail(ctx interface{}, in interface{}, opts ...interface{}) *ThumbnailService_GetThumbnail_Call { - return &ThumbnailService_GetThumbnail_Call{Call: _e.mock.On("GetThumbnail", - append([]interface{}{ctx, in}, opts...)...)} -} - -func (_c *ThumbnailService_GetThumbnail_Call) Run(run func(ctx context.Context, in *v0.GetThumbnailRequest, opts ...client.CallOption)) *ThumbnailService_GetThumbnail_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]client.CallOption, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(client.CallOption) - } - } - run(args[0].(context.Context), args[1].(*v0.GetThumbnailRequest), variadicArgs...) - }) - return _c -} - -func (_c *ThumbnailService_GetThumbnail_Call) Return(_a0 *v0.GetThumbnailResponse, _a1 error) *ThumbnailService_GetThumbnail_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ThumbnailService_GetThumbnail_Call) RunAndReturn(run func(context.Context, *v0.GetThumbnailRequest, ...client.CallOption) (*v0.GetThumbnailResponse, error)) *ThumbnailService_GetThumbnail_Call { - _c.Call.Return(run) - return _c -} - // NewThumbnailService creates a new instance of ThumbnailService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewThumbnailService(t interface { @@ -112,3 +25,82 @@ func NewThumbnailService(t interface { return mock } + +// ThumbnailService is an autogenerated mock type for the ThumbnailService type +type ThumbnailService struct { + mock.Mock +} + +type ThumbnailService_Expecter struct { + mock *mock.Mock +} + +func (_m *ThumbnailService) EXPECT() *ThumbnailService_Expecter { + return &ThumbnailService_Expecter{mock: &_m.Mock} +} + +// GetThumbnail provides a mock function for the type ThumbnailService +func (_mock *ThumbnailService) GetThumbnail(ctx context.Context, in *v0.GetThumbnailRequest, opts ...client.CallOption) (*v0.GetThumbnailResponse, error) { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(ctx, in, opts) + } else { + tmpRet = _mock.Called(ctx, in) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for GetThumbnail") + } + + var r0 *v0.GetThumbnailResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetThumbnailRequest, ...client.CallOption) (*v0.GetThumbnailResponse, error)); ok { + return returnFunc(ctx, in, opts...) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetThumbnailRequest, ...client.CallOption) *v0.GetThumbnailResponse); ok { + r0 = returnFunc(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v0.GetThumbnailResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.GetThumbnailRequest, ...client.CallOption) error); ok { + r1 = returnFunc(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// ThumbnailService_GetThumbnail_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetThumbnail' +type ThumbnailService_GetThumbnail_Call struct { + *mock.Call +} + +// GetThumbnail is a helper method to define mock.On call +// - ctx +// - in +// - opts +func (_e *ThumbnailService_Expecter) GetThumbnail(ctx interface{}, in interface{}, opts ...interface{}) *ThumbnailService_GetThumbnail_Call { + return &ThumbnailService_GetThumbnail_Call{Call: _e.mock.On("GetThumbnail", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *ThumbnailService_GetThumbnail_Call) Run(run func(ctx context.Context, in *v0.GetThumbnailRequest, opts ...client.CallOption)) *ThumbnailService_GetThumbnail_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := args[2].([]client.CallOption) + run(args[0].(context.Context), args[1].(*v0.GetThumbnailRequest), variadicArgs...) + }) + return _c +} + +func (_c *ThumbnailService_GetThumbnail_Call) Return(getThumbnailResponse *v0.GetThumbnailResponse, err error) *ThumbnailService_GetThumbnail_Call { + _c.Call.Return(getThumbnailResponse, err) + return _c +} + +func (_c *ThumbnailService_GetThumbnail_Call) RunAndReturn(run func(ctx context.Context, in *v0.GetThumbnailRequest, opts ...client.CallOption) (*v0.GetThumbnailResponse, error)) *ThumbnailService_GetThumbnail_Call { + _c.Call.Return(run) + return _c +} diff --git a/services/antivirus/.mockery.yaml b/services/antivirus/.mockery.yaml index c61a87442d..2d7eff34cf 100644 --- a/services/antivirus/.mockery.yaml +++ b/services/antivirus/.mockery.yaml @@ -1,12 +1,11 @@ -issue-845-fix: True -resolve-type-alias: False -with-expecter: true -disable-version-string: True +# maintain v2 separate mocks dir +dir: "{{.InterfaceDir}}/mocks" +structname: "{{.InterfaceName}}" filename: "{{.InterfaceName | snakecase }}.go" -dir: "pkg/{{.PackageName}}/mocks" -mockname: "{{.InterfaceName}}" -outpkg: "mocks" +pkgname: mocks + +template: testify packages: - github.com/opencloud-eu/opencloud/services/antivirus/pkg/scanners: - interfaces: - Scanner: + github.com/opencloud-eu/opencloud/services/antivirus/pkg/scanners: + interfaces: + Scanner: {} diff --git a/services/antivirus/pkg/scanners/mocks/scanner.go b/services/antivirus/pkg/scanners/mocks/scanner.go index e7d73743b4..d23befda2b 100644 --- a/services/antivirus/pkg/scanners/mocks/scanner.go +++ b/services/antivirus/pkg/scanners/mocks/scanner.go @@ -1,12 +1,28 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - icapclient "github.com/egirna/icap-client" + "github.com/egirna/icap-client" mock "github.com/stretchr/testify/mock" ) +// NewScanner creates a new instance of Scanner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewScanner(t interface { + mock.TestingT + Cleanup(func()) +}) *Scanner { + mock := &Scanner{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // Scanner is an autogenerated mock type for the Scanner type type Scanner struct { mock.Mock @@ -20,9 +36,9 @@ func (_m *Scanner) EXPECT() *Scanner_Expecter { return &Scanner_Expecter{mock: &_m.Mock} } -// Do provides a mock function with given fields: req -func (_m *Scanner) Do(req icapclient.Request) (icapclient.Response, error) { - ret := _m.Called(req) +// Do provides a mock function for the type Scanner +func (_mock *Scanner) Do(req icapclient.Request) (icapclient.Response, error) { + ret := _mock.Called(req) if len(ret) == 0 { panic("no return value specified for Do") @@ -30,21 +46,19 @@ func (_m *Scanner) Do(req icapclient.Request) (icapclient.Response, error) { var r0 icapclient.Response var r1 error - if rf, ok := ret.Get(0).(func(icapclient.Request) (icapclient.Response, error)); ok { - return rf(req) + if returnFunc, ok := ret.Get(0).(func(icapclient.Request) (icapclient.Response, error)); ok { + return returnFunc(req) } - if rf, ok := ret.Get(0).(func(icapclient.Request) icapclient.Response); ok { - r0 = rf(req) + if returnFunc, ok := ret.Get(0).(func(icapclient.Request) icapclient.Response); ok { + r0 = returnFunc(req) } else { r0 = ret.Get(0).(icapclient.Response) } - - if rf, ok := ret.Get(1).(func(icapclient.Request) error); ok { - r1 = rf(req) + if returnFunc, ok := ret.Get(1).(func(icapclient.Request) error); ok { + r1 = returnFunc(req) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -61,31 +75,23 @@ func (_e *Scanner_Expecter) Do(req interface{}) *Scanner_Do_Call { func (_c *Scanner_Do_Call) Run(run func(req icapclient.Request)) *Scanner_Do_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(icapclient.Request)) + var arg0 icapclient.Request + if args[0] != nil { + arg0 = args[0].(icapclient.Request) + } + run( + arg0, + ) }) return _c } -func (_c *Scanner_Do_Call) Return(_a0 icapclient.Response, _a1 error) *Scanner_Do_Call { - _c.Call.Return(_a0, _a1) +func (_c *Scanner_Do_Call) Return(response icapclient.Response, err error) *Scanner_Do_Call { + _c.Call.Return(response, err) return _c } -func (_c *Scanner_Do_Call) RunAndReturn(run func(icapclient.Request) (icapclient.Response, error)) *Scanner_Do_Call { +func (_c *Scanner_Do_Call) RunAndReturn(run func(req icapclient.Request) (icapclient.Response, error)) *Scanner_Do_Call { _c.Call.Return(run) return _c } - -// NewScanner creates a new instance of Scanner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewScanner(t interface { - mock.TestingT - Cleanup(func()) -}) *Scanner { - mock := &Scanner{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/services/collaboration/.mockery.yaml b/services/collaboration/.mockery.yaml index 6e5f2443e2..fe3e8d5349 100644 --- a/services/collaboration/.mockery.yaml +++ b/services/collaboration/.mockery.yaml @@ -1,27 +1,27 @@ -issue-845-fix: True -resolve-type-alias: False -with-expecter: true -disable-version-string: True +# maintain v2 separate mocks dir +dir: "{{.InterfaceDir}}/mocks" +structname: "{{.InterfaceName}}" filename: "{{.InterfaceName | snakecase }}.go" -mockname: "{{.InterfaceName}}" -outpkg: "mocks" +pkgname: mocks + +template: testify packages: - github.com/opencloud-eu/opencloud/services/collaboration/pkg/connector: + github.com/opencloud-eu/opencloud/services/collaboration/pkg/connector: + config: + dir: mocks + interfaces: + ConnectorService: {} + ContentConnectorService: {} + FileConnectorService: {} + github.com/opencloud-eu/opencloud/services/collaboration/pkg/locks: + config: + dir: mocks + interfaces: + LockParser: {} + github.com/opencloud-eu/reva/v2/pkg/rgrpc/todo/pool: + config: + dir: mocks + interfaces: + Selectable: config: - dir: "mocks" - interfaces: - ConnectorService: - ContentConnectorService: - FileConnectorService: - github.com/opencloud-eu/opencloud/services/collaboration/pkg/locks: - config: - dir: "mocks" - interfaces: - LockParser: - github.com/opencloud-eu/reva/v2/pkg/rgrpc/todo/pool: - config: - dir: "mocks" - interfaces: - Selectable: - config: - filename: "gateway_selector.go" + filename: gateway_selector.go diff --git a/services/collaboration/mocks/connector_service.go b/services/collaboration/mocks/connector_service.go index 15c337cb27..efccdd89a7 100644 --- a/services/collaboration/mocks/connector_service.go +++ b/services/collaboration/mocks/connector_service.go @@ -1,12 +1,28 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - connector "github.com/opencloud-eu/opencloud/services/collaboration/pkg/connector" + "github.com/opencloud-eu/opencloud/services/collaboration/pkg/connector" mock "github.com/stretchr/testify/mock" ) +// NewConnectorService creates a new instance of ConnectorService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewConnectorService(t interface { + mock.TestingT + Cleanup(func()) +}) *ConnectorService { + mock := &ConnectorService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // ConnectorService is an autogenerated mock type for the ConnectorService type type ConnectorService struct { mock.Mock @@ -20,23 +36,22 @@ func (_m *ConnectorService) EXPECT() *ConnectorService_Expecter { return &ConnectorService_Expecter{mock: &_m.Mock} } -// GetContentConnector provides a mock function with no fields -func (_m *ConnectorService) GetContentConnector() connector.ContentConnectorService { - ret := _m.Called() +// GetContentConnector provides a mock function for the type ConnectorService +func (_mock *ConnectorService) GetContentConnector() connector.ContentConnectorService { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for GetContentConnector") } var r0 connector.ContentConnectorService - if rf, ok := ret.Get(0).(func() connector.ContentConnectorService); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() connector.ContentConnectorService); ok { + r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(connector.ContentConnectorService) } } - return r0 } @@ -57,8 +72,8 @@ func (_c *ConnectorService_GetContentConnector_Call) Run(run func()) *ConnectorS return _c } -func (_c *ConnectorService_GetContentConnector_Call) Return(_a0 connector.ContentConnectorService) *ConnectorService_GetContentConnector_Call { - _c.Call.Return(_a0) +func (_c *ConnectorService_GetContentConnector_Call) Return(contentConnectorService connector.ContentConnectorService) *ConnectorService_GetContentConnector_Call { + _c.Call.Return(contentConnectorService) return _c } @@ -67,23 +82,22 @@ func (_c *ConnectorService_GetContentConnector_Call) RunAndReturn(run func() con return _c } -// GetFileConnector provides a mock function with no fields -func (_m *ConnectorService) GetFileConnector() connector.FileConnectorService { - ret := _m.Called() +// GetFileConnector provides a mock function for the type ConnectorService +func (_mock *ConnectorService) GetFileConnector() connector.FileConnectorService { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for GetFileConnector") } var r0 connector.FileConnectorService - if rf, ok := ret.Get(0).(func() connector.FileConnectorService); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() connector.FileConnectorService); ok { + r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(connector.FileConnectorService) } } - return r0 } @@ -104,8 +118,8 @@ func (_c *ConnectorService_GetFileConnector_Call) Run(run func()) *ConnectorServ return _c } -func (_c *ConnectorService_GetFileConnector_Call) Return(_a0 connector.FileConnectorService) *ConnectorService_GetFileConnector_Call { - _c.Call.Return(_a0) +func (_c *ConnectorService_GetFileConnector_Call) Return(fileConnectorService connector.FileConnectorService) *ConnectorService_GetFileConnector_Call { + _c.Call.Return(fileConnectorService) return _c } @@ -113,17 +127,3 @@ func (_c *ConnectorService_GetFileConnector_Call) RunAndReturn(run func() connec _c.Call.Return(run) return _c } - -// NewConnectorService creates a new instance of ConnectorService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewConnectorService(t interface { - mock.TestingT - Cleanup(func()) -}) *ConnectorService { - mock := &ConnectorService{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/services/collaboration/mocks/content_connector_service.go b/services/collaboration/mocks/content_connector_service.go index 9e9b2af498..b987ad7525 100644 --- a/services/collaboration/mocks/content_connector_service.go +++ b/services/collaboration/mocks/content_connector_service.go @@ -1,19 +1,32 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" - - connector "github.com/opencloud-eu/opencloud/services/collaboration/pkg/connector" - - http "net/http" - - io "io" + "context" + "io" + "net/http" + "github.com/opencloud-eu/opencloud/services/collaboration/pkg/connector" mock "github.com/stretchr/testify/mock" ) +// NewContentConnectorService creates a new instance of ContentConnectorService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewContentConnectorService(t interface { + mock.TestingT + Cleanup(func()) +}) *ContentConnectorService { + mock := &ContentConnectorService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // ContentConnectorService is an autogenerated mock type for the ContentConnectorService type type ContentConnectorService struct { mock.Mock @@ -27,21 +40,20 @@ func (_m *ContentConnectorService) EXPECT() *ContentConnectorService_Expecter { return &ContentConnectorService_Expecter{mock: &_m.Mock} } -// GetFile provides a mock function with given fields: ctx, w -func (_m *ContentConnectorService) GetFile(ctx context.Context, w http.ResponseWriter) error { - ret := _m.Called(ctx, w) +// GetFile provides a mock function for the type ContentConnectorService +func (_mock *ContentConnectorService) GetFile(ctx context.Context, w http.ResponseWriter) error { + ret := _mock.Called(ctx, w) if len(ret) == 0 { panic("no return value specified for GetFile") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, http.ResponseWriter) error); ok { - r0 = rf(ctx, w) + if returnFunc, ok := ret.Get(0).(func(context.Context, http.ResponseWriter) error); ok { + r0 = returnFunc(ctx, w) } else { r0 = ret.Error(0) } - return r0 } @@ -59,24 +71,35 @@ func (_e *ContentConnectorService_Expecter) GetFile(ctx interface{}, w interface func (_c *ContentConnectorService_GetFile_Call) Run(run func(ctx context.Context, w http.ResponseWriter)) *ContentConnectorService_GetFile_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(http.ResponseWriter)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 http.ResponseWriter + if args[1] != nil { + arg1 = args[1].(http.ResponseWriter) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *ContentConnectorService_GetFile_Call) Return(_a0 error) *ContentConnectorService_GetFile_Call { - _c.Call.Return(_a0) +func (_c *ContentConnectorService_GetFile_Call) Return(err error) *ContentConnectorService_GetFile_Call { + _c.Call.Return(err) return _c } -func (_c *ContentConnectorService_GetFile_Call) RunAndReturn(run func(context.Context, http.ResponseWriter) error) *ContentConnectorService_GetFile_Call { +func (_c *ContentConnectorService_GetFile_Call) RunAndReturn(run func(ctx context.Context, w http.ResponseWriter) error) *ContentConnectorService_GetFile_Call { _c.Call.Return(run) return _c } -// PutFile provides a mock function with given fields: ctx, stream, streamLength, lockID -func (_m *ContentConnectorService) PutFile(ctx context.Context, stream io.Reader, streamLength int64, lockID string) (*connector.ConnectorResponse, error) { - ret := _m.Called(ctx, stream, streamLength, lockID) +// PutFile provides a mock function for the type ContentConnectorService +func (_mock *ContentConnectorService) PutFile(ctx context.Context, stream io.Reader, streamLength int64, lockID string) (*connector.ConnectorResponse, error) { + ret := _mock.Called(ctx, stream, streamLength, lockID) if len(ret) == 0 { panic("no return value specified for PutFile") @@ -84,23 +107,21 @@ func (_m *ContentConnectorService) PutFile(ctx context.Context, stream io.Reader var r0 *connector.ConnectorResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, io.Reader, int64, string) (*connector.ConnectorResponse, error)); ok { - return rf(ctx, stream, streamLength, lockID) + if returnFunc, ok := ret.Get(0).(func(context.Context, io.Reader, int64, string) (*connector.ConnectorResponse, error)); ok { + return returnFunc(ctx, stream, streamLength, lockID) } - if rf, ok := ret.Get(0).(func(context.Context, io.Reader, int64, string) *connector.ConnectorResponse); ok { - r0 = rf(ctx, stream, streamLength, lockID) + if returnFunc, ok := ret.Get(0).(func(context.Context, io.Reader, int64, string) *connector.ConnectorResponse); ok { + r0 = returnFunc(ctx, stream, streamLength, lockID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*connector.ConnectorResponse) } } - - if rf, ok := ret.Get(1).(func(context.Context, io.Reader, int64, string) error); ok { - r1 = rf(ctx, stream, streamLength, lockID) + if returnFunc, ok := ret.Get(1).(func(context.Context, io.Reader, int64, string) error); ok { + r1 = returnFunc(ctx, stream, streamLength, lockID) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -120,31 +141,38 @@ func (_e *ContentConnectorService_Expecter) PutFile(ctx interface{}, stream inte func (_c *ContentConnectorService_PutFile_Call) Run(run func(ctx context.Context, stream io.Reader, streamLength int64, lockID string)) *ContentConnectorService_PutFile_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(io.Reader), args[2].(int64), args[3].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 io.Reader + if args[1] != nil { + arg1 = args[1].(io.Reader) + } + var arg2 int64 + if args[2] != nil { + arg2 = args[2].(int64) + } + var arg3 string + if args[3] != nil { + arg3 = args[3].(string) + } + run( + arg0, + arg1, + arg2, + arg3, + ) }) return _c } -func (_c *ContentConnectorService_PutFile_Call) Return(_a0 *connector.ConnectorResponse, _a1 error) *ContentConnectorService_PutFile_Call { - _c.Call.Return(_a0, _a1) +func (_c *ContentConnectorService_PutFile_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *ContentConnectorService_PutFile_Call { + _c.Call.Return(connectorResponse, err) return _c } -func (_c *ContentConnectorService_PutFile_Call) RunAndReturn(run func(context.Context, io.Reader, int64, string) (*connector.ConnectorResponse, error)) *ContentConnectorService_PutFile_Call { +func (_c *ContentConnectorService_PutFile_Call) RunAndReturn(run func(ctx context.Context, stream io.Reader, streamLength int64, lockID string) (*connector.ConnectorResponse, error)) *ContentConnectorService_PutFile_Call { _c.Call.Return(run) return _c } - -// NewContentConnectorService creates a new instance of ContentConnectorService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewContentConnectorService(t interface { - mock.TestingT - Cleanup(func()) -}) *ContentConnectorService { - mock := &ContentConnectorService{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/services/collaboration/mocks/file_connector_service.go b/services/collaboration/mocks/file_connector_service.go index 0bf401a7e6..3e9f5041db 100644 --- a/services/collaboration/mocks/file_connector_service.go +++ b/services/collaboration/mocks/file_connector_service.go @@ -1,17 +1,31 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" - - connector "github.com/opencloud-eu/opencloud/services/collaboration/pkg/connector" - - io "io" + "context" + "io" + "github.com/opencloud-eu/opencloud/services/collaboration/pkg/connector" mock "github.com/stretchr/testify/mock" ) +// NewFileConnectorService creates a new instance of FileConnectorService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewFileConnectorService(t interface { + mock.TestingT + Cleanup(func()) +}) *FileConnectorService { + mock := &FileConnectorService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // FileConnectorService is an autogenerated mock type for the FileConnectorService type type FileConnectorService struct { mock.Mock @@ -25,9 +39,9 @@ func (_m *FileConnectorService) EXPECT() *FileConnectorService_Expecter { return &FileConnectorService_Expecter{mock: &_m.Mock} } -// CheckFileInfo provides a mock function with given fields: ctx -func (_m *FileConnectorService) CheckFileInfo(ctx context.Context) (*connector.ConnectorResponse, error) { - ret := _m.Called(ctx) +// CheckFileInfo provides a mock function for the type FileConnectorService +func (_mock *FileConnectorService) CheckFileInfo(ctx context.Context) (*connector.ConnectorResponse, error) { + ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for CheckFileInfo") @@ -35,23 +49,21 @@ func (_m *FileConnectorService) CheckFileInfo(ctx context.Context) (*connector.C var r0 *connector.ConnectorResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*connector.ConnectorResponse, error)); ok { - return rf(ctx) + if returnFunc, ok := ret.Get(0).(func(context.Context) (*connector.ConnectorResponse, error)); ok { + return returnFunc(ctx) } - if rf, ok := ret.Get(0).(func(context.Context) *connector.ConnectorResponse); ok { - r0 = rf(ctx) + if returnFunc, ok := ret.Get(0).(func(context.Context) *connector.ConnectorResponse); ok { + r0 = returnFunc(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*connector.ConnectorResponse) } } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(ctx) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -68,24 +80,30 @@ func (_e *FileConnectorService_Expecter) CheckFileInfo(ctx interface{}) *FileCon func (_c *FileConnectorService_CheckFileInfo_Call) Run(run func(ctx context.Context)) *FileConnectorService_CheckFileInfo_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + run( + arg0, + ) }) return _c } -func (_c *FileConnectorService_CheckFileInfo_Call) Return(_a0 *connector.ConnectorResponse, _a1 error) *FileConnectorService_CheckFileInfo_Call { - _c.Call.Return(_a0, _a1) +func (_c *FileConnectorService_CheckFileInfo_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *FileConnectorService_CheckFileInfo_Call { + _c.Call.Return(connectorResponse, err) return _c } -func (_c *FileConnectorService_CheckFileInfo_Call) RunAndReturn(run func(context.Context) (*connector.ConnectorResponse, error)) *FileConnectorService_CheckFileInfo_Call { +func (_c *FileConnectorService_CheckFileInfo_Call) RunAndReturn(run func(ctx context.Context) (*connector.ConnectorResponse, error)) *FileConnectorService_CheckFileInfo_Call { _c.Call.Return(run) return _c } -// DeleteFile provides a mock function with given fields: ctx, lockID -func (_m *FileConnectorService) DeleteFile(ctx context.Context, lockID string) (*connector.ConnectorResponse, error) { - ret := _m.Called(ctx, lockID) +// DeleteFile provides a mock function for the type FileConnectorService +func (_mock *FileConnectorService) DeleteFile(ctx context.Context, lockID string) (*connector.ConnectorResponse, error) { + ret := _mock.Called(ctx, lockID) if len(ret) == 0 { panic("no return value specified for DeleteFile") @@ -93,23 +111,21 @@ func (_m *FileConnectorService) DeleteFile(ctx context.Context, lockID string) ( var r0 *connector.ConnectorResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*connector.ConnectorResponse, error)); ok { - return rf(ctx, lockID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*connector.ConnectorResponse, error)); ok { + return returnFunc(ctx, lockID) } - if rf, ok := ret.Get(0).(func(context.Context, string) *connector.ConnectorResponse); ok { - r0 = rf(ctx, lockID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) *connector.ConnectorResponse); ok { + r0 = returnFunc(ctx, lockID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*connector.ConnectorResponse) } } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, lockID) + if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = returnFunc(ctx, lockID) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -127,24 +143,35 @@ func (_e *FileConnectorService_Expecter) DeleteFile(ctx interface{}, lockID inte func (_c *FileConnectorService_DeleteFile_Call) Run(run func(ctx context.Context, lockID string)) *FileConnectorService_DeleteFile_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *FileConnectorService_DeleteFile_Call) Return(_a0 *connector.ConnectorResponse, _a1 error) *FileConnectorService_DeleteFile_Call { - _c.Call.Return(_a0, _a1) +func (_c *FileConnectorService_DeleteFile_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *FileConnectorService_DeleteFile_Call { + _c.Call.Return(connectorResponse, err) return _c } -func (_c *FileConnectorService_DeleteFile_Call) RunAndReturn(run func(context.Context, string) (*connector.ConnectorResponse, error)) *FileConnectorService_DeleteFile_Call { +func (_c *FileConnectorService_DeleteFile_Call) RunAndReturn(run func(ctx context.Context, lockID string) (*connector.ConnectorResponse, error)) *FileConnectorService_DeleteFile_Call { _c.Call.Return(run) return _c } -// GetLock provides a mock function with given fields: ctx -func (_m *FileConnectorService) GetLock(ctx context.Context) (*connector.ConnectorResponse, error) { - ret := _m.Called(ctx) +// GetLock provides a mock function for the type FileConnectorService +func (_mock *FileConnectorService) GetLock(ctx context.Context) (*connector.ConnectorResponse, error) { + ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for GetLock") @@ -152,23 +179,21 @@ func (_m *FileConnectorService) GetLock(ctx context.Context) (*connector.Connect var r0 *connector.ConnectorResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*connector.ConnectorResponse, error)); ok { - return rf(ctx) + if returnFunc, ok := ret.Get(0).(func(context.Context) (*connector.ConnectorResponse, error)); ok { + return returnFunc(ctx) } - if rf, ok := ret.Get(0).(func(context.Context) *connector.ConnectorResponse); ok { - r0 = rf(ctx) + if returnFunc, ok := ret.Get(0).(func(context.Context) *connector.ConnectorResponse); ok { + r0 = returnFunc(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*connector.ConnectorResponse) } } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(ctx) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -185,24 +210,30 @@ func (_e *FileConnectorService_Expecter) GetLock(ctx interface{}) *FileConnector func (_c *FileConnectorService_GetLock_Call) Run(run func(ctx context.Context)) *FileConnectorService_GetLock_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + run( + arg0, + ) }) return _c } -func (_c *FileConnectorService_GetLock_Call) Return(_a0 *connector.ConnectorResponse, _a1 error) *FileConnectorService_GetLock_Call { - _c.Call.Return(_a0, _a1) +func (_c *FileConnectorService_GetLock_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *FileConnectorService_GetLock_Call { + _c.Call.Return(connectorResponse, err) return _c } -func (_c *FileConnectorService_GetLock_Call) RunAndReturn(run func(context.Context) (*connector.ConnectorResponse, error)) *FileConnectorService_GetLock_Call { +func (_c *FileConnectorService_GetLock_Call) RunAndReturn(run func(ctx context.Context) (*connector.ConnectorResponse, error)) *FileConnectorService_GetLock_Call { _c.Call.Return(run) return _c } -// Lock provides a mock function with given fields: ctx, lockID, oldLockID -func (_m *FileConnectorService) Lock(ctx context.Context, lockID string, oldLockID string) (*connector.ConnectorResponse, error) { - ret := _m.Called(ctx, lockID, oldLockID) +// Lock provides a mock function for the type FileConnectorService +func (_mock *FileConnectorService) Lock(ctx context.Context, lockID string, oldLockID string) (*connector.ConnectorResponse, error) { + ret := _mock.Called(ctx, lockID, oldLockID) if len(ret) == 0 { panic("no return value specified for Lock") @@ -210,23 +241,21 @@ func (_m *FileConnectorService) Lock(ctx context.Context, lockID string, oldLock var r0 *connector.ConnectorResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) (*connector.ConnectorResponse, error)); ok { - return rf(ctx, lockID, oldLockID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (*connector.ConnectorResponse, error)); ok { + return returnFunc(ctx, lockID, oldLockID) } - if rf, ok := ret.Get(0).(func(context.Context, string, string) *connector.ConnectorResponse); ok { - r0 = rf(ctx, lockID, oldLockID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) *connector.ConnectorResponse); ok { + r0 = returnFunc(ctx, lockID, oldLockID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*connector.ConnectorResponse) } } - - if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { - r1 = rf(ctx, lockID, oldLockID) + if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = returnFunc(ctx, lockID, oldLockID) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -245,24 +274,40 @@ func (_e *FileConnectorService_Expecter) Lock(ctx interface{}, lockID interface{ func (_c *FileConnectorService_Lock_Call) Run(run func(ctx context.Context, lockID string, oldLockID string)) *FileConnectorService_Lock_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *FileConnectorService_Lock_Call) Return(_a0 *connector.ConnectorResponse, _a1 error) *FileConnectorService_Lock_Call { - _c.Call.Return(_a0, _a1) +func (_c *FileConnectorService_Lock_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *FileConnectorService_Lock_Call { + _c.Call.Return(connectorResponse, err) return _c } -func (_c *FileConnectorService_Lock_Call) RunAndReturn(run func(context.Context, string, string) (*connector.ConnectorResponse, error)) *FileConnectorService_Lock_Call { +func (_c *FileConnectorService_Lock_Call) RunAndReturn(run func(ctx context.Context, lockID string, oldLockID string) (*connector.ConnectorResponse, error)) *FileConnectorService_Lock_Call { _c.Call.Return(run) return _c } -// PutRelativeFileRelative provides a mock function with given fields: ctx, ccs, stream, streamLength, target -func (_m *FileConnectorService) PutRelativeFileRelative(ctx context.Context, ccs connector.ContentConnectorService, stream io.Reader, streamLength int64, target string) (*connector.ConnectorResponse, error) { - ret := _m.Called(ctx, ccs, stream, streamLength, target) +// PutRelativeFileRelative provides a mock function for the type FileConnectorService +func (_mock *FileConnectorService) PutRelativeFileRelative(ctx context.Context, ccs connector.ContentConnectorService, stream io.Reader, streamLength int64, target string) (*connector.ConnectorResponse, error) { + ret := _mock.Called(ctx, ccs, stream, streamLength, target) if len(ret) == 0 { panic("no return value specified for PutRelativeFileRelative") @@ -270,23 +315,21 @@ func (_m *FileConnectorService) PutRelativeFileRelative(ctx context.Context, ccs var r0 *connector.ConnectorResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) (*connector.ConnectorResponse, error)); ok { - return rf(ctx, ccs, stream, streamLength, target) + if returnFunc, ok := ret.Get(0).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) (*connector.ConnectorResponse, error)); ok { + return returnFunc(ctx, ccs, stream, streamLength, target) } - if rf, ok := ret.Get(0).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) *connector.ConnectorResponse); ok { - r0 = rf(ctx, ccs, stream, streamLength, target) + if returnFunc, ok := ret.Get(0).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) *connector.ConnectorResponse); ok { + r0 = returnFunc(ctx, ccs, stream, streamLength, target) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*connector.ConnectorResponse) } } - - if rf, ok := ret.Get(1).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) error); ok { - r1 = rf(ctx, ccs, stream, streamLength, target) + if returnFunc, ok := ret.Get(1).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) error); ok { + r1 = returnFunc(ctx, ccs, stream, streamLength, target) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -307,24 +350,50 @@ func (_e *FileConnectorService_Expecter) PutRelativeFileRelative(ctx interface{} func (_c *FileConnectorService_PutRelativeFileRelative_Call) Run(run func(ctx context.Context, ccs connector.ContentConnectorService, stream io.Reader, streamLength int64, target string)) *FileConnectorService_PutRelativeFileRelative_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(connector.ContentConnectorService), args[2].(io.Reader), args[3].(int64), args[4].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 connector.ContentConnectorService + if args[1] != nil { + arg1 = args[1].(connector.ContentConnectorService) + } + var arg2 io.Reader + if args[2] != nil { + arg2 = args[2].(io.Reader) + } + var arg3 int64 + if args[3] != nil { + arg3 = args[3].(int64) + } + var arg4 string + if args[4] != nil { + arg4 = args[4].(string) + } + run( + arg0, + arg1, + arg2, + arg3, + arg4, + ) }) return _c } -func (_c *FileConnectorService_PutRelativeFileRelative_Call) Return(_a0 *connector.ConnectorResponse, _a1 error) *FileConnectorService_PutRelativeFileRelative_Call { - _c.Call.Return(_a0, _a1) +func (_c *FileConnectorService_PutRelativeFileRelative_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *FileConnectorService_PutRelativeFileRelative_Call { + _c.Call.Return(connectorResponse, err) return _c } -func (_c *FileConnectorService_PutRelativeFileRelative_Call) RunAndReturn(run func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) (*connector.ConnectorResponse, error)) *FileConnectorService_PutRelativeFileRelative_Call { +func (_c *FileConnectorService_PutRelativeFileRelative_Call) RunAndReturn(run func(ctx context.Context, ccs connector.ContentConnectorService, stream io.Reader, streamLength int64, target string) (*connector.ConnectorResponse, error)) *FileConnectorService_PutRelativeFileRelative_Call { _c.Call.Return(run) return _c } -// PutRelativeFileSuggested provides a mock function with given fields: ctx, ccs, stream, streamLength, target -func (_m *FileConnectorService) PutRelativeFileSuggested(ctx context.Context, ccs connector.ContentConnectorService, stream io.Reader, streamLength int64, target string) (*connector.ConnectorResponse, error) { - ret := _m.Called(ctx, ccs, stream, streamLength, target) +// PutRelativeFileSuggested provides a mock function for the type FileConnectorService +func (_mock *FileConnectorService) PutRelativeFileSuggested(ctx context.Context, ccs connector.ContentConnectorService, stream io.Reader, streamLength int64, target string) (*connector.ConnectorResponse, error) { + ret := _mock.Called(ctx, ccs, stream, streamLength, target) if len(ret) == 0 { panic("no return value specified for PutRelativeFileSuggested") @@ -332,23 +401,21 @@ func (_m *FileConnectorService) PutRelativeFileSuggested(ctx context.Context, cc var r0 *connector.ConnectorResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) (*connector.ConnectorResponse, error)); ok { - return rf(ctx, ccs, stream, streamLength, target) + if returnFunc, ok := ret.Get(0).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) (*connector.ConnectorResponse, error)); ok { + return returnFunc(ctx, ccs, stream, streamLength, target) } - if rf, ok := ret.Get(0).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) *connector.ConnectorResponse); ok { - r0 = rf(ctx, ccs, stream, streamLength, target) + if returnFunc, ok := ret.Get(0).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) *connector.ConnectorResponse); ok { + r0 = returnFunc(ctx, ccs, stream, streamLength, target) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*connector.ConnectorResponse) } } - - if rf, ok := ret.Get(1).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) error); ok { - r1 = rf(ctx, ccs, stream, streamLength, target) + if returnFunc, ok := ret.Get(1).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) error); ok { + r1 = returnFunc(ctx, ccs, stream, streamLength, target) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -369,24 +436,50 @@ func (_e *FileConnectorService_Expecter) PutRelativeFileSuggested(ctx interface{ func (_c *FileConnectorService_PutRelativeFileSuggested_Call) Run(run func(ctx context.Context, ccs connector.ContentConnectorService, stream io.Reader, streamLength int64, target string)) *FileConnectorService_PutRelativeFileSuggested_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(connector.ContentConnectorService), args[2].(io.Reader), args[3].(int64), args[4].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 connector.ContentConnectorService + if args[1] != nil { + arg1 = args[1].(connector.ContentConnectorService) + } + var arg2 io.Reader + if args[2] != nil { + arg2 = args[2].(io.Reader) + } + var arg3 int64 + if args[3] != nil { + arg3 = args[3].(int64) + } + var arg4 string + if args[4] != nil { + arg4 = args[4].(string) + } + run( + arg0, + arg1, + arg2, + arg3, + arg4, + ) }) return _c } -func (_c *FileConnectorService_PutRelativeFileSuggested_Call) Return(_a0 *connector.ConnectorResponse, _a1 error) *FileConnectorService_PutRelativeFileSuggested_Call { - _c.Call.Return(_a0, _a1) +func (_c *FileConnectorService_PutRelativeFileSuggested_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *FileConnectorService_PutRelativeFileSuggested_Call { + _c.Call.Return(connectorResponse, err) return _c } -func (_c *FileConnectorService_PutRelativeFileSuggested_Call) RunAndReturn(run func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) (*connector.ConnectorResponse, error)) *FileConnectorService_PutRelativeFileSuggested_Call { +func (_c *FileConnectorService_PutRelativeFileSuggested_Call) RunAndReturn(run func(ctx context.Context, ccs connector.ContentConnectorService, stream io.Reader, streamLength int64, target string) (*connector.ConnectorResponse, error)) *FileConnectorService_PutRelativeFileSuggested_Call { _c.Call.Return(run) return _c } -// RefreshLock provides a mock function with given fields: ctx, lockID -func (_m *FileConnectorService) RefreshLock(ctx context.Context, lockID string) (*connector.ConnectorResponse, error) { - ret := _m.Called(ctx, lockID) +// RefreshLock provides a mock function for the type FileConnectorService +func (_mock *FileConnectorService) RefreshLock(ctx context.Context, lockID string) (*connector.ConnectorResponse, error) { + ret := _mock.Called(ctx, lockID) if len(ret) == 0 { panic("no return value specified for RefreshLock") @@ -394,23 +487,21 @@ func (_m *FileConnectorService) RefreshLock(ctx context.Context, lockID string) var r0 *connector.ConnectorResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*connector.ConnectorResponse, error)); ok { - return rf(ctx, lockID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*connector.ConnectorResponse, error)); ok { + return returnFunc(ctx, lockID) } - if rf, ok := ret.Get(0).(func(context.Context, string) *connector.ConnectorResponse); ok { - r0 = rf(ctx, lockID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) *connector.ConnectorResponse); ok { + r0 = returnFunc(ctx, lockID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*connector.ConnectorResponse) } } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, lockID) + if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = returnFunc(ctx, lockID) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -428,24 +519,35 @@ func (_e *FileConnectorService_Expecter) RefreshLock(ctx interface{}, lockID int func (_c *FileConnectorService_RefreshLock_Call) Run(run func(ctx context.Context, lockID string)) *FileConnectorService_RefreshLock_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *FileConnectorService_RefreshLock_Call) Return(_a0 *connector.ConnectorResponse, _a1 error) *FileConnectorService_RefreshLock_Call { - _c.Call.Return(_a0, _a1) +func (_c *FileConnectorService_RefreshLock_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *FileConnectorService_RefreshLock_Call { + _c.Call.Return(connectorResponse, err) return _c } -func (_c *FileConnectorService_RefreshLock_Call) RunAndReturn(run func(context.Context, string) (*connector.ConnectorResponse, error)) *FileConnectorService_RefreshLock_Call { +func (_c *FileConnectorService_RefreshLock_Call) RunAndReturn(run func(ctx context.Context, lockID string) (*connector.ConnectorResponse, error)) *FileConnectorService_RefreshLock_Call { _c.Call.Return(run) return _c } -// RenameFile provides a mock function with given fields: ctx, lockID, target -func (_m *FileConnectorService) RenameFile(ctx context.Context, lockID string, target string) (*connector.ConnectorResponse, error) { - ret := _m.Called(ctx, lockID, target) +// RenameFile provides a mock function for the type FileConnectorService +func (_mock *FileConnectorService) RenameFile(ctx context.Context, lockID string, target string) (*connector.ConnectorResponse, error) { + ret := _mock.Called(ctx, lockID, target) if len(ret) == 0 { panic("no return value specified for RenameFile") @@ -453,23 +555,21 @@ func (_m *FileConnectorService) RenameFile(ctx context.Context, lockID string, t var r0 *connector.ConnectorResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) (*connector.ConnectorResponse, error)); ok { - return rf(ctx, lockID, target) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (*connector.ConnectorResponse, error)); ok { + return returnFunc(ctx, lockID, target) } - if rf, ok := ret.Get(0).(func(context.Context, string, string) *connector.ConnectorResponse); ok { - r0 = rf(ctx, lockID, target) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) *connector.ConnectorResponse); ok { + r0 = returnFunc(ctx, lockID, target) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*connector.ConnectorResponse) } } - - if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { - r1 = rf(ctx, lockID, target) + if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = returnFunc(ctx, lockID, target) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -488,24 +588,40 @@ func (_e *FileConnectorService_Expecter) RenameFile(ctx interface{}, lockID inte func (_c *FileConnectorService_RenameFile_Call) Run(run func(ctx context.Context, lockID string, target string)) *FileConnectorService_RenameFile_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *FileConnectorService_RenameFile_Call) Return(_a0 *connector.ConnectorResponse, _a1 error) *FileConnectorService_RenameFile_Call { - _c.Call.Return(_a0, _a1) +func (_c *FileConnectorService_RenameFile_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *FileConnectorService_RenameFile_Call { + _c.Call.Return(connectorResponse, err) return _c } -func (_c *FileConnectorService_RenameFile_Call) RunAndReturn(run func(context.Context, string, string) (*connector.ConnectorResponse, error)) *FileConnectorService_RenameFile_Call { +func (_c *FileConnectorService_RenameFile_Call) RunAndReturn(run func(ctx context.Context, lockID string, target string) (*connector.ConnectorResponse, error)) *FileConnectorService_RenameFile_Call { _c.Call.Return(run) return _c } -// UnLock provides a mock function with given fields: ctx, lockID -func (_m *FileConnectorService) UnLock(ctx context.Context, lockID string) (*connector.ConnectorResponse, error) { - ret := _m.Called(ctx, lockID) +// UnLock provides a mock function for the type FileConnectorService +func (_mock *FileConnectorService) UnLock(ctx context.Context, lockID string) (*connector.ConnectorResponse, error) { + ret := _mock.Called(ctx, lockID) if len(ret) == 0 { panic("no return value specified for UnLock") @@ -513,23 +629,21 @@ func (_m *FileConnectorService) UnLock(ctx context.Context, lockID string) (*con var r0 *connector.ConnectorResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*connector.ConnectorResponse, error)); ok { - return rf(ctx, lockID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*connector.ConnectorResponse, error)); ok { + return returnFunc(ctx, lockID) } - if rf, ok := ret.Get(0).(func(context.Context, string) *connector.ConnectorResponse); ok { - r0 = rf(ctx, lockID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) *connector.ConnectorResponse); ok { + r0 = returnFunc(ctx, lockID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*connector.ConnectorResponse) } } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, lockID) + if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = returnFunc(ctx, lockID) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -547,31 +661,28 @@ func (_e *FileConnectorService_Expecter) UnLock(ctx interface{}, lockID interfac func (_c *FileConnectorService_UnLock_Call) Run(run func(ctx context.Context, lockID string)) *FileConnectorService_UnLock_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *FileConnectorService_UnLock_Call) Return(_a0 *connector.ConnectorResponse, _a1 error) *FileConnectorService_UnLock_Call { - _c.Call.Return(_a0, _a1) +func (_c *FileConnectorService_UnLock_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *FileConnectorService_UnLock_Call { + _c.Call.Return(connectorResponse, err) return _c } -func (_c *FileConnectorService_UnLock_Call) RunAndReturn(run func(context.Context, string) (*connector.ConnectorResponse, error)) *FileConnectorService_UnLock_Call { +func (_c *FileConnectorService_UnLock_Call) RunAndReturn(run func(ctx context.Context, lockID string) (*connector.ConnectorResponse, error)) *FileConnectorService_UnLock_Call { _c.Call.Return(run) return _c } - -// NewFileConnectorService creates a new instance of FileConnectorService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewFileConnectorService(t interface { - mock.TestingT - Cleanup(func()) -}) *FileConnectorService { - mock := &FileConnectorService{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/services/collaboration/mocks/gateway_selector.go b/services/collaboration/mocks/gateway_selector.go index 315aba044c..175a2910e7 100644 --- a/services/collaboration/mocks/gateway_selector.go +++ b/services/collaboration/mocks/gateway_selector.go @@ -1,12 +1,28 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - pool "github.com/opencloud-eu/reva/v2/pkg/rgrpc/todo/pool" + "github.com/opencloud-eu/reva/v2/pkg/rgrpc/todo/pool" mock "github.com/stretchr/testify/mock" ) +// NewSelectable creates a new instance of Selectable. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewSelectable[T any](t interface { + mock.TestingT + Cleanup(func()) +}) *Selectable[T] { + mock := &Selectable[T]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // Selectable is an autogenerated mock type for the Selectable type type Selectable[T any] struct { mock.Mock @@ -20,15 +36,15 @@ func (_m *Selectable[T]) EXPECT() *Selectable_Expecter[T] { return &Selectable_Expecter[T]{mock: &_m.Mock} } -// Next provides a mock function with given fields: opts -func (_m *Selectable[T]) Next(opts ...pool.Option) (T, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] +// Next provides a mock function for the type Selectable +func (_mock *Selectable[T]) Next(opts ...pool.Option) (T, error) { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(opts) + } else { + tmpRet = _mock.Called() } - var _ca []interface{} - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) + ret := tmpRet if len(ret) == 0 { panic("no return value specified for Next") @@ -36,23 +52,21 @@ func (_m *Selectable[T]) Next(opts ...pool.Option) (T, error) { var r0 T var r1 error - if rf, ok := ret.Get(0).(func(...pool.Option) (T, error)); ok { - return rf(opts...) + if returnFunc, ok := ret.Get(0).(func(...pool.Option) (T, error)); ok { + return returnFunc(opts...) } - if rf, ok := ret.Get(0).(func(...pool.Option) T); ok { - r0 = rf(opts...) + if returnFunc, ok := ret.Get(0).(func(...pool.Option) T); ok { + r0 = returnFunc(opts...) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(T) } } - - if rf, ok := ret.Get(1).(func(...pool.Option) error); ok { - r1 = rf(opts...) + if returnFunc, ok := ret.Get(1).(func(...pool.Option) error); ok { + r1 = returnFunc(opts...) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -70,37 +84,25 @@ func (_e *Selectable_Expecter[T]) Next(opts ...interface{}) *Selectable_Next_Cal func (_c *Selectable_Next_Call[T]) Run(run func(opts ...pool.Option)) *Selectable_Next_Call[T] { _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]pool.Option, len(args)-0) - for i, a := range args[0:] { - if a != nil { - variadicArgs[i] = a.(pool.Option) - } + var arg0 []pool.Option + var variadicArgs []pool.Option + if len(args) > 0 { + variadicArgs = args[0].([]pool.Option) } - run(variadicArgs...) + arg0 = variadicArgs + run( + arg0..., + ) }) return _c } -func (_c *Selectable_Next_Call[T]) Return(_a0 T, _a1 error) *Selectable_Next_Call[T] { - _c.Call.Return(_a0, _a1) +func (_c *Selectable_Next_Call[T]) Return(v T, err error) *Selectable_Next_Call[T] { + _c.Call.Return(v, err) return _c } -func (_c *Selectable_Next_Call[T]) RunAndReturn(run func(...pool.Option) (T, error)) *Selectable_Next_Call[T] { +func (_c *Selectable_Next_Call[T]) RunAndReturn(run func(opts ...pool.Option) (T, error)) *Selectable_Next_Call[T] { _c.Call.Return(run) return _c } - -// NewSelectable creates a new instance of Selectable. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewSelectable[T any](t interface { - mock.TestingT - Cleanup(func()) -}) *Selectable[T] { - mock := &Selectable[T]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/services/collaboration/mocks/lock_parser.go b/services/collaboration/mocks/lock_parser.go index 41f97e05b8..c15c2d200b 100644 --- a/services/collaboration/mocks/lock_parser.go +++ b/services/collaboration/mocks/lock_parser.go @@ -1,8 +1,26 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks -import mock "github.com/stretchr/testify/mock" +import ( + mock "github.com/stretchr/testify/mock" +) + +// NewLockParser creates a new instance of LockParser. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewLockParser(t interface { + mock.TestingT + Cleanup(func()) +}) *LockParser { + mock := &LockParser{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} // LockParser is an autogenerated mock type for the LockParser type type LockParser struct { @@ -17,21 +35,20 @@ func (_m *LockParser) EXPECT() *LockParser_Expecter { return &LockParser_Expecter{mock: &_m.Mock} } -// ParseLock provides a mock function with given fields: id -func (_m *LockParser) ParseLock(id string) string { - ret := _m.Called(id) +// ParseLock provides a mock function for the type LockParser +func (_mock *LockParser) ParseLock(id string) string { + ret := _mock.Called(id) if len(ret) == 0 { panic("no return value specified for ParseLock") } var r0 string - if rf, ok := ret.Get(0).(func(string) string); ok { - r0 = rf(id) + if returnFunc, ok := ret.Get(0).(func(string) string); ok { + r0 = returnFunc(id) } else { r0 = ret.Get(0).(string) } - return r0 } @@ -48,31 +65,23 @@ func (_e *LockParser_Expecter) ParseLock(id interface{}) *LockParser_ParseLock_C func (_c *LockParser_ParseLock_Call) Run(run func(id string)) *LockParser_ParseLock_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) }) return _c } -func (_c *LockParser_ParseLock_Call) Return(_a0 string) *LockParser_ParseLock_Call { - _c.Call.Return(_a0) +func (_c *LockParser_ParseLock_Call) Return(s string) *LockParser_ParseLock_Call { + _c.Call.Return(s) return _c } -func (_c *LockParser_ParseLock_Call) RunAndReturn(run func(string) string) *LockParser_ParseLock_Call { +func (_c *LockParser_ParseLock_Call) RunAndReturn(run func(id string) string) *LockParser_ParseLock_Call { _c.Call.Return(run) return _c } - -// NewLockParser creates a new instance of LockParser. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewLockParser(t interface { - mock.TestingT - Cleanup(func()) -}) *LockParser { - mock := &LockParser{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/services/graph/.mockery.yaml b/services/graph/.mockery.yaml index fcfd8a989b..3f6957708c 100644 --- a/services/graph/.mockery.yaml +++ b/services/graph/.mockery.yaml @@ -1,49 +1,47 @@ -issue-845-fix: True -resolve-type-alias: False -with-expecter: true -disable-version-string: True +# maintain v2 separate mocks dir +dir: "{{.InterfaceDir}}/mocks" +structname: "{{.InterfaceName}}" filename: "{{.InterfaceName | snakecase }}.go" -mockname: "{{.InterfaceName}}" -outpkg: "mocks" +pkgname: mocks + +template: testify packages: - github.com/opencloud-eu/opencloud/services/graph/pkg/service/v0: + github.com/opencloud-eu/opencloud/services/graph/pkg/service/v0: + config: + dir: mocks + interfaces: + BaseGraphProvider: {} + DrivesDriveItemProvider: {} + DriveItemPermissionsProvider: {} + HTTPClient: {} + Permissions: {} + RoleService: {} + UsersUserProfilePhotoProvider: {} + github.com/opencloud-eu/reva/v2/pkg/events: + config: + dir: mocks + interfaces: + Publisher: {} + github.com/opencloud-eu/reva/v2/pkg/storage/utils/metadata: + config: + dir: mocks + interfaces: + Storage: {} + github.com/opencloud-eu/reva/v2/pkg/rgrpc/todo/pool: + config: + dir: mocks + interfaces: + Selectable: config: - dir: "mocks" - interfaces: - BaseGraphProvider: - DrivesDriveItemProvider: - DriveItemPermissionsProvider: - HTTPClient: - Permissions: - RoleService: - UsersUserProfilePhotoProvider: - github.com/opencloud-eu/reva/v2/pkg/events: + filename: gateway_selector.go + github.com/opencloud-eu/opencloud/services/graph/pkg/identity: + interfaces: + Backend: {} + EducationBackend: {} + github.com/go-ldap/ldap/v3: + config: + dir: pkg/identity/mocks + interfaces: + Client: config: - dir: "mocks" - interfaces: - Publisher: - github.com/opencloud-eu/reva/v2/pkg/storage/utils/metadata: - config: - dir: "mocks" - interfaces: - Storage: - github.com/opencloud-eu/reva/v2/pkg/rgrpc/todo/pool: - config: - dir: "mocks" - interfaces: - Selectable: - config: - filename: "gateway_selector.go" - github.com/opencloud-eu/opencloud/services/graph/pkg/identity: - config: - dir: "pkg/identity/mocks" - interfaces: - Backend: - EducationBackend: - github.com/go-ldap/ldap/v3: - config: - dir: "pkg/identity/mocks" - interfaces: - Client: - config: - filename: "ldapclient.go" + filename: ldapclient.go diff --git a/services/graph/mocks/base_graph_provider.go b/services/graph/mocks/base_graph_provider.go index b948dcf9d0..b74756bb30 100644 --- a/services/graph/mocks/base_graph_provider.go +++ b/services/graph/mocks/base_graph_provider.go @@ -1,19 +1,32 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" - - collaborationv1beta1 "github.com/cs3org/go-cs3apis/cs3/sharing/collaboration/v1beta1" - - libregraph "github.com/opencloud-eu/libre-graph-api-go" + "context" + "github.com/cs3org/go-cs3apis/cs3/sharing/collaboration/v1beta1" + "github.com/cs3org/go-cs3apis/cs3/sharing/ocm/v1beta1" + "github.com/opencloud-eu/libre-graph-api-go" mock "github.com/stretchr/testify/mock" - - ocmv1beta1 "github.com/cs3org/go-cs3apis/cs3/sharing/ocm/v1beta1" ) +// NewBaseGraphProvider creates a new instance of BaseGraphProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewBaseGraphProvider(t interface { + mock.TestingT + Cleanup(func()) +}) *BaseGraphProvider { + mock := &BaseGraphProvider{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // BaseGraphProvider is an autogenerated mock type for the BaseGraphProvider type type BaseGraphProvider struct { mock.Mock @@ -27,9 +40,9 @@ func (_m *BaseGraphProvider) EXPECT() *BaseGraphProvider_Expecter { return &BaseGraphProvider_Expecter{mock: &_m.Mock} } -// CS3ReceivedOCMSharesToDriveItems provides a mock function with given fields: ctx, receivedOCMShares -func (_m *BaseGraphProvider) CS3ReceivedOCMSharesToDriveItems(ctx context.Context, receivedOCMShares []*ocmv1beta1.ReceivedShare) ([]libregraph.DriveItem, error) { - ret := _m.Called(ctx, receivedOCMShares) +// CS3ReceivedOCMSharesToDriveItems provides a mock function for the type BaseGraphProvider +func (_mock *BaseGraphProvider) CS3ReceivedOCMSharesToDriveItems(ctx context.Context, receivedOCMShares []*ocmv1beta1.ReceivedShare) ([]libregraph.DriveItem, error) { + ret := _mock.Called(ctx, receivedOCMShares) if len(ret) == 0 { panic("no return value specified for CS3ReceivedOCMSharesToDriveItems") @@ -37,23 +50,21 @@ func (_m *BaseGraphProvider) CS3ReceivedOCMSharesToDriveItems(ctx context.Contex var r0 []libregraph.DriveItem var r1 error - if rf, ok := ret.Get(0).(func(context.Context, []*ocmv1beta1.ReceivedShare) ([]libregraph.DriveItem, error)); ok { - return rf(ctx, receivedOCMShares) + if returnFunc, ok := ret.Get(0).(func(context.Context, []*ocmv1beta1.ReceivedShare) ([]libregraph.DriveItem, error)); ok { + return returnFunc(ctx, receivedOCMShares) } - if rf, ok := ret.Get(0).(func(context.Context, []*ocmv1beta1.ReceivedShare) []libregraph.DriveItem); ok { - r0 = rf(ctx, receivedOCMShares) + if returnFunc, ok := ret.Get(0).(func(context.Context, []*ocmv1beta1.ReceivedShare) []libregraph.DriveItem); ok { + r0 = returnFunc(ctx, receivedOCMShares) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]libregraph.DriveItem) } } - - if rf, ok := ret.Get(1).(func(context.Context, []*ocmv1beta1.ReceivedShare) error); ok { - r1 = rf(ctx, receivedOCMShares) + if returnFunc, ok := ret.Get(1).(func(context.Context, []*ocmv1beta1.ReceivedShare) error); ok { + r1 = returnFunc(ctx, receivedOCMShares) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -71,24 +82,35 @@ func (_e *BaseGraphProvider_Expecter) CS3ReceivedOCMSharesToDriveItems(ctx inter func (_c *BaseGraphProvider_CS3ReceivedOCMSharesToDriveItems_Call) Run(run func(ctx context.Context, receivedOCMShares []*ocmv1beta1.ReceivedShare)) *BaseGraphProvider_CS3ReceivedOCMSharesToDriveItems_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].([]*ocmv1beta1.ReceivedShare)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 []*ocmv1beta1.ReceivedShare + if args[1] != nil { + arg1 = args[1].([]*ocmv1beta1.ReceivedShare) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *BaseGraphProvider_CS3ReceivedOCMSharesToDriveItems_Call) Return(_a0 []libregraph.DriveItem, _a1 error) *BaseGraphProvider_CS3ReceivedOCMSharesToDriveItems_Call { - _c.Call.Return(_a0, _a1) +func (_c *BaseGraphProvider_CS3ReceivedOCMSharesToDriveItems_Call) Return(driveItems []libregraph.DriveItem, err error) *BaseGraphProvider_CS3ReceivedOCMSharesToDriveItems_Call { + _c.Call.Return(driveItems, err) return _c } -func (_c *BaseGraphProvider_CS3ReceivedOCMSharesToDriveItems_Call) RunAndReturn(run func(context.Context, []*ocmv1beta1.ReceivedShare) ([]libregraph.DriveItem, error)) *BaseGraphProvider_CS3ReceivedOCMSharesToDriveItems_Call { +func (_c *BaseGraphProvider_CS3ReceivedOCMSharesToDriveItems_Call) RunAndReturn(run func(ctx context.Context, receivedOCMShares []*ocmv1beta1.ReceivedShare) ([]libregraph.DriveItem, error)) *BaseGraphProvider_CS3ReceivedOCMSharesToDriveItems_Call { _c.Call.Return(run) return _c } -// CS3ReceivedSharesToDriveItems provides a mock function with given fields: ctx, receivedShares -func (_m *BaseGraphProvider) CS3ReceivedSharesToDriveItems(ctx context.Context, receivedShares []*collaborationv1beta1.ReceivedShare) ([]libregraph.DriveItem, error) { - ret := _m.Called(ctx, receivedShares) +// CS3ReceivedSharesToDriveItems provides a mock function for the type BaseGraphProvider +func (_mock *BaseGraphProvider) CS3ReceivedSharesToDriveItems(ctx context.Context, receivedShares []*collaborationv1beta1.ReceivedShare) ([]libregraph.DriveItem, error) { + ret := _mock.Called(ctx, receivedShares) if len(ret) == 0 { panic("no return value specified for CS3ReceivedSharesToDriveItems") @@ -96,23 +118,21 @@ func (_m *BaseGraphProvider) CS3ReceivedSharesToDriveItems(ctx context.Context, var r0 []libregraph.DriveItem var r1 error - if rf, ok := ret.Get(0).(func(context.Context, []*collaborationv1beta1.ReceivedShare) ([]libregraph.DriveItem, error)); ok { - return rf(ctx, receivedShares) + if returnFunc, ok := ret.Get(0).(func(context.Context, []*collaborationv1beta1.ReceivedShare) ([]libregraph.DriveItem, error)); ok { + return returnFunc(ctx, receivedShares) } - if rf, ok := ret.Get(0).(func(context.Context, []*collaborationv1beta1.ReceivedShare) []libregraph.DriveItem); ok { - r0 = rf(ctx, receivedShares) + if returnFunc, ok := ret.Get(0).(func(context.Context, []*collaborationv1beta1.ReceivedShare) []libregraph.DriveItem); ok { + r0 = returnFunc(ctx, receivedShares) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]libregraph.DriveItem) } } - - if rf, ok := ret.Get(1).(func(context.Context, []*collaborationv1beta1.ReceivedShare) error); ok { - r1 = rf(ctx, receivedShares) + if returnFunc, ok := ret.Get(1).(func(context.Context, []*collaborationv1beta1.ReceivedShare) error); ok { + r1 = returnFunc(ctx, receivedShares) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -130,31 +150,28 @@ func (_e *BaseGraphProvider_Expecter) CS3ReceivedSharesToDriveItems(ctx interfac func (_c *BaseGraphProvider_CS3ReceivedSharesToDriveItems_Call) Run(run func(ctx context.Context, receivedShares []*collaborationv1beta1.ReceivedShare)) *BaseGraphProvider_CS3ReceivedSharesToDriveItems_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].([]*collaborationv1beta1.ReceivedShare)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 []*collaborationv1beta1.ReceivedShare + if args[1] != nil { + arg1 = args[1].([]*collaborationv1beta1.ReceivedShare) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *BaseGraphProvider_CS3ReceivedSharesToDriveItems_Call) Return(_a0 []libregraph.DriveItem, _a1 error) *BaseGraphProvider_CS3ReceivedSharesToDriveItems_Call { - _c.Call.Return(_a0, _a1) +func (_c *BaseGraphProvider_CS3ReceivedSharesToDriveItems_Call) Return(driveItems []libregraph.DriveItem, err error) *BaseGraphProvider_CS3ReceivedSharesToDriveItems_Call { + _c.Call.Return(driveItems, err) return _c } -func (_c *BaseGraphProvider_CS3ReceivedSharesToDriveItems_Call) RunAndReturn(run func(context.Context, []*collaborationv1beta1.ReceivedShare) ([]libregraph.DriveItem, error)) *BaseGraphProvider_CS3ReceivedSharesToDriveItems_Call { +func (_c *BaseGraphProvider_CS3ReceivedSharesToDriveItems_Call) RunAndReturn(run func(ctx context.Context, receivedShares []*collaborationv1beta1.ReceivedShare) ([]libregraph.DriveItem, error)) *BaseGraphProvider_CS3ReceivedSharesToDriveItems_Call { _c.Call.Return(run) return _c } - -// NewBaseGraphProvider creates a new instance of BaseGraphProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewBaseGraphProvider(t interface { - mock.TestingT - Cleanup(func()) -}) *BaseGraphProvider { - mock := &BaseGraphProvider{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/services/graph/mocks/drive_item_permissions_provider.go b/services/graph/mocks/drive_item_permissions_provider.go index cd2429b015..682f04ca43 100644 --- a/services/graph/mocks/drive_item_permissions_provider.go +++ b/services/graph/mocks/drive_item_permissions_provider.go @@ -1,18 +1,32 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" + "context" - libregraph "github.com/opencloud-eu/libre-graph-api-go" + "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" + "github.com/opencloud-eu/libre-graph-api-go" + "github.com/opencloud-eu/opencloud/services/graph/pkg/service/v0" mock "github.com/stretchr/testify/mock" - - providerv1beta1 "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" - - svc "github.com/opencloud-eu/opencloud/services/graph/pkg/service/v0" ) +// NewDriveItemPermissionsProvider creates a new instance of DriveItemPermissionsProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewDriveItemPermissionsProvider(t interface { + mock.TestingT + Cleanup(func()) +}) *DriveItemPermissionsProvider { + mock := &DriveItemPermissionsProvider{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // DriveItemPermissionsProvider is an autogenerated mock type for the DriveItemPermissionsProvider type type DriveItemPermissionsProvider struct { mock.Mock @@ -26,9 +40,9 @@ func (_m *DriveItemPermissionsProvider) EXPECT() *DriveItemPermissionsProvider_E return &DriveItemPermissionsProvider_Expecter{mock: &_m.Mock} } -// CreateLink provides a mock function with given fields: ctx, driveItemID, createLink -func (_m *DriveItemPermissionsProvider) CreateLink(ctx context.Context, driveItemID *providerv1beta1.ResourceId, createLink libregraph.DriveItemCreateLink) (libregraph.Permission, error) { - ret := _m.Called(ctx, driveItemID, createLink) +// CreateLink provides a mock function for the type DriveItemPermissionsProvider +func (_mock *DriveItemPermissionsProvider) CreateLink(ctx context.Context, driveItemID *providerv1beta1.ResourceId, createLink libregraph.DriveItemCreateLink) (libregraph.Permission, error) { + ret := _mock.Called(ctx, driveItemID, createLink) if len(ret) == 0 { panic("no return value specified for CreateLink") @@ -36,21 +50,19 @@ func (_m *DriveItemPermissionsProvider) CreateLink(ctx context.Context, driveIte var r0 libregraph.Permission var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) (libregraph.Permission, error)); ok { - return rf(ctx, driveItemID, createLink) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) (libregraph.Permission, error)); ok { + return returnFunc(ctx, driveItemID, createLink) } - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) libregraph.Permission); ok { - r0 = rf(ctx, driveItemID, createLink) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) libregraph.Permission); ok { + r0 = returnFunc(ctx, driveItemID, createLink) } else { r0 = ret.Get(0).(libregraph.Permission) } - - if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) error); ok { - r1 = rf(ctx, driveItemID, createLink) + if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) error); ok { + r1 = returnFunc(ctx, driveItemID, createLink) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -69,24 +81,40 @@ func (_e *DriveItemPermissionsProvider_Expecter) CreateLink(ctx interface{}, dri func (_c *DriveItemPermissionsProvider_CreateLink_Call) Run(run func(ctx context.Context, driveItemID *providerv1beta1.ResourceId, createLink libregraph.DriveItemCreateLink)) *DriveItemPermissionsProvider_CreateLink_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId), args[2].(libregraph.DriveItemCreateLink)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *providerv1beta1.ResourceId + if args[1] != nil { + arg1 = args[1].(*providerv1beta1.ResourceId) + } + var arg2 libregraph.DriveItemCreateLink + if args[2] != nil { + arg2 = args[2].(libregraph.DriveItemCreateLink) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *DriveItemPermissionsProvider_CreateLink_Call) Return(_a0 libregraph.Permission, _a1 error) *DriveItemPermissionsProvider_CreateLink_Call { - _c.Call.Return(_a0, _a1) +func (_c *DriveItemPermissionsProvider_CreateLink_Call) Return(permission libregraph.Permission, err error) *DriveItemPermissionsProvider_CreateLink_Call { + _c.Call.Return(permission, err) return _c } -func (_c *DriveItemPermissionsProvider_CreateLink_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) (libregraph.Permission, error)) *DriveItemPermissionsProvider_CreateLink_Call { +func (_c *DriveItemPermissionsProvider_CreateLink_Call) RunAndReturn(run func(ctx context.Context, driveItemID *providerv1beta1.ResourceId, createLink libregraph.DriveItemCreateLink) (libregraph.Permission, error)) *DriveItemPermissionsProvider_CreateLink_Call { _c.Call.Return(run) return _c } -// CreateSpaceRootLink provides a mock function with given fields: ctx, driveID, createLink -func (_m *DriveItemPermissionsProvider) CreateSpaceRootLink(ctx context.Context, driveID *providerv1beta1.ResourceId, createLink libregraph.DriveItemCreateLink) (libregraph.Permission, error) { - ret := _m.Called(ctx, driveID, createLink) +// CreateSpaceRootLink provides a mock function for the type DriveItemPermissionsProvider +func (_mock *DriveItemPermissionsProvider) CreateSpaceRootLink(ctx context.Context, driveID *providerv1beta1.ResourceId, createLink libregraph.DriveItemCreateLink) (libregraph.Permission, error) { + ret := _mock.Called(ctx, driveID, createLink) if len(ret) == 0 { panic("no return value specified for CreateSpaceRootLink") @@ -94,21 +122,19 @@ func (_m *DriveItemPermissionsProvider) CreateSpaceRootLink(ctx context.Context, var r0 libregraph.Permission var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) (libregraph.Permission, error)); ok { - return rf(ctx, driveID, createLink) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) (libregraph.Permission, error)); ok { + return returnFunc(ctx, driveID, createLink) } - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) libregraph.Permission); ok { - r0 = rf(ctx, driveID, createLink) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) libregraph.Permission); ok { + r0 = returnFunc(ctx, driveID, createLink) } else { r0 = ret.Get(0).(libregraph.Permission) } - - if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) error); ok { - r1 = rf(ctx, driveID, createLink) + if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) error); ok { + r1 = returnFunc(ctx, driveID, createLink) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -127,36 +153,51 @@ func (_e *DriveItemPermissionsProvider_Expecter) CreateSpaceRootLink(ctx interfa func (_c *DriveItemPermissionsProvider_CreateSpaceRootLink_Call) Run(run func(ctx context.Context, driveID *providerv1beta1.ResourceId, createLink libregraph.DriveItemCreateLink)) *DriveItemPermissionsProvider_CreateSpaceRootLink_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId), args[2].(libregraph.DriveItemCreateLink)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *providerv1beta1.ResourceId + if args[1] != nil { + arg1 = args[1].(*providerv1beta1.ResourceId) + } + var arg2 libregraph.DriveItemCreateLink + if args[2] != nil { + arg2 = args[2].(libregraph.DriveItemCreateLink) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *DriveItemPermissionsProvider_CreateSpaceRootLink_Call) Return(_a0 libregraph.Permission, _a1 error) *DriveItemPermissionsProvider_CreateSpaceRootLink_Call { - _c.Call.Return(_a0, _a1) +func (_c *DriveItemPermissionsProvider_CreateSpaceRootLink_Call) Return(permission libregraph.Permission, err error) *DriveItemPermissionsProvider_CreateSpaceRootLink_Call { + _c.Call.Return(permission, err) return _c } -func (_c *DriveItemPermissionsProvider_CreateSpaceRootLink_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) (libregraph.Permission, error)) *DriveItemPermissionsProvider_CreateSpaceRootLink_Call { +func (_c *DriveItemPermissionsProvider_CreateSpaceRootLink_Call) RunAndReturn(run func(ctx context.Context, driveID *providerv1beta1.ResourceId, createLink libregraph.DriveItemCreateLink) (libregraph.Permission, error)) *DriveItemPermissionsProvider_CreateSpaceRootLink_Call { _c.Call.Return(run) return _c } -// DeletePermission provides a mock function with given fields: ctx, itemID, permissionID -func (_m *DriveItemPermissionsProvider) DeletePermission(ctx context.Context, itemID *providerv1beta1.ResourceId, permissionID string) error { - ret := _m.Called(ctx, itemID, permissionID) +// DeletePermission provides a mock function for the type DriveItemPermissionsProvider +func (_mock *DriveItemPermissionsProvider) DeletePermission(ctx context.Context, itemID *providerv1beta1.ResourceId, permissionID string) error { + ret := _mock.Called(ctx, itemID, permissionID) if len(ret) == 0 { panic("no return value specified for DeletePermission") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string) error); ok { - r0 = rf(ctx, itemID, permissionID) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string) error); ok { + r0 = returnFunc(ctx, itemID, permissionID) } else { r0 = ret.Error(0) } - return r0 } @@ -175,36 +216,51 @@ func (_e *DriveItemPermissionsProvider_Expecter) DeletePermission(ctx interface{ func (_c *DriveItemPermissionsProvider_DeletePermission_Call) Run(run func(ctx context.Context, itemID *providerv1beta1.ResourceId, permissionID string)) *DriveItemPermissionsProvider_DeletePermission_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId), args[2].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *providerv1beta1.ResourceId + if args[1] != nil { + arg1 = args[1].(*providerv1beta1.ResourceId) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *DriveItemPermissionsProvider_DeletePermission_Call) Return(_a0 error) *DriveItemPermissionsProvider_DeletePermission_Call { - _c.Call.Return(_a0) +func (_c *DriveItemPermissionsProvider_DeletePermission_Call) Return(err error) *DriveItemPermissionsProvider_DeletePermission_Call { + _c.Call.Return(err) return _c } -func (_c *DriveItemPermissionsProvider_DeletePermission_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId, string) error) *DriveItemPermissionsProvider_DeletePermission_Call { +func (_c *DriveItemPermissionsProvider_DeletePermission_Call) RunAndReturn(run func(ctx context.Context, itemID *providerv1beta1.ResourceId, permissionID string) error) *DriveItemPermissionsProvider_DeletePermission_Call { _c.Call.Return(run) return _c } -// DeleteSpaceRootPermission provides a mock function with given fields: ctx, driveID, permissionID -func (_m *DriveItemPermissionsProvider) DeleteSpaceRootPermission(ctx context.Context, driveID *providerv1beta1.ResourceId, permissionID string) error { - ret := _m.Called(ctx, driveID, permissionID) +// DeleteSpaceRootPermission provides a mock function for the type DriveItemPermissionsProvider +func (_mock *DriveItemPermissionsProvider) DeleteSpaceRootPermission(ctx context.Context, driveID *providerv1beta1.ResourceId, permissionID string) error { + ret := _mock.Called(ctx, driveID, permissionID) if len(ret) == 0 { panic("no return value specified for DeleteSpaceRootPermission") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string) error); ok { - r0 = rf(ctx, driveID, permissionID) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string) error); ok { + r0 = returnFunc(ctx, driveID, permissionID) } else { r0 = ret.Error(0) } - return r0 } @@ -223,24 +279,40 @@ func (_e *DriveItemPermissionsProvider_Expecter) DeleteSpaceRootPermission(ctx i func (_c *DriveItemPermissionsProvider_DeleteSpaceRootPermission_Call) Run(run func(ctx context.Context, driveID *providerv1beta1.ResourceId, permissionID string)) *DriveItemPermissionsProvider_DeleteSpaceRootPermission_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId), args[2].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *providerv1beta1.ResourceId + if args[1] != nil { + arg1 = args[1].(*providerv1beta1.ResourceId) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *DriveItemPermissionsProvider_DeleteSpaceRootPermission_Call) Return(_a0 error) *DriveItemPermissionsProvider_DeleteSpaceRootPermission_Call { - _c.Call.Return(_a0) +func (_c *DriveItemPermissionsProvider_DeleteSpaceRootPermission_Call) Return(err error) *DriveItemPermissionsProvider_DeleteSpaceRootPermission_Call { + _c.Call.Return(err) return _c } -func (_c *DriveItemPermissionsProvider_DeleteSpaceRootPermission_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId, string) error) *DriveItemPermissionsProvider_DeleteSpaceRootPermission_Call { +func (_c *DriveItemPermissionsProvider_DeleteSpaceRootPermission_Call) RunAndReturn(run func(ctx context.Context, driveID *providerv1beta1.ResourceId, permissionID string) error) *DriveItemPermissionsProvider_DeleteSpaceRootPermission_Call { _c.Call.Return(run) return _c } -// Invite provides a mock function with given fields: ctx, resourceId, invite -func (_m *DriveItemPermissionsProvider) Invite(ctx context.Context, resourceId *providerv1beta1.ResourceId, invite libregraph.DriveItemInvite) (libregraph.Permission, error) { - ret := _m.Called(ctx, resourceId, invite) +// Invite provides a mock function for the type DriveItemPermissionsProvider +func (_mock *DriveItemPermissionsProvider) Invite(ctx context.Context, resourceId *providerv1beta1.ResourceId, invite libregraph.DriveItemInvite) (libregraph.Permission, error) { + ret := _mock.Called(ctx, resourceId, invite) if len(ret) == 0 { panic("no return value specified for Invite") @@ -248,21 +320,19 @@ func (_m *DriveItemPermissionsProvider) Invite(ctx context.Context, resourceId * var r0 libregraph.Permission var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) (libregraph.Permission, error)); ok { - return rf(ctx, resourceId, invite) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) (libregraph.Permission, error)); ok { + return returnFunc(ctx, resourceId, invite) } - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) libregraph.Permission); ok { - r0 = rf(ctx, resourceId, invite) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) libregraph.Permission); ok { + r0 = returnFunc(ctx, resourceId, invite) } else { r0 = ret.Get(0).(libregraph.Permission) } - - if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) error); ok { - r1 = rf(ctx, resourceId, invite) + if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) error); ok { + r1 = returnFunc(ctx, resourceId, invite) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -281,24 +351,40 @@ func (_e *DriveItemPermissionsProvider_Expecter) Invite(ctx interface{}, resourc func (_c *DriveItemPermissionsProvider_Invite_Call) Run(run func(ctx context.Context, resourceId *providerv1beta1.ResourceId, invite libregraph.DriveItemInvite)) *DriveItemPermissionsProvider_Invite_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId), args[2].(libregraph.DriveItemInvite)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *providerv1beta1.ResourceId + if args[1] != nil { + arg1 = args[1].(*providerv1beta1.ResourceId) + } + var arg2 libregraph.DriveItemInvite + if args[2] != nil { + arg2 = args[2].(libregraph.DriveItemInvite) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *DriveItemPermissionsProvider_Invite_Call) Return(_a0 libregraph.Permission, _a1 error) *DriveItemPermissionsProvider_Invite_Call { - _c.Call.Return(_a0, _a1) +func (_c *DriveItemPermissionsProvider_Invite_Call) Return(permission libregraph.Permission, err error) *DriveItemPermissionsProvider_Invite_Call { + _c.Call.Return(permission, err) return _c } -func (_c *DriveItemPermissionsProvider_Invite_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) (libregraph.Permission, error)) *DriveItemPermissionsProvider_Invite_Call { +func (_c *DriveItemPermissionsProvider_Invite_Call) RunAndReturn(run func(ctx context.Context, resourceId *providerv1beta1.ResourceId, invite libregraph.DriveItemInvite) (libregraph.Permission, error)) *DriveItemPermissionsProvider_Invite_Call { _c.Call.Return(run) return _c } -// ListPermissions provides a mock function with given fields: ctx, itemID, queryOptions -func (_m *DriveItemPermissionsProvider) ListPermissions(ctx context.Context, itemID *providerv1beta1.ResourceId, queryOptions svc.ListPermissionsQueryOptions) (libregraph.CollectionOfPermissionsWithAllowedValues, error) { - ret := _m.Called(ctx, itemID, queryOptions) +// ListPermissions provides a mock function for the type DriveItemPermissionsProvider +func (_mock *DriveItemPermissionsProvider) ListPermissions(ctx context.Context, itemID *providerv1beta1.ResourceId, queryOptions svc.ListPermissionsQueryOptions) (libregraph.CollectionOfPermissionsWithAllowedValues, error) { + ret := _mock.Called(ctx, itemID, queryOptions) if len(ret) == 0 { panic("no return value specified for ListPermissions") @@ -306,21 +392,19 @@ func (_m *DriveItemPermissionsProvider) ListPermissions(ctx context.Context, ite var r0 libregraph.CollectionOfPermissionsWithAllowedValues var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) (libregraph.CollectionOfPermissionsWithAllowedValues, error)); ok { - return rf(ctx, itemID, queryOptions) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) (libregraph.CollectionOfPermissionsWithAllowedValues, error)); ok { + return returnFunc(ctx, itemID, queryOptions) } - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) libregraph.CollectionOfPermissionsWithAllowedValues); ok { - r0 = rf(ctx, itemID, queryOptions) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) libregraph.CollectionOfPermissionsWithAllowedValues); ok { + r0 = returnFunc(ctx, itemID, queryOptions) } else { r0 = ret.Get(0).(libregraph.CollectionOfPermissionsWithAllowedValues) } - - if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) error); ok { - r1 = rf(ctx, itemID, queryOptions) + if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) error); ok { + r1 = returnFunc(ctx, itemID, queryOptions) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -339,24 +423,40 @@ func (_e *DriveItemPermissionsProvider_Expecter) ListPermissions(ctx interface{} func (_c *DriveItemPermissionsProvider_ListPermissions_Call) Run(run func(ctx context.Context, itemID *providerv1beta1.ResourceId, queryOptions svc.ListPermissionsQueryOptions)) *DriveItemPermissionsProvider_ListPermissions_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId), args[2].(svc.ListPermissionsQueryOptions)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *providerv1beta1.ResourceId + if args[1] != nil { + arg1 = args[1].(*providerv1beta1.ResourceId) + } + var arg2 svc.ListPermissionsQueryOptions + if args[2] != nil { + arg2 = args[2].(svc.ListPermissionsQueryOptions) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *DriveItemPermissionsProvider_ListPermissions_Call) Return(_a0 libregraph.CollectionOfPermissionsWithAllowedValues, _a1 error) *DriveItemPermissionsProvider_ListPermissions_Call { - _c.Call.Return(_a0, _a1) +func (_c *DriveItemPermissionsProvider_ListPermissions_Call) Return(collectionOfPermissionsWithAllowedValues libregraph.CollectionOfPermissionsWithAllowedValues, err error) *DriveItemPermissionsProvider_ListPermissions_Call { + _c.Call.Return(collectionOfPermissionsWithAllowedValues, err) return _c } -func (_c *DriveItemPermissionsProvider_ListPermissions_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) (libregraph.CollectionOfPermissionsWithAllowedValues, error)) *DriveItemPermissionsProvider_ListPermissions_Call { +func (_c *DriveItemPermissionsProvider_ListPermissions_Call) RunAndReturn(run func(ctx context.Context, itemID *providerv1beta1.ResourceId, queryOptions svc.ListPermissionsQueryOptions) (libregraph.CollectionOfPermissionsWithAllowedValues, error)) *DriveItemPermissionsProvider_ListPermissions_Call { _c.Call.Return(run) return _c } -// ListSpaceRootPermissions provides a mock function with given fields: ctx, driveID, queryOptions -func (_m *DriveItemPermissionsProvider) ListSpaceRootPermissions(ctx context.Context, driveID *providerv1beta1.ResourceId, queryOptions svc.ListPermissionsQueryOptions) (libregraph.CollectionOfPermissionsWithAllowedValues, error) { - ret := _m.Called(ctx, driveID, queryOptions) +// ListSpaceRootPermissions provides a mock function for the type DriveItemPermissionsProvider +func (_mock *DriveItemPermissionsProvider) ListSpaceRootPermissions(ctx context.Context, driveID *providerv1beta1.ResourceId, queryOptions svc.ListPermissionsQueryOptions) (libregraph.CollectionOfPermissionsWithAllowedValues, error) { + ret := _mock.Called(ctx, driveID, queryOptions) if len(ret) == 0 { panic("no return value specified for ListSpaceRootPermissions") @@ -364,21 +464,19 @@ func (_m *DriveItemPermissionsProvider) ListSpaceRootPermissions(ctx context.Con var r0 libregraph.CollectionOfPermissionsWithAllowedValues var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) (libregraph.CollectionOfPermissionsWithAllowedValues, error)); ok { - return rf(ctx, driveID, queryOptions) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) (libregraph.CollectionOfPermissionsWithAllowedValues, error)); ok { + return returnFunc(ctx, driveID, queryOptions) } - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) libregraph.CollectionOfPermissionsWithAllowedValues); ok { - r0 = rf(ctx, driveID, queryOptions) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) libregraph.CollectionOfPermissionsWithAllowedValues); ok { + r0 = returnFunc(ctx, driveID, queryOptions) } else { r0 = ret.Get(0).(libregraph.CollectionOfPermissionsWithAllowedValues) } - - if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) error); ok { - r1 = rf(ctx, driveID, queryOptions) + if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) error); ok { + r1 = returnFunc(ctx, driveID, queryOptions) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -397,24 +495,40 @@ func (_e *DriveItemPermissionsProvider_Expecter) ListSpaceRootPermissions(ctx in func (_c *DriveItemPermissionsProvider_ListSpaceRootPermissions_Call) Run(run func(ctx context.Context, driveID *providerv1beta1.ResourceId, queryOptions svc.ListPermissionsQueryOptions)) *DriveItemPermissionsProvider_ListSpaceRootPermissions_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId), args[2].(svc.ListPermissionsQueryOptions)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *providerv1beta1.ResourceId + if args[1] != nil { + arg1 = args[1].(*providerv1beta1.ResourceId) + } + var arg2 svc.ListPermissionsQueryOptions + if args[2] != nil { + arg2 = args[2].(svc.ListPermissionsQueryOptions) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *DriveItemPermissionsProvider_ListSpaceRootPermissions_Call) Return(_a0 libregraph.CollectionOfPermissionsWithAllowedValues, _a1 error) *DriveItemPermissionsProvider_ListSpaceRootPermissions_Call { - _c.Call.Return(_a0, _a1) +func (_c *DriveItemPermissionsProvider_ListSpaceRootPermissions_Call) Return(collectionOfPermissionsWithAllowedValues libregraph.CollectionOfPermissionsWithAllowedValues, err error) *DriveItemPermissionsProvider_ListSpaceRootPermissions_Call { + _c.Call.Return(collectionOfPermissionsWithAllowedValues, err) return _c } -func (_c *DriveItemPermissionsProvider_ListSpaceRootPermissions_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) (libregraph.CollectionOfPermissionsWithAllowedValues, error)) *DriveItemPermissionsProvider_ListSpaceRootPermissions_Call { +func (_c *DriveItemPermissionsProvider_ListSpaceRootPermissions_Call) RunAndReturn(run func(ctx context.Context, driveID *providerv1beta1.ResourceId, queryOptions svc.ListPermissionsQueryOptions) (libregraph.CollectionOfPermissionsWithAllowedValues, error)) *DriveItemPermissionsProvider_ListSpaceRootPermissions_Call { _c.Call.Return(run) return _c } -// SetPublicLinkPassword provides a mock function with given fields: ctx, driveItemID, permissionID, password -func (_m *DriveItemPermissionsProvider) SetPublicLinkPassword(ctx context.Context, driveItemID *providerv1beta1.ResourceId, permissionID string, password string) (libregraph.Permission, error) { - ret := _m.Called(ctx, driveItemID, permissionID, password) +// SetPublicLinkPassword provides a mock function for the type DriveItemPermissionsProvider +func (_mock *DriveItemPermissionsProvider) SetPublicLinkPassword(ctx context.Context, driveItemID *providerv1beta1.ResourceId, permissionID string, password string) (libregraph.Permission, error) { + ret := _mock.Called(ctx, driveItemID, permissionID, password) if len(ret) == 0 { panic("no return value specified for SetPublicLinkPassword") @@ -422,21 +536,19 @@ func (_m *DriveItemPermissionsProvider) SetPublicLinkPassword(ctx context.Contex var r0 libregraph.Permission var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, string) (libregraph.Permission, error)); ok { - return rf(ctx, driveItemID, permissionID, password) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, string) (libregraph.Permission, error)); ok { + return returnFunc(ctx, driveItemID, permissionID, password) } - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, string) libregraph.Permission); ok { - r0 = rf(ctx, driveItemID, permissionID, password) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, string) libregraph.Permission); ok { + r0 = returnFunc(ctx, driveItemID, permissionID, password) } else { r0 = ret.Get(0).(libregraph.Permission) } - - if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, string, string) error); ok { - r1 = rf(ctx, driveItemID, permissionID, password) + if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, string, string) error); ok { + r1 = returnFunc(ctx, driveItemID, permissionID, password) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -456,24 +568,45 @@ func (_e *DriveItemPermissionsProvider_Expecter) SetPublicLinkPassword(ctx inter func (_c *DriveItemPermissionsProvider_SetPublicLinkPassword_Call) Run(run func(ctx context.Context, driveItemID *providerv1beta1.ResourceId, permissionID string, password string)) *DriveItemPermissionsProvider_SetPublicLinkPassword_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId), args[2].(string), args[3].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *providerv1beta1.ResourceId + if args[1] != nil { + arg1 = args[1].(*providerv1beta1.ResourceId) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + var arg3 string + if args[3] != nil { + arg3 = args[3].(string) + } + run( + arg0, + arg1, + arg2, + arg3, + ) }) return _c } -func (_c *DriveItemPermissionsProvider_SetPublicLinkPassword_Call) Return(_a0 libregraph.Permission, _a1 error) *DriveItemPermissionsProvider_SetPublicLinkPassword_Call { - _c.Call.Return(_a0, _a1) +func (_c *DriveItemPermissionsProvider_SetPublicLinkPassword_Call) Return(permission libregraph.Permission, err error) *DriveItemPermissionsProvider_SetPublicLinkPassword_Call { + _c.Call.Return(permission, err) return _c } -func (_c *DriveItemPermissionsProvider_SetPublicLinkPassword_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId, string, string) (libregraph.Permission, error)) *DriveItemPermissionsProvider_SetPublicLinkPassword_Call { +func (_c *DriveItemPermissionsProvider_SetPublicLinkPassword_Call) RunAndReturn(run func(ctx context.Context, driveItemID *providerv1beta1.ResourceId, permissionID string, password string) (libregraph.Permission, error)) *DriveItemPermissionsProvider_SetPublicLinkPassword_Call { _c.Call.Return(run) return _c } -// SetPublicLinkPasswordOnSpaceRoot provides a mock function with given fields: ctx, driveID, permissionID, password -func (_m *DriveItemPermissionsProvider) SetPublicLinkPasswordOnSpaceRoot(ctx context.Context, driveID *providerv1beta1.ResourceId, permissionID string, password string) (libregraph.Permission, error) { - ret := _m.Called(ctx, driveID, permissionID, password) +// SetPublicLinkPasswordOnSpaceRoot provides a mock function for the type DriveItemPermissionsProvider +func (_mock *DriveItemPermissionsProvider) SetPublicLinkPasswordOnSpaceRoot(ctx context.Context, driveID *providerv1beta1.ResourceId, permissionID string, password string) (libregraph.Permission, error) { + ret := _mock.Called(ctx, driveID, permissionID, password) if len(ret) == 0 { panic("no return value specified for SetPublicLinkPasswordOnSpaceRoot") @@ -481,21 +614,19 @@ func (_m *DriveItemPermissionsProvider) SetPublicLinkPasswordOnSpaceRoot(ctx con var r0 libregraph.Permission var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, string) (libregraph.Permission, error)); ok { - return rf(ctx, driveID, permissionID, password) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, string) (libregraph.Permission, error)); ok { + return returnFunc(ctx, driveID, permissionID, password) } - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, string) libregraph.Permission); ok { - r0 = rf(ctx, driveID, permissionID, password) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, string) libregraph.Permission); ok { + r0 = returnFunc(ctx, driveID, permissionID, password) } else { r0 = ret.Get(0).(libregraph.Permission) } - - if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, string, string) error); ok { - r1 = rf(ctx, driveID, permissionID, password) + if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, string, string) error); ok { + r1 = returnFunc(ctx, driveID, permissionID, password) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -515,24 +646,45 @@ func (_e *DriveItemPermissionsProvider_Expecter) SetPublicLinkPasswordOnSpaceRoo func (_c *DriveItemPermissionsProvider_SetPublicLinkPasswordOnSpaceRoot_Call) Run(run func(ctx context.Context, driveID *providerv1beta1.ResourceId, permissionID string, password string)) *DriveItemPermissionsProvider_SetPublicLinkPasswordOnSpaceRoot_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId), args[2].(string), args[3].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *providerv1beta1.ResourceId + if args[1] != nil { + arg1 = args[1].(*providerv1beta1.ResourceId) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + var arg3 string + if args[3] != nil { + arg3 = args[3].(string) + } + run( + arg0, + arg1, + arg2, + arg3, + ) }) return _c } -func (_c *DriveItemPermissionsProvider_SetPublicLinkPasswordOnSpaceRoot_Call) Return(_a0 libregraph.Permission, _a1 error) *DriveItemPermissionsProvider_SetPublicLinkPasswordOnSpaceRoot_Call { - _c.Call.Return(_a0, _a1) +func (_c *DriveItemPermissionsProvider_SetPublicLinkPasswordOnSpaceRoot_Call) Return(permission libregraph.Permission, err error) *DriveItemPermissionsProvider_SetPublicLinkPasswordOnSpaceRoot_Call { + _c.Call.Return(permission, err) return _c } -func (_c *DriveItemPermissionsProvider_SetPublicLinkPasswordOnSpaceRoot_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId, string, string) (libregraph.Permission, error)) *DriveItemPermissionsProvider_SetPublicLinkPasswordOnSpaceRoot_Call { +func (_c *DriveItemPermissionsProvider_SetPublicLinkPasswordOnSpaceRoot_Call) RunAndReturn(run func(ctx context.Context, driveID *providerv1beta1.ResourceId, permissionID string, password string) (libregraph.Permission, error)) *DriveItemPermissionsProvider_SetPublicLinkPasswordOnSpaceRoot_Call { _c.Call.Return(run) return _c } -// SpaceRootInvite provides a mock function with given fields: ctx, driveID, invite -func (_m *DriveItemPermissionsProvider) SpaceRootInvite(ctx context.Context, driveID *providerv1beta1.ResourceId, invite libregraph.DriveItemInvite) (libregraph.Permission, error) { - ret := _m.Called(ctx, driveID, invite) +// SpaceRootInvite provides a mock function for the type DriveItemPermissionsProvider +func (_mock *DriveItemPermissionsProvider) SpaceRootInvite(ctx context.Context, driveID *providerv1beta1.ResourceId, invite libregraph.DriveItemInvite) (libregraph.Permission, error) { + ret := _mock.Called(ctx, driveID, invite) if len(ret) == 0 { panic("no return value specified for SpaceRootInvite") @@ -540,21 +692,19 @@ func (_m *DriveItemPermissionsProvider) SpaceRootInvite(ctx context.Context, dri var r0 libregraph.Permission var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) (libregraph.Permission, error)); ok { - return rf(ctx, driveID, invite) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) (libregraph.Permission, error)); ok { + return returnFunc(ctx, driveID, invite) } - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) libregraph.Permission); ok { - r0 = rf(ctx, driveID, invite) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) libregraph.Permission); ok { + r0 = returnFunc(ctx, driveID, invite) } else { r0 = ret.Get(0).(libregraph.Permission) } - - if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) error); ok { - r1 = rf(ctx, driveID, invite) + if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) error); ok { + r1 = returnFunc(ctx, driveID, invite) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -573,24 +723,40 @@ func (_e *DriveItemPermissionsProvider_Expecter) SpaceRootInvite(ctx interface{} func (_c *DriveItemPermissionsProvider_SpaceRootInvite_Call) Run(run func(ctx context.Context, driveID *providerv1beta1.ResourceId, invite libregraph.DriveItemInvite)) *DriveItemPermissionsProvider_SpaceRootInvite_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId), args[2].(libregraph.DriveItemInvite)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *providerv1beta1.ResourceId + if args[1] != nil { + arg1 = args[1].(*providerv1beta1.ResourceId) + } + var arg2 libregraph.DriveItemInvite + if args[2] != nil { + arg2 = args[2].(libregraph.DriveItemInvite) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *DriveItemPermissionsProvider_SpaceRootInvite_Call) Return(_a0 libregraph.Permission, _a1 error) *DriveItemPermissionsProvider_SpaceRootInvite_Call { - _c.Call.Return(_a0, _a1) +func (_c *DriveItemPermissionsProvider_SpaceRootInvite_Call) Return(permission libregraph.Permission, err error) *DriveItemPermissionsProvider_SpaceRootInvite_Call { + _c.Call.Return(permission, err) return _c } -func (_c *DriveItemPermissionsProvider_SpaceRootInvite_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) (libregraph.Permission, error)) *DriveItemPermissionsProvider_SpaceRootInvite_Call { +func (_c *DriveItemPermissionsProvider_SpaceRootInvite_Call) RunAndReturn(run func(ctx context.Context, driveID *providerv1beta1.ResourceId, invite libregraph.DriveItemInvite) (libregraph.Permission, error)) *DriveItemPermissionsProvider_SpaceRootInvite_Call { _c.Call.Return(run) return _c } -// UpdatePermission provides a mock function with given fields: ctx, itemID, permissionID, newPermission -func (_m *DriveItemPermissionsProvider) UpdatePermission(ctx context.Context, itemID *providerv1beta1.ResourceId, permissionID string, newPermission libregraph.Permission) (libregraph.Permission, error) { - ret := _m.Called(ctx, itemID, permissionID, newPermission) +// UpdatePermission provides a mock function for the type DriveItemPermissionsProvider +func (_mock *DriveItemPermissionsProvider) UpdatePermission(ctx context.Context, itemID *providerv1beta1.ResourceId, permissionID string, newPermission libregraph.Permission) (libregraph.Permission, error) { + ret := _mock.Called(ctx, itemID, permissionID, newPermission) if len(ret) == 0 { panic("no return value specified for UpdatePermission") @@ -598,21 +764,19 @@ func (_m *DriveItemPermissionsProvider) UpdatePermission(ctx context.Context, it var r0 libregraph.Permission var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, libregraph.Permission) (libregraph.Permission, error)); ok { - return rf(ctx, itemID, permissionID, newPermission) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, libregraph.Permission) (libregraph.Permission, error)); ok { + return returnFunc(ctx, itemID, permissionID, newPermission) } - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, libregraph.Permission) libregraph.Permission); ok { - r0 = rf(ctx, itemID, permissionID, newPermission) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, libregraph.Permission) libregraph.Permission); ok { + r0 = returnFunc(ctx, itemID, permissionID, newPermission) } else { r0 = ret.Get(0).(libregraph.Permission) } - - if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, string, libregraph.Permission) error); ok { - r1 = rf(ctx, itemID, permissionID, newPermission) + if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, string, libregraph.Permission) error); ok { + r1 = returnFunc(ctx, itemID, permissionID, newPermission) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -632,24 +796,45 @@ func (_e *DriveItemPermissionsProvider_Expecter) UpdatePermission(ctx interface{ func (_c *DriveItemPermissionsProvider_UpdatePermission_Call) Run(run func(ctx context.Context, itemID *providerv1beta1.ResourceId, permissionID string, newPermission libregraph.Permission)) *DriveItemPermissionsProvider_UpdatePermission_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId), args[2].(string), args[3].(libregraph.Permission)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *providerv1beta1.ResourceId + if args[1] != nil { + arg1 = args[1].(*providerv1beta1.ResourceId) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + var arg3 libregraph.Permission + if args[3] != nil { + arg3 = args[3].(libregraph.Permission) + } + run( + arg0, + arg1, + arg2, + arg3, + ) }) return _c } -func (_c *DriveItemPermissionsProvider_UpdatePermission_Call) Return(_a0 libregraph.Permission, _a1 error) *DriveItemPermissionsProvider_UpdatePermission_Call { - _c.Call.Return(_a0, _a1) +func (_c *DriveItemPermissionsProvider_UpdatePermission_Call) Return(permission libregraph.Permission, err error) *DriveItemPermissionsProvider_UpdatePermission_Call { + _c.Call.Return(permission, err) return _c } -func (_c *DriveItemPermissionsProvider_UpdatePermission_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId, string, libregraph.Permission) (libregraph.Permission, error)) *DriveItemPermissionsProvider_UpdatePermission_Call { +func (_c *DriveItemPermissionsProvider_UpdatePermission_Call) RunAndReturn(run func(ctx context.Context, itemID *providerv1beta1.ResourceId, permissionID string, newPermission libregraph.Permission) (libregraph.Permission, error)) *DriveItemPermissionsProvider_UpdatePermission_Call { _c.Call.Return(run) return _c } -// UpdateSpaceRootPermission provides a mock function with given fields: ctx, driveID, permissionID, newPermission -func (_m *DriveItemPermissionsProvider) UpdateSpaceRootPermission(ctx context.Context, driveID *providerv1beta1.ResourceId, permissionID string, newPermission libregraph.Permission) (libregraph.Permission, error) { - ret := _m.Called(ctx, driveID, permissionID, newPermission) +// UpdateSpaceRootPermission provides a mock function for the type DriveItemPermissionsProvider +func (_mock *DriveItemPermissionsProvider) UpdateSpaceRootPermission(ctx context.Context, driveID *providerv1beta1.ResourceId, permissionID string, newPermission libregraph.Permission) (libregraph.Permission, error) { + ret := _mock.Called(ctx, driveID, permissionID, newPermission) if len(ret) == 0 { panic("no return value specified for UpdateSpaceRootPermission") @@ -657,21 +842,19 @@ func (_m *DriveItemPermissionsProvider) UpdateSpaceRootPermission(ctx context.Co var r0 libregraph.Permission var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, libregraph.Permission) (libregraph.Permission, error)); ok { - return rf(ctx, driveID, permissionID, newPermission) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, libregraph.Permission) (libregraph.Permission, error)); ok { + return returnFunc(ctx, driveID, permissionID, newPermission) } - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, libregraph.Permission) libregraph.Permission); ok { - r0 = rf(ctx, driveID, permissionID, newPermission) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, libregraph.Permission) libregraph.Permission); ok { + r0 = returnFunc(ctx, driveID, permissionID, newPermission) } else { r0 = ret.Get(0).(libregraph.Permission) } - - if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, string, libregraph.Permission) error); ok { - r1 = rf(ctx, driveID, permissionID, newPermission) + if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, string, libregraph.Permission) error); ok { + r1 = returnFunc(ctx, driveID, permissionID, newPermission) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -691,31 +874,38 @@ func (_e *DriveItemPermissionsProvider_Expecter) UpdateSpaceRootPermission(ctx i func (_c *DriveItemPermissionsProvider_UpdateSpaceRootPermission_Call) Run(run func(ctx context.Context, driveID *providerv1beta1.ResourceId, permissionID string, newPermission libregraph.Permission)) *DriveItemPermissionsProvider_UpdateSpaceRootPermission_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId), args[2].(string), args[3].(libregraph.Permission)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *providerv1beta1.ResourceId + if args[1] != nil { + arg1 = args[1].(*providerv1beta1.ResourceId) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + var arg3 libregraph.Permission + if args[3] != nil { + arg3 = args[3].(libregraph.Permission) + } + run( + arg0, + arg1, + arg2, + arg3, + ) }) return _c } -func (_c *DriveItemPermissionsProvider_UpdateSpaceRootPermission_Call) Return(_a0 libregraph.Permission, _a1 error) *DriveItemPermissionsProvider_UpdateSpaceRootPermission_Call { - _c.Call.Return(_a0, _a1) +func (_c *DriveItemPermissionsProvider_UpdateSpaceRootPermission_Call) Return(permission libregraph.Permission, err error) *DriveItemPermissionsProvider_UpdateSpaceRootPermission_Call { + _c.Call.Return(permission, err) return _c } -func (_c *DriveItemPermissionsProvider_UpdateSpaceRootPermission_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId, string, libregraph.Permission) (libregraph.Permission, error)) *DriveItemPermissionsProvider_UpdateSpaceRootPermission_Call { +func (_c *DriveItemPermissionsProvider_UpdateSpaceRootPermission_Call) RunAndReturn(run func(ctx context.Context, driveID *providerv1beta1.ResourceId, permissionID string, newPermission libregraph.Permission) (libregraph.Permission, error)) *DriveItemPermissionsProvider_UpdateSpaceRootPermission_Call { _c.Call.Return(run) return _c } - -// NewDriveItemPermissionsProvider creates a new instance of DriveItemPermissionsProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewDriveItemPermissionsProvider(t interface { - mock.TestingT - Cleanup(func()) -}) *DriveItemPermissionsProvider { - mock := &DriveItemPermissionsProvider{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/services/graph/mocks/drives_drive_item_provider.go b/services/graph/mocks/drives_drive_item_provider.go index 6ee63e4767..d89a326ccc 100644 --- a/services/graph/mocks/drives_drive_item_provider.go +++ b/services/graph/mocks/drives_drive_item_provider.go @@ -1,21 +1,33 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" - - collaborationv1beta1 "github.com/cs3org/go-cs3apis/cs3/sharing/collaboration/v1beta1" + "context" + "github.com/cs3org/go-cs3apis/cs3/sharing/collaboration/v1beta1" + "github.com/cs3org/go-cs3apis/cs3/sharing/ocm/v1beta1" + "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" + "github.com/opencloud-eu/opencloud/services/graph/pkg/service/v0" mock "github.com/stretchr/testify/mock" - - ocmv1beta1 "github.com/cs3org/go-cs3apis/cs3/sharing/ocm/v1beta1" - - providerv1beta1 "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" - - svc "github.com/opencloud-eu/opencloud/services/graph/pkg/service/v0" ) +// NewDrivesDriveItemProvider creates a new instance of DrivesDriveItemProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewDrivesDriveItemProvider(t interface { + mock.TestingT + Cleanup(func()) +}) *DrivesDriveItemProvider { + mock := &DrivesDriveItemProvider{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // DrivesDriveItemProvider is an autogenerated mock type for the DrivesDriveItemProvider type type DrivesDriveItemProvider struct { mock.Mock @@ -29,9 +41,9 @@ func (_m *DrivesDriveItemProvider) EXPECT() *DrivesDriveItemProvider_Expecter { return &DrivesDriveItemProvider_Expecter{mock: &_m.Mock} } -// GetShare provides a mock function with given fields: ctx, shareID -func (_m *DrivesDriveItemProvider) GetShare(ctx context.Context, shareID *collaborationv1beta1.ShareId) (*collaborationv1beta1.ReceivedShare, error) { - ret := _m.Called(ctx, shareID) +// GetShare provides a mock function for the type DrivesDriveItemProvider +func (_mock *DrivesDriveItemProvider) GetShare(ctx context.Context, shareID *collaborationv1beta1.ShareId) (*collaborationv1beta1.ReceivedShare, error) { + ret := _mock.Called(ctx, shareID) if len(ret) == 0 { panic("no return value specified for GetShare") @@ -39,23 +51,21 @@ func (_m *DrivesDriveItemProvider) GetShare(ctx context.Context, shareID *collab var r0 *collaborationv1beta1.ReceivedShare var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *collaborationv1beta1.ShareId) (*collaborationv1beta1.ReceivedShare, error)); ok { - return rf(ctx, shareID) + if returnFunc, ok := ret.Get(0).(func(context.Context, *collaborationv1beta1.ShareId) (*collaborationv1beta1.ReceivedShare, error)); ok { + return returnFunc(ctx, shareID) } - if rf, ok := ret.Get(0).(func(context.Context, *collaborationv1beta1.ShareId) *collaborationv1beta1.ReceivedShare); ok { - r0 = rf(ctx, shareID) + if returnFunc, ok := ret.Get(0).(func(context.Context, *collaborationv1beta1.ShareId) *collaborationv1beta1.ReceivedShare); ok { + r0 = returnFunc(ctx, shareID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*collaborationv1beta1.ReceivedShare) } } - - if rf, ok := ret.Get(1).(func(context.Context, *collaborationv1beta1.ShareId) error); ok { - r1 = rf(ctx, shareID) + if returnFunc, ok := ret.Get(1).(func(context.Context, *collaborationv1beta1.ShareId) error); ok { + r1 = returnFunc(ctx, shareID) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -73,24 +83,35 @@ func (_e *DrivesDriveItemProvider_Expecter) GetShare(ctx interface{}, shareID in func (_c *DrivesDriveItemProvider_GetShare_Call) Run(run func(ctx context.Context, shareID *collaborationv1beta1.ShareId)) *DrivesDriveItemProvider_GetShare_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*collaborationv1beta1.ShareId)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *collaborationv1beta1.ShareId + if args[1] != nil { + arg1 = args[1].(*collaborationv1beta1.ShareId) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *DrivesDriveItemProvider_GetShare_Call) Return(_a0 *collaborationv1beta1.ReceivedShare, _a1 error) *DrivesDriveItemProvider_GetShare_Call { - _c.Call.Return(_a0, _a1) +func (_c *DrivesDriveItemProvider_GetShare_Call) Return(receivedShare *collaborationv1beta1.ReceivedShare, err error) *DrivesDriveItemProvider_GetShare_Call { + _c.Call.Return(receivedShare, err) return _c } -func (_c *DrivesDriveItemProvider_GetShare_Call) RunAndReturn(run func(context.Context, *collaborationv1beta1.ShareId) (*collaborationv1beta1.ReceivedShare, error)) *DrivesDriveItemProvider_GetShare_Call { +func (_c *DrivesDriveItemProvider_GetShare_Call) RunAndReturn(run func(ctx context.Context, shareID *collaborationv1beta1.ShareId) (*collaborationv1beta1.ReceivedShare, error)) *DrivesDriveItemProvider_GetShare_Call { _c.Call.Return(run) return _c } -// GetSharesForResource provides a mock function with given fields: ctx, resourceID, filters -func (_m *DrivesDriveItemProvider) GetSharesForResource(ctx context.Context, resourceID *providerv1beta1.ResourceId, filters []*collaborationv1beta1.Filter) ([]*collaborationv1beta1.ReceivedShare, error) { - ret := _m.Called(ctx, resourceID, filters) +// GetSharesForResource provides a mock function for the type DrivesDriveItemProvider +func (_mock *DrivesDriveItemProvider) GetSharesForResource(ctx context.Context, resourceID *providerv1beta1.ResourceId, filters []*collaborationv1beta1.Filter) ([]*collaborationv1beta1.ReceivedShare, error) { + ret := _mock.Called(ctx, resourceID, filters) if len(ret) == 0 { panic("no return value specified for GetSharesForResource") @@ -98,23 +119,21 @@ func (_m *DrivesDriveItemProvider) GetSharesForResource(ctx context.Context, res var r0 []*collaborationv1beta1.ReceivedShare var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, []*collaborationv1beta1.Filter) ([]*collaborationv1beta1.ReceivedShare, error)); ok { - return rf(ctx, resourceID, filters) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, []*collaborationv1beta1.Filter) ([]*collaborationv1beta1.ReceivedShare, error)); ok { + return returnFunc(ctx, resourceID, filters) } - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, []*collaborationv1beta1.Filter) []*collaborationv1beta1.ReceivedShare); ok { - r0 = rf(ctx, resourceID, filters) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, []*collaborationv1beta1.Filter) []*collaborationv1beta1.ReceivedShare); ok { + r0 = returnFunc(ctx, resourceID, filters) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*collaborationv1beta1.ReceivedShare) } } - - if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, []*collaborationv1beta1.Filter) error); ok { - r1 = rf(ctx, resourceID, filters) + if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, []*collaborationv1beta1.Filter) error); ok { + r1 = returnFunc(ctx, resourceID, filters) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -133,24 +152,40 @@ func (_e *DrivesDriveItemProvider_Expecter) GetSharesForResource(ctx interface{} func (_c *DrivesDriveItemProvider_GetSharesForResource_Call) Run(run func(ctx context.Context, resourceID *providerv1beta1.ResourceId, filters []*collaborationv1beta1.Filter)) *DrivesDriveItemProvider_GetSharesForResource_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId), args[2].([]*collaborationv1beta1.Filter)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *providerv1beta1.ResourceId + if args[1] != nil { + arg1 = args[1].(*providerv1beta1.ResourceId) + } + var arg2 []*collaborationv1beta1.Filter + if args[2] != nil { + arg2 = args[2].([]*collaborationv1beta1.Filter) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *DrivesDriveItemProvider_GetSharesForResource_Call) Return(_a0 []*collaborationv1beta1.ReceivedShare, _a1 error) *DrivesDriveItemProvider_GetSharesForResource_Call { - _c.Call.Return(_a0, _a1) +func (_c *DrivesDriveItemProvider_GetSharesForResource_Call) Return(receivedShares []*collaborationv1beta1.ReceivedShare, err error) *DrivesDriveItemProvider_GetSharesForResource_Call { + _c.Call.Return(receivedShares, err) return _c } -func (_c *DrivesDriveItemProvider_GetSharesForResource_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId, []*collaborationv1beta1.Filter) ([]*collaborationv1beta1.ReceivedShare, error)) *DrivesDriveItemProvider_GetSharesForResource_Call { +func (_c *DrivesDriveItemProvider_GetSharesForResource_Call) RunAndReturn(run func(ctx context.Context, resourceID *providerv1beta1.ResourceId, filters []*collaborationv1beta1.Filter) ([]*collaborationv1beta1.ReceivedShare, error)) *DrivesDriveItemProvider_GetSharesForResource_Call { _c.Call.Return(run) return _c } -// MountOCMShare provides a mock function with given fields: ctx, resourceID -func (_m *DrivesDriveItemProvider) MountOCMShare(ctx context.Context, resourceID *providerv1beta1.ResourceId) ([]*ocmv1beta1.ReceivedShare, error) { - ret := _m.Called(ctx, resourceID) +// MountOCMShare provides a mock function for the type DrivesDriveItemProvider +func (_mock *DrivesDriveItemProvider) MountOCMShare(ctx context.Context, resourceID *providerv1beta1.ResourceId) ([]*ocmv1beta1.ReceivedShare, error) { + ret := _mock.Called(ctx, resourceID) if len(ret) == 0 { panic("no return value specified for MountOCMShare") @@ -158,23 +193,21 @@ func (_m *DrivesDriveItemProvider) MountOCMShare(ctx context.Context, resourceID var r0 []*ocmv1beta1.ReceivedShare var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId) ([]*ocmv1beta1.ReceivedShare, error)); ok { - return rf(ctx, resourceID) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId) ([]*ocmv1beta1.ReceivedShare, error)); ok { + return returnFunc(ctx, resourceID) } - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId) []*ocmv1beta1.ReceivedShare); ok { - r0 = rf(ctx, resourceID) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId) []*ocmv1beta1.ReceivedShare); ok { + r0 = returnFunc(ctx, resourceID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*ocmv1beta1.ReceivedShare) } } - - if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId) error); ok { - r1 = rf(ctx, resourceID) + if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId) error); ok { + r1 = returnFunc(ctx, resourceID) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -192,24 +225,35 @@ func (_e *DrivesDriveItemProvider_Expecter) MountOCMShare(ctx interface{}, resou func (_c *DrivesDriveItemProvider_MountOCMShare_Call) Run(run func(ctx context.Context, resourceID *providerv1beta1.ResourceId)) *DrivesDriveItemProvider_MountOCMShare_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *providerv1beta1.ResourceId + if args[1] != nil { + arg1 = args[1].(*providerv1beta1.ResourceId) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *DrivesDriveItemProvider_MountOCMShare_Call) Return(_a0 []*ocmv1beta1.ReceivedShare, _a1 error) *DrivesDriveItemProvider_MountOCMShare_Call { - _c.Call.Return(_a0, _a1) +func (_c *DrivesDriveItemProvider_MountOCMShare_Call) Return(receivedShares []*ocmv1beta1.ReceivedShare, err error) *DrivesDriveItemProvider_MountOCMShare_Call { + _c.Call.Return(receivedShares, err) return _c } -func (_c *DrivesDriveItemProvider_MountOCMShare_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId) ([]*ocmv1beta1.ReceivedShare, error)) *DrivesDriveItemProvider_MountOCMShare_Call { +func (_c *DrivesDriveItemProvider_MountOCMShare_Call) RunAndReturn(run func(ctx context.Context, resourceID *providerv1beta1.ResourceId) ([]*ocmv1beta1.ReceivedShare, error)) *DrivesDriveItemProvider_MountOCMShare_Call { _c.Call.Return(run) return _c } -// MountShare provides a mock function with given fields: ctx, resourceID, name -func (_m *DrivesDriveItemProvider) MountShare(ctx context.Context, resourceID *providerv1beta1.ResourceId, name string) ([]*collaborationv1beta1.ReceivedShare, error) { - ret := _m.Called(ctx, resourceID, name) +// MountShare provides a mock function for the type DrivesDriveItemProvider +func (_mock *DrivesDriveItemProvider) MountShare(ctx context.Context, resourceID *providerv1beta1.ResourceId, name string) ([]*collaborationv1beta1.ReceivedShare, error) { + ret := _mock.Called(ctx, resourceID, name) if len(ret) == 0 { panic("no return value specified for MountShare") @@ -217,23 +261,21 @@ func (_m *DrivesDriveItemProvider) MountShare(ctx context.Context, resourceID *p var r0 []*collaborationv1beta1.ReceivedShare var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string) ([]*collaborationv1beta1.ReceivedShare, error)); ok { - return rf(ctx, resourceID, name) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string) ([]*collaborationv1beta1.ReceivedShare, error)); ok { + return returnFunc(ctx, resourceID, name) } - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string) []*collaborationv1beta1.ReceivedShare); ok { - r0 = rf(ctx, resourceID, name) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string) []*collaborationv1beta1.ReceivedShare); ok { + r0 = returnFunc(ctx, resourceID, name) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*collaborationv1beta1.ReceivedShare) } } - - if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, string) error); ok { - r1 = rf(ctx, resourceID, name) + if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, string) error); ok { + r1 = returnFunc(ctx, resourceID, name) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -252,36 +294,51 @@ func (_e *DrivesDriveItemProvider_Expecter) MountShare(ctx interface{}, resource func (_c *DrivesDriveItemProvider_MountShare_Call) Run(run func(ctx context.Context, resourceID *providerv1beta1.ResourceId, name string)) *DrivesDriveItemProvider_MountShare_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId), args[2].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *providerv1beta1.ResourceId + if args[1] != nil { + arg1 = args[1].(*providerv1beta1.ResourceId) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *DrivesDriveItemProvider_MountShare_Call) Return(_a0 []*collaborationv1beta1.ReceivedShare, _a1 error) *DrivesDriveItemProvider_MountShare_Call { - _c.Call.Return(_a0, _a1) +func (_c *DrivesDriveItemProvider_MountShare_Call) Return(receivedShares []*collaborationv1beta1.ReceivedShare, err error) *DrivesDriveItemProvider_MountShare_Call { + _c.Call.Return(receivedShares, err) return _c } -func (_c *DrivesDriveItemProvider_MountShare_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId, string) ([]*collaborationv1beta1.ReceivedShare, error)) *DrivesDriveItemProvider_MountShare_Call { +func (_c *DrivesDriveItemProvider_MountShare_Call) RunAndReturn(run func(ctx context.Context, resourceID *providerv1beta1.ResourceId, name string) ([]*collaborationv1beta1.ReceivedShare, error)) *DrivesDriveItemProvider_MountShare_Call { _c.Call.Return(run) return _c } -// UnmountShare provides a mock function with given fields: ctx, shareID -func (_m *DrivesDriveItemProvider) UnmountShare(ctx context.Context, shareID *collaborationv1beta1.ShareId) error { - ret := _m.Called(ctx, shareID) +// UnmountShare provides a mock function for the type DrivesDriveItemProvider +func (_mock *DrivesDriveItemProvider) UnmountShare(ctx context.Context, shareID *collaborationv1beta1.ShareId) error { + ret := _mock.Called(ctx, shareID) if len(ret) == 0 { panic("no return value specified for UnmountShare") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *collaborationv1beta1.ShareId) error); ok { - r0 = rf(ctx, shareID) + if returnFunc, ok := ret.Get(0).(func(context.Context, *collaborationv1beta1.ShareId) error); ok { + r0 = returnFunc(ctx, shareID) } else { r0 = ret.Error(0) } - return r0 } @@ -299,24 +356,35 @@ func (_e *DrivesDriveItemProvider_Expecter) UnmountShare(ctx interface{}, shareI func (_c *DrivesDriveItemProvider_UnmountShare_Call) Run(run func(ctx context.Context, shareID *collaborationv1beta1.ShareId)) *DrivesDriveItemProvider_UnmountShare_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*collaborationv1beta1.ShareId)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *collaborationv1beta1.ShareId + if args[1] != nil { + arg1 = args[1].(*collaborationv1beta1.ShareId) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *DrivesDriveItemProvider_UnmountShare_Call) Return(_a0 error) *DrivesDriveItemProvider_UnmountShare_Call { - _c.Call.Return(_a0) +func (_c *DrivesDriveItemProvider_UnmountShare_Call) Return(err error) *DrivesDriveItemProvider_UnmountShare_Call { + _c.Call.Return(err) return _c } -func (_c *DrivesDriveItemProvider_UnmountShare_Call) RunAndReturn(run func(context.Context, *collaborationv1beta1.ShareId) error) *DrivesDriveItemProvider_UnmountShare_Call { +func (_c *DrivesDriveItemProvider_UnmountShare_Call) RunAndReturn(run func(ctx context.Context, shareID *collaborationv1beta1.ShareId) error) *DrivesDriveItemProvider_UnmountShare_Call { _c.Call.Return(run) return _c } -// UpdateShares provides a mock function with given fields: ctx, shares, updater -func (_m *DrivesDriveItemProvider) UpdateShares(ctx context.Context, shares []*collaborationv1beta1.ReceivedShare, updater svc.UpdateShareClosure) ([]*collaborationv1beta1.ReceivedShare, error) { - ret := _m.Called(ctx, shares, updater) +// UpdateShares provides a mock function for the type DrivesDriveItemProvider +func (_mock *DrivesDriveItemProvider) UpdateShares(ctx context.Context, shares []*collaborationv1beta1.ReceivedShare, updater svc.UpdateShareClosure) ([]*collaborationv1beta1.ReceivedShare, error) { + ret := _mock.Called(ctx, shares, updater) if len(ret) == 0 { panic("no return value specified for UpdateShares") @@ -324,23 +392,21 @@ func (_m *DrivesDriveItemProvider) UpdateShares(ctx context.Context, shares []*c var r0 []*collaborationv1beta1.ReceivedShare var r1 error - if rf, ok := ret.Get(0).(func(context.Context, []*collaborationv1beta1.ReceivedShare, svc.UpdateShareClosure) ([]*collaborationv1beta1.ReceivedShare, error)); ok { - return rf(ctx, shares, updater) + if returnFunc, ok := ret.Get(0).(func(context.Context, []*collaborationv1beta1.ReceivedShare, svc.UpdateShareClosure) ([]*collaborationv1beta1.ReceivedShare, error)); ok { + return returnFunc(ctx, shares, updater) } - if rf, ok := ret.Get(0).(func(context.Context, []*collaborationv1beta1.ReceivedShare, svc.UpdateShareClosure) []*collaborationv1beta1.ReceivedShare); ok { - r0 = rf(ctx, shares, updater) + if returnFunc, ok := ret.Get(0).(func(context.Context, []*collaborationv1beta1.ReceivedShare, svc.UpdateShareClosure) []*collaborationv1beta1.ReceivedShare); ok { + r0 = returnFunc(ctx, shares, updater) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*collaborationv1beta1.ReceivedShare) } } - - if rf, ok := ret.Get(1).(func(context.Context, []*collaborationv1beta1.ReceivedShare, svc.UpdateShareClosure) error); ok { - r1 = rf(ctx, shares, updater) + if returnFunc, ok := ret.Get(1).(func(context.Context, []*collaborationv1beta1.ReceivedShare, svc.UpdateShareClosure) error); ok { + r1 = returnFunc(ctx, shares, updater) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -359,31 +425,33 @@ func (_e *DrivesDriveItemProvider_Expecter) UpdateShares(ctx interface{}, shares func (_c *DrivesDriveItemProvider_UpdateShares_Call) Run(run func(ctx context.Context, shares []*collaborationv1beta1.ReceivedShare, updater svc.UpdateShareClosure)) *DrivesDriveItemProvider_UpdateShares_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].([]*collaborationv1beta1.ReceivedShare), args[2].(svc.UpdateShareClosure)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 []*collaborationv1beta1.ReceivedShare + if args[1] != nil { + arg1 = args[1].([]*collaborationv1beta1.ReceivedShare) + } + var arg2 svc.UpdateShareClosure + if args[2] != nil { + arg2 = args[2].(svc.UpdateShareClosure) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *DrivesDriveItemProvider_UpdateShares_Call) Return(_a0 []*collaborationv1beta1.ReceivedShare, _a1 error) *DrivesDriveItemProvider_UpdateShares_Call { - _c.Call.Return(_a0, _a1) +func (_c *DrivesDriveItemProvider_UpdateShares_Call) Return(receivedShares []*collaborationv1beta1.ReceivedShare, err error) *DrivesDriveItemProvider_UpdateShares_Call { + _c.Call.Return(receivedShares, err) return _c } -func (_c *DrivesDriveItemProvider_UpdateShares_Call) RunAndReturn(run func(context.Context, []*collaborationv1beta1.ReceivedShare, svc.UpdateShareClosure) ([]*collaborationv1beta1.ReceivedShare, error)) *DrivesDriveItemProvider_UpdateShares_Call { +func (_c *DrivesDriveItemProvider_UpdateShares_Call) RunAndReturn(run func(ctx context.Context, shares []*collaborationv1beta1.ReceivedShare, updater svc.UpdateShareClosure) ([]*collaborationv1beta1.ReceivedShare, error)) *DrivesDriveItemProvider_UpdateShares_Call { _c.Call.Return(run) return _c } - -// NewDrivesDriveItemProvider creates a new instance of DrivesDriveItemProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewDrivesDriveItemProvider(t interface { - mock.TestingT - Cleanup(func()) -}) *DrivesDriveItemProvider { - mock := &DrivesDriveItemProvider{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/services/graph/mocks/gateway_selector.go b/services/graph/mocks/gateway_selector.go index 315aba044c..175a2910e7 100644 --- a/services/graph/mocks/gateway_selector.go +++ b/services/graph/mocks/gateway_selector.go @@ -1,12 +1,28 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - pool "github.com/opencloud-eu/reva/v2/pkg/rgrpc/todo/pool" + "github.com/opencloud-eu/reva/v2/pkg/rgrpc/todo/pool" mock "github.com/stretchr/testify/mock" ) +// NewSelectable creates a new instance of Selectable. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewSelectable[T any](t interface { + mock.TestingT + Cleanup(func()) +}) *Selectable[T] { + mock := &Selectable[T]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // Selectable is an autogenerated mock type for the Selectable type type Selectable[T any] struct { mock.Mock @@ -20,15 +36,15 @@ func (_m *Selectable[T]) EXPECT() *Selectable_Expecter[T] { return &Selectable_Expecter[T]{mock: &_m.Mock} } -// Next provides a mock function with given fields: opts -func (_m *Selectable[T]) Next(opts ...pool.Option) (T, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] +// Next provides a mock function for the type Selectable +func (_mock *Selectable[T]) Next(opts ...pool.Option) (T, error) { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(opts) + } else { + tmpRet = _mock.Called() } - var _ca []interface{} - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) + ret := tmpRet if len(ret) == 0 { panic("no return value specified for Next") @@ -36,23 +52,21 @@ func (_m *Selectable[T]) Next(opts ...pool.Option) (T, error) { var r0 T var r1 error - if rf, ok := ret.Get(0).(func(...pool.Option) (T, error)); ok { - return rf(opts...) + if returnFunc, ok := ret.Get(0).(func(...pool.Option) (T, error)); ok { + return returnFunc(opts...) } - if rf, ok := ret.Get(0).(func(...pool.Option) T); ok { - r0 = rf(opts...) + if returnFunc, ok := ret.Get(0).(func(...pool.Option) T); ok { + r0 = returnFunc(opts...) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(T) } } - - if rf, ok := ret.Get(1).(func(...pool.Option) error); ok { - r1 = rf(opts...) + if returnFunc, ok := ret.Get(1).(func(...pool.Option) error); ok { + r1 = returnFunc(opts...) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -70,37 +84,25 @@ func (_e *Selectable_Expecter[T]) Next(opts ...interface{}) *Selectable_Next_Cal func (_c *Selectable_Next_Call[T]) Run(run func(opts ...pool.Option)) *Selectable_Next_Call[T] { _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]pool.Option, len(args)-0) - for i, a := range args[0:] { - if a != nil { - variadicArgs[i] = a.(pool.Option) - } + var arg0 []pool.Option + var variadicArgs []pool.Option + if len(args) > 0 { + variadicArgs = args[0].([]pool.Option) } - run(variadicArgs...) + arg0 = variadicArgs + run( + arg0..., + ) }) return _c } -func (_c *Selectable_Next_Call[T]) Return(_a0 T, _a1 error) *Selectable_Next_Call[T] { - _c.Call.Return(_a0, _a1) +func (_c *Selectable_Next_Call[T]) Return(v T, err error) *Selectable_Next_Call[T] { + _c.Call.Return(v, err) return _c } -func (_c *Selectable_Next_Call[T]) RunAndReturn(run func(...pool.Option) (T, error)) *Selectable_Next_Call[T] { +func (_c *Selectable_Next_Call[T]) RunAndReturn(run func(opts ...pool.Option) (T, error)) *Selectable_Next_Call[T] { _c.Call.Return(run) return _c } - -// NewSelectable creates a new instance of Selectable. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewSelectable[T any](t interface { - mock.TestingT - Cleanup(func()) -}) *Selectable[T] { - mock := &Selectable[T]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/services/graph/mocks/http_client.go b/services/graph/mocks/http_client.go index 96e964d4de..670c041622 100644 --- a/services/graph/mocks/http_client.go +++ b/services/graph/mocks/http_client.go @@ -1,13 +1,29 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - http "net/http" + "net/http" mock "github.com/stretchr/testify/mock" ) +// NewHTTPClient creates a new instance of HTTPClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewHTTPClient(t interface { + mock.TestingT + Cleanup(func()) +}) *HTTPClient { + mock := &HTTPClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // HTTPClient is an autogenerated mock type for the HTTPClient type type HTTPClient struct { mock.Mock @@ -21,9 +37,9 @@ func (_m *HTTPClient) EXPECT() *HTTPClient_Expecter { return &HTTPClient_Expecter{mock: &_m.Mock} } -// Do provides a mock function with given fields: req -func (_m *HTTPClient) Do(req *http.Request) (*http.Response, error) { - ret := _m.Called(req) +// Do provides a mock function for the type HTTPClient +func (_mock *HTTPClient) Do(req *http.Request) (*http.Response, error) { + ret := _mock.Called(req) if len(ret) == 0 { panic("no return value specified for Do") @@ -31,23 +47,21 @@ func (_m *HTTPClient) Do(req *http.Request) (*http.Response, error) { var r0 *http.Response var r1 error - if rf, ok := ret.Get(0).(func(*http.Request) (*http.Response, error)); ok { - return rf(req) + if returnFunc, ok := ret.Get(0).(func(*http.Request) (*http.Response, error)); ok { + return returnFunc(req) } - if rf, ok := ret.Get(0).(func(*http.Request) *http.Response); ok { - r0 = rf(req) + if returnFunc, ok := ret.Get(0).(func(*http.Request) *http.Response); ok { + r0 = returnFunc(req) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*http.Response) } } - - if rf, ok := ret.Get(1).(func(*http.Request) error); ok { - r1 = rf(req) + if returnFunc, ok := ret.Get(1).(func(*http.Request) error); ok { + r1 = returnFunc(req) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -64,31 +78,23 @@ func (_e *HTTPClient_Expecter) Do(req interface{}) *HTTPClient_Do_Call { func (_c *HTTPClient_Do_Call) Run(run func(req *http.Request)) *HTTPClient_Do_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*http.Request)) + var arg0 *http.Request + if args[0] != nil { + arg0 = args[0].(*http.Request) + } + run( + arg0, + ) }) return _c } -func (_c *HTTPClient_Do_Call) Return(_a0 *http.Response, _a1 error) *HTTPClient_Do_Call { - _c.Call.Return(_a0, _a1) +func (_c *HTTPClient_Do_Call) Return(response *http.Response, err error) *HTTPClient_Do_Call { + _c.Call.Return(response, err) return _c } -func (_c *HTTPClient_Do_Call) RunAndReturn(run func(*http.Request) (*http.Response, error)) *HTTPClient_Do_Call { +func (_c *HTTPClient_Do_Call) RunAndReturn(run func(req *http.Request) (*http.Response, error)) *HTTPClient_Do_Call { _c.Call.Return(run) return _c } - -// NewHTTPClient creates a new instance of HTTPClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewHTTPClient(t interface { - mock.TestingT - Cleanup(func()) -}) *HTTPClient { - mock := &HTTPClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/services/graph/mocks/permissions.go b/services/graph/mocks/permissions.go index 586373ec64..7edd96b5f6 100644 --- a/services/graph/mocks/permissions.go +++ b/services/graph/mocks/permissions.go @@ -1,17 +1,31 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" - - client "go-micro.dev/v4/client" + "context" + "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/settings/v0" mock "github.com/stretchr/testify/mock" - - v0 "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/settings/v0" + "go-micro.dev/v4/client" ) +// NewPermissions creates a new instance of Permissions. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewPermissions(t interface { + mock.TestingT + Cleanup(func()) +}) *Permissions { + mock := &Permissions{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // Permissions is an autogenerated mock type for the Permissions type type Permissions struct { mock.Mock @@ -25,16 +39,15 @@ func (_m *Permissions) EXPECT() *Permissions_Expecter { return &Permissions_Expecter{mock: &_m.Mock} } -// GetPermissionByID provides a mock function with given fields: ctx, request, opts -func (_m *Permissions) GetPermissionByID(ctx context.Context, request *v0.GetPermissionByIDRequest, opts ...client.CallOption) (*v0.GetPermissionByIDResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] +// GetPermissionByID provides a mock function for the type Permissions +func (_mock *Permissions) GetPermissionByID(ctx context.Context, request *v0.GetPermissionByIDRequest, opts ...client.CallOption) (*v0.GetPermissionByIDResponse, error) { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(ctx, request, opts) + } else { + tmpRet = _mock.Called(ctx, request) } - var _ca []interface{} - _ca = append(_ca, ctx, request) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) + ret := tmpRet if len(ret) == 0 { panic("no return value specified for GetPermissionByID") @@ -42,23 +55,21 @@ func (_m *Permissions) GetPermissionByID(ctx context.Context, request *v0.GetPer var r0 *v0.GetPermissionByIDResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v0.GetPermissionByIDRequest, ...client.CallOption) (*v0.GetPermissionByIDResponse, error)); ok { - return rf(ctx, request, opts...) + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetPermissionByIDRequest, ...client.CallOption) (*v0.GetPermissionByIDResponse, error)); ok { + return returnFunc(ctx, request, opts...) } - if rf, ok := ret.Get(0).(func(context.Context, *v0.GetPermissionByIDRequest, ...client.CallOption) *v0.GetPermissionByIDResponse); ok { - r0 = rf(ctx, request, opts...) + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetPermissionByIDRequest, ...client.CallOption) *v0.GetPermissionByIDResponse); ok { + r0 = returnFunc(ctx, request, opts...) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v0.GetPermissionByIDResponse) } } - - if rf, ok := ret.Get(1).(func(context.Context, *v0.GetPermissionByIDRequest, ...client.CallOption) error); ok { - r1 = rf(ctx, request, opts...) + if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.GetPermissionByIDRequest, ...client.CallOption) error); ok { + r1 = returnFunc(ctx, request, opts...) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -78,37 +89,48 @@ func (_e *Permissions_Expecter) GetPermissionByID(ctx interface{}, request inter func (_c *Permissions_GetPermissionByID_Call) Run(run func(ctx context.Context, request *v0.GetPermissionByIDRequest, opts ...client.CallOption)) *Permissions_GetPermissionByID_Call { _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]client.CallOption, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(client.CallOption) - } + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) } - run(args[0].(context.Context), args[1].(*v0.GetPermissionByIDRequest), variadicArgs...) + var arg1 *v0.GetPermissionByIDRequest + if args[1] != nil { + arg1 = args[1].(*v0.GetPermissionByIDRequest) + } + var arg2 []client.CallOption + var variadicArgs []client.CallOption + if len(args) > 2 { + variadicArgs = args[2].([]client.CallOption) + } + arg2 = variadicArgs + run( + arg0, + arg1, + arg2..., + ) }) return _c } -func (_c *Permissions_GetPermissionByID_Call) Return(_a0 *v0.GetPermissionByIDResponse, _a1 error) *Permissions_GetPermissionByID_Call { - _c.Call.Return(_a0, _a1) +func (_c *Permissions_GetPermissionByID_Call) Return(getPermissionByIDResponse *v0.GetPermissionByIDResponse, err error) *Permissions_GetPermissionByID_Call { + _c.Call.Return(getPermissionByIDResponse, err) return _c } -func (_c *Permissions_GetPermissionByID_Call) RunAndReturn(run func(context.Context, *v0.GetPermissionByIDRequest, ...client.CallOption) (*v0.GetPermissionByIDResponse, error)) *Permissions_GetPermissionByID_Call { +func (_c *Permissions_GetPermissionByID_Call) RunAndReturn(run func(ctx context.Context, request *v0.GetPermissionByIDRequest, opts ...client.CallOption) (*v0.GetPermissionByIDResponse, error)) *Permissions_GetPermissionByID_Call { _c.Call.Return(run) return _c } -// ListPermissions provides a mock function with given fields: ctx, req, opts -func (_m *Permissions) ListPermissions(ctx context.Context, req *v0.ListPermissionsRequest, opts ...client.CallOption) (*v0.ListPermissionsResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] +// ListPermissions provides a mock function for the type Permissions +func (_mock *Permissions) ListPermissions(ctx context.Context, req *v0.ListPermissionsRequest, opts ...client.CallOption) (*v0.ListPermissionsResponse, error) { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(ctx, req, opts) + } else { + tmpRet = _mock.Called(ctx, req) } - var _ca []interface{} - _ca = append(_ca, ctx, req) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) + ret := tmpRet if len(ret) == 0 { panic("no return value specified for ListPermissions") @@ -116,23 +138,21 @@ func (_m *Permissions) ListPermissions(ctx context.Context, req *v0.ListPermissi var r0 *v0.ListPermissionsResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v0.ListPermissionsRequest, ...client.CallOption) (*v0.ListPermissionsResponse, error)); ok { - return rf(ctx, req, opts...) + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListPermissionsRequest, ...client.CallOption) (*v0.ListPermissionsResponse, error)); ok { + return returnFunc(ctx, req, opts...) } - if rf, ok := ret.Get(0).(func(context.Context, *v0.ListPermissionsRequest, ...client.CallOption) *v0.ListPermissionsResponse); ok { - r0 = rf(ctx, req, opts...) + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListPermissionsRequest, ...client.CallOption) *v0.ListPermissionsResponse); ok { + r0 = returnFunc(ctx, req, opts...) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v0.ListPermissionsResponse) } } - - if rf, ok := ret.Get(1).(func(context.Context, *v0.ListPermissionsRequest, ...client.CallOption) error); ok { - r1 = rf(ctx, req, opts...) + if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.ListPermissionsRequest, ...client.CallOption) error); ok { + r1 = returnFunc(ctx, req, opts...) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -152,37 +172,48 @@ func (_e *Permissions_Expecter) ListPermissions(ctx interface{}, req interface{} func (_c *Permissions_ListPermissions_Call) Run(run func(ctx context.Context, req *v0.ListPermissionsRequest, opts ...client.CallOption)) *Permissions_ListPermissions_Call { _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]client.CallOption, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(client.CallOption) - } + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) } - run(args[0].(context.Context), args[1].(*v0.ListPermissionsRequest), variadicArgs...) + var arg1 *v0.ListPermissionsRequest + if args[1] != nil { + arg1 = args[1].(*v0.ListPermissionsRequest) + } + var arg2 []client.CallOption + var variadicArgs []client.CallOption + if len(args) > 2 { + variadicArgs = args[2].([]client.CallOption) + } + arg2 = variadicArgs + run( + arg0, + arg1, + arg2..., + ) }) return _c } -func (_c *Permissions_ListPermissions_Call) Return(_a0 *v0.ListPermissionsResponse, _a1 error) *Permissions_ListPermissions_Call { - _c.Call.Return(_a0, _a1) +func (_c *Permissions_ListPermissions_Call) Return(listPermissionsResponse *v0.ListPermissionsResponse, err error) *Permissions_ListPermissions_Call { + _c.Call.Return(listPermissionsResponse, err) return _c } -func (_c *Permissions_ListPermissions_Call) RunAndReturn(run func(context.Context, *v0.ListPermissionsRequest, ...client.CallOption) (*v0.ListPermissionsResponse, error)) *Permissions_ListPermissions_Call { +func (_c *Permissions_ListPermissions_Call) RunAndReturn(run func(ctx context.Context, req *v0.ListPermissionsRequest, opts ...client.CallOption) (*v0.ListPermissionsResponse, error)) *Permissions_ListPermissions_Call { _c.Call.Return(run) return _c } -// ListPermissionsByResource provides a mock function with given fields: ctx, in, opts -func (_m *Permissions) ListPermissionsByResource(ctx context.Context, in *v0.ListPermissionsByResourceRequest, opts ...client.CallOption) (*v0.ListPermissionsByResourceResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] +// ListPermissionsByResource provides a mock function for the type Permissions +func (_mock *Permissions) ListPermissionsByResource(ctx context.Context, in *v0.ListPermissionsByResourceRequest, opts ...client.CallOption) (*v0.ListPermissionsByResourceResponse, error) { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(ctx, in, opts) + } else { + tmpRet = _mock.Called(ctx, in) } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) + ret := tmpRet if len(ret) == 0 { panic("no return value specified for ListPermissionsByResource") @@ -190,23 +221,21 @@ func (_m *Permissions) ListPermissionsByResource(ctx context.Context, in *v0.Lis var r0 *v0.ListPermissionsByResourceResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v0.ListPermissionsByResourceRequest, ...client.CallOption) (*v0.ListPermissionsByResourceResponse, error)); ok { - return rf(ctx, in, opts...) + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListPermissionsByResourceRequest, ...client.CallOption) (*v0.ListPermissionsByResourceResponse, error)); ok { + return returnFunc(ctx, in, opts...) } - if rf, ok := ret.Get(0).(func(context.Context, *v0.ListPermissionsByResourceRequest, ...client.CallOption) *v0.ListPermissionsByResourceResponse); ok { - r0 = rf(ctx, in, opts...) + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListPermissionsByResourceRequest, ...client.CallOption) *v0.ListPermissionsByResourceResponse); ok { + r0 = returnFunc(ctx, in, opts...) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v0.ListPermissionsByResourceResponse) } } - - if rf, ok := ret.Get(1).(func(context.Context, *v0.ListPermissionsByResourceRequest, ...client.CallOption) error); ok { - r1 = rf(ctx, in, opts...) + if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.ListPermissionsByResourceRequest, ...client.CallOption) error); ok { + r1 = returnFunc(ctx, in, opts...) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -226,37 +255,35 @@ func (_e *Permissions_Expecter) ListPermissionsByResource(ctx interface{}, in in func (_c *Permissions_ListPermissionsByResource_Call) Run(run func(ctx context.Context, in *v0.ListPermissionsByResourceRequest, opts ...client.CallOption)) *Permissions_ListPermissionsByResource_Call { _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]client.CallOption, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(client.CallOption) - } + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) } - run(args[0].(context.Context), args[1].(*v0.ListPermissionsByResourceRequest), variadicArgs...) + var arg1 *v0.ListPermissionsByResourceRequest + if args[1] != nil { + arg1 = args[1].(*v0.ListPermissionsByResourceRequest) + } + var arg2 []client.CallOption + var variadicArgs []client.CallOption + if len(args) > 2 { + variadicArgs = args[2].([]client.CallOption) + } + arg2 = variadicArgs + run( + arg0, + arg1, + arg2..., + ) }) return _c } -func (_c *Permissions_ListPermissionsByResource_Call) Return(_a0 *v0.ListPermissionsByResourceResponse, _a1 error) *Permissions_ListPermissionsByResource_Call { - _c.Call.Return(_a0, _a1) +func (_c *Permissions_ListPermissionsByResource_Call) Return(listPermissionsByResourceResponse *v0.ListPermissionsByResourceResponse, err error) *Permissions_ListPermissionsByResource_Call { + _c.Call.Return(listPermissionsByResourceResponse, err) return _c } -func (_c *Permissions_ListPermissionsByResource_Call) RunAndReturn(run func(context.Context, *v0.ListPermissionsByResourceRequest, ...client.CallOption) (*v0.ListPermissionsByResourceResponse, error)) *Permissions_ListPermissionsByResource_Call { +func (_c *Permissions_ListPermissionsByResource_Call) RunAndReturn(run func(ctx context.Context, in *v0.ListPermissionsByResourceRequest, opts ...client.CallOption) (*v0.ListPermissionsByResourceResponse, error)) *Permissions_ListPermissionsByResource_Call { _c.Call.Return(run) return _c } - -// NewPermissions creates a new instance of Permissions. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewPermissions(t interface { - mock.TestingT - Cleanup(func()) -}) *Permissions { - mock := &Permissions{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/services/graph/mocks/publisher.go b/services/graph/mocks/publisher.go index 4f67dd8063..276eff4a1a 100644 --- a/services/graph/mocks/publisher.go +++ b/services/graph/mocks/publisher.go @@ -1,87 +1,14 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( mock "github.com/stretchr/testify/mock" - events "go-micro.dev/v4/events" + "go-micro.dev/v4/events" ) -// Publisher is an autogenerated mock type for the Publisher type -type Publisher struct { - mock.Mock -} - -type Publisher_Expecter struct { - mock *mock.Mock -} - -func (_m *Publisher) EXPECT() *Publisher_Expecter { - return &Publisher_Expecter{mock: &_m.Mock} -} - -// Publish provides a mock function with given fields: _a0, _a1, _a2 -func (_m *Publisher) Publish(_a0 string, _a1 interface{}, _a2 ...events.PublishOption) error { - _va := make([]interface{}, len(_a2)) - for _i := range _a2 { - _va[_i] = _a2[_i] - } - var _ca []interface{} - _ca = append(_ca, _a0, _a1) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for Publish") - } - - var r0 error - if rf, ok := ret.Get(0).(func(string, interface{}, ...events.PublishOption) error); ok { - r0 = rf(_a0, _a1, _a2...) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Publisher_Publish_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Publish' -type Publisher_Publish_Call struct { - *mock.Call -} - -// Publish is a helper method to define mock.On call -// - _a0 string -// - _a1 interface{} -// - _a2 ...events.PublishOption -func (_e *Publisher_Expecter) Publish(_a0 interface{}, _a1 interface{}, _a2 ...interface{}) *Publisher_Publish_Call { - return &Publisher_Publish_Call{Call: _e.mock.On("Publish", - append([]interface{}{_a0, _a1}, _a2...)...)} -} - -func (_c *Publisher_Publish_Call) Run(run func(_a0 string, _a1 interface{}, _a2 ...events.PublishOption)) *Publisher_Publish_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]events.PublishOption, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(events.PublishOption) - } - } - run(args[0].(string), args[1].(interface{}), variadicArgs...) - }) - return _c -} - -func (_c *Publisher_Publish_Call) Return(_a0 error) *Publisher_Publish_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Publisher_Publish_Call) RunAndReturn(run func(string, interface{}, ...events.PublishOption) error) *Publisher_Publish_Call { - _c.Call.Return(run) - return _c -} - // NewPublisher creates a new instance of Publisher. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewPublisher(t interface { @@ -95,3 +22,88 @@ func NewPublisher(t interface { return mock } + +// Publisher is an autogenerated mock type for the Publisher type +type Publisher struct { + mock.Mock +} + +type Publisher_Expecter struct { + mock *mock.Mock +} + +func (_m *Publisher) EXPECT() *Publisher_Expecter { + return &Publisher_Expecter{mock: &_m.Mock} +} + +// Publish provides a mock function for the type Publisher +func (_mock *Publisher) Publish(s string, ifaceVal interface{}, publishOptions ...events.PublishOption) error { + var tmpRet mock.Arguments + if len(publishOptions) > 0 { + tmpRet = _mock.Called(s, ifaceVal, publishOptions) + } else { + tmpRet = _mock.Called(s, ifaceVal) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for Publish") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(string, interface{}, ...events.PublishOption) error); ok { + r0 = returnFunc(s, ifaceVal, publishOptions...) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// Publisher_Publish_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Publish' +type Publisher_Publish_Call struct { + *mock.Call +} + +// Publish is a helper method to define mock.On call +// - s string +// - ifaceVal interface{} +// - publishOptions ...events.PublishOption +func (_e *Publisher_Expecter) Publish(s interface{}, ifaceVal interface{}, publishOptions ...interface{}) *Publisher_Publish_Call { + return &Publisher_Publish_Call{Call: _e.mock.On("Publish", + append([]interface{}{s, ifaceVal}, publishOptions...)...)} +} + +func (_c *Publisher_Publish_Call) Run(run func(s string, ifaceVal interface{}, publishOptions ...events.PublishOption)) *Publisher_Publish_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 interface{} + if args[1] != nil { + arg1 = args[1].(interface{}) + } + var arg2 []events.PublishOption + var variadicArgs []events.PublishOption + if len(args) > 2 { + variadicArgs = args[2].([]events.PublishOption) + } + arg2 = variadicArgs + run( + arg0, + arg1, + arg2..., + ) + }) + return _c +} + +func (_c *Publisher_Publish_Call) Return(err error) *Publisher_Publish_Call { + _c.Call.Return(err) + return _c +} + +func (_c *Publisher_Publish_Call) RunAndReturn(run func(s string, ifaceVal interface{}, publishOptions ...events.PublishOption) error) *Publisher_Publish_Call { + _c.Call.Return(run) + return _c +} diff --git a/services/graph/mocks/role_service.go b/services/graph/mocks/role_service.go index 7009aaddc9..a531a725a3 100644 --- a/services/graph/mocks/role_service.go +++ b/services/graph/mocks/role_service.go @@ -1,19 +1,32 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" - - client "go-micro.dev/v4/client" - - emptypb "google.golang.org/protobuf/types/known/emptypb" + "context" + "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/settings/v0" mock "github.com/stretchr/testify/mock" - - v0 "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/settings/v0" + "go-micro.dev/v4/client" + "google.golang.org/protobuf/types/known/emptypb" ) +// NewRoleService creates a new instance of RoleService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewRoleService(t interface { + mock.TestingT + Cleanup(func()) +}) *RoleService { + mock := &RoleService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // RoleService is an autogenerated mock type for the RoleService type type RoleService struct { mock.Mock @@ -27,16 +40,15 @@ func (_m *RoleService) EXPECT() *RoleService_Expecter { return &RoleService_Expecter{mock: &_m.Mock} } -// AssignRoleToUser provides a mock function with given fields: ctx, in, opts -func (_m *RoleService) AssignRoleToUser(ctx context.Context, in *v0.AssignRoleToUserRequest, opts ...client.CallOption) (*v0.AssignRoleToUserResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] +// AssignRoleToUser provides a mock function for the type RoleService +func (_mock *RoleService) AssignRoleToUser(ctx context.Context, in *v0.AssignRoleToUserRequest, opts ...client.CallOption) (*v0.AssignRoleToUserResponse, error) { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(ctx, in, opts) + } else { + tmpRet = _mock.Called(ctx, in) } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) + ret := tmpRet if len(ret) == 0 { panic("no return value specified for AssignRoleToUser") @@ -44,23 +56,21 @@ func (_m *RoleService) AssignRoleToUser(ctx context.Context, in *v0.AssignRoleTo var r0 *v0.AssignRoleToUserResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v0.AssignRoleToUserRequest, ...client.CallOption) (*v0.AssignRoleToUserResponse, error)); ok { - return rf(ctx, in, opts...) + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.AssignRoleToUserRequest, ...client.CallOption) (*v0.AssignRoleToUserResponse, error)); ok { + return returnFunc(ctx, in, opts...) } - if rf, ok := ret.Get(0).(func(context.Context, *v0.AssignRoleToUserRequest, ...client.CallOption) *v0.AssignRoleToUserResponse); ok { - r0 = rf(ctx, in, opts...) + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.AssignRoleToUserRequest, ...client.CallOption) *v0.AssignRoleToUserResponse); ok { + r0 = returnFunc(ctx, in, opts...) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v0.AssignRoleToUserResponse) } } - - if rf, ok := ret.Get(1).(func(context.Context, *v0.AssignRoleToUserRequest, ...client.CallOption) error); ok { - r1 = rf(ctx, in, opts...) + if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.AssignRoleToUserRequest, ...client.CallOption) error); ok { + r1 = returnFunc(ctx, in, opts...) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -80,37 +90,48 @@ func (_e *RoleService_Expecter) AssignRoleToUser(ctx interface{}, in interface{} func (_c *RoleService_AssignRoleToUser_Call) Run(run func(ctx context.Context, in *v0.AssignRoleToUserRequest, opts ...client.CallOption)) *RoleService_AssignRoleToUser_Call { _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]client.CallOption, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(client.CallOption) - } + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) } - run(args[0].(context.Context), args[1].(*v0.AssignRoleToUserRequest), variadicArgs...) + var arg1 *v0.AssignRoleToUserRequest + if args[1] != nil { + arg1 = args[1].(*v0.AssignRoleToUserRequest) + } + var arg2 []client.CallOption + var variadicArgs []client.CallOption + if len(args) > 2 { + variadicArgs = args[2].([]client.CallOption) + } + arg2 = variadicArgs + run( + arg0, + arg1, + arg2..., + ) }) return _c } -func (_c *RoleService_AssignRoleToUser_Call) Return(_a0 *v0.AssignRoleToUserResponse, _a1 error) *RoleService_AssignRoleToUser_Call { - _c.Call.Return(_a0, _a1) +func (_c *RoleService_AssignRoleToUser_Call) Return(assignRoleToUserResponse *v0.AssignRoleToUserResponse, err error) *RoleService_AssignRoleToUser_Call { + _c.Call.Return(assignRoleToUserResponse, err) return _c } -func (_c *RoleService_AssignRoleToUser_Call) RunAndReturn(run func(context.Context, *v0.AssignRoleToUserRequest, ...client.CallOption) (*v0.AssignRoleToUserResponse, error)) *RoleService_AssignRoleToUser_Call { +func (_c *RoleService_AssignRoleToUser_Call) RunAndReturn(run func(ctx context.Context, in *v0.AssignRoleToUserRequest, opts ...client.CallOption) (*v0.AssignRoleToUserResponse, error)) *RoleService_AssignRoleToUser_Call { _c.Call.Return(run) return _c } -// ListRoleAssignments provides a mock function with given fields: ctx, in, opts -func (_m *RoleService) ListRoleAssignments(ctx context.Context, in *v0.ListRoleAssignmentsRequest, opts ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] +// ListRoleAssignments provides a mock function for the type RoleService +func (_mock *RoleService) ListRoleAssignments(ctx context.Context, in *v0.ListRoleAssignmentsRequest, opts ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error) { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(ctx, in, opts) + } else { + tmpRet = _mock.Called(ctx, in) } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) + ret := tmpRet if len(ret) == 0 { panic("no return value specified for ListRoleAssignments") @@ -118,23 +139,21 @@ func (_m *RoleService) ListRoleAssignments(ctx context.Context, in *v0.ListRoleA var r0 *v0.ListRoleAssignmentsResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v0.ListRoleAssignmentsRequest, ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error)); ok { - return rf(ctx, in, opts...) + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListRoleAssignmentsRequest, ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error)); ok { + return returnFunc(ctx, in, opts...) } - if rf, ok := ret.Get(0).(func(context.Context, *v0.ListRoleAssignmentsRequest, ...client.CallOption) *v0.ListRoleAssignmentsResponse); ok { - r0 = rf(ctx, in, opts...) + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListRoleAssignmentsRequest, ...client.CallOption) *v0.ListRoleAssignmentsResponse); ok { + r0 = returnFunc(ctx, in, opts...) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v0.ListRoleAssignmentsResponse) } } - - if rf, ok := ret.Get(1).(func(context.Context, *v0.ListRoleAssignmentsRequest, ...client.CallOption) error); ok { - r1 = rf(ctx, in, opts...) + if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.ListRoleAssignmentsRequest, ...client.CallOption) error); ok { + r1 = returnFunc(ctx, in, opts...) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -154,37 +173,48 @@ func (_e *RoleService_Expecter) ListRoleAssignments(ctx interface{}, in interfac func (_c *RoleService_ListRoleAssignments_Call) Run(run func(ctx context.Context, in *v0.ListRoleAssignmentsRequest, opts ...client.CallOption)) *RoleService_ListRoleAssignments_Call { _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]client.CallOption, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(client.CallOption) - } + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) } - run(args[0].(context.Context), args[1].(*v0.ListRoleAssignmentsRequest), variadicArgs...) + var arg1 *v0.ListRoleAssignmentsRequest + if args[1] != nil { + arg1 = args[1].(*v0.ListRoleAssignmentsRequest) + } + var arg2 []client.CallOption + var variadicArgs []client.CallOption + if len(args) > 2 { + variadicArgs = args[2].([]client.CallOption) + } + arg2 = variadicArgs + run( + arg0, + arg1, + arg2..., + ) }) return _c } -func (_c *RoleService_ListRoleAssignments_Call) Return(_a0 *v0.ListRoleAssignmentsResponse, _a1 error) *RoleService_ListRoleAssignments_Call { - _c.Call.Return(_a0, _a1) +func (_c *RoleService_ListRoleAssignments_Call) Return(listRoleAssignmentsResponse *v0.ListRoleAssignmentsResponse, err error) *RoleService_ListRoleAssignments_Call { + _c.Call.Return(listRoleAssignmentsResponse, err) return _c } -func (_c *RoleService_ListRoleAssignments_Call) RunAndReturn(run func(context.Context, *v0.ListRoleAssignmentsRequest, ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error)) *RoleService_ListRoleAssignments_Call { +func (_c *RoleService_ListRoleAssignments_Call) RunAndReturn(run func(ctx context.Context, in *v0.ListRoleAssignmentsRequest, opts ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error)) *RoleService_ListRoleAssignments_Call { _c.Call.Return(run) return _c } -// ListRoleAssignmentsFiltered provides a mock function with given fields: ctx, in, opts -func (_m *RoleService) ListRoleAssignmentsFiltered(ctx context.Context, in *v0.ListRoleAssignmentsFilteredRequest, opts ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] +// ListRoleAssignmentsFiltered provides a mock function for the type RoleService +func (_mock *RoleService) ListRoleAssignmentsFiltered(ctx context.Context, in *v0.ListRoleAssignmentsFilteredRequest, opts ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error) { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(ctx, in, opts) + } else { + tmpRet = _mock.Called(ctx, in) } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) + ret := tmpRet if len(ret) == 0 { panic("no return value specified for ListRoleAssignmentsFiltered") @@ -192,23 +222,21 @@ func (_m *RoleService) ListRoleAssignmentsFiltered(ctx context.Context, in *v0.L var r0 *v0.ListRoleAssignmentsResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v0.ListRoleAssignmentsFilteredRequest, ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error)); ok { - return rf(ctx, in, opts...) + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListRoleAssignmentsFilteredRequest, ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error)); ok { + return returnFunc(ctx, in, opts...) } - if rf, ok := ret.Get(0).(func(context.Context, *v0.ListRoleAssignmentsFilteredRequest, ...client.CallOption) *v0.ListRoleAssignmentsResponse); ok { - r0 = rf(ctx, in, opts...) + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListRoleAssignmentsFilteredRequest, ...client.CallOption) *v0.ListRoleAssignmentsResponse); ok { + r0 = returnFunc(ctx, in, opts...) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v0.ListRoleAssignmentsResponse) } } - - if rf, ok := ret.Get(1).(func(context.Context, *v0.ListRoleAssignmentsFilteredRequest, ...client.CallOption) error); ok { - r1 = rf(ctx, in, opts...) + if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.ListRoleAssignmentsFilteredRequest, ...client.CallOption) error); ok { + r1 = returnFunc(ctx, in, opts...) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -228,37 +256,48 @@ func (_e *RoleService_Expecter) ListRoleAssignmentsFiltered(ctx interface{}, in func (_c *RoleService_ListRoleAssignmentsFiltered_Call) Run(run func(ctx context.Context, in *v0.ListRoleAssignmentsFilteredRequest, opts ...client.CallOption)) *RoleService_ListRoleAssignmentsFiltered_Call { _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]client.CallOption, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(client.CallOption) - } + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) } - run(args[0].(context.Context), args[1].(*v0.ListRoleAssignmentsFilteredRequest), variadicArgs...) + var arg1 *v0.ListRoleAssignmentsFilteredRequest + if args[1] != nil { + arg1 = args[1].(*v0.ListRoleAssignmentsFilteredRequest) + } + var arg2 []client.CallOption + var variadicArgs []client.CallOption + if len(args) > 2 { + variadicArgs = args[2].([]client.CallOption) + } + arg2 = variadicArgs + run( + arg0, + arg1, + arg2..., + ) }) return _c } -func (_c *RoleService_ListRoleAssignmentsFiltered_Call) Return(_a0 *v0.ListRoleAssignmentsResponse, _a1 error) *RoleService_ListRoleAssignmentsFiltered_Call { - _c.Call.Return(_a0, _a1) +func (_c *RoleService_ListRoleAssignmentsFiltered_Call) Return(listRoleAssignmentsResponse *v0.ListRoleAssignmentsResponse, err error) *RoleService_ListRoleAssignmentsFiltered_Call { + _c.Call.Return(listRoleAssignmentsResponse, err) return _c } -func (_c *RoleService_ListRoleAssignmentsFiltered_Call) RunAndReturn(run func(context.Context, *v0.ListRoleAssignmentsFilteredRequest, ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error)) *RoleService_ListRoleAssignmentsFiltered_Call { +func (_c *RoleService_ListRoleAssignmentsFiltered_Call) RunAndReturn(run func(ctx context.Context, in *v0.ListRoleAssignmentsFilteredRequest, opts ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error)) *RoleService_ListRoleAssignmentsFiltered_Call { _c.Call.Return(run) return _c } -// ListRoles provides a mock function with given fields: ctx, in, opts -func (_m *RoleService) ListRoles(ctx context.Context, in *v0.ListBundlesRequest, opts ...client.CallOption) (*v0.ListBundlesResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] +// ListRoles provides a mock function for the type RoleService +func (_mock *RoleService) ListRoles(ctx context.Context, in *v0.ListBundlesRequest, opts ...client.CallOption) (*v0.ListBundlesResponse, error) { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(ctx, in, opts) + } else { + tmpRet = _mock.Called(ctx, in) } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) + ret := tmpRet if len(ret) == 0 { panic("no return value specified for ListRoles") @@ -266,23 +305,21 @@ func (_m *RoleService) ListRoles(ctx context.Context, in *v0.ListBundlesRequest, var r0 *v0.ListBundlesResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v0.ListBundlesRequest, ...client.CallOption) (*v0.ListBundlesResponse, error)); ok { - return rf(ctx, in, opts...) + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListBundlesRequest, ...client.CallOption) (*v0.ListBundlesResponse, error)); ok { + return returnFunc(ctx, in, opts...) } - if rf, ok := ret.Get(0).(func(context.Context, *v0.ListBundlesRequest, ...client.CallOption) *v0.ListBundlesResponse); ok { - r0 = rf(ctx, in, opts...) + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListBundlesRequest, ...client.CallOption) *v0.ListBundlesResponse); ok { + r0 = returnFunc(ctx, in, opts...) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v0.ListBundlesResponse) } } - - if rf, ok := ret.Get(1).(func(context.Context, *v0.ListBundlesRequest, ...client.CallOption) error); ok { - r1 = rf(ctx, in, opts...) + if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.ListBundlesRequest, ...client.CallOption) error); ok { + r1 = returnFunc(ctx, in, opts...) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -302,37 +339,48 @@ func (_e *RoleService_Expecter) ListRoles(ctx interface{}, in interface{}, opts func (_c *RoleService_ListRoles_Call) Run(run func(ctx context.Context, in *v0.ListBundlesRequest, opts ...client.CallOption)) *RoleService_ListRoles_Call { _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]client.CallOption, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(client.CallOption) - } + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) } - run(args[0].(context.Context), args[1].(*v0.ListBundlesRequest), variadicArgs...) + var arg1 *v0.ListBundlesRequest + if args[1] != nil { + arg1 = args[1].(*v0.ListBundlesRequest) + } + var arg2 []client.CallOption + var variadicArgs []client.CallOption + if len(args) > 2 { + variadicArgs = args[2].([]client.CallOption) + } + arg2 = variadicArgs + run( + arg0, + arg1, + arg2..., + ) }) return _c } -func (_c *RoleService_ListRoles_Call) Return(_a0 *v0.ListBundlesResponse, _a1 error) *RoleService_ListRoles_Call { - _c.Call.Return(_a0, _a1) +func (_c *RoleService_ListRoles_Call) Return(listBundlesResponse *v0.ListBundlesResponse, err error) *RoleService_ListRoles_Call { + _c.Call.Return(listBundlesResponse, err) return _c } -func (_c *RoleService_ListRoles_Call) RunAndReturn(run func(context.Context, *v0.ListBundlesRequest, ...client.CallOption) (*v0.ListBundlesResponse, error)) *RoleService_ListRoles_Call { +func (_c *RoleService_ListRoles_Call) RunAndReturn(run func(ctx context.Context, in *v0.ListBundlesRequest, opts ...client.CallOption) (*v0.ListBundlesResponse, error)) *RoleService_ListRoles_Call { _c.Call.Return(run) return _c } -// RemoveRoleFromUser provides a mock function with given fields: ctx, in, opts -func (_m *RoleService) RemoveRoleFromUser(ctx context.Context, in *v0.RemoveRoleFromUserRequest, opts ...client.CallOption) (*emptypb.Empty, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] +// RemoveRoleFromUser provides a mock function for the type RoleService +func (_mock *RoleService) RemoveRoleFromUser(ctx context.Context, in *v0.RemoveRoleFromUserRequest, opts ...client.CallOption) (*emptypb.Empty, error) { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(ctx, in, opts) + } else { + tmpRet = _mock.Called(ctx, in) } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) + ret := tmpRet if len(ret) == 0 { panic("no return value specified for RemoveRoleFromUser") @@ -340,23 +388,21 @@ func (_m *RoleService) RemoveRoleFromUser(ctx context.Context, in *v0.RemoveRole var r0 *emptypb.Empty var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v0.RemoveRoleFromUserRequest, ...client.CallOption) (*emptypb.Empty, error)); ok { - return rf(ctx, in, opts...) + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.RemoveRoleFromUserRequest, ...client.CallOption) (*emptypb.Empty, error)); ok { + return returnFunc(ctx, in, opts...) } - if rf, ok := ret.Get(0).(func(context.Context, *v0.RemoveRoleFromUserRequest, ...client.CallOption) *emptypb.Empty); ok { - r0 = rf(ctx, in, opts...) + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.RemoveRoleFromUserRequest, ...client.CallOption) *emptypb.Empty); ok { + r0 = returnFunc(ctx, in, opts...) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*emptypb.Empty) } } - - if rf, ok := ret.Get(1).(func(context.Context, *v0.RemoveRoleFromUserRequest, ...client.CallOption) error); ok { - r1 = rf(ctx, in, opts...) + if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.RemoveRoleFromUserRequest, ...client.CallOption) error); ok { + r1 = returnFunc(ctx, in, opts...) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -376,37 +422,35 @@ func (_e *RoleService_Expecter) RemoveRoleFromUser(ctx interface{}, in interface func (_c *RoleService_RemoveRoleFromUser_Call) Run(run func(ctx context.Context, in *v0.RemoveRoleFromUserRequest, opts ...client.CallOption)) *RoleService_RemoveRoleFromUser_Call { _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]client.CallOption, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(client.CallOption) - } + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) } - run(args[0].(context.Context), args[1].(*v0.RemoveRoleFromUserRequest), variadicArgs...) + var arg1 *v0.RemoveRoleFromUserRequest + if args[1] != nil { + arg1 = args[1].(*v0.RemoveRoleFromUserRequest) + } + var arg2 []client.CallOption + var variadicArgs []client.CallOption + if len(args) > 2 { + variadicArgs = args[2].([]client.CallOption) + } + arg2 = variadicArgs + run( + arg0, + arg1, + arg2..., + ) }) return _c } -func (_c *RoleService_RemoveRoleFromUser_Call) Return(_a0 *emptypb.Empty, _a1 error) *RoleService_RemoveRoleFromUser_Call { - _c.Call.Return(_a0, _a1) +func (_c *RoleService_RemoveRoleFromUser_Call) Return(empty *emptypb.Empty, err error) *RoleService_RemoveRoleFromUser_Call { + _c.Call.Return(empty, err) return _c } -func (_c *RoleService_RemoveRoleFromUser_Call) RunAndReturn(run func(context.Context, *v0.RemoveRoleFromUserRequest, ...client.CallOption) (*emptypb.Empty, error)) *RoleService_RemoveRoleFromUser_Call { +func (_c *RoleService_RemoveRoleFromUser_Call) RunAndReturn(run func(ctx context.Context, in *v0.RemoveRoleFromUserRequest, opts ...client.CallOption) (*emptypb.Empty, error)) *RoleService_RemoveRoleFromUser_Call { _c.Call.Return(run) return _c } - -// NewRoleService creates a new instance of RoleService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewRoleService(t interface { - mock.TestingT - Cleanup(func()) -}) *RoleService { - mock := &RoleService{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/services/graph/mocks/storage.go b/services/graph/mocks/storage.go index 62fdc1fcae..99498cafb1 100644 --- a/services/graph/mocks/storage.go +++ b/services/graph/mocks/storage.go @@ -1,16 +1,31 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" + "context" - metadata "github.com/opencloud-eu/reva/v2/pkg/storage/utils/metadata" + "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" + "github.com/opencloud-eu/reva/v2/pkg/storage/utils/metadata" mock "github.com/stretchr/testify/mock" - - providerv1beta1 "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" ) +// NewStorage creates a new instance of Storage. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewStorage(t interface { + mock.TestingT + Cleanup(func()) +}) *Storage { + mock := &Storage{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // Storage is an autogenerated mock type for the Storage type type Storage struct { mock.Mock @@ -24,21 +39,20 @@ func (_m *Storage) EXPECT() *Storage_Expecter { return &Storage_Expecter{mock: &_m.Mock} } -// Backend provides a mock function with no fields -func (_m *Storage) Backend() string { - ret := _m.Called() +// Backend provides a mock function for the type Storage +func (_mock *Storage) Backend() string { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Backend") } var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() } else { r0 = ret.Get(0).(string) } - return r0 } @@ -59,8 +73,8 @@ func (_c *Storage_Backend_Call) Run(run func()) *Storage_Backend_Call { return _c } -func (_c *Storage_Backend_Call) Return(_a0 string) *Storage_Backend_Call { - _c.Call.Return(_a0) +func (_c *Storage_Backend_Call) Return(s string) *Storage_Backend_Call { + _c.Call.Return(s) return _c } @@ -69,21 +83,20 @@ func (_c *Storage_Backend_Call) RunAndReturn(run func() string) *Storage_Backend return _c } -// CreateSymlink provides a mock function with given fields: ctx, oldname, newname -func (_m *Storage) CreateSymlink(ctx context.Context, oldname string, newname string) error { - ret := _m.Called(ctx, oldname, newname) +// CreateSymlink provides a mock function for the type Storage +func (_mock *Storage) CreateSymlink(ctx context.Context, oldname string, newname string) error { + ret := _mock.Called(ctx, oldname, newname) if len(ret) == 0 { panic("no return value specified for CreateSymlink") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { - r0 = rf(ctx, oldname, newname) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = returnFunc(ctx, oldname, newname) } else { r0 = ret.Error(0) } - return r0 } @@ -102,36 +115,51 @@ func (_e *Storage_Expecter) CreateSymlink(ctx interface{}, oldname interface{}, func (_c *Storage_CreateSymlink_Call) Run(run func(ctx context.Context, oldname string, newname string)) *Storage_CreateSymlink_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *Storage_CreateSymlink_Call) Return(_a0 error) *Storage_CreateSymlink_Call { - _c.Call.Return(_a0) +func (_c *Storage_CreateSymlink_Call) Return(err error) *Storage_CreateSymlink_Call { + _c.Call.Return(err) return _c } -func (_c *Storage_CreateSymlink_Call) RunAndReturn(run func(context.Context, string, string) error) *Storage_CreateSymlink_Call { +func (_c *Storage_CreateSymlink_Call) RunAndReturn(run func(ctx context.Context, oldname string, newname string) error) *Storage_CreateSymlink_Call { _c.Call.Return(run) return _c } -// Delete provides a mock function with given fields: ctx, path -func (_m *Storage) Delete(ctx context.Context, path string) error { - ret := _m.Called(ctx, path) +// Delete provides a mock function for the type Storage +func (_mock *Storage) Delete(ctx context.Context, path string) error { + ret := _mock.Called(ctx, path) if len(ret) == 0 { panic("no return value specified for Delete") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { - r0 = rf(ctx, path) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = returnFunc(ctx, path) } else { r0 = ret.Error(0) } - return r0 } @@ -149,24 +177,35 @@ func (_e *Storage_Expecter) Delete(ctx interface{}, path interface{}) *Storage_D func (_c *Storage_Delete_Call) Run(run func(ctx context.Context, path string)) *Storage_Delete_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Storage_Delete_Call) Return(_a0 error) *Storage_Delete_Call { - _c.Call.Return(_a0) +func (_c *Storage_Delete_Call) Return(err error) *Storage_Delete_Call { + _c.Call.Return(err) return _c } -func (_c *Storage_Delete_Call) RunAndReturn(run func(context.Context, string) error) *Storage_Delete_Call { +func (_c *Storage_Delete_Call) RunAndReturn(run func(ctx context.Context, path string) error) *Storage_Delete_Call { _c.Call.Return(run) return _c } -// Download provides a mock function with given fields: ctx, req -func (_m *Storage) Download(ctx context.Context, req metadata.DownloadRequest) (*metadata.DownloadResponse, error) { - ret := _m.Called(ctx, req) +// Download provides a mock function for the type Storage +func (_mock *Storage) Download(ctx context.Context, req metadata.DownloadRequest) (*metadata.DownloadResponse, error) { + ret := _mock.Called(ctx, req) if len(ret) == 0 { panic("no return value specified for Download") @@ -174,23 +213,21 @@ func (_m *Storage) Download(ctx context.Context, req metadata.DownloadRequest) ( var r0 *metadata.DownloadResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, metadata.DownloadRequest) (*metadata.DownloadResponse, error)); ok { - return rf(ctx, req) + if returnFunc, ok := ret.Get(0).(func(context.Context, metadata.DownloadRequest) (*metadata.DownloadResponse, error)); ok { + return returnFunc(ctx, req) } - if rf, ok := ret.Get(0).(func(context.Context, metadata.DownloadRequest) *metadata.DownloadResponse); ok { - r0 = rf(ctx, req) + if returnFunc, ok := ret.Get(0).(func(context.Context, metadata.DownloadRequest) *metadata.DownloadResponse); ok { + r0 = returnFunc(ctx, req) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*metadata.DownloadResponse) } } - - if rf, ok := ret.Get(1).(func(context.Context, metadata.DownloadRequest) error); ok { - r1 = rf(ctx, req) + if returnFunc, ok := ret.Get(1).(func(context.Context, metadata.DownloadRequest) error); ok { + r1 = returnFunc(ctx, req) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -208,36 +245,46 @@ func (_e *Storage_Expecter) Download(ctx interface{}, req interface{}) *Storage_ func (_c *Storage_Download_Call) Run(run func(ctx context.Context, req metadata.DownloadRequest)) *Storage_Download_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(metadata.DownloadRequest)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 metadata.DownloadRequest + if args[1] != nil { + arg1 = args[1].(metadata.DownloadRequest) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Storage_Download_Call) Return(_a0 *metadata.DownloadResponse, _a1 error) *Storage_Download_Call { - _c.Call.Return(_a0, _a1) +func (_c *Storage_Download_Call) Return(downloadResponse *metadata.DownloadResponse, err error) *Storage_Download_Call { + _c.Call.Return(downloadResponse, err) return _c } -func (_c *Storage_Download_Call) RunAndReturn(run func(context.Context, metadata.DownloadRequest) (*metadata.DownloadResponse, error)) *Storage_Download_Call { +func (_c *Storage_Download_Call) RunAndReturn(run func(ctx context.Context, req metadata.DownloadRequest) (*metadata.DownloadResponse, error)) *Storage_Download_Call { _c.Call.Return(run) return _c } -// Init provides a mock function with given fields: ctx, name -func (_m *Storage) Init(ctx context.Context, name string) error { - ret := _m.Called(ctx, name) +// Init provides a mock function for the type Storage +func (_mock *Storage) Init(ctx context.Context, name string) error { + ret := _mock.Called(ctx, name) if len(ret) == 0 { panic("no return value specified for Init") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { - r0 = rf(ctx, name) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = returnFunc(ctx, name) } else { r0 = ret.Error(0) } - return r0 } @@ -255,7 +302,18 @@ func (_e *Storage_Expecter) Init(ctx interface{}, name interface{}) *Storage_Ini func (_c *Storage_Init_Call) Run(run func(ctx context.Context, name string)) *Storage_Init_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } @@ -265,14 +323,14 @@ func (_c *Storage_Init_Call) Return(err error) *Storage_Init_Call { return _c } -func (_c *Storage_Init_Call) RunAndReturn(run func(context.Context, string) error) *Storage_Init_Call { +func (_c *Storage_Init_Call) RunAndReturn(run func(ctx context.Context, name string) error) *Storage_Init_Call { _c.Call.Return(run) return _c } -// ListDir provides a mock function with given fields: ctx, path -func (_m *Storage) ListDir(ctx context.Context, path string) ([]*providerv1beta1.ResourceInfo, error) { - ret := _m.Called(ctx, path) +// ListDir provides a mock function for the type Storage +func (_mock *Storage) ListDir(ctx context.Context, path string) ([]*providerv1beta1.ResourceInfo, error) { + ret := _mock.Called(ctx, path) if len(ret) == 0 { panic("no return value specified for ListDir") @@ -280,23 +338,21 @@ func (_m *Storage) ListDir(ctx context.Context, path string) ([]*providerv1beta1 var r0 []*providerv1beta1.ResourceInfo var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) ([]*providerv1beta1.ResourceInfo, error)); ok { - return rf(ctx, path) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) ([]*providerv1beta1.ResourceInfo, error)); ok { + return returnFunc(ctx, path) } - if rf, ok := ret.Get(0).(func(context.Context, string) []*providerv1beta1.ResourceInfo); ok { - r0 = rf(ctx, path) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) []*providerv1beta1.ResourceInfo); ok { + r0 = returnFunc(ctx, path) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*providerv1beta1.ResourceInfo) } } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, path) + if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = returnFunc(ctx, path) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -314,36 +370,46 @@ func (_e *Storage_Expecter) ListDir(ctx interface{}, path interface{}) *Storage_ func (_c *Storage_ListDir_Call) Run(run func(ctx context.Context, path string)) *Storage_ListDir_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Storage_ListDir_Call) Return(_a0 []*providerv1beta1.ResourceInfo, _a1 error) *Storage_ListDir_Call { - _c.Call.Return(_a0, _a1) +func (_c *Storage_ListDir_Call) Return(resourceInfos []*providerv1beta1.ResourceInfo, err error) *Storage_ListDir_Call { + _c.Call.Return(resourceInfos, err) return _c } -func (_c *Storage_ListDir_Call) RunAndReturn(run func(context.Context, string) ([]*providerv1beta1.ResourceInfo, error)) *Storage_ListDir_Call { +func (_c *Storage_ListDir_Call) RunAndReturn(run func(ctx context.Context, path string) ([]*providerv1beta1.ResourceInfo, error)) *Storage_ListDir_Call { _c.Call.Return(run) return _c } -// MakeDirIfNotExist provides a mock function with given fields: ctx, name -func (_m *Storage) MakeDirIfNotExist(ctx context.Context, name string) error { - ret := _m.Called(ctx, name) +// MakeDirIfNotExist provides a mock function for the type Storage +func (_mock *Storage) MakeDirIfNotExist(ctx context.Context, name string) error { + ret := _mock.Called(ctx, name) if len(ret) == 0 { panic("no return value specified for MakeDirIfNotExist") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { - r0 = rf(ctx, name) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = returnFunc(ctx, name) } else { r0 = ret.Error(0) } - return r0 } @@ -361,24 +427,35 @@ func (_e *Storage_Expecter) MakeDirIfNotExist(ctx interface{}, name interface{}) func (_c *Storage_MakeDirIfNotExist_Call) Run(run func(ctx context.Context, name string)) *Storage_MakeDirIfNotExist_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Storage_MakeDirIfNotExist_Call) Return(_a0 error) *Storage_MakeDirIfNotExist_Call { - _c.Call.Return(_a0) +func (_c *Storage_MakeDirIfNotExist_Call) Return(err error) *Storage_MakeDirIfNotExist_Call { + _c.Call.Return(err) return _c } -func (_c *Storage_MakeDirIfNotExist_Call) RunAndReturn(run func(context.Context, string) error) *Storage_MakeDirIfNotExist_Call { +func (_c *Storage_MakeDirIfNotExist_Call) RunAndReturn(run func(ctx context.Context, name string) error) *Storage_MakeDirIfNotExist_Call { _c.Call.Return(run) return _c } -// ReadDir provides a mock function with given fields: ctx, path -func (_m *Storage) ReadDir(ctx context.Context, path string) ([]string, error) { - ret := _m.Called(ctx, path) +// ReadDir provides a mock function for the type Storage +func (_mock *Storage) ReadDir(ctx context.Context, path string) ([]string, error) { + ret := _mock.Called(ctx, path) if len(ret) == 0 { panic("no return value specified for ReadDir") @@ -386,23 +463,21 @@ func (_m *Storage) ReadDir(ctx context.Context, path string) ([]string, error) { var r0 []string var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) ([]string, error)); ok { - return rf(ctx, path) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) ([]string, error)); ok { + return returnFunc(ctx, path) } - if rf, ok := ret.Get(0).(func(context.Context, string) []string); ok { - r0 = rf(ctx, path) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) []string); ok { + r0 = returnFunc(ctx, path) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]string) } } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, path) + if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = returnFunc(ctx, path) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -420,24 +495,35 @@ func (_e *Storage_Expecter) ReadDir(ctx interface{}, path interface{}) *Storage_ func (_c *Storage_ReadDir_Call) Run(run func(ctx context.Context, path string)) *Storage_ReadDir_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Storage_ReadDir_Call) Return(_a0 []string, _a1 error) *Storage_ReadDir_Call { - _c.Call.Return(_a0, _a1) +func (_c *Storage_ReadDir_Call) Return(strings []string, err error) *Storage_ReadDir_Call { + _c.Call.Return(strings, err) return _c } -func (_c *Storage_ReadDir_Call) RunAndReturn(run func(context.Context, string) ([]string, error)) *Storage_ReadDir_Call { +func (_c *Storage_ReadDir_Call) RunAndReturn(run func(ctx context.Context, path string) ([]string, error)) *Storage_ReadDir_Call { _c.Call.Return(run) return _c } -// ResolveSymlink provides a mock function with given fields: ctx, name -func (_m *Storage) ResolveSymlink(ctx context.Context, name string) (string, error) { - ret := _m.Called(ctx, name) +// ResolveSymlink provides a mock function for the type Storage +func (_mock *Storage) ResolveSymlink(ctx context.Context, name string) (string, error) { + ret := _mock.Called(ctx, name) if len(ret) == 0 { panic("no return value specified for ResolveSymlink") @@ -445,21 +531,19 @@ func (_m *Storage) ResolveSymlink(ctx context.Context, name string) (string, err var r0 string var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (string, error)); ok { - return rf(ctx, name) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) (string, error)); ok { + return returnFunc(ctx, name) } - if rf, ok := ret.Get(0).(func(context.Context, string) string); ok { - r0 = rf(ctx, name) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) string); ok { + r0 = returnFunc(ctx, name) } else { r0 = ret.Get(0).(string) } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, name) + if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = returnFunc(ctx, name) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -477,24 +561,35 @@ func (_e *Storage_Expecter) ResolveSymlink(ctx interface{}, name interface{}) *S func (_c *Storage_ResolveSymlink_Call) Run(run func(ctx context.Context, name string)) *Storage_ResolveSymlink_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Storage_ResolveSymlink_Call) Return(_a0 string, _a1 error) *Storage_ResolveSymlink_Call { - _c.Call.Return(_a0, _a1) +func (_c *Storage_ResolveSymlink_Call) Return(s string, err error) *Storage_ResolveSymlink_Call { + _c.Call.Return(s, err) return _c } -func (_c *Storage_ResolveSymlink_Call) RunAndReturn(run func(context.Context, string) (string, error)) *Storage_ResolveSymlink_Call { +func (_c *Storage_ResolveSymlink_Call) RunAndReturn(run func(ctx context.Context, name string) (string, error)) *Storage_ResolveSymlink_Call { _c.Call.Return(run) return _c } -// SimpleDownload provides a mock function with given fields: ctx, path -func (_m *Storage) SimpleDownload(ctx context.Context, path string) ([]byte, error) { - ret := _m.Called(ctx, path) +// SimpleDownload provides a mock function for the type Storage +func (_mock *Storage) SimpleDownload(ctx context.Context, path string) ([]byte, error) { + ret := _mock.Called(ctx, path) if len(ret) == 0 { panic("no return value specified for SimpleDownload") @@ -502,23 +597,21 @@ func (_m *Storage) SimpleDownload(ctx context.Context, path string) ([]byte, err var r0 []byte var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) ([]byte, error)); ok { - return rf(ctx, path) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) ([]byte, error)); ok { + return returnFunc(ctx, path) } - if rf, ok := ret.Get(0).(func(context.Context, string) []byte); ok { - r0 = rf(ctx, path) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) []byte); ok { + r0 = returnFunc(ctx, path) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]byte) } } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, path) + if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = returnFunc(ctx, path) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -536,36 +629,46 @@ func (_e *Storage_Expecter) SimpleDownload(ctx interface{}, path interface{}) *S func (_c *Storage_SimpleDownload_Call) Run(run func(ctx context.Context, path string)) *Storage_SimpleDownload_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Storage_SimpleDownload_Call) Return(_a0 []byte, _a1 error) *Storage_SimpleDownload_Call { - _c.Call.Return(_a0, _a1) +func (_c *Storage_SimpleDownload_Call) Return(bytes []byte, err error) *Storage_SimpleDownload_Call { + _c.Call.Return(bytes, err) return _c } -func (_c *Storage_SimpleDownload_Call) RunAndReturn(run func(context.Context, string) ([]byte, error)) *Storage_SimpleDownload_Call { +func (_c *Storage_SimpleDownload_Call) RunAndReturn(run func(ctx context.Context, path string) ([]byte, error)) *Storage_SimpleDownload_Call { _c.Call.Return(run) return _c } -// SimpleUpload provides a mock function with given fields: ctx, uploadpath, content -func (_m *Storage) SimpleUpload(ctx context.Context, uploadpath string, content []byte) error { - ret := _m.Called(ctx, uploadpath, content) +// SimpleUpload provides a mock function for the type Storage +func (_mock *Storage) SimpleUpload(ctx context.Context, uploadpath string, content []byte) error { + ret := _mock.Called(ctx, uploadpath, content) if len(ret) == 0 { panic("no return value specified for SimpleUpload") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, []byte) error); ok { - r0 = rf(ctx, uploadpath, content) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, []byte) error); ok { + r0 = returnFunc(ctx, uploadpath, content) } else { r0 = ret.Error(0) } - return r0 } @@ -584,24 +687,40 @@ func (_e *Storage_Expecter) SimpleUpload(ctx interface{}, uploadpath interface{} func (_c *Storage_SimpleUpload_Call) Run(run func(ctx context.Context, uploadpath string, content []byte)) *Storage_SimpleUpload_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].([]byte)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 []byte + if args[2] != nil { + arg2 = args[2].([]byte) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *Storage_SimpleUpload_Call) Return(_a0 error) *Storage_SimpleUpload_Call { - _c.Call.Return(_a0) +func (_c *Storage_SimpleUpload_Call) Return(err error) *Storage_SimpleUpload_Call { + _c.Call.Return(err) return _c } -func (_c *Storage_SimpleUpload_Call) RunAndReturn(run func(context.Context, string, []byte) error) *Storage_SimpleUpload_Call { +func (_c *Storage_SimpleUpload_Call) RunAndReturn(run func(ctx context.Context, uploadpath string, content []byte) error) *Storage_SimpleUpload_Call { _c.Call.Return(run) return _c } -// Stat provides a mock function with given fields: ctx, path -func (_m *Storage) Stat(ctx context.Context, path string) (*providerv1beta1.ResourceInfo, error) { - ret := _m.Called(ctx, path) +// Stat provides a mock function for the type Storage +func (_mock *Storage) Stat(ctx context.Context, path string) (*providerv1beta1.ResourceInfo, error) { + ret := _mock.Called(ctx, path) if len(ret) == 0 { panic("no return value specified for Stat") @@ -609,23 +728,21 @@ func (_m *Storage) Stat(ctx context.Context, path string) (*providerv1beta1.Reso var r0 *providerv1beta1.ResourceInfo var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*providerv1beta1.ResourceInfo, error)); ok { - return rf(ctx, path) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*providerv1beta1.ResourceInfo, error)); ok { + return returnFunc(ctx, path) } - if rf, ok := ret.Get(0).(func(context.Context, string) *providerv1beta1.ResourceInfo); ok { - r0 = rf(ctx, path) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) *providerv1beta1.ResourceInfo); ok { + r0 = returnFunc(ctx, path) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*providerv1beta1.ResourceInfo) } } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, path) + if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = returnFunc(ctx, path) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -643,24 +760,35 @@ func (_e *Storage_Expecter) Stat(ctx interface{}, path interface{}) *Storage_Sta func (_c *Storage_Stat_Call) Run(run func(ctx context.Context, path string)) *Storage_Stat_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Storage_Stat_Call) Return(_a0 *providerv1beta1.ResourceInfo, _a1 error) *Storage_Stat_Call { - _c.Call.Return(_a0, _a1) +func (_c *Storage_Stat_Call) Return(resourceInfo *providerv1beta1.ResourceInfo, err error) *Storage_Stat_Call { + _c.Call.Return(resourceInfo, err) return _c } -func (_c *Storage_Stat_Call) RunAndReturn(run func(context.Context, string) (*providerv1beta1.ResourceInfo, error)) *Storage_Stat_Call { +func (_c *Storage_Stat_Call) RunAndReturn(run func(ctx context.Context, path string) (*providerv1beta1.ResourceInfo, error)) *Storage_Stat_Call { _c.Call.Return(run) return _c } -// Upload provides a mock function with given fields: ctx, req -func (_m *Storage) Upload(ctx context.Context, req metadata.UploadRequest) (*metadata.UploadResponse, error) { - ret := _m.Called(ctx, req) +// Upload provides a mock function for the type Storage +func (_mock *Storage) Upload(ctx context.Context, req metadata.UploadRequest) (*metadata.UploadResponse, error) { + ret := _mock.Called(ctx, req) if len(ret) == 0 { panic("no return value specified for Upload") @@ -668,23 +796,21 @@ func (_m *Storage) Upload(ctx context.Context, req metadata.UploadRequest) (*met var r0 *metadata.UploadResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, metadata.UploadRequest) (*metadata.UploadResponse, error)); ok { - return rf(ctx, req) + if returnFunc, ok := ret.Get(0).(func(context.Context, metadata.UploadRequest) (*metadata.UploadResponse, error)); ok { + return returnFunc(ctx, req) } - if rf, ok := ret.Get(0).(func(context.Context, metadata.UploadRequest) *metadata.UploadResponse); ok { - r0 = rf(ctx, req) + if returnFunc, ok := ret.Get(0).(func(context.Context, metadata.UploadRequest) *metadata.UploadResponse); ok { + r0 = returnFunc(ctx, req) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*metadata.UploadResponse) } } - - if rf, ok := ret.Get(1).(func(context.Context, metadata.UploadRequest) error); ok { - r1 = rf(ctx, req) + if returnFunc, ok := ret.Get(1).(func(context.Context, metadata.UploadRequest) error); ok { + r1 = returnFunc(ctx, req) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -702,31 +828,28 @@ func (_e *Storage_Expecter) Upload(ctx interface{}, req interface{}) *Storage_Up func (_c *Storage_Upload_Call) Run(run func(ctx context.Context, req metadata.UploadRequest)) *Storage_Upload_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(metadata.UploadRequest)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 metadata.UploadRequest + if args[1] != nil { + arg1 = args[1].(metadata.UploadRequest) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Storage_Upload_Call) Return(_a0 *metadata.UploadResponse, _a1 error) *Storage_Upload_Call { - _c.Call.Return(_a0, _a1) +func (_c *Storage_Upload_Call) Return(uploadResponse *metadata.UploadResponse, err error) *Storage_Upload_Call { + _c.Call.Return(uploadResponse, err) return _c } -func (_c *Storage_Upload_Call) RunAndReturn(run func(context.Context, metadata.UploadRequest) (*metadata.UploadResponse, error)) *Storage_Upload_Call { +func (_c *Storage_Upload_Call) RunAndReturn(run func(ctx context.Context, req metadata.UploadRequest) (*metadata.UploadResponse, error)) *Storage_Upload_Call { _c.Call.Return(run) return _c } - -// NewStorage creates a new instance of Storage. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewStorage(t interface { - mock.TestingT - Cleanup(func()) -}) *Storage { - mock := &Storage{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/services/graph/mocks/users_user_profile_photo_provider.go b/services/graph/mocks/users_user_profile_photo_provider.go index faeb8f1a8d..66bc5c622c 100644 --- a/services/graph/mocks/users_user_profile_photo_provider.go +++ b/services/graph/mocks/users_user_profile_photo_provider.go @@ -1,14 +1,30 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" - io "io" + "context" + "io" mock "github.com/stretchr/testify/mock" ) +// NewUsersUserProfilePhotoProvider creates a new instance of UsersUserProfilePhotoProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewUsersUserProfilePhotoProvider(t interface { + mock.TestingT + Cleanup(func()) +}) *UsersUserProfilePhotoProvider { + mock := &UsersUserProfilePhotoProvider{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // UsersUserProfilePhotoProvider is an autogenerated mock type for the UsersUserProfilePhotoProvider type type UsersUserProfilePhotoProvider struct { mock.Mock @@ -22,21 +38,20 @@ func (_m *UsersUserProfilePhotoProvider) EXPECT() *UsersUserProfilePhotoProvider return &UsersUserProfilePhotoProvider_Expecter{mock: &_m.Mock} } -// DeletePhoto provides a mock function with given fields: ctx, id -func (_m *UsersUserProfilePhotoProvider) DeletePhoto(ctx context.Context, id string) error { - ret := _m.Called(ctx, id) +// DeletePhoto provides a mock function for the type UsersUserProfilePhotoProvider +func (_mock *UsersUserProfilePhotoProvider) DeletePhoto(ctx context.Context, id string) error { + ret := _mock.Called(ctx, id) if len(ret) == 0 { panic("no return value specified for DeletePhoto") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { - r0 = rf(ctx, id) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = returnFunc(ctx, id) } else { r0 = ret.Error(0) } - return r0 } @@ -54,24 +69,35 @@ func (_e *UsersUserProfilePhotoProvider_Expecter) DeletePhoto(ctx interface{}, i func (_c *UsersUserProfilePhotoProvider_DeletePhoto_Call) Run(run func(ctx context.Context, id string)) *UsersUserProfilePhotoProvider_DeletePhoto_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *UsersUserProfilePhotoProvider_DeletePhoto_Call) Return(_a0 error) *UsersUserProfilePhotoProvider_DeletePhoto_Call { - _c.Call.Return(_a0) +func (_c *UsersUserProfilePhotoProvider_DeletePhoto_Call) Return(err error) *UsersUserProfilePhotoProvider_DeletePhoto_Call { + _c.Call.Return(err) return _c } -func (_c *UsersUserProfilePhotoProvider_DeletePhoto_Call) RunAndReturn(run func(context.Context, string) error) *UsersUserProfilePhotoProvider_DeletePhoto_Call { +func (_c *UsersUserProfilePhotoProvider_DeletePhoto_Call) RunAndReturn(run func(ctx context.Context, id string) error) *UsersUserProfilePhotoProvider_DeletePhoto_Call { _c.Call.Return(run) return _c } -// GetPhoto provides a mock function with given fields: ctx, id -func (_m *UsersUserProfilePhotoProvider) GetPhoto(ctx context.Context, id string) ([]byte, error) { - ret := _m.Called(ctx, id) +// GetPhoto provides a mock function for the type UsersUserProfilePhotoProvider +func (_mock *UsersUserProfilePhotoProvider) GetPhoto(ctx context.Context, id string) ([]byte, error) { + ret := _mock.Called(ctx, id) if len(ret) == 0 { panic("no return value specified for GetPhoto") @@ -79,23 +105,21 @@ func (_m *UsersUserProfilePhotoProvider) GetPhoto(ctx context.Context, id string var r0 []byte var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) ([]byte, error)); ok { - return rf(ctx, id) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) ([]byte, error)); ok { + return returnFunc(ctx, id) } - if rf, ok := ret.Get(0).(func(context.Context, string) []byte); ok { - r0 = rf(ctx, id) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) []byte); ok { + r0 = returnFunc(ctx, id) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]byte) } } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, id) + if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = returnFunc(ctx, id) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -113,36 +137,46 @@ func (_e *UsersUserProfilePhotoProvider_Expecter) GetPhoto(ctx interface{}, id i func (_c *UsersUserProfilePhotoProvider_GetPhoto_Call) Run(run func(ctx context.Context, id string)) *UsersUserProfilePhotoProvider_GetPhoto_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *UsersUserProfilePhotoProvider_GetPhoto_Call) Return(_a0 []byte, _a1 error) *UsersUserProfilePhotoProvider_GetPhoto_Call { - _c.Call.Return(_a0, _a1) +func (_c *UsersUserProfilePhotoProvider_GetPhoto_Call) Return(bytes []byte, err error) *UsersUserProfilePhotoProvider_GetPhoto_Call { + _c.Call.Return(bytes, err) return _c } -func (_c *UsersUserProfilePhotoProvider_GetPhoto_Call) RunAndReturn(run func(context.Context, string) ([]byte, error)) *UsersUserProfilePhotoProvider_GetPhoto_Call { +func (_c *UsersUserProfilePhotoProvider_GetPhoto_Call) RunAndReturn(run func(ctx context.Context, id string) ([]byte, error)) *UsersUserProfilePhotoProvider_GetPhoto_Call { _c.Call.Return(run) return _c } -// UpdatePhoto provides a mock function with given fields: ctx, id, r -func (_m *UsersUserProfilePhotoProvider) UpdatePhoto(ctx context.Context, id string, r io.Reader) error { - ret := _m.Called(ctx, id, r) +// UpdatePhoto provides a mock function for the type UsersUserProfilePhotoProvider +func (_mock *UsersUserProfilePhotoProvider) UpdatePhoto(ctx context.Context, id string, r io.Reader) error { + ret := _mock.Called(ctx, id, r) if len(ret) == 0 { panic("no return value specified for UpdatePhoto") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, io.Reader) error); ok { - r0 = rf(ctx, id, r) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, io.Reader) error); ok { + r0 = returnFunc(ctx, id, r) } else { r0 = ret.Error(0) } - return r0 } @@ -161,31 +195,33 @@ func (_e *UsersUserProfilePhotoProvider_Expecter) UpdatePhoto(ctx interface{}, i func (_c *UsersUserProfilePhotoProvider_UpdatePhoto_Call) Run(run func(ctx context.Context, id string, r io.Reader)) *UsersUserProfilePhotoProvider_UpdatePhoto_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(io.Reader)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 io.Reader + if args[2] != nil { + arg2 = args[2].(io.Reader) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *UsersUserProfilePhotoProvider_UpdatePhoto_Call) Return(_a0 error) *UsersUserProfilePhotoProvider_UpdatePhoto_Call { - _c.Call.Return(_a0) +func (_c *UsersUserProfilePhotoProvider_UpdatePhoto_Call) Return(err error) *UsersUserProfilePhotoProvider_UpdatePhoto_Call { + _c.Call.Return(err) return _c } -func (_c *UsersUserProfilePhotoProvider_UpdatePhoto_Call) RunAndReturn(run func(context.Context, string, io.Reader) error) *UsersUserProfilePhotoProvider_UpdatePhoto_Call { +func (_c *UsersUserProfilePhotoProvider_UpdatePhoto_Call) RunAndReturn(run func(ctx context.Context, id string, r io.Reader) error) *UsersUserProfilePhotoProvider_UpdatePhoto_Call { _c.Call.Return(run) return _c } - -// NewUsersUserProfilePhotoProvider creates a new instance of UsersUserProfilePhotoProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewUsersUserProfilePhotoProvider(t interface { - mock.TestingT - Cleanup(func()) -}) *UsersUserProfilePhotoProvider { - mock := &UsersUserProfilePhotoProvider{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/services/graph/pkg/identity/mocks/backend.go b/services/graph/pkg/identity/mocks/backend.go index cf272dfad8..ec056e5e80 100644 --- a/services/graph/pkg/identity/mocks/backend.go +++ b/services/graph/pkg/identity/mocks/backend.go @@ -1,21 +1,33 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" - - godata "github.com/CiscoM31/godata" - - libregraph "github.com/opencloud-eu/libre-graph-api-go" + "context" + "net/url" + "time" + "github.com/CiscoM31/godata" + "github.com/opencloud-eu/libre-graph-api-go" mock "github.com/stretchr/testify/mock" - - time "time" - - url "net/url" ) +// NewBackend creates a new instance of Backend. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewBackend(t interface { + mock.TestingT + Cleanup(func()) +}) *Backend { + mock := &Backend{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // Backend is an autogenerated mock type for the Backend type type Backend struct { mock.Mock @@ -29,21 +41,20 @@ func (_m *Backend) EXPECT() *Backend_Expecter { return &Backend_Expecter{mock: &_m.Mock} } -// AddMembersToGroup provides a mock function with given fields: ctx, groupID, memberID -func (_m *Backend) AddMembersToGroup(ctx context.Context, groupID string, memberID []string) error { - ret := _m.Called(ctx, groupID, memberID) +// AddMembersToGroup provides a mock function for the type Backend +func (_mock *Backend) AddMembersToGroup(ctx context.Context, groupID string, memberID []string) error { + ret := _mock.Called(ctx, groupID, memberID) if len(ret) == 0 { panic("no return value specified for AddMembersToGroup") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, []string) error); ok { - r0 = rf(ctx, groupID, memberID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, []string) error); ok { + r0 = returnFunc(ctx, groupID, memberID) } else { r0 = ret.Error(0) } - return r0 } @@ -62,24 +73,40 @@ func (_e *Backend_Expecter) AddMembersToGroup(ctx interface{}, groupID interface func (_c *Backend_AddMembersToGroup_Call) Run(run func(ctx context.Context, groupID string, memberID []string)) *Backend_AddMembersToGroup_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].([]string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 []string + if args[2] != nil { + arg2 = args[2].([]string) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *Backend_AddMembersToGroup_Call) Return(_a0 error) *Backend_AddMembersToGroup_Call { - _c.Call.Return(_a0) +func (_c *Backend_AddMembersToGroup_Call) Return(err error) *Backend_AddMembersToGroup_Call { + _c.Call.Return(err) return _c } -func (_c *Backend_AddMembersToGroup_Call) RunAndReturn(run func(context.Context, string, []string) error) *Backend_AddMembersToGroup_Call { +func (_c *Backend_AddMembersToGroup_Call) RunAndReturn(run func(ctx context.Context, groupID string, memberID []string) error) *Backend_AddMembersToGroup_Call { _c.Call.Return(run) return _c } -// CreateGroup provides a mock function with given fields: ctx, group -func (_m *Backend) CreateGroup(ctx context.Context, group libregraph.Group) (*libregraph.Group, error) { - ret := _m.Called(ctx, group) +// CreateGroup provides a mock function for the type Backend +func (_mock *Backend) CreateGroup(ctx context.Context, group libregraph.Group) (*libregraph.Group, error) { + ret := _mock.Called(ctx, group) if len(ret) == 0 { panic("no return value specified for CreateGroup") @@ -87,23 +114,21 @@ func (_m *Backend) CreateGroup(ctx context.Context, group libregraph.Group) (*li var r0 *libregraph.Group var r1 error - if rf, ok := ret.Get(0).(func(context.Context, libregraph.Group) (*libregraph.Group, error)); ok { - return rf(ctx, group) + if returnFunc, ok := ret.Get(0).(func(context.Context, libregraph.Group) (*libregraph.Group, error)); ok { + return returnFunc(ctx, group) } - if rf, ok := ret.Get(0).(func(context.Context, libregraph.Group) *libregraph.Group); ok { - r0 = rf(ctx, group) + if returnFunc, ok := ret.Get(0).(func(context.Context, libregraph.Group) *libregraph.Group); ok { + r0 = returnFunc(ctx, group) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*libregraph.Group) } } - - if rf, ok := ret.Get(1).(func(context.Context, libregraph.Group) error); ok { - r1 = rf(ctx, group) + if returnFunc, ok := ret.Get(1).(func(context.Context, libregraph.Group) error); ok { + r1 = returnFunc(ctx, group) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -121,24 +146,35 @@ func (_e *Backend_Expecter) CreateGroup(ctx interface{}, group interface{}) *Bac func (_c *Backend_CreateGroup_Call) Run(run func(ctx context.Context, group libregraph.Group)) *Backend_CreateGroup_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(libregraph.Group)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 libregraph.Group + if args[1] != nil { + arg1 = args[1].(libregraph.Group) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Backend_CreateGroup_Call) Return(_a0 *libregraph.Group, _a1 error) *Backend_CreateGroup_Call { - _c.Call.Return(_a0, _a1) +func (_c *Backend_CreateGroup_Call) Return(group1 *libregraph.Group, err error) *Backend_CreateGroup_Call { + _c.Call.Return(group1, err) return _c } -func (_c *Backend_CreateGroup_Call) RunAndReturn(run func(context.Context, libregraph.Group) (*libregraph.Group, error)) *Backend_CreateGroup_Call { +func (_c *Backend_CreateGroup_Call) RunAndReturn(run func(ctx context.Context, group libregraph.Group) (*libregraph.Group, error)) *Backend_CreateGroup_Call { _c.Call.Return(run) return _c } -// CreateUser provides a mock function with given fields: ctx, user -func (_m *Backend) CreateUser(ctx context.Context, user libregraph.User) (*libregraph.User, error) { - ret := _m.Called(ctx, user) +// CreateUser provides a mock function for the type Backend +func (_mock *Backend) CreateUser(ctx context.Context, user libregraph.User) (*libregraph.User, error) { + ret := _mock.Called(ctx, user) if len(ret) == 0 { panic("no return value specified for CreateUser") @@ -146,23 +182,21 @@ func (_m *Backend) CreateUser(ctx context.Context, user libregraph.User) (*libre var r0 *libregraph.User var r1 error - if rf, ok := ret.Get(0).(func(context.Context, libregraph.User) (*libregraph.User, error)); ok { - return rf(ctx, user) + if returnFunc, ok := ret.Get(0).(func(context.Context, libregraph.User) (*libregraph.User, error)); ok { + return returnFunc(ctx, user) } - if rf, ok := ret.Get(0).(func(context.Context, libregraph.User) *libregraph.User); ok { - r0 = rf(ctx, user) + if returnFunc, ok := ret.Get(0).(func(context.Context, libregraph.User) *libregraph.User); ok { + r0 = returnFunc(ctx, user) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*libregraph.User) } } - - if rf, ok := ret.Get(1).(func(context.Context, libregraph.User) error); ok { - r1 = rf(ctx, user) + if returnFunc, ok := ret.Get(1).(func(context.Context, libregraph.User) error); ok { + r1 = returnFunc(ctx, user) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -180,36 +214,46 @@ func (_e *Backend_Expecter) CreateUser(ctx interface{}, user interface{}) *Backe func (_c *Backend_CreateUser_Call) Run(run func(ctx context.Context, user libregraph.User)) *Backend_CreateUser_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(libregraph.User)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 libregraph.User + if args[1] != nil { + arg1 = args[1].(libregraph.User) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Backend_CreateUser_Call) Return(_a0 *libregraph.User, _a1 error) *Backend_CreateUser_Call { - _c.Call.Return(_a0, _a1) +func (_c *Backend_CreateUser_Call) Return(user1 *libregraph.User, err error) *Backend_CreateUser_Call { + _c.Call.Return(user1, err) return _c } -func (_c *Backend_CreateUser_Call) RunAndReturn(run func(context.Context, libregraph.User) (*libregraph.User, error)) *Backend_CreateUser_Call { +func (_c *Backend_CreateUser_Call) RunAndReturn(run func(ctx context.Context, user libregraph.User) (*libregraph.User, error)) *Backend_CreateUser_Call { _c.Call.Return(run) return _c } -// DeleteGroup provides a mock function with given fields: ctx, id -func (_m *Backend) DeleteGroup(ctx context.Context, id string) error { - ret := _m.Called(ctx, id) +// DeleteGroup provides a mock function for the type Backend +func (_mock *Backend) DeleteGroup(ctx context.Context, id string) error { + ret := _mock.Called(ctx, id) if len(ret) == 0 { panic("no return value specified for DeleteGroup") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { - r0 = rf(ctx, id) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = returnFunc(ctx, id) } else { r0 = ret.Error(0) } - return r0 } @@ -227,36 +271,46 @@ func (_e *Backend_Expecter) DeleteGroup(ctx interface{}, id interface{}) *Backen func (_c *Backend_DeleteGroup_Call) Run(run func(ctx context.Context, id string)) *Backend_DeleteGroup_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Backend_DeleteGroup_Call) Return(_a0 error) *Backend_DeleteGroup_Call { - _c.Call.Return(_a0) +func (_c *Backend_DeleteGroup_Call) Return(err error) *Backend_DeleteGroup_Call { + _c.Call.Return(err) return _c } -func (_c *Backend_DeleteGroup_Call) RunAndReturn(run func(context.Context, string) error) *Backend_DeleteGroup_Call { +func (_c *Backend_DeleteGroup_Call) RunAndReturn(run func(ctx context.Context, id string) error) *Backend_DeleteGroup_Call { _c.Call.Return(run) return _c } -// DeleteUser provides a mock function with given fields: ctx, nameOrID -func (_m *Backend) DeleteUser(ctx context.Context, nameOrID string) error { - ret := _m.Called(ctx, nameOrID) +// DeleteUser provides a mock function for the type Backend +func (_mock *Backend) DeleteUser(ctx context.Context, nameOrID string) error { + ret := _mock.Called(ctx, nameOrID) if len(ret) == 0 { panic("no return value specified for DeleteUser") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { - r0 = rf(ctx, nameOrID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = returnFunc(ctx, nameOrID) } else { r0 = ret.Error(0) } - return r0 } @@ -274,24 +328,35 @@ func (_e *Backend_Expecter) DeleteUser(ctx interface{}, nameOrID interface{}) *B func (_c *Backend_DeleteUser_Call) Run(run func(ctx context.Context, nameOrID string)) *Backend_DeleteUser_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Backend_DeleteUser_Call) Return(_a0 error) *Backend_DeleteUser_Call { - _c.Call.Return(_a0) +func (_c *Backend_DeleteUser_Call) Return(err error) *Backend_DeleteUser_Call { + _c.Call.Return(err) return _c } -func (_c *Backend_DeleteUser_Call) RunAndReturn(run func(context.Context, string) error) *Backend_DeleteUser_Call { +func (_c *Backend_DeleteUser_Call) RunAndReturn(run func(ctx context.Context, nameOrID string) error) *Backend_DeleteUser_Call { _c.Call.Return(run) return _c } -// FilterUsers provides a mock function with given fields: ctx, oreq, filter -func (_m *Backend) FilterUsers(ctx context.Context, oreq *godata.GoDataRequest, filter *godata.ParseNode) ([]*libregraph.User, error) { - ret := _m.Called(ctx, oreq, filter) +// FilterUsers provides a mock function for the type Backend +func (_mock *Backend) FilterUsers(ctx context.Context, oreq *godata.GoDataRequest, filter *godata.ParseNode) ([]*libregraph.User, error) { + ret := _mock.Called(ctx, oreq, filter) if len(ret) == 0 { panic("no return value specified for FilterUsers") @@ -299,23 +364,21 @@ func (_m *Backend) FilterUsers(ctx context.Context, oreq *godata.GoDataRequest, var r0 []*libregraph.User var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *godata.GoDataRequest, *godata.ParseNode) ([]*libregraph.User, error)); ok { - return rf(ctx, oreq, filter) + if returnFunc, ok := ret.Get(0).(func(context.Context, *godata.GoDataRequest, *godata.ParseNode) ([]*libregraph.User, error)); ok { + return returnFunc(ctx, oreq, filter) } - if rf, ok := ret.Get(0).(func(context.Context, *godata.GoDataRequest, *godata.ParseNode) []*libregraph.User); ok { - r0 = rf(ctx, oreq, filter) + if returnFunc, ok := ret.Get(0).(func(context.Context, *godata.GoDataRequest, *godata.ParseNode) []*libregraph.User); ok { + r0 = returnFunc(ctx, oreq, filter) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*libregraph.User) } } - - if rf, ok := ret.Get(1).(func(context.Context, *godata.GoDataRequest, *godata.ParseNode) error); ok { - r1 = rf(ctx, oreq, filter) + if returnFunc, ok := ret.Get(1).(func(context.Context, *godata.GoDataRequest, *godata.ParseNode) error); ok { + r1 = returnFunc(ctx, oreq, filter) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -334,24 +397,40 @@ func (_e *Backend_Expecter) FilterUsers(ctx interface{}, oreq interface{}, filte func (_c *Backend_FilterUsers_Call) Run(run func(ctx context.Context, oreq *godata.GoDataRequest, filter *godata.ParseNode)) *Backend_FilterUsers_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*godata.GoDataRequest), args[2].(*godata.ParseNode)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *godata.GoDataRequest + if args[1] != nil { + arg1 = args[1].(*godata.GoDataRequest) + } + var arg2 *godata.ParseNode + if args[2] != nil { + arg2 = args[2].(*godata.ParseNode) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *Backend_FilterUsers_Call) Return(_a0 []*libregraph.User, _a1 error) *Backend_FilterUsers_Call { - _c.Call.Return(_a0, _a1) +func (_c *Backend_FilterUsers_Call) Return(users []*libregraph.User, err error) *Backend_FilterUsers_Call { + _c.Call.Return(users, err) return _c } -func (_c *Backend_FilterUsers_Call) RunAndReturn(run func(context.Context, *godata.GoDataRequest, *godata.ParseNode) ([]*libregraph.User, error)) *Backend_FilterUsers_Call { +func (_c *Backend_FilterUsers_Call) RunAndReturn(run func(ctx context.Context, oreq *godata.GoDataRequest, filter *godata.ParseNode) ([]*libregraph.User, error)) *Backend_FilterUsers_Call { _c.Call.Return(run) return _c } -// GetGroup provides a mock function with given fields: ctx, nameOrID, queryParam -func (_m *Backend) GetGroup(ctx context.Context, nameOrID string, queryParam url.Values) (*libregraph.Group, error) { - ret := _m.Called(ctx, nameOrID, queryParam) +// GetGroup provides a mock function for the type Backend +func (_mock *Backend) GetGroup(ctx context.Context, nameOrID string, queryParam url.Values) (*libregraph.Group, error) { + ret := _mock.Called(ctx, nameOrID, queryParam) if len(ret) == 0 { panic("no return value specified for GetGroup") @@ -359,23 +438,21 @@ func (_m *Backend) GetGroup(ctx context.Context, nameOrID string, queryParam url var r0 *libregraph.Group var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, url.Values) (*libregraph.Group, error)); ok { - return rf(ctx, nameOrID, queryParam) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, url.Values) (*libregraph.Group, error)); ok { + return returnFunc(ctx, nameOrID, queryParam) } - if rf, ok := ret.Get(0).(func(context.Context, string, url.Values) *libregraph.Group); ok { - r0 = rf(ctx, nameOrID, queryParam) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, url.Values) *libregraph.Group); ok { + r0 = returnFunc(ctx, nameOrID, queryParam) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*libregraph.Group) } } - - if rf, ok := ret.Get(1).(func(context.Context, string, url.Values) error); ok { - r1 = rf(ctx, nameOrID, queryParam) + if returnFunc, ok := ret.Get(1).(func(context.Context, string, url.Values) error); ok { + r1 = returnFunc(ctx, nameOrID, queryParam) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -394,24 +471,40 @@ func (_e *Backend_Expecter) GetGroup(ctx interface{}, nameOrID interface{}, quer func (_c *Backend_GetGroup_Call) Run(run func(ctx context.Context, nameOrID string, queryParam url.Values)) *Backend_GetGroup_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(url.Values)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 url.Values + if args[2] != nil { + arg2 = args[2].(url.Values) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *Backend_GetGroup_Call) Return(_a0 *libregraph.Group, _a1 error) *Backend_GetGroup_Call { - _c.Call.Return(_a0, _a1) +func (_c *Backend_GetGroup_Call) Return(group *libregraph.Group, err error) *Backend_GetGroup_Call { + _c.Call.Return(group, err) return _c } -func (_c *Backend_GetGroup_Call) RunAndReturn(run func(context.Context, string, url.Values) (*libregraph.Group, error)) *Backend_GetGroup_Call { +func (_c *Backend_GetGroup_Call) RunAndReturn(run func(ctx context.Context, nameOrID string, queryParam url.Values) (*libregraph.Group, error)) *Backend_GetGroup_Call { _c.Call.Return(run) return _c } -// GetGroupMembers provides a mock function with given fields: ctx, id, oreq -func (_m *Backend) GetGroupMembers(ctx context.Context, id string, oreq *godata.GoDataRequest) ([]*libregraph.User, error) { - ret := _m.Called(ctx, id, oreq) +// GetGroupMembers provides a mock function for the type Backend +func (_mock *Backend) GetGroupMembers(ctx context.Context, id string, oreq *godata.GoDataRequest) ([]*libregraph.User, error) { + ret := _mock.Called(ctx, id, oreq) if len(ret) == 0 { panic("no return value specified for GetGroupMembers") @@ -419,23 +512,21 @@ func (_m *Backend) GetGroupMembers(ctx context.Context, id string, oreq *godata. var r0 []*libregraph.User var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, *godata.GoDataRequest) ([]*libregraph.User, error)); ok { - return rf(ctx, id, oreq) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, *godata.GoDataRequest) ([]*libregraph.User, error)); ok { + return returnFunc(ctx, id, oreq) } - if rf, ok := ret.Get(0).(func(context.Context, string, *godata.GoDataRequest) []*libregraph.User); ok { - r0 = rf(ctx, id, oreq) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, *godata.GoDataRequest) []*libregraph.User); ok { + r0 = returnFunc(ctx, id, oreq) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*libregraph.User) } } - - if rf, ok := ret.Get(1).(func(context.Context, string, *godata.GoDataRequest) error); ok { - r1 = rf(ctx, id, oreq) + if returnFunc, ok := ret.Get(1).(func(context.Context, string, *godata.GoDataRequest) error); ok { + r1 = returnFunc(ctx, id, oreq) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -454,24 +545,40 @@ func (_e *Backend_Expecter) GetGroupMembers(ctx interface{}, id interface{}, ore func (_c *Backend_GetGroupMembers_Call) Run(run func(ctx context.Context, id string, oreq *godata.GoDataRequest)) *Backend_GetGroupMembers_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(*godata.GoDataRequest)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 *godata.GoDataRequest + if args[2] != nil { + arg2 = args[2].(*godata.GoDataRequest) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *Backend_GetGroupMembers_Call) Return(_a0 []*libregraph.User, _a1 error) *Backend_GetGroupMembers_Call { - _c.Call.Return(_a0, _a1) +func (_c *Backend_GetGroupMembers_Call) Return(users []*libregraph.User, err error) *Backend_GetGroupMembers_Call { + _c.Call.Return(users, err) return _c } -func (_c *Backend_GetGroupMembers_Call) RunAndReturn(run func(context.Context, string, *godata.GoDataRequest) ([]*libregraph.User, error)) *Backend_GetGroupMembers_Call { +func (_c *Backend_GetGroupMembers_Call) RunAndReturn(run func(ctx context.Context, id string, oreq *godata.GoDataRequest) ([]*libregraph.User, error)) *Backend_GetGroupMembers_Call { _c.Call.Return(run) return _c } -// GetGroups provides a mock function with given fields: ctx, oreq -func (_m *Backend) GetGroups(ctx context.Context, oreq *godata.GoDataRequest) ([]*libregraph.Group, error) { - ret := _m.Called(ctx, oreq) +// GetGroups provides a mock function for the type Backend +func (_mock *Backend) GetGroups(ctx context.Context, oreq *godata.GoDataRequest) ([]*libregraph.Group, error) { + ret := _mock.Called(ctx, oreq) if len(ret) == 0 { panic("no return value specified for GetGroups") @@ -479,23 +586,21 @@ func (_m *Backend) GetGroups(ctx context.Context, oreq *godata.GoDataRequest) ([ var r0 []*libregraph.Group var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *godata.GoDataRequest) ([]*libregraph.Group, error)); ok { - return rf(ctx, oreq) + if returnFunc, ok := ret.Get(0).(func(context.Context, *godata.GoDataRequest) ([]*libregraph.Group, error)); ok { + return returnFunc(ctx, oreq) } - if rf, ok := ret.Get(0).(func(context.Context, *godata.GoDataRequest) []*libregraph.Group); ok { - r0 = rf(ctx, oreq) + if returnFunc, ok := ret.Get(0).(func(context.Context, *godata.GoDataRequest) []*libregraph.Group); ok { + r0 = returnFunc(ctx, oreq) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*libregraph.Group) } } - - if rf, ok := ret.Get(1).(func(context.Context, *godata.GoDataRequest) error); ok { - r1 = rf(ctx, oreq) + if returnFunc, ok := ret.Get(1).(func(context.Context, *godata.GoDataRequest) error); ok { + r1 = returnFunc(ctx, oreq) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -513,24 +618,35 @@ func (_e *Backend_Expecter) GetGroups(ctx interface{}, oreq interface{}) *Backen func (_c *Backend_GetGroups_Call) Run(run func(ctx context.Context, oreq *godata.GoDataRequest)) *Backend_GetGroups_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*godata.GoDataRequest)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *godata.GoDataRequest + if args[1] != nil { + arg1 = args[1].(*godata.GoDataRequest) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Backend_GetGroups_Call) Return(_a0 []*libregraph.Group, _a1 error) *Backend_GetGroups_Call { - _c.Call.Return(_a0, _a1) +func (_c *Backend_GetGroups_Call) Return(groups []*libregraph.Group, err error) *Backend_GetGroups_Call { + _c.Call.Return(groups, err) return _c } -func (_c *Backend_GetGroups_Call) RunAndReturn(run func(context.Context, *godata.GoDataRequest) ([]*libregraph.Group, error)) *Backend_GetGroups_Call { +func (_c *Backend_GetGroups_Call) RunAndReturn(run func(ctx context.Context, oreq *godata.GoDataRequest) ([]*libregraph.Group, error)) *Backend_GetGroups_Call { _c.Call.Return(run) return _c } -// GetUser provides a mock function with given fields: ctx, nameOrID, oreq -func (_m *Backend) GetUser(ctx context.Context, nameOrID string, oreq *godata.GoDataRequest) (*libregraph.User, error) { - ret := _m.Called(ctx, nameOrID, oreq) +// GetUser provides a mock function for the type Backend +func (_mock *Backend) GetUser(ctx context.Context, nameOrID string, oreq *godata.GoDataRequest) (*libregraph.User, error) { + ret := _mock.Called(ctx, nameOrID, oreq) if len(ret) == 0 { panic("no return value specified for GetUser") @@ -538,23 +654,21 @@ func (_m *Backend) GetUser(ctx context.Context, nameOrID string, oreq *godata.Go var r0 *libregraph.User var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, *godata.GoDataRequest) (*libregraph.User, error)); ok { - return rf(ctx, nameOrID, oreq) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, *godata.GoDataRequest) (*libregraph.User, error)); ok { + return returnFunc(ctx, nameOrID, oreq) } - if rf, ok := ret.Get(0).(func(context.Context, string, *godata.GoDataRequest) *libregraph.User); ok { - r0 = rf(ctx, nameOrID, oreq) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, *godata.GoDataRequest) *libregraph.User); ok { + r0 = returnFunc(ctx, nameOrID, oreq) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*libregraph.User) } } - - if rf, ok := ret.Get(1).(func(context.Context, string, *godata.GoDataRequest) error); ok { - r1 = rf(ctx, nameOrID, oreq) + if returnFunc, ok := ret.Get(1).(func(context.Context, string, *godata.GoDataRequest) error); ok { + r1 = returnFunc(ctx, nameOrID, oreq) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -573,24 +687,40 @@ func (_e *Backend_Expecter) GetUser(ctx interface{}, nameOrID interface{}, oreq func (_c *Backend_GetUser_Call) Run(run func(ctx context.Context, nameOrID string, oreq *godata.GoDataRequest)) *Backend_GetUser_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(*godata.GoDataRequest)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 *godata.GoDataRequest + if args[2] != nil { + arg2 = args[2].(*godata.GoDataRequest) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *Backend_GetUser_Call) Return(_a0 *libregraph.User, _a1 error) *Backend_GetUser_Call { - _c.Call.Return(_a0, _a1) +func (_c *Backend_GetUser_Call) Return(user *libregraph.User, err error) *Backend_GetUser_Call { + _c.Call.Return(user, err) return _c } -func (_c *Backend_GetUser_Call) RunAndReturn(run func(context.Context, string, *godata.GoDataRequest) (*libregraph.User, error)) *Backend_GetUser_Call { +func (_c *Backend_GetUser_Call) RunAndReturn(run func(ctx context.Context, nameOrID string, oreq *godata.GoDataRequest) (*libregraph.User, error)) *Backend_GetUser_Call { _c.Call.Return(run) return _c } -// GetUsers provides a mock function with given fields: ctx, oreq -func (_m *Backend) GetUsers(ctx context.Context, oreq *godata.GoDataRequest) ([]*libregraph.User, error) { - ret := _m.Called(ctx, oreq) +// GetUsers provides a mock function for the type Backend +func (_mock *Backend) GetUsers(ctx context.Context, oreq *godata.GoDataRequest) ([]*libregraph.User, error) { + ret := _mock.Called(ctx, oreq) if len(ret) == 0 { panic("no return value specified for GetUsers") @@ -598,23 +728,21 @@ func (_m *Backend) GetUsers(ctx context.Context, oreq *godata.GoDataRequest) ([] var r0 []*libregraph.User var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *godata.GoDataRequest) ([]*libregraph.User, error)); ok { - return rf(ctx, oreq) + if returnFunc, ok := ret.Get(0).(func(context.Context, *godata.GoDataRequest) ([]*libregraph.User, error)); ok { + return returnFunc(ctx, oreq) } - if rf, ok := ret.Get(0).(func(context.Context, *godata.GoDataRequest) []*libregraph.User); ok { - r0 = rf(ctx, oreq) + if returnFunc, ok := ret.Get(0).(func(context.Context, *godata.GoDataRequest) []*libregraph.User); ok { + r0 = returnFunc(ctx, oreq) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*libregraph.User) } } - - if rf, ok := ret.Get(1).(func(context.Context, *godata.GoDataRequest) error); ok { - r1 = rf(ctx, oreq) + if returnFunc, ok := ret.Get(1).(func(context.Context, *godata.GoDataRequest) error); ok { + r1 = returnFunc(ctx, oreq) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -632,36 +760,46 @@ func (_e *Backend_Expecter) GetUsers(ctx interface{}, oreq interface{}) *Backend func (_c *Backend_GetUsers_Call) Run(run func(ctx context.Context, oreq *godata.GoDataRequest)) *Backend_GetUsers_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*godata.GoDataRequest)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *godata.GoDataRequest + if args[1] != nil { + arg1 = args[1].(*godata.GoDataRequest) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Backend_GetUsers_Call) Return(_a0 []*libregraph.User, _a1 error) *Backend_GetUsers_Call { - _c.Call.Return(_a0, _a1) +func (_c *Backend_GetUsers_Call) Return(users []*libregraph.User, err error) *Backend_GetUsers_Call { + _c.Call.Return(users, err) return _c } -func (_c *Backend_GetUsers_Call) RunAndReturn(run func(context.Context, *godata.GoDataRequest) ([]*libregraph.User, error)) *Backend_GetUsers_Call { +func (_c *Backend_GetUsers_Call) RunAndReturn(run func(ctx context.Context, oreq *godata.GoDataRequest) ([]*libregraph.User, error)) *Backend_GetUsers_Call { _c.Call.Return(run) return _c } -// RemoveMemberFromGroup provides a mock function with given fields: ctx, groupID, memberID -func (_m *Backend) RemoveMemberFromGroup(ctx context.Context, groupID string, memberID string) error { - ret := _m.Called(ctx, groupID, memberID) +// RemoveMemberFromGroup provides a mock function for the type Backend +func (_mock *Backend) RemoveMemberFromGroup(ctx context.Context, groupID string, memberID string) error { + ret := _mock.Called(ctx, groupID, memberID) if len(ret) == 0 { panic("no return value specified for RemoveMemberFromGroup") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { - r0 = rf(ctx, groupID, memberID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = returnFunc(ctx, groupID, memberID) } else { r0 = ret.Error(0) } - return r0 } @@ -680,36 +818,51 @@ func (_e *Backend_Expecter) RemoveMemberFromGroup(ctx interface{}, groupID inter func (_c *Backend_RemoveMemberFromGroup_Call) Run(run func(ctx context.Context, groupID string, memberID string)) *Backend_RemoveMemberFromGroup_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *Backend_RemoveMemberFromGroup_Call) Return(_a0 error) *Backend_RemoveMemberFromGroup_Call { - _c.Call.Return(_a0) +func (_c *Backend_RemoveMemberFromGroup_Call) Return(err error) *Backend_RemoveMemberFromGroup_Call { + _c.Call.Return(err) return _c } -func (_c *Backend_RemoveMemberFromGroup_Call) RunAndReturn(run func(context.Context, string, string) error) *Backend_RemoveMemberFromGroup_Call { +func (_c *Backend_RemoveMemberFromGroup_Call) RunAndReturn(run func(ctx context.Context, groupID string, memberID string) error) *Backend_RemoveMemberFromGroup_Call { _c.Call.Return(run) return _c } -// UpdateGroupName provides a mock function with given fields: ctx, groupID, groupName -func (_m *Backend) UpdateGroupName(ctx context.Context, groupID string, groupName string) error { - ret := _m.Called(ctx, groupID, groupName) +// UpdateGroupName provides a mock function for the type Backend +func (_mock *Backend) UpdateGroupName(ctx context.Context, groupID string, groupName string) error { + ret := _mock.Called(ctx, groupID, groupName) if len(ret) == 0 { panic("no return value specified for UpdateGroupName") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { - r0 = rf(ctx, groupID, groupName) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = returnFunc(ctx, groupID, groupName) } else { r0 = ret.Error(0) } - return r0 } @@ -728,36 +881,51 @@ func (_e *Backend_Expecter) UpdateGroupName(ctx interface{}, groupID interface{} func (_c *Backend_UpdateGroupName_Call) Run(run func(ctx context.Context, groupID string, groupName string)) *Backend_UpdateGroupName_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *Backend_UpdateGroupName_Call) Return(_a0 error) *Backend_UpdateGroupName_Call { - _c.Call.Return(_a0) +func (_c *Backend_UpdateGroupName_Call) Return(err error) *Backend_UpdateGroupName_Call { + _c.Call.Return(err) return _c } -func (_c *Backend_UpdateGroupName_Call) RunAndReturn(run func(context.Context, string, string) error) *Backend_UpdateGroupName_Call { +func (_c *Backend_UpdateGroupName_Call) RunAndReturn(run func(ctx context.Context, groupID string, groupName string) error) *Backend_UpdateGroupName_Call { _c.Call.Return(run) return _c } -// UpdateLastSignInDate provides a mock function with given fields: ctx, userID, timestamp -func (_m *Backend) UpdateLastSignInDate(ctx context.Context, userID string, timestamp time.Time) error { - ret := _m.Called(ctx, userID, timestamp) +// UpdateLastSignInDate provides a mock function for the type Backend +func (_mock *Backend) UpdateLastSignInDate(ctx context.Context, userID string, timestamp time.Time) error { + ret := _mock.Called(ctx, userID, timestamp) if len(ret) == 0 { panic("no return value specified for UpdateLastSignInDate") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, time.Time) error); ok { - r0 = rf(ctx, userID, timestamp) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, time.Time) error); ok { + r0 = returnFunc(ctx, userID, timestamp) } else { r0 = ret.Error(0) } - return r0 } @@ -776,24 +944,40 @@ func (_e *Backend_Expecter) UpdateLastSignInDate(ctx interface{}, userID interfa func (_c *Backend_UpdateLastSignInDate_Call) Run(run func(ctx context.Context, userID string, timestamp time.Time)) *Backend_UpdateLastSignInDate_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(time.Time)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 time.Time + if args[2] != nil { + arg2 = args[2].(time.Time) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *Backend_UpdateLastSignInDate_Call) Return(_a0 error) *Backend_UpdateLastSignInDate_Call { - _c.Call.Return(_a0) +func (_c *Backend_UpdateLastSignInDate_Call) Return(err error) *Backend_UpdateLastSignInDate_Call { + _c.Call.Return(err) return _c } -func (_c *Backend_UpdateLastSignInDate_Call) RunAndReturn(run func(context.Context, string, time.Time) error) *Backend_UpdateLastSignInDate_Call { +func (_c *Backend_UpdateLastSignInDate_Call) RunAndReturn(run func(ctx context.Context, userID string, timestamp time.Time) error) *Backend_UpdateLastSignInDate_Call { _c.Call.Return(run) return _c } -// UpdateUser provides a mock function with given fields: ctx, nameOrID, user -func (_m *Backend) UpdateUser(ctx context.Context, nameOrID string, user libregraph.UserUpdate) (*libregraph.User, error) { - ret := _m.Called(ctx, nameOrID, user) +// UpdateUser provides a mock function for the type Backend +func (_mock *Backend) UpdateUser(ctx context.Context, nameOrID string, user libregraph.UserUpdate) (*libregraph.User, error) { + ret := _mock.Called(ctx, nameOrID, user) if len(ret) == 0 { panic("no return value specified for UpdateUser") @@ -801,23 +985,21 @@ func (_m *Backend) UpdateUser(ctx context.Context, nameOrID string, user libregr var r0 *libregraph.User var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, libregraph.UserUpdate) (*libregraph.User, error)); ok { - return rf(ctx, nameOrID, user) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, libregraph.UserUpdate) (*libregraph.User, error)); ok { + return returnFunc(ctx, nameOrID, user) } - if rf, ok := ret.Get(0).(func(context.Context, string, libregraph.UserUpdate) *libregraph.User); ok { - r0 = rf(ctx, nameOrID, user) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, libregraph.UserUpdate) *libregraph.User); ok { + r0 = returnFunc(ctx, nameOrID, user) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*libregraph.User) } } - - if rf, ok := ret.Get(1).(func(context.Context, string, libregraph.UserUpdate) error); ok { - r1 = rf(ctx, nameOrID, user) + if returnFunc, ok := ret.Get(1).(func(context.Context, string, libregraph.UserUpdate) error); ok { + r1 = returnFunc(ctx, nameOrID, user) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -836,31 +1018,33 @@ func (_e *Backend_Expecter) UpdateUser(ctx interface{}, nameOrID interface{}, us func (_c *Backend_UpdateUser_Call) Run(run func(ctx context.Context, nameOrID string, user libregraph.UserUpdate)) *Backend_UpdateUser_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(libregraph.UserUpdate)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 libregraph.UserUpdate + if args[2] != nil { + arg2 = args[2].(libregraph.UserUpdate) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *Backend_UpdateUser_Call) Return(_a0 *libregraph.User, _a1 error) *Backend_UpdateUser_Call { - _c.Call.Return(_a0, _a1) +func (_c *Backend_UpdateUser_Call) Return(user1 *libregraph.User, err error) *Backend_UpdateUser_Call { + _c.Call.Return(user1, err) return _c } -func (_c *Backend_UpdateUser_Call) RunAndReturn(run func(context.Context, string, libregraph.UserUpdate) (*libregraph.User, error)) *Backend_UpdateUser_Call { +func (_c *Backend_UpdateUser_Call) RunAndReturn(run func(ctx context.Context, nameOrID string, user libregraph.UserUpdate) (*libregraph.User, error)) *Backend_UpdateUser_Call { _c.Call.Return(run) return _c } - -// NewBackend creates a new instance of Backend. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewBackend(t interface { - mock.TestingT - Cleanup(func()) -}) *Backend { - mock := &Backend{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/services/graph/pkg/identity/mocks/education_backend.go b/services/graph/pkg/identity/mocks/education_backend.go index b61c3377f0..08e075bd2f 100644 --- a/services/graph/pkg/identity/mocks/education_backend.go +++ b/services/graph/pkg/identity/mocks/education_backend.go @@ -1,15 +1,30 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" - - libregraph "github.com/opencloud-eu/libre-graph-api-go" + "context" + "github.com/opencloud-eu/libre-graph-api-go" mock "github.com/stretchr/testify/mock" ) +// NewEducationBackend creates a new instance of EducationBackend. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewEducationBackend(t interface { + mock.TestingT + Cleanup(func()) +}) *EducationBackend { + mock := &EducationBackend{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // EducationBackend is an autogenerated mock type for the EducationBackend type type EducationBackend struct { mock.Mock @@ -23,21 +38,20 @@ func (_m *EducationBackend) EXPECT() *EducationBackend_Expecter { return &EducationBackend_Expecter{mock: &_m.Mock} } -// AddClassesToEducationSchool provides a mock function with given fields: ctx, schoolNumberOrID, memberIDs -func (_m *EducationBackend) AddClassesToEducationSchool(ctx context.Context, schoolNumberOrID string, memberIDs []string) error { - ret := _m.Called(ctx, schoolNumberOrID, memberIDs) +// AddClassesToEducationSchool provides a mock function for the type EducationBackend +func (_mock *EducationBackend) AddClassesToEducationSchool(ctx context.Context, schoolNumberOrID string, memberIDs []string) error { + ret := _mock.Called(ctx, schoolNumberOrID, memberIDs) if len(ret) == 0 { panic("no return value specified for AddClassesToEducationSchool") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, []string) error); ok { - r0 = rf(ctx, schoolNumberOrID, memberIDs) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, []string) error); ok { + r0 = returnFunc(ctx, schoolNumberOrID, memberIDs) } else { r0 = ret.Error(0) } - return r0 } @@ -56,36 +70,51 @@ func (_e *EducationBackend_Expecter) AddClassesToEducationSchool(ctx interface{} func (_c *EducationBackend_AddClassesToEducationSchool_Call) Run(run func(ctx context.Context, schoolNumberOrID string, memberIDs []string)) *EducationBackend_AddClassesToEducationSchool_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].([]string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 []string + if args[2] != nil { + arg2 = args[2].([]string) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *EducationBackend_AddClassesToEducationSchool_Call) Return(_a0 error) *EducationBackend_AddClassesToEducationSchool_Call { - _c.Call.Return(_a0) +func (_c *EducationBackend_AddClassesToEducationSchool_Call) Return(err error) *EducationBackend_AddClassesToEducationSchool_Call { + _c.Call.Return(err) return _c } -func (_c *EducationBackend_AddClassesToEducationSchool_Call) RunAndReturn(run func(context.Context, string, []string) error) *EducationBackend_AddClassesToEducationSchool_Call { +func (_c *EducationBackend_AddClassesToEducationSchool_Call) RunAndReturn(run func(ctx context.Context, schoolNumberOrID string, memberIDs []string) error) *EducationBackend_AddClassesToEducationSchool_Call { _c.Call.Return(run) return _c } -// AddTeacherToEducationClass provides a mock function with given fields: ctx, classID, teacherID -func (_m *EducationBackend) AddTeacherToEducationClass(ctx context.Context, classID string, teacherID string) error { - ret := _m.Called(ctx, classID, teacherID) +// AddTeacherToEducationClass provides a mock function for the type EducationBackend +func (_mock *EducationBackend) AddTeacherToEducationClass(ctx context.Context, classID string, teacherID string) error { + ret := _mock.Called(ctx, classID, teacherID) if len(ret) == 0 { panic("no return value specified for AddTeacherToEducationClass") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { - r0 = rf(ctx, classID, teacherID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = returnFunc(ctx, classID, teacherID) } else { r0 = ret.Error(0) } - return r0 } @@ -104,36 +133,51 @@ func (_e *EducationBackend_Expecter) AddTeacherToEducationClass(ctx interface{}, func (_c *EducationBackend_AddTeacherToEducationClass_Call) Run(run func(ctx context.Context, classID string, teacherID string)) *EducationBackend_AddTeacherToEducationClass_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *EducationBackend_AddTeacherToEducationClass_Call) Return(_a0 error) *EducationBackend_AddTeacherToEducationClass_Call { - _c.Call.Return(_a0) +func (_c *EducationBackend_AddTeacherToEducationClass_Call) Return(err error) *EducationBackend_AddTeacherToEducationClass_Call { + _c.Call.Return(err) return _c } -func (_c *EducationBackend_AddTeacherToEducationClass_Call) RunAndReturn(run func(context.Context, string, string) error) *EducationBackend_AddTeacherToEducationClass_Call { +func (_c *EducationBackend_AddTeacherToEducationClass_Call) RunAndReturn(run func(ctx context.Context, classID string, teacherID string) error) *EducationBackend_AddTeacherToEducationClass_Call { _c.Call.Return(run) return _c } -// AddUsersToEducationSchool provides a mock function with given fields: ctx, schoolID, memberID -func (_m *EducationBackend) AddUsersToEducationSchool(ctx context.Context, schoolID string, memberID []string) error { - ret := _m.Called(ctx, schoolID, memberID) +// AddUsersToEducationSchool provides a mock function for the type EducationBackend +func (_mock *EducationBackend) AddUsersToEducationSchool(ctx context.Context, schoolID string, memberID []string) error { + ret := _mock.Called(ctx, schoolID, memberID) if len(ret) == 0 { panic("no return value specified for AddUsersToEducationSchool") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, []string) error); ok { - r0 = rf(ctx, schoolID, memberID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, []string) error); ok { + r0 = returnFunc(ctx, schoolID, memberID) } else { r0 = ret.Error(0) } - return r0 } @@ -152,24 +196,40 @@ func (_e *EducationBackend_Expecter) AddUsersToEducationSchool(ctx interface{}, func (_c *EducationBackend_AddUsersToEducationSchool_Call) Run(run func(ctx context.Context, schoolID string, memberID []string)) *EducationBackend_AddUsersToEducationSchool_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].([]string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 []string + if args[2] != nil { + arg2 = args[2].([]string) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *EducationBackend_AddUsersToEducationSchool_Call) Return(_a0 error) *EducationBackend_AddUsersToEducationSchool_Call { - _c.Call.Return(_a0) +func (_c *EducationBackend_AddUsersToEducationSchool_Call) Return(err error) *EducationBackend_AddUsersToEducationSchool_Call { + _c.Call.Return(err) return _c } -func (_c *EducationBackend_AddUsersToEducationSchool_Call) RunAndReturn(run func(context.Context, string, []string) error) *EducationBackend_AddUsersToEducationSchool_Call { +func (_c *EducationBackend_AddUsersToEducationSchool_Call) RunAndReturn(run func(ctx context.Context, schoolID string, memberID []string) error) *EducationBackend_AddUsersToEducationSchool_Call { _c.Call.Return(run) return _c } -// CreateEducationClass provides a mock function with given fields: ctx, class -func (_m *EducationBackend) CreateEducationClass(ctx context.Context, class libregraph.EducationClass) (*libregraph.EducationClass, error) { - ret := _m.Called(ctx, class) +// CreateEducationClass provides a mock function for the type EducationBackend +func (_mock *EducationBackend) CreateEducationClass(ctx context.Context, class libregraph.EducationClass) (*libregraph.EducationClass, error) { + ret := _mock.Called(ctx, class) if len(ret) == 0 { panic("no return value specified for CreateEducationClass") @@ -177,23 +237,21 @@ func (_m *EducationBackend) CreateEducationClass(ctx context.Context, class libr var r0 *libregraph.EducationClass var r1 error - if rf, ok := ret.Get(0).(func(context.Context, libregraph.EducationClass) (*libregraph.EducationClass, error)); ok { - return rf(ctx, class) + if returnFunc, ok := ret.Get(0).(func(context.Context, libregraph.EducationClass) (*libregraph.EducationClass, error)); ok { + return returnFunc(ctx, class) } - if rf, ok := ret.Get(0).(func(context.Context, libregraph.EducationClass) *libregraph.EducationClass); ok { - r0 = rf(ctx, class) + if returnFunc, ok := ret.Get(0).(func(context.Context, libregraph.EducationClass) *libregraph.EducationClass); ok { + r0 = returnFunc(ctx, class) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*libregraph.EducationClass) } } - - if rf, ok := ret.Get(1).(func(context.Context, libregraph.EducationClass) error); ok { - r1 = rf(ctx, class) + if returnFunc, ok := ret.Get(1).(func(context.Context, libregraph.EducationClass) error); ok { + r1 = returnFunc(ctx, class) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -211,24 +269,35 @@ func (_e *EducationBackend_Expecter) CreateEducationClass(ctx interface{}, class func (_c *EducationBackend_CreateEducationClass_Call) Run(run func(ctx context.Context, class libregraph.EducationClass)) *EducationBackend_CreateEducationClass_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(libregraph.EducationClass)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 libregraph.EducationClass + if args[1] != nil { + arg1 = args[1].(libregraph.EducationClass) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *EducationBackend_CreateEducationClass_Call) Return(_a0 *libregraph.EducationClass, _a1 error) *EducationBackend_CreateEducationClass_Call { - _c.Call.Return(_a0, _a1) +func (_c *EducationBackend_CreateEducationClass_Call) Return(educationClass *libregraph.EducationClass, err error) *EducationBackend_CreateEducationClass_Call { + _c.Call.Return(educationClass, err) return _c } -func (_c *EducationBackend_CreateEducationClass_Call) RunAndReturn(run func(context.Context, libregraph.EducationClass) (*libregraph.EducationClass, error)) *EducationBackend_CreateEducationClass_Call { +func (_c *EducationBackend_CreateEducationClass_Call) RunAndReturn(run func(ctx context.Context, class libregraph.EducationClass) (*libregraph.EducationClass, error)) *EducationBackend_CreateEducationClass_Call { _c.Call.Return(run) return _c } -// CreateEducationSchool provides a mock function with given fields: ctx, group -func (_m *EducationBackend) CreateEducationSchool(ctx context.Context, group libregraph.EducationSchool) (*libregraph.EducationSchool, error) { - ret := _m.Called(ctx, group) +// CreateEducationSchool provides a mock function for the type EducationBackend +func (_mock *EducationBackend) CreateEducationSchool(ctx context.Context, group libregraph.EducationSchool) (*libregraph.EducationSchool, error) { + ret := _mock.Called(ctx, group) if len(ret) == 0 { panic("no return value specified for CreateEducationSchool") @@ -236,23 +305,21 @@ func (_m *EducationBackend) CreateEducationSchool(ctx context.Context, group lib var r0 *libregraph.EducationSchool var r1 error - if rf, ok := ret.Get(0).(func(context.Context, libregraph.EducationSchool) (*libregraph.EducationSchool, error)); ok { - return rf(ctx, group) + if returnFunc, ok := ret.Get(0).(func(context.Context, libregraph.EducationSchool) (*libregraph.EducationSchool, error)); ok { + return returnFunc(ctx, group) } - if rf, ok := ret.Get(0).(func(context.Context, libregraph.EducationSchool) *libregraph.EducationSchool); ok { - r0 = rf(ctx, group) + if returnFunc, ok := ret.Get(0).(func(context.Context, libregraph.EducationSchool) *libregraph.EducationSchool); ok { + r0 = returnFunc(ctx, group) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*libregraph.EducationSchool) } } - - if rf, ok := ret.Get(1).(func(context.Context, libregraph.EducationSchool) error); ok { - r1 = rf(ctx, group) + if returnFunc, ok := ret.Get(1).(func(context.Context, libregraph.EducationSchool) error); ok { + r1 = returnFunc(ctx, group) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -270,24 +337,35 @@ func (_e *EducationBackend_Expecter) CreateEducationSchool(ctx interface{}, grou func (_c *EducationBackend_CreateEducationSchool_Call) Run(run func(ctx context.Context, group libregraph.EducationSchool)) *EducationBackend_CreateEducationSchool_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(libregraph.EducationSchool)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 libregraph.EducationSchool + if args[1] != nil { + arg1 = args[1].(libregraph.EducationSchool) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *EducationBackend_CreateEducationSchool_Call) Return(_a0 *libregraph.EducationSchool, _a1 error) *EducationBackend_CreateEducationSchool_Call { - _c.Call.Return(_a0, _a1) +func (_c *EducationBackend_CreateEducationSchool_Call) Return(educationSchool *libregraph.EducationSchool, err error) *EducationBackend_CreateEducationSchool_Call { + _c.Call.Return(educationSchool, err) return _c } -func (_c *EducationBackend_CreateEducationSchool_Call) RunAndReturn(run func(context.Context, libregraph.EducationSchool) (*libregraph.EducationSchool, error)) *EducationBackend_CreateEducationSchool_Call { +func (_c *EducationBackend_CreateEducationSchool_Call) RunAndReturn(run func(ctx context.Context, group libregraph.EducationSchool) (*libregraph.EducationSchool, error)) *EducationBackend_CreateEducationSchool_Call { _c.Call.Return(run) return _c } -// CreateEducationUser provides a mock function with given fields: ctx, user -func (_m *EducationBackend) CreateEducationUser(ctx context.Context, user libregraph.EducationUser) (*libregraph.EducationUser, error) { - ret := _m.Called(ctx, user) +// CreateEducationUser provides a mock function for the type EducationBackend +func (_mock *EducationBackend) CreateEducationUser(ctx context.Context, user libregraph.EducationUser) (*libregraph.EducationUser, error) { + ret := _mock.Called(ctx, user) if len(ret) == 0 { panic("no return value specified for CreateEducationUser") @@ -295,23 +373,21 @@ func (_m *EducationBackend) CreateEducationUser(ctx context.Context, user libreg var r0 *libregraph.EducationUser var r1 error - if rf, ok := ret.Get(0).(func(context.Context, libregraph.EducationUser) (*libregraph.EducationUser, error)); ok { - return rf(ctx, user) + if returnFunc, ok := ret.Get(0).(func(context.Context, libregraph.EducationUser) (*libregraph.EducationUser, error)); ok { + return returnFunc(ctx, user) } - if rf, ok := ret.Get(0).(func(context.Context, libregraph.EducationUser) *libregraph.EducationUser); ok { - r0 = rf(ctx, user) + if returnFunc, ok := ret.Get(0).(func(context.Context, libregraph.EducationUser) *libregraph.EducationUser); ok { + r0 = returnFunc(ctx, user) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*libregraph.EducationUser) } } - - if rf, ok := ret.Get(1).(func(context.Context, libregraph.EducationUser) error); ok { - r1 = rf(ctx, user) + if returnFunc, ok := ret.Get(1).(func(context.Context, libregraph.EducationUser) error); ok { + r1 = returnFunc(ctx, user) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -329,36 +405,46 @@ func (_e *EducationBackend_Expecter) CreateEducationUser(ctx interface{}, user i func (_c *EducationBackend_CreateEducationUser_Call) Run(run func(ctx context.Context, user libregraph.EducationUser)) *EducationBackend_CreateEducationUser_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(libregraph.EducationUser)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 libregraph.EducationUser + if args[1] != nil { + arg1 = args[1].(libregraph.EducationUser) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *EducationBackend_CreateEducationUser_Call) Return(_a0 *libregraph.EducationUser, _a1 error) *EducationBackend_CreateEducationUser_Call { - _c.Call.Return(_a0, _a1) +func (_c *EducationBackend_CreateEducationUser_Call) Return(educationUser *libregraph.EducationUser, err error) *EducationBackend_CreateEducationUser_Call { + _c.Call.Return(educationUser, err) return _c } -func (_c *EducationBackend_CreateEducationUser_Call) RunAndReturn(run func(context.Context, libregraph.EducationUser) (*libregraph.EducationUser, error)) *EducationBackend_CreateEducationUser_Call { +func (_c *EducationBackend_CreateEducationUser_Call) RunAndReturn(run func(ctx context.Context, user libregraph.EducationUser) (*libregraph.EducationUser, error)) *EducationBackend_CreateEducationUser_Call { _c.Call.Return(run) return _c } -// DeleteEducationClass provides a mock function with given fields: ctx, nameOrID -func (_m *EducationBackend) DeleteEducationClass(ctx context.Context, nameOrID string) error { - ret := _m.Called(ctx, nameOrID) +// DeleteEducationClass provides a mock function for the type EducationBackend +func (_mock *EducationBackend) DeleteEducationClass(ctx context.Context, nameOrID string) error { + ret := _mock.Called(ctx, nameOrID) if len(ret) == 0 { panic("no return value specified for DeleteEducationClass") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { - r0 = rf(ctx, nameOrID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = returnFunc(ctx, nameOrID) } else { r0 = ret.Error(0) } - return r0 } @@ -376,36 +462,46 @@ func (_e *EducationBackend_Expecter) DeleteEducationClass(ctx interface{}, nameO func (_c *EducationBackend_DeleteEducationClass_Call) Run(run func(ctx context.Context, nameOrID string)) *EducationBackend_DeleteEducationClass_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *EducationBackend_DeleteEducationClass_Call) Return(_a0 error) *EducationBackend_DeleteEducationClass_Call { - _c.Call.Return(_a0) +func (_c *EducationBackend_DeleteEducationClass_Call) Return(err error) *EducationBackend_DeleteEducationClass_Call { + _c.Call.Return(err) return _c } -func (_c *EducationBackend_DeleteEducationClass_Call) RunAndReturn(run func(context.Context, string) error) *EducationBackend_DeleteEducationClass_Call { +func (_c *EducationBackend_DeleteEducationClass_Call) RunAndReturn(run func(ctx context.Context, nameOrID string) error) *EducationBackend_DeleteEducationClass_Call { _c.Call.Return(run) return _c } -// DeleteEducationSchool provides a mock function with given fields: ctx, id -func (_m *EducationBackend) DeleteEducationSchool(ctx context.Context, id string) error { - ret := _m.Called(ctx, id) +// DeleteEducationSchool provides a mock function for the type EducationBackend +func (_mock *EducationBackend) DeleteEducationSchool(ctx context.Context, id string) error { + ret := _mock.Called(ctx, id) if len(ret) == 0 { panic("no return value specified for DeleteEducationSchool") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { - r0 = rf(ctx, id) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = returnFunc(ctx, id) } else { r0 = ret.Error(0) } - return r0 } @@ -423,36 +519,46 @@ func (_e *EducationBackend_Expecter) DeleteEducationSchool(ctx interface{}, id i func (_c *EducationBackend_DeleteEducationSchool_Call) Run(run func(ctx context.Context, id string)) *EducationBackend_DeleteEducationSchool_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *EducationBackend_DeleteEducationSchool_Call) Return(_a0 error) *EducationBackend_DeleteEducationSchool_Call { - _c.Call.Return(_a0) +func (_c *EducationBackend_DeleteEducationSchool_Call) Return(err error) *EducationBackend_DeleteEducationSchool_Call { + _c.Call.Return(err) return _c } -func (_c *EducationBackend_DeleteEducationSchool_Call) RunAndReturn(run func(context.Context, string) error) *EducationBackend_DeleteEducationSchool_Call { +func (_c *EducationBackend_DeleteEducationSchool_Call) RunAndReturn(run func(ctx context.Context, id string) error) *EducationBackend_DeleteEducationSchool_Call { _c.Call.Return(run) return _c } -// DeleteEducationUser provides a mock function with given fields: ctx, nameOrID -func (_m *EducationBackend) DeleteEducationUser(ctx context.Context, nameOrID string) error { - ret := _m.Called(ctx, nameOrID) +// DeleteEducationUser provides a mock function for the type EducationBackend +func (_mock *EducationBackend) DeleteEducationUser(ctx context.Context, nameOrID string) error { + ret := _mock.Called(ctx, nameOrID) if len(ret) == 0 { panic("no return value specified for DeleteEducationUser") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { - r0 = rf(ctx, nameOrID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = returnFunc(ctx, nameOrID) } else { r0 = ret.Error(0) } - return r0 } @@ -470,24 +576,35 @@ func (_e *EducationBackend_Expecter) DeleteEducationUser(ctx interface{}, nameOr func (_c *EducationBackend_DeleteEducationUser_Call) Run(run func(ctx context.Context, nameOrID string)) *EducationBackend_DeleteEducationUser_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *EducationBackend_DeleteEducationUser_Call) Return(_a0 error) *EducationBackend_DeleteEducationUser_Call { - _c.Call.Return(_a0) +func (_c *EducationBackend_DeleteEducationUser_Call) Return(err error) *EducationBackend_DeleteEducationUser_Call { + _c.Call.Return(err) return _c } -func (_c *EducationBackend_DeleteEducationUser_Call) RunAndReturn(run func(context.Context, string) error) *EducationBackend_DeleteEducationUser_Call { +func (_c *EducationBackend_DeleteEducationUser_Call) RunAndReturn(run func(ctx context.Context, nameOrID string) error) *EducationBackend_DeleteEducationUser_Call { _c.Call.Return(run) return _c } -// GetEducationClass provides a mock function with given fields: ctx, namedOrID -func (_m *EducationBackend) GetEducationClass(ctx context.Context, namedOrID string) (*libregraph.EducationClass, error) { - ret := _m.Called(ctx, namedOrID) +// GetEducationClass provides a mock function for the type EducationBackend +func (_mock *EducationBackend) GetEducationClass(ctx context.Context, namedOrID string) (*libregraph.EducationClass, error) { + ret := _mock.Called(ctx, namedOrID) if len(ret) == 0 { panic("no return value specified for GetEducationClass") @@ -495,23 +612,21 @@ func (_m *EducationBackend) GetEducationClass(ctx context.Context, namedOrID str var r0 *libregraph.EducationClass var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*libregraph.EducationClass, error)); ok { - return rf(ctx, namedOrID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*libregraph.EducationClass, error)); ok { + return returnFunc(ctx, namedOrID) } - if rf, ok := ret.Get(0).(func(context.Context, string) *libregraph.EducationClass); ok { - r0 = rf(ctx, namedOrID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) *libregraph.EducationClass); ok { + r0 = returnFunc(ctx, namedOrID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*libregraph.EducationClass) } } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, namedOrID) + if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = returnFunc(ctx, namedOrID) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -529,24 +644,35 @@ func (_e *EducationBackend_Expecter) GetEducationClass(ctx interface{}, namedOrI func (_c *EducationBackend_GetEducationClass_Call) Run(run func(ctx context.Context, namedOrID string)) *EducationBackend_GetEducationClass_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *EducationBackend_GetEducationClass_Call) Return(_a0 *libregraph.EducationClass, _a1 error) *EducationBackend_GetEducationClass_Call { - _c.Call.Return(_a0, _a1) +func (_c *EducationBackend_GetEducationClass_Call) Return(educationClass *libregraph.EducationClass, err error) *EducationBackend_GetEducationClass_Call { + _c.Call.Return(educationClass, err) return _c } -func (_c *EducationBackend_GetEducationClass_Call) RunAndReturn(run func(context.Context, string) (*libregraph.EducationClass, error)) *EducationBackend_GetEducationClass_Call { +func (_c *EducationBackend_GetEducationClass_Call) RunAndReturn(run func(ctx context.Context, namedOrID string) (*libregraph.EducationClass, error)) *EducationBackend_GetEducationClass_Call { _c.Call.Return(run) return _c } -// GetEducationClassMembers provides a mock function with given fields: ctx, nameOrID -func (_m *EducationBackend) GetEducationClassMembers(ctx context.Context, nameOrID string) ([]*libregraph.EducationUser, error) { - ret := _m.Called(ctx, nameOrID) +// GetEducationClassMembers provides a mock function for the type EducationBackend +func (_mock *EducationBackend) GetEducationClassMembers(ctx context.Context, nameOrID string) ([]*libregraph.EducationUser, error) { + ret := _mock.Called(ctx, nameOrID) if len(ret) == 0 { panic("no return value specified for GetEducationClassMembers") @@ -554,23 +680,21 @@ func (_m *EducationBackend) GetEducationClassMembers(ctx context.Context, nameOr var r0 []*libregraph.EducationUser var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) ([]*libregraph.EducationUser, error)); ok { - return rf(ctx, nameOrID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) ([]*libregraph.EducationUser, error)); ok { + return returnFunc(ctx, nameOrID) } - if rf, ok := ret.Get(0).(func(context.Context, string) []*libregraph.EducationUser); ok { - r0 = rf(ctx, nameOrID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) []*libregraph.EducationUser); ok { + r0 = returnFunc(ctx, nameOrID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*libregraph.EducationUser) } } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, nameOrID) + if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = returnFunc(ctx, nameOrID) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -588,24 +712,35 @@ func (_e *EducationBackend_Expecter) GetEducationClassMembers(ctx interface{}, n func (_c *EducationBackend_GetEducationClassMembers_Call) Run(run func(ctx context.Context, nameOrID string)) *EducationBackend_GetEducationClassMembers_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *EducationBackend_GetEducationClassMembers_Call) Return(_a0 []*libregraph.EducationUser, _a1 error) *EducationBackend_GetEducationClassMembers_Call { - _c.Call.Return(_a0, _a1) +func (_c *EducationBackend_GetEducationClassMembers_Call) Return(educationUsers []*libregraph.EducationUser, err error) *EducationBackend_GetEducationClassMembers_Call { + _c.Call.Return(educationUsers, err) return _c } -func (_c *EducationBackend_GetEducationClassMembers_Call) RunAndReturn(run func(context.Context, string) ([]*libregraph.EducationUser, error)) *EducationBackend_GetEducationClassMembers_Call { +func (_c *EducationBackend_GetEducationClassMembers_Call) RunAndReturn(run func(ctx context.Context, nameOrID string) ([]*libregraph.EducationUser, error)) *EducationBackend_GetEducationClassMembers_Call { _c.Call.Return(run) return _c } -// GetEducationClassTeachers provides a mock function with given fields: ctx, classID -func (_m *EducationBackend) GetEducationClassTeachers(ctx context.Context, classID string) ([]*libregraph.EducationUser, error) { - ret := _m.Called(ctx, classID) +// GetEducationClassTeachers provides a mock function for the type EducationBackend +func (_mock *EducationBackend) GetEducationClassTeachers(ctx context.Context, classID string) ([]*libregraph.EducationUser, error) { + ret := _mock.Called(ctx, classID) if len(ret) == 0 { panic("no return value specified for GetEducationClassTeachers") @@ -613,23 +748,21 @@ func (_m *EducationBackend) GetEducationClassTeachers(ctx context.Context, class var r0 []*libregraph.EducationUser var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) ([]*libregraph.EducationUser, error)); ok { - return rf(ctx, classID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) ([]*libregraph.EducationUser, error)); ok { + return returnFunc(ctx, classID) } - if rf, ok := ret.Get(0).(func(context.Context, string) []*libregraph.EducationUser); ok { - r0 = rf(ctx, classID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) []*libregraph.EducationUser); ok { + r0 = returnFunc(ctx, classID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*libregraph.EducationUser) } } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, classID) + if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = returnFunc(ctx, classID) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -647,24 +780,35 @@ func (_e *EducationBackend_Expecter) GetEducationClassTeachers(ctx interface{}, func (_c *EducationBackend_GetEducationClassTeachers_Call) Run(run func(ctx context.Context, classID string)) *EducationBackend_GetEducationClassTeachers_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *EducationBackend_GetEducationClassTeachers_Call) Return(_a0 []*libregraph.EducationUser, _a1 error) *EducationBackend_GetEducationClassTeachers_Call { - _c.Call.Return(_a0, _a1) +func (_c *EducationBackend_GetEducationClassTeachers_Call) Return(educationUsers []*libregraph.EducationUser, err error) *EducationBackend_GetEducationClassTeachers_Call { + _c.Call.Return(educationUsers, err) return _c } -func (_c *EducationBackend_GetEducationClassTeachers_Call) RunAndReturn(run func(context.Context, string) ([]*libregraph.EducationUser, error)) *EducationBackend_GetEducationClassTeachers_Call { +func (_c *EducationBackend_GetEducationClassTeachers_Call) RunAndReturn(run func(ctx context.Context, classID string) ([]*libregraph.EducationUser, error)) *EducationBackend_GetEducationClassTeachers_Call { _c.Call.Return(run) return _c } -// GetEducationClasses provides a mock function with given fields: ctx -func (_m *EducationBackend) GetEducationClasses(ctx context.Context) ([]*libregraph.EducationClass, error) { - ret := _m.Called(ctx) +// GetEducationClasses provides a mock function for the type EducationBackend +func (_mock *EducationBackend) GetEducationClasses(ctx context.Context) ([]*libregraph.EducationClass, error) { + ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for GetEducationClasses") @@ -672,23 +816,21 @@ func (_m *EducationBackend) GetEducationClasses(ctx context.Context) ([]*libregr var r0 []*libregraph.EducationClass var r1 error - if rf, ok := ret.Get(0).(func(context.Context) ([]*libregraph.EducationClass, error)); ok { - return rf(ctx) + if returnFunc, ok := ret.Get(0).(func(context.Context) ([]*libregraph.EducationClass, error)); ok { + return returnFunc(ctx) } - if rf, ok := ret.Get(0).(func(context.Context) []*libregraph.EducationClass); ok { - r0 = rf(ctx) + if returnFunc, ok := ret.Get(0).(func(context.Context) []*libregraph.EducationClass); ok { + r0 = returnFunc(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*libregraph.EducationClass) } } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(ctx) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -705,24 +847,30 @@ func (_e *EducationBackend_Expecter) GetEducationClasses(ctx interface{}) *Educa func (_c *EducationBackend_GetEducationClasses_Call) Run(run func(ctx context.Context)) *EducationBackend_GetEducationClasses_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + run( + arg0, + ) }) return _c } -func (_c *EducationBackend_GetEducationClasses_Call) Return(_a0 []*libregraph.EducationClass, _a1 error) *EducationBackend_GetEducationClasses_Call { - _c.Call.Return(_a0, _a1) +func (_c *EducationBackend_GetEducationClasses_Call) Return(educationClasss []*libregraph.EducationClass, err error) *EducationBackend_GetEducationClasses_Call { + _c.Call.Return(educationClasss, err) return _c } -func (_c *EducationBackend_GetEducationClasses_Call) RunAndReturn(run func(context.Context) ([]*libregraph.EducationClass, error)) *EducationBackend_GetEducationClasses_Call { +func (_c *EducationBackend_GetEducationClasses_Call) RunAndReturn(run func(ctx context.Context) ([]*libregraph.EducationClass, error)) *EducationBackend_GetEducationClasses_Call { _c.Call.Return(run) return _c } -// GetEducationSchool provides a mock function with given fields: ctx, nameOrID -func (_m *EducationBackend) GetEducationSchool(ctx context.Context, nameOrID string) (*libregraph.EducationSchool, error) { - ret := _m.Called(ctx, nameOrID) +// GetEducationSchool provides a mock function for the type EducationBackend +func (_mock *EducationBackend) GetEducationSchool(ctx context.Context, nameOrID string) (*libregraph.EducationSchool, error) { + ret := _mock.Called(ctx, nameOrID) if len(ret) == 0 { panic("no return value specified for GetEducationSchool") @@ -730,23 +878,21 @@ func (_m *EducationBackend) GetEducationSchool(ctx context.Context, nameOrID str var r0 *libregraph.EducationSchool var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*libregraph.EducationSchool, error)); ok { - return rf(ctx, nameOrID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*libregraph.EducationSchool, error)); ok { + return returnFunc(ctx, nameOrID) } - if rf, ok := ret.Get(0).(func(context.Context, string) *libregraph.EducationSchool); ok { - r0 = rf(ctx, nameOrID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) *libregraph.EducationSchool); ok { + r0 = returnFunc(ctx, nameOrID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*libregraph.EducationSchool) } } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, nameOrID) + if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = returnFunc(ctx, nameOrID) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -764,24 +910,35 @@ func (_e *EducationBackend_Expecter) GetEducationSchool(ctx interface{}, nameOrI func (_c *EducationBackend_GetEducationSchool_Call) Run(run func(ctx context.Context, nameOrID string)) *EducationBackend_GetEducationSchool_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *EducationBackend_GetEducationSchool_Call) Return(_a0 *libregraph.EducationSchool, _a1 error) *EducationBackend_GetEducationSchool_Call { - _c.Call.Return(_a0, _a1) +func (_c *EducationBackend_GetEducationSchool_Call) Return(educationSchool *libregraph.EducationSchool, err error) *EducationBackend_GetEducationSchool_Call { + _c.Call.Return(educationSchool, err) return _c } -func (_c *EducationBackend_GetEducationSchool_Call) RunAndReturn(run func(context.Context, string) (*libregraph.EducationSchool, error)) *EducationBackend_GetEducationSchool_Call { +func (_c *EducationBackend_GetEducationSchool_Call) RunAndReturn(run func(ctx context.Context, nameOrID string) (*libregraph.EducationSchool, error)) *EducationBackend_GetEducationSchool_Call { _c.Call.Return(run) return _c } -// GetEducationSchoolClasses provides a mock function with given fields: ctx, schoolNumberOrID -func (_m *EducationBackend) GetEducationSchoolClasses(ctx context.Context, schoolNumberOrID string) ([]*libregraph.EducationClass, error) { - ret := _m.Called(ctx, schoolNumberOrID) +// GetEducationSchoolClasses provides a mock function for the type EducationBackend +func (_mock *EducationBackend) GetEducationSchoolClasses(ctx context.Context, schoolNumberOrID string) ([]*libregraph.EducationClass, error) { + ret := _mock.Called(ctx, schoolNumberOrID) if len(ret) == 0 { panic("no return value specified for GetEducationSchoolClasses") @@ -789,23 +946,21 @@ func (_m *EducationBackend) GetEducationSchoolClasses(ctx context.Context, schoo var r0 []*libregraph.EducationClass var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) ([]*libregraph.EducationClass, error)); ok { - return rf(ctx, schoolNumberOrID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) ([]*libregraph.EducationClass, error)); ok { + return returnFunc(ctx, schoolNumberOrID) } - if rf, ok := ret.Get(0).(func(context.Context, string) []*libregraph.EducationClass); ok { - r0 = rf(ctx, schoolNumberOrID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) []*libregraph.EducationClass); ok { + r0 = returnFunc(ctx, schoolNumberOrID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*libregraph.EducationClass) } } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, schoolNumberOrID) + if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = returnFunc(ctx, schoolNumberOrID) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -823,24 +978,35 @@ func (_e *EducationBackend_Expecter) GetEducationSchoolClasses(ctx interface{}, func (_c *EducationBackend_GetEducationSchoolClasses_Call) Run(run func(ctx context.Context, schoolNumberOrID string)) *EducationBackend_GetEducationSchoolClasses_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *EducationBackend_GetEducationSchoolClasses_Call) Return(_a0 []*libregraph.EducationClass, _a1 error) *EducationBackend_GetEducationSchoolClasses_Call { - _c.Call.Return(_a0, _a1) +func (_c *EducationBackend_GetEducationSchoolClasses_Call) Return(educationClasss []*libregraph.EducationClass, err error) *EducationBackend_GetEducationSchoolClasses_Call { + _c.Call.Return(educationClasss, err) return _c } -func (_c *EducationBackend_GetEducationSchoolClasses_Call) RunAndReturn(run func(context.Context, string) ([]*libregraph.EducationClass, error)) *EducationBackend_GetEducationSchoolClasses_Call { +func (_c *EducationBackend_GetEducationSchoolClasses_Call) RunAndReturn(run func(ctx context.Context, schoolNumberOrID string) ([]*libregraph.EducationClass, error)) *EducationBackend_GetEducationSchoolClasses_Call { _c.Call.Return(run) return _c } -// GetEducationSchoolUsers provides a mock function with given fields: ctx, id -func (_m *EducationBackend) GetEducationSchoolUsers(ctx context.Context, id string) ([]*libregraph.EducationUser, error) { - ret := _m.Called(ctx, id) +// GetEducationSchoolUsers provides a mock function for the type EducationBackend +func (_mock *EducationBackend) GetEducationSchoolUsers(ctx context.Context, id string) ([]*libregraph.EducationUser, error) { + ret := _mock.Called(ctx, id) if len(ret) == 0 { panic("no return value specified for GetEducationSchoolUsers") @@ -848,23 +1014,21 @@ func (_m *EducationBackend) GetEducationSchoolUsers(ctx context.Context, id stri var r0 []*libregraph.EducationUser var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) ([]*libregraph.EducationUser, error)); ok { - return rf(ctx, id) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) ([]*libregraph.EducationUser, error)); ok { + return returnFunc(ctx, id) } - if rf, ok := ret.Get(0).(func(context.Context, string) []*libregraph.EducationUser); ok { - r0 = rf(ctx, id) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) []*libregraph.EducationUser); ok { + r0 = returnFunc(ctx, id) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*libregraph.EducationUser) } } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, id) + if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = returnFunc(ctx, id) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -882,24 +1046,35 @@ func (_e *EducationBackend_Expecter) GetEducationSchoolUsers(ctx interface{}, id func (_c *EducationBackend_GetEducationSchoolUsers_Call) Run(run func(ctx context.Context, id string)) *EducationBackend_GetEducationSchoolUsers_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *EducationBackend_GetEducationSchoolUsers_Call) Return(_a0 []*libregraph.EducationUser, _a1 error) *EducationBackend_GetEducationSchoolUsers_Call { - _c.Call.Return(_a0, _a1) +func (_c *EducationBackend_GetEducationSchoolUsers_Call) Return(educationUsers []*libregraph.EducationUser, err error) *EducationBackend_GetEducationSchoolUsers_Call { + _c.Call.Return(educationUsers, err) return _c } -func (_c *EducationBackend_GetEducationSchoolUsers_Call) RunAndReturn(run func(context.Context, string) ([]*libregraph.EducationUser, error)) *EducationBackend_GetEducationSchoolUsers_Call { +func (_c *EducationBackend_GetEducationSchoolUsers_Call) RunAndReturn(run func(ctx context.Context, id string) ([]*libregraph.EducationUser, error)) *EducationBackend_GetEducationSchoolUsers_Call { _c.Call.Return(run) return _c } -// GetEducationSchools provides a mock function with given fields: ctx -func (_m *EducationBackend) GetEducationSchools(ctx context.Context) ([]*libregraph.EducationSchool, error) { - ret := _m.Called(ctx) +// GetEducationSchools provides a mock function for the type EducationBackend +func (_mock *EducationBackend) GetEducationSchools(ctx context.Context) ([]*libregraph.EducationSchool, error) { + ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for GetEducationSchools") @@ -907,23 +1082,21 @@ func (_m *EducationBackend) GetEducationSchools(ctx context.Context) ([]*libregr var r0 []*libregraph.EducationSchool var r1 error - if rf, ok := ret.Get(0).(func(context.Context) ([]*libregraph.EducationSchool, error)); ok { - return rf(ctx) + if returnFunc, ok := ret.Get(0).(func(context.Context) ([]*libregraph.EducationSchool, error)); ok { + return returnFunc(ctx) } - if rf, ok := ret.Get(0).(func(context.Context) []*libregraph.EducationSchool); ok { - r0 = rf(ctx) + if returnFunc, ok := ret.Get(0).(func(context.Context) []*libregraph.EducationSchool); ok { + r0 = returnFunc(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*libregraph.EducationSchool) } } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(ctx) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -940,24 +1113,30 @@ func (_e *EducationBackend_Expecter) GetEducationSchools(ctx interface{}) *Educa func (_c *EducationBackend_GetEducationSchools_Call) Run(run func(ctx context.Context)) *EducationBackend_GetEducationSchools_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + run( + arg0, + ) }) return _c } -func (_c *EducationBackend_GetEducationSchools_Call) Return(_a0 []*libregraph.EducationSchool, _a1 error) *EducationBackend_GetEducationSchools_Call { - _c.Call.Return(_a0, _a1) +func (_c *EducationBackend_GetEducationSchools_Call) Return(educationSchools []*libregraph.EducationSchool, err error) *EducationBackend_GetEducationSchools_Call { + _c.Call.Return(educationSchools, err) return _c } -func (_c *EducationBackend_GetEducationSchools_Call) RunAndReturn(run func(context.Context) ([]*libregraph.EducationSchool, error)) *EducationBackend_GetEducationSchools_Call { +func (_c *EducationBackend_GetEducationSchools_Call) RunAndReturn(run func(ctx context.Context) ([]*libregraph.EducationSchool, error)) *EducationBackend_GetEducationSchools_Call { _c.Call.Return(run) return _c } -// GetEducationUser provides a mock function with given fields: ctx, nameOrID -func (_m *EducationBackend) GetEducationUser(ctx context.Context, nameOrID string) (*libregraph.EducationUser, error) { - ret := _m.Called(ctx, nameOrID) +// GetEducationUser provides a mock function for the type EducationBackend +func (_mock *EducationBackend) GetEducationUser(ctx context.Context, nameOrID string) (*libregraph.EducationUser, error) { + ret := _mock.Called(ctx, nameOrID) if len(ret) == 0 { panic("no return value specified for GetEducationUser") @@ -965,23 +1144,21 @@ func (_m *EducationBackend) GetEducationUser(ctx context.Context, nameOrID strin var r0 *libregraph.EducationUser var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*libregraph.EducationUser, error)); ok { - return rf(ctx, nameOrID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*libregraph.EducationUser, error)); ok { + return returnFunc(ctx, nameOrID) } - if rf, ok := ret.Get(0).(func(context.Context, string) *libregraph.EducationUser); ok { - r0 = rf(ctx, nameOrID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) *libregraph.EducationUser); ok { + r0 = returnFunc(ctx, nameOrID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*libregraph.EducationUser) } } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, nameOrID) + if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = returnFunc(ctx, nameOrID) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -999,24 +1176,35 @@ func (_e *EducationBackend_Expecter) GetEducationUser(ctx interface{}, nameOrID func (_c *EducationBackend_GetEducationUser_Call) Run(run func(ctx context.Context, nameOrID string)) *EducationBackend_GetEducationUser_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *EducationBackend_GetEducationUser_Call) Return(_a0 *libregraph.EducationUser, _a1 error) *EducationBackend_GetEducationUser_Call { - _c.Call.Return(_a0, _a1) +func (_c *EducationBackend_GetEducationUser_Call) Return(educationUser *libregraph.EducationUser, err error) *EducationBackend_GetEducationUser_Call { + _c.Call.Return(educationUser, err) return _c } -func (_c *EducationBackend_GetEducationUser_Call) RunAndReturn(run func(context.Context, string) (*libregraph.EducationUser, error)) *EducationBackend_GetEducationUser_Call { +func (_c *EducationBackend_GetEducationUser_Call) RunAndReturn(run func(ctx context.Context, nameOrID string) (*libregraph.EducationUser, error)) *EducationBackend_GetEducationUser_Call { _c.Call.Return(run) return _c } -// GetEducationUsers provides a mock function with given fields: ctx -func (_m *EducationBackend) GetEducationUsers(ctx context.Context) ([]*libregraph.EducationUser, error) { - ret := _m.Called(ctx) +// GetEducationUsers provides a mock function for the type EducationBackend +func (_mock *EducationBackend) GetEducationUsers(ctx context.Context) ([]*libregraph.EducationUser, error) { + ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for GetEducationUsers") @@ -1024,23 +1212,21 @@ func (_m *EducationBackend) GetEducationUsers(ctx context.Context) ([]*libregrap var r0 []*libregraph.EducationUser var r1 error - if rf, ok := ret.Get(0).(func(context.Context) ([]*libregraph.EducationUser, error)); ok { - return rf(ctx) + if returnFunc, ok := ret.Get(0).(func(context.Context) ([]*libregraph.EducationUser, error)); ok { + return returnFunc(ctx) } - if rf, ok := ret.Get(0).(func(context.Context) []*libregraph.EducationUser); ok { - r0 = rf(ctx) + if returnFunc, ok := ret.Get(0).(func(context.Context) []*libregraph.EducationUser); ok { + r0 = returnFunc(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*libregraph.EducationUser) } } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(ctx) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1057,36 +1243,41 @@ func (_e *EducationBackend_Expecter) GetEducationUsers(ctx interface{}) *Educati func (_c *EducationBackend_GetEducationUsers_Call) Run(run func(ctx context.Context)) *EducationBackend_GetEducationUsers_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + run( + arg0, + ) }) return _c } -func (_c *EducationBackend_GetEducationUsers_Call) Return(_a0 []*libregraph.EducationUser, _a1 error) *EducationBackend_GetEducationUsers_Call { - _c.Call.Return(_a0, _a1) +func (_c *EducationBackend_GetEducationUsers_Call) Return(educationUsers []*libregraph.EducationUser, err error) *EducationBackend_GetEducationUsers_Call { + _c.Call.Return(educationUsers, err) return _c } -func (_c *EducationBackend_GetEducationUsers_Call) RunAndReturn(run func(context.Context) ([]*libregraph.EducationUser, error)) *EducationBackend_GetEducationUsers_Call { +func (_c *EducationBackend_GetEducationUsers_Call) RunAndReturn(run func(ctx context.Context) ([]*libregraph.EducationUser, error)) *EducationBackend_GetEducationUsers_Call { _c.Call.Return(run) return _c } -// RemoveClassFromEducationSchool provides a mock function with given fields: ctx, schoolNumberOrID, memberID -func (_m *EducationBackend) RemoveClassFromEducationSchool(ctx context.Context, schoolNumberOrID string, memberID string) error { - ret := _m.Called(ctx, schoolNumberOrID, memberID) +// RemoveClassFromEducationSchool provides a mock function for the type EducationBackend +func (_mock *EducationBackend) RemoveClassFromEducationSchool(ctx context.Context, schoolNumberOrID string, memberID string) error { + ret := _mock.Called(ctx, schoolNumberOrID, memberID) if len(ret) == 0 { panic("no return value specified for RemoveClassFromEducationSchool") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { - r0 = rf(ctx, schoolNumberOrID, memberID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = returnFunc(ctx, schoolNumberOrID, memberID) } else { r0 = ret.Error(0) } - return r0 } @@ -1105,36 +1296,51 @@ func (_e *EducationBackend_Expecter) RemoveClassFromEducationSchool(ctx interfac func (_c *EducationBackend_RemoveClassFromEducationSchool_Call) Run(run func(ctx context.Context, schoolNumberOrID string, memberID string)) *EducationBackend_RemoveClassFromEducationSchool_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *EducationBackend_RemoveClassFromEducationSchool_Call) Return(_a0 error) *EducationBackend_RemoveClassFromEducationSchool_Call { - _c.Call.Return(_a0) +func (_c *EducationBackend_RemoveClassFromEducationSchool_Call) Return(err error) *EducationBackend_RemoveClassFromEducationSchool_Call { + _c.Call.Return(err) return _c } -func (_c *EducationBackend_RemoveClassFromEducationSchool_Call) RunAndReturn(run func(context.Context, string, string) error) *EducationBackend_RemoveClassFromEducationSchool_Call { +func (_c *EducationBackend_RemoveClassFromEducationSchool_Call) RunAndReturn(run func(ctx context.Context, schoolNumberOrID string, memberID string) error) *EducationBackend_RemoveClassFromEducationSchool_Call { _c.Call.Return(run) return _c } -// RemoveTeacherFromEducationClass provides a mock function with given fields: ctx, classID, teacherID -func (_m *EducationBackend) RemoveTeacherFromEducationClass(ctx context.Context, classID string, teacherID string) error { - ret := _m.Called(ctx, classID, teacherID) +// RemoveTeacherFromEducationClass provides a mock function for the type EducationBackend +func (_mock *EducationBackend) RemoveTeacherFromEducationClass(ctx context.Context, classID string, teacherID string) error { + ret := _mock.Called(ctx, classID, teacherID) if len(ret) == 0 { panic("no return value specified for RemoveTeacherFromEducationClass") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { - r0 = rf(ctx, classID, teacherID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = returnFunc(ctx, classID, teacherID) } else { r0 = ret.Error(0) } - return r0 } @@ -1153,36 +1359,51 @@ func (_e *EducationBackend_Expecter) RemoveTeacherFromEducationClass(ctx interfa func (_c *EducationBackend_RemoveTeacherFromEducationClass_Call) Run(run func(ctx context.Context, classID string, teacherID string)) *EducationBackend_RemoveTeacherFromEducationClass_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *EducationBackend_RemoveTeacherFromEducationClass_Call) Return(_a0 error) *EducationBackend_RemoveTeacherFromEducationClass_Call { - _c.Call.Return(_a0) +func (_c *EducationBackend_RemoveTeacherFromEducationClass_Call) Return(err error) *EducationBackend_RemoveTeacherFromEducationClass_Call { + _c.Call.Return(err) return _c } -func (_c *EducationBackend_RemoveTeacherFromEducationClass_Call) RunAndReturn(run func(context.Context, string, string) error) *EducationBackend_RemoveTeacherFromEducationClass_Call { +func (_c *EducationBackend_RemoveTeacherFromEducationClass_Call) RunAndReturn(run func(ctx context.Context, classID string, teacherID string) error) *EducationBackend_RemoveTeacherFromEducationClass_Call { _c.Call.Return(run) return _c } -// RemoveUserFromEducationSchool provides a mock function with given fields: ctx, schoolID, memberID -func (_m *EducationBackend) RemoveUserFromEducationSchool(ctx context.Context, schoolID string, memberID string) error { - ret := _m.Called(ctx, schoolID, memberID) +// RemoveUserFromEducationSchool provides a mock function for the type EducationBackend +func (_mock *EducationBackend) RemoveUserFromEducationSchool(ctx context.Context, schoolID string, memberID string) error { + ret := _mock.Called(ctx, schoolID, memberID) if len(ret) == 0 { panic("no return value specified for RemoveUserFromEducationSchool") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { - r0 = rf(ctx, schoolID, memberID) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = returnFunc(ctx, schoolID, memberID) } else { r0 = ret.Error(0) } - return r0 } @@ -1201,24 +1422,40 @@ func (_e *EducationBackend_Expecter) RemoveUserFromEducationSchool(ctx interface func (_c *EducationBackend_RemoveUserFromEducationSchool_Call) Run(run func(ctx context.Context, schoolID string, memberID string)) *EducationBackend_RemoveUserFromEducationSchool_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *EducationBackend_RemoveUserFromEducationSchool_Call) Return(_a0 error) *EducationBackend_RemoveUserFromEducationSchool_Call { - _c.Call.Return(_a0) +func (_c *EducationBackend_RemoveUserFromEducationSchool_Call) Return(err error) *EducationBackend_RemoveUserFromEducationSchool_Call { + _c.Call.Return(err) return _c } -func (_c *EducationBackend_RemoveUserFromEducationSchool_Call) RunAndReturn(run func(context.Context, string, string) error) *EducationBackend_RemoveUserFromEducationSchool_Call { +func (_c *EducationBackend_RemoveUserFromEducationSchool_Call) RunAndReturn(run func(ctx context.Context, schoolID string, memberID string) error) *EducationBackend_RemoveUserFromEducationSchool_Call { _c.Call.Return(run) return _c } -// UpdateEducationClass provides a mock function with given fields: ctx, id, class -func (_m *EducationBackend) UpdateEducationClass(ctx context.Context, id string, class libregraph.EducationClass) (*libregraph.EducationClass, error) { - ret := _m.Called(ctx, id, class) +// UpdateEducationClass provides a mock function for the type EducationBackend +func (_mock *EducationBackend) UpdateEducationClass(ctx context.Context, id string, class libregraph.EducationClass) (*libregraph.EducationClass, error) { + ret := _mock.Called(ctx, id, class) if len(ret) == 0 { panic("no return value specified for UpdateEducationClass") @@ -1226,23 +1463,21 @@ func (_m *EducationBackend) UpdateEducationClass(ctx context.Context, id string, var r0 *libregraph.EducationClass var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, libregraph.EducationClass) (*libregraph.EducationClass, error)); ok { - return rf(ctx, id, class) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, libregraph.EducationClass) (*libregraph.EducationClass, error)); ok { + return returnFunc(ctx, id, class) } - if rf, ok := ret.Get(0).(func(context.Context, string, libregraph.EducationClass) *libregraph.EducationClass); ok { - r0 = rf(ctx, id, class) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, libregraph.EducationClass) *libregraph.EducationClass); ok { + r0 = returnFunc(ctx, id, class) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*libregraph.EducationClass) } } - - if rf, ok := ret.Get(1).(func(context.Context, string, libregraph.EducationClass) error); ok { - r1 = rf(ctx, id, class) + if returnFunc, ok := ret.Get(1).(func(context.Context, string, libregraph.EducationClass) error); ok { + r1 = returnFunc(ctx, id, class) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1261,24 +1496,40 @@ func (_e *EducationBackend_Expecter) UpdateEducationClass(ctx interface{}, id in func (_c *EducationBackend_UpdateEducationClass_Call) Run(run func(ctx context.Context, id string, class libregraph.EducationClass)) *EducationBackend_UpdateEducationClass_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(libregraph.EducationClass)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 libregraph.EducationClass + if args[2] != nil { + arg2 = args[2].(libregraph.EducationClass) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *EducationBackend_UpdateEducationClass_Call) Return(_a0 *libregraph.EducationClass, _a1 error) *EducationBackend_UpdateEducationClass_Call { - _c.Call.Return(_a0, _a1) +func (_c *EducationBackend_UpdateEducationClass_Call) Return(educationClass *libregraph.EducationClass, err error) *EducationBackend_UpdateEducationClass_Call { + _c.Call.Return(educationClass, err) return _c } -func (_c *EducationBackend_UpdateEducationClass_Call) RunAndReturn(run func(context.Context, string, libregraph.EducationClass) (*libregraph.EducationClass, error)) *EducationBackend_UpdateEducationClass_Call { +func (_c *EducationBackend_UpdateEducationClass_Call) RunAndReturn(run func(ctx context.Context, id string, class libregraph.EducationClass) (*libregraph.EducationClass, error)) *EducationBackend_UpdateEducationClass_Call { _c.Call.Return(run) return _c } -// UpdateEducationSchool provides a mock function with given fields: ctx, numberOrID, school -func (_m *EducationBackend) UpdateEducationSchool(ctx context.Context, numberOrID string, school libregraph.EducationSchool) (*libregraph.EducationSchool, error) { - ret := _m.Called(ctx, numberOrID, school) +// UpdateEducationSchool provides a mock function for the type EducationBackend +func (_mock *EducationBackend) UpdateEducationSchool(ctx context.Context, numberOrID string, school libregraph.EducationSchool) (*libregraph.EducationSchool, error) { + ret := _mock.Called(ctx, numberOrID, school) if len(ret) == 0 { panic("no return value specified for UpdateEducationSchool") @@ -1286,23 +1537,21 @@ func (_m *EducationBackend) UpdateEducationSchool(ctx context.Context, numberOrI var r0 *libregraph.EducationSchool var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, libregraph.EducationSchool) (*libregraph.EducationSchool, error)); ok { - return rf(ctx, numberOrID, school) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, libregraph.EducationSchool) (*libregraph.EducationSchool, error)); ok { + return returnFunc(ctx, numberOrID, school) } - if rf, ok := ret.Get(0).(func(context.Context, string, libregraph.EducationSchool) *libregraph.EducationSchool); ok { - r0 = rf(ctx, numberOrID, school) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, libregraph.EducationSchool) *libregraph.EducationSchool); ok { + r0 = returnFunc(ctx, numberOrID, school) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*libregraph.EducationSchool) } } - - if rf, ok := ret.Get(1).(func(context.Context, string, libregraph.EducationSchool) error); ok { - r1 = rf(ctx, numberOrID, school) + if returnFunc, ok := ret.Get(1).(func(context.Context, string, libregraph.EducationSchool) error); ok { + r1 = returnFunc(ctx, numberOrID, school) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1321,24 +1570,40 @@ func (_e *EducationBackend_Expecter) UpdateEducationSchool(ctx interface{}, numb func (_c *EducationBackend_UpdateEducationSchool_Call) Run(run func(ctx context.Context, numberOrID string, school libregraph.EducationSchool)) *EducationBackend_UpdateEducationSchool_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(libregraph.EducationSchool)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 libregraph.EducationSchool + if args[2] != nil { + arg2 = args[2].(libregraph.EducationSchool) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *EducationBackend_UpdateEducationSchool_Call) Return(_a0 *libregraph.EducationSchool, _a1 error) *EducationBackend_UpdateEducationSchool_Call { - _c.Call.Return(_a0, _a1) +func (_c *EducationBackend_UpdateEducationSchool_Call) Return(educationSchool *libregraph.EducationSchool, err error) *EducationBackend_UpdateEducationSchool_Call { + _c.Call.Return(educationSchool, err) return _c } -func (_c *EducationBackend_UpdateEducationSchool_Call) RunAndReturn(run func(context.Context, string, libregraph.EducationSchool) (*libregraph.EducationSchool, error)) *EducationBackend_UpdateEducationSchool_Call { +func (_c *EducationBackend_UpdateEducationSchool_Call) RunAndReturn(run func(ctx context.Context, numberOrID string, school libregraph.EducationSchool) (*libregraph.EducationSchool, error)) *EducationBackend_UpdateEducationSchool_Call { _c.Call.Return(run) return _c } -// UpdateEducationUser provides a mock function with given fields: ctx, nameOrID, user -func (_m *EducationBackend) UpdateEducationUser(ctx context.Context, nameOrID string, user libregraph.EducationUser) (*libregraph.EducationUser, error) { - ret := _m.Called(ctx, nameOrID, user) +// UpdateEducationUser provides a mock function for the type EducationBackend +func (_mock *EducationBackend) UpdateEducationUser(ctx context.Context, nameOrID string, user libregraph.EducationUser) (*libregraph.EducationUser, error) { + ret := _mock.Called(ctx, nameOrID, user) if len(ret) == 0 { panic("no return value specified for UpdateEducationUser") @@ -1346,23 +1611,21 @@ func (_m *EducationBackend) UpdateEducationUser(ctx context.Context, nameOrID st var r0 *libregraph.EducationUser var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, libregraph.EducationUser) (*libregraph.EducationUser, error)); ok { - return rf(ctx, nameOrID, user) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, libregraph.EducationUser) (*libregraph.EducationUser, error)); ok { + return returnFunc(ctx, nameOrID, user) } - if rf, ok := ret.Get(0).(func(context.Context, string, libregraph.EducationUser) *libregraph.EducationUser); ok { - r0 = rf(ctx, nameOrID, user) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, libregraph.EducationUser) *libregraph.EducationUser); ok { + r0 = returnFunc(ctx, nameOrID, user) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*libregraph.EducationUser) } } - - if rf, ok := ret.Get(1).(func(context.Context, string, libregraph.EducationUser) error); ok { - r1 = rf(ctx, nameOrID, user) + if returnFunc, ok := ret.Get(1).(func(context.Context, string, libregraph.EducationUser) error); ok { + r1 = returnFunc(ctx, nameOrID, user) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1381,31 +1644,33 @@ func (_e *EducationBackend_Expecter) UpdateEducationUser(ctx interface{}, nameOr func (_c *EducationBackend_UpdateEducationUser_Call) Run(run func(ctx context.Context, nameOrID string, user libregraph.EducationUser)) *EducationBackend_UpdateEducationUser_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(libregraph.EducationUser)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 libregraph.EducationUser + if args[2] != nil { + arg2 = args[2].(libregraph.EducationUser) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *EducationBackend_UpdateEducationUser_Call) Return(_a0 *libregraph.EducationUser, _a1 error) *EducationBackend_UpdateEducationUser_Call { - _c.Call.Return(_a0, _a1) +func (_c *EducationBackend_UpdateEducationUser_Call) Return(educationUser *libregraph.EducationUser, err error) *EducationBackend_UpdateEducationUser_Call { + _c.Call.Return(educationUser, err) return _c } -func (_c *EducationBackend_UpdateEducationUser_Call) RunAndReturn(run func(context.Context, string, libregraph.EducationUser) (*libregraph.EducationUser, error)) *EducationBackend_UpdateEducationUser_Call { +func (_c *EducationBackend_UpdateEducationUser_Call) RunAndReturn(run func(ctx context.Context, nameOrID string, user libregraph.EducationUser) (*libregraph.EducationUser, error)) *EducationBackend_UpdateEducationUser_Call { _c.Call.Return(run) return _c } - -// NewEducationBackend creates a new instance of EducationBackend. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewEducationBackend(t interface { - mock.TestingT - Cleanup(func()) -}) *EducationBackend { - mock := &EducationBackend{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/services/graph/pkg/identity/mocks/ldapclient.go b/services/graph/pkg/identity/mocks/ldapclient.go index 4d6f3d1300..e16c880038 100644 --- a/services/graph/pkg/identity/mocks/ldapclient.go +++ b/services/graph/pkg/identity/mocks/ldapclient.go @@ -1,18 +1,32 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" + "context" + "crypto/tls" + "time" - ldap "github.com/go-ldap/ldap/v3" + "github.com/go-ldap/ldap/v3" mock "github.com/stretchr/testify/mock" - - time "time" - - tls "crypto/tls" ) +// NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewClient(t interface { + mock.TestingT + Cleanup(func()) +}) *Client { + mock := &Client{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // Client is an autogenerated mock type for the Client type type Client struct { mock.Mock @@ -26,21 +40,20 @@ func (_m *Client) EXPECT() *Client_Expecter { return &Client_Expecter{mock: &_m.Mock} } -// Add provides a mock function with given fields: _a0 -func (_m *Client) Add(_a0 *ldap.AddRequest) error { - ret := _m.Called(_a0) +// Add provides a mock function for the type Client +func (_mock *Client) Add(addRequest *ldap.AddRequest) error { + ret := _mock.Called(addRequest) if len(ret) == 0 { panic("no return value specified for Add") } var r0 error - if rf, ok := ret.Get(0).(func(*ldap.AddRequest) error); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(*ldap.AddRequest) error); ok { + r0 = returnFunc(addRequest) } else { r0 = ret.Error(0) } - return r0 } @@ -50,43 +63,48 @@ type Client_Add_Call struct { } // Add is a helper method to define mock.On call -// - _a0 *ldap.AddRequest -func (_e *Client_Expecter) Add(_a0 interface{}) *Client_Add_Call { - return &Client_Add_Call{Call: _e.mock.On("Add", _a0)} +// - addRequest *ldap.AddRequest +func (_e *Client_Expecter) Add(addRequest interface{}) *Client_Add_Call { + return &Client_Add_Call{Call: _e.mock.On("Add", addRequest)} } -func (_c *Client_Add_Call) Run(run func(_a0 *ldap.AddRequest)) *Client_Add_Call { +func (_c *Client_Add_Call) Run(run func(addRequest *ldap.AddRequest)) *Client_Add_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*ldap.AddRequest)) + var arg0 *ldap.AddRequest + if args[0] != nil { + arg0 = args[0].(*ldap.AddRequest) + } + run( + arg0, + ) }) return _c } -func (_c *Client_Add_Call) Return(_a0 error) *Client_Add_Call { - _c.Call.Return(_a0) +func (_c *Client_Add_Call) Return(err error) *Client_Add_Call { + _c.Call.Return(err) return _c } -func (_c *Client_Add_Call) RunAndReturn(run func(*ldap.AddRequest) error) *Client_Add_Call { +func (_c *Client_Add_Call) RunAndReturn(run func(addRequest *ldap.AddRequest) error) *Client_Add_Call { _c.Call.Return(run) return _c } -// Bind provides a mock function with given fields: username, password -func (_m *Client) Bind(username string, password string) error { - ret := _m.Called(username, password) +// Bind provides a mock function for the type Client +func (_mock *Client) Bind(username string, password string) error { + ret := _mock.Called(username, password) if len(ret) == 0 { panic("no return value specified for Bind") } var r0 error - if rf, ok := ret.Get(0).(func(string, string) error); ok { - r0 = rf(username, password) + if returnFunc, ok := ret.Get(0).(func(string, string) error); ok { + r0 = returnFunc(username, password) } else { r0 = ret.Error(0) } - return r0 } @@ -104,36 +122,46 @@ func (_e *Client_Expecter) Bind(username interface{}, password interface{}) *Cli func (_c *Client_Bind_Call) Run(run func(username string, password string)) *Client_Bind_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(string)) + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Client_Bind_Call) Return(_a0 error) *Client_Bind_Call { - _c.Call.Return(_a0) +func (_c *Client_Bind_Call) Return(err error) *Client_Bind_Call { + _c.Call.Return(err) return _c } -func (_c *Client_Bind_Call) RunAndReturn(run func(string, string) error) *Client_Bind_Call { +func (_c *Client_Bind_Call) RunAndReturn(run func(username string, password string) error) *Client_Bind_Call { _c.Call.Return(run) return _c } -// Close provides a mock function with no fields -func (_m *Client) Close() error { - ret := _m.Called() +// Close provides a mock function for the type Client +func (_mock *Client) Close() error { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Close") } var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() error); ok { + r0 = returnFunc() } else { r0 = ret.Error(0) } - return r0 } @@ -154,8 +182,8 @@ func (_c *Client_Close_Call) Run(run func()) *Client_Close_Call { return _c } -func (_c *Client_Close_Call) Return(_a0 error) *Client_Close_Call { - _c.Call.Return(_a0) +func (_c *Client_Close_Call) Return(err error) *Client_Close_Call { + _c.Call.Return(err) return _c } @@ -164,9 +192,9 @@ func (_c *Client_Close_Call) RunAndReturn(run func() error) *Client_Close_Call { return _c } -// Compare provides a mock function with given fields: dn, attribute, value -func (_m *Client) Compare(dn string, attribute string, value string) (bool, error) { - ret := _m.Called(dn, attribute, value) +// Compare provides a mock function for the type Client +func (_mock *Client) Compare(dn string, attribute string, value string) (bool, error) { + ret := _mock.Called(dn, attribute, value) if len(ret) == 0 { panic("no return value specified for Compare") @@ -174,21 +202,19 @@ func (_m *Client) Compare(dn string, attribute string, value string) (bool, erro var r0 bool var r1 error - if rf, ok := ret.Get(0).(func(string, string, string) (bool, error)); ok { - return rf(dn, attribute, value) + if returnFunc, ok := ret.Get(0).(func(string, string, string) (bool, error)); ok { + return returnFunc(dn, attribute, value) } - if rf, ok := ret.Get(0).(func(string, string, string) bool); ok { - r0 = rf(dn, attribute, value) + if returnFunc, ok := ret.Get(0).(func(string, string, string) bool); ok { + r0 = returnFunc(dn, attribute, value) } else { r0 = ret.Get(0).(bool) } - - if rf, ok := ret.Get(1).(func(string, string, string) error); ok { - r1 = rf(dn, attribute, value) + if returnFunc, ok := ret.Get(1).(func(string, string, string) error); ok { + r1 = returnFunc(dn, attribute, value) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -207,36 +233,51 @@ func (_e *Client_Expecter) Compare(dn interface{}, attribute interface{}, value func (_c *Client_Compare_Call) Run(run func(dn string, attribute string, value string)) *Client_Compare_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(string), args[2].(string)) + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *Client_Compare_Call) Return(_a0 bool, _a1 error) *Client_Compare_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_Compare_Call) Return(b bool, err error) *Client_Compare_Call { + _c.Call.Return(b, err) return _c } -func (_c *Client_Compare_Call) RunAndReturn(run func(string, string, string) (bool, error)) *Client_Compare_Call { +func (_c *Client_Compare_Call) RunAndReturn(run func(dn string, attribute string, value string) (bool, error)) *Client_Compare_Call { _c.Call.Return(run) return _c } -// Del provides a mock function with given fields: _a0 -func (_m *Client) Del(_a0 *ldap.DelRequest) error { - ret := _m.Called(_a0) +// Del provides a mock function for the type Client +func (_mock *Client) Del(delRequest *ldap.DelRequest) error { + ret := _mock.Called(delRequest) if len(ret) == 0 { panic("no return value specified for Del") } var r0 error - if rf, ok := ret.Get(0).(func(*ldap.DelRequest) error); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(*ldap.DelRequest) error); ok { + r0 = returnFunc(delRequest) } else { r0 = ret.Error(0) } - return r0 } @@ -246,31 +287,37 @@ type Client_Del_Call struct { } // Del is a helper method to define mock.On call -// - _a0 *ldap.DelRequest -func (_e *Client_Expecter) Del(_a0 interface{}) *Client_Del_Call { - return &Client_Del_Call{Call: _e.mock.On("Del", _a0)} +// - delRequest *ldap.DelRequest +func (_e *Client_Expecter) Del(delRequest interface{}) *Client_Del_Call { + return &Client_Del_Call{Call: _e.mock.On("Del", delRequest)} } -func (_c *Client_Del_Call) Run(run func(_a0 *ldap.DelRequest)) *Client_Del_Call { +func (_c *Client_Del_Call) Run(run func(delRequest *ldap.DelRequest)) *Client_Del_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*ldap.DelRequest)) + var arg0 *ldap.DelRequest + if args[0] != nil { + arg0 = args[0].(*ldap.DelRequest) + } + run( + arg0, + ) }) return _c } -func (_c *Client_Del_Call) Return(_a0 error) *Client_Del_Call { - _c.Call.Return(_a0) +func (_c *Client_Del_Call) Return(err error) *Client_Del_Call { + _c.Call.Return(err) return _c } -func (_c *Client_Del_Call) RunAndReturn(run func(*ldap.DelRequest) error) *Client_Del_Call { +func (_c *Client_Del_Call) RunAndReturn(run func(delRequest *ldap.DelRequest) error) *Client_Del_Call { _c.Call.Return(run) return _c } -// DirSync provides a mock function with given fields: searchRequest, flags, maxAttrCount, cookie -func (_m *Client) DirSync(searchRequest *ldap.SearchRequest, flags int64, maxAttrCount int64, cookie []byte) (*ldap.SearchResult, error) { - ret := _m.Called(searchRequest, flags, maxAttrCount, cookie) +// DirSync provides a mock function for the type Client +func (_mock *Client) DirSync(searchRequest *ldap.SearchRequest, flags int64, maxAttrCount int64, cookie []byte) (*ldap.SearchResult, error) { + ret := _mock.Called(searchRequest, flags, maxAttrCount, cookie) if len(ret) == 0 { panic("no return value specified for DirSync") @@ -278,23 +325,21 @@ func (_m *Client) DirSync(searchRequest *ldap.SearchRequest, flags int64, maxAtt var r0 *ldap.SearchResult var r1 error - if rf, ok := ret.Get(0).(func(*ldap.SearchRequest, int64, int64, []byte) (*ldap.SearchResult, error)); ok { - return rf(searchRequest, flags, maxAttrCount, cookie) + if returnFunc, ok := ret.Get(0).(func(*ldap.SearchRequest, int64, int64, []byte) (*ldap.SearchResult, error)); ok { + return returnFunc(searchRequest, flags, maxAttrCount, cookie) } - if rf, ok := ret.Get(0).(func(*ldap.SearchRequest, int64, int64, []byte) *ldap.SearchResult); ok { - r0 = rf(searchRequest, flags, maxAttrCount, cookie) + if returnFunc, ok := ret.Get(0).(func(*ldap.SearchRequest, int64, int64, []byte) *ldap.SearchResult); ok { + r0 = returnFunc(searchRequest, flags, maxAttrCount, cookie) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*ldap.SearchResult) } } - - if rf, ok := ret.Get(1).(func(*ldap.SearchRequest, int64, int64, []byte) error); ok { - r1 = rf(searchRequest, flags, maxAttrCount, cookie) + if returnFunc, ok := ret.Get(1).(func(*ldap.SearchRequest, int64, int64, []byte) error); ok { + r1 = returnFunc(searchRequest, flags, maxAttrCount, cookie) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -314,38 +359,58 @@ func (_e *Client_Expecter) DirSync(searchRequest interface{}, flags interface{}, func (_c *Client_DirSync_Call) Run(run func(searchRequest *ldap.SearchRequest, flags int64, maxAttrCount int64, cookie []byte)) *Client_DirSync_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*ldap.SearchRequest), args[1].(int64), args[2].(int64), args[3].([]byte)) + var arg0 *ldap.SearchRequest + if args[0] != nil { + arg0 = args[0].(*ldap.SearchRequest) + } + var arg1 int64 + if args[1] != nil { + arg1 = args[1].(int64) + } + var arg2 int64 + if args[2] != nil { + arg2 = args[2].(int64) + } + var arg3 []byte + if args[3] != nil { + arg3 = args[3].([]byte) + } + run( + arg0, + arg1, + arg2, + arg3, + ) }) return _c } -func (_c *Client_DirSync_Call) Return(_a0 *ldap.SearchResult, _a1 error) *Client_DirSync_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_DirSync_Call) Return(searchResult *ldap.SearchResult, err error) *Client_DirSync_Call { + _c.Call.Return(searchResult, err) return _c } -func (_c *Client_DirSync_Call) RunAndReturn(run func(*ldap.SearchRequest, int64, int64, []byte) (*ldap.SearchResult, error)) *Client_DirSync_Call { +func (_c *Client_DirSync_Call) RunAndReturn(run func(searchRequest *ldap.SearchRequest, flags int64, maxAttrCount int64, cookie []byte) (*ldap.SearchResult, error)) *Client_DirSync_Call { _c.Call.Return(run) return _c } -// DirSyncAsync provides a mock function with given fields: ctx, searchRequest, bufferSize, flags, maxAttrCount, cookie -func (_m *Client) DirSyncAsync(ctx context.Context, searchRequest *ldap.SearchRequest, bufferSize int, flags int64, maxAttrCount int64, cookie []byte) ldap.Response { - ret := _m.Called(ctx, searchRequest, bufferSize, flags, maxAttrCount, cookie) +// DirSyncAsync provides a mock function for the type Client +func (_mock *Client) DirSyncAsync(ctx context.Context, searchRequest *ldap.SearchRequest, bufferSize int, flags int64, maxAttrCount int64, cookie []byte) ldap.Response { + ret := _mock.Called(ctx, searchRequest, bufferSize, flags, maxAttrCount, cookie) if len(ret) == 0 { panic("no return value specified for DirSyncAsync") } var r0 ldap.Response - if rf, ok := ret.Get(0).(func(context.Context, *ldap.SearchRequest, int, int64, int64, []byte) ldap.Response); ok { - r0 = rf(ctx, searchRequest, bufferSize, flags, maxAttrCount, cookie) + if returnFunc, ok := ret.Get(0).(func(context.Context, *ldap.SearchRequest, int, int64, int64, []byte) ldap.Response); ok { + r0 = returnFunc(ctx, searchRequest, bufferSize, flags, maxAttrCount, cookie) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(ldap.Response) } } - return r0 } @@ -367,24 +432,55 @@ func (_e *Client_Expecter) DirSyncAsync(ctx interface{}, searchRequest interface func (_c *Client_DirSyncAsync_Call) Run(run func(ctx context.Context, searchRequest *ldap.SearchRequest, bufferSize int, flags int64, maxAttrCount int64, cookie []byte)) *Client_DirSyncAsync_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*ldap.SearchRequest), args[2].(int), args[3].(int64), args[4].(int64), args[5].([]byte)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *ldap.SearchRequest + if args[1] != nil { + arg1 = args[1].(*ldap.SearchRequest) + } + var arg2 int + if args[2] != nil { + arg2 = args[2].(int) + } + var arg3 int64 + if args[3] != nil { + arg3 = args[3].(int64) + } + var arg4 int64 + if args[4] != nil { + arg4 = args[4].(int64) + } + var arg5 []byte + if args[5] != nil { + arg5 = args[5].([]byte) + } + run( + arg0, + arg1, + arg2, + arg3, + arg4, + arg5, + ) }) return _c } -func (_c *Client_DirSyncAsync_Call) Return(_a0 ldap.Response) *Client_DirSyncAsync_Call { - _c.Call.Return(_a0) +func (_c *Client_DirSyncAsync_Call) Return(response ldap.Response) *Client_DirSyncAsync_Call { + _c.Call.Return(response) return _c } -func (_c *Client_DirSyncAsync_Call) RunAndReturn(run func(context.Context, *ldap.SearchRequest, int, int64, int64, []byte) ldap.Response) *Client_DirSyncAsync_Call { +func (_c *Client_DirSyncAsync_Call) RunAndReturn(run func(ctx context.Context, searchRequest *ldap.SearchRequest, bufferSize int, flags int64, maxAttrCount int64, cookie []byte) ldap.Response) *Client_DirSyncAsync_Call { _c.Call.Return(run) return _c } -// Extended provides a mock function with given fields: _a0 -func (_m *Client) Extended(_a0 *ldap.ExtendedRequest) (*ldap.ExtendedResponse, error) { - ret := _m.Called(_a0) +// Extended provides a mock function for the type Client +func (_mock *Client) Extended(extendedRequest *ldap.ExtendedRequest) (*ldap.ExtendedResponse, error) { + ret := _mock.Called(extendedRequest) if len(ret) == 0 { panic("no return value specified for Extended") @@ -392,23 +488,21 @@ func (_m *Client) Extended(_a0 *ldap.ExtendedRequest) (*ldap.ExtendedResponse, e var r0 *ldap.ExtendedResponse var r1 error - if rf, ok := ret.Get(0).(func(*ldap.ExtendedRequest) (*ldap.ExtendedResponse, error)); ok { - return rf(_a0) + if returnFunc, ok := ret.Get(0).(func(*ldap.ExtendedRequest) (*ldap.ExtendedResponse, error)); ok { + return returnFunc(extendedRequest) } - if rf, ok := ret.Get(0).(func(*ldap.ExtendedRequest) *ldap.ExtendedResponse); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(*ldap.ExtendedRequest) *ldap.ExtendedResponse); ok { + r0 = returnFunc(extendedRequest) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*ldap.ExtendedResponse) } } - - if rf, ok := ret.Get(1).(func(*ldap.ExtendedRequest) error); ok { - r1 = rf(_a0) + if returnFunc, ok := ret.Get(1).(func(*ldap.ExtendedRequest) error); ok { + r1 = returnFunc(extendedRequest) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -418,43 +512,48 @@ type Client_Extended_Call struct { } // Extended is a helper method to define mock.On call -// - _a0 *ldap.ExtendedRequest -func (_e *Client_Expecter) Extended(_a0 interface{}) *Client_Extended_Call { - return &Client_Extended_Call{Call: _e.mock.On("Extended", _a0)} +// - extendedRequest *ldap.ExtendedRequest +func (_e *Client_Expecter) Extended(extendedRequest interface{}) *Client_Extended_Call { + return &Client_Extended_Call{Call: _e.mock.On("Extended", extendedRequest)} } -func (_c *Client_Extended_Call) Run(run func(_a0 *ldap.ExtendedRequest)) *Client_Extended_Call { +func (_c *Client_Extended_Call) Run(run func(extendedRequest *ldap.ExtendedRequest)) *Client_Extended_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*ldap.ExtendedRequest)) + var arg0 *ldap.ExtendedRequest + if args[0] != nil { + arg0 = args[0].(*ldap.ExtendedRequest) + } + run( + arg0, + ) }) return _c } -func (_c *Client_Extended_Call) Return(_a0 *ldap.ExtendedResponse, _a1 error) *Client_Extended_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_Extended_Call) Return(extendedResponse *ldap.ExtendedResponse, err error) *Client_Extended_Call { + _c.Call.Return(extendedResponse, err) return _c } -func (_c *Client_Extended_Call) RunAndReturn(run func(*ldap.ExtendedRequest) (*ldap.ExtendedResponse, error)) *Client_Extended_Call { +func (_c *Client_Extended_Call) RunAndReturn(run func(extendedRequest *ldap.ExtendedRequest) (*ldap.ExtendedResponse, error)) *Client_Extended_Call { _c.Call.Return(run) return _c } -// ExternalBind provides a mock function with no fields -func (_m *Client) ExternalBind() error { - ret := _m.Called() +// ExternalBind provides a mock function for the type Client +func (_mock *Client) ExternalBind() error { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for ExternalBind") } var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() error); ok { + r0 = returnFunc() } else { r0 = ret.Error(0) } - return r0 } @@ -475,8 +574,8 @@ func (_c *Client_ExternalBind_Call) Run(run func()) *Client_ExternalBind_Call { return _c } -func (_c *Client_ExternalBind_Call) Return(_a0 error) *Client_ExternalBind_Call { - _c.Call.Return(_a0) +func (_c *Client_ExternalBind_Call) Return(err error) *Client_ExternalBind_Call { + _c.Call.Return(err) return _c } @@ -485,21 +584,20 @@ func (_c *Client_ExternalBind_Call) RunAndReturn(run func() error) *Client_Exter return _c } -// GetLastError provides a mock function with no fields -func (_m *Client) GetLastError() error { - ret := _m.Called() +// GetLastError provides a mock function for the type Client +func (_mock *Client) GetLastError() error { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for GetLastError") } var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() error); ok { + r0 = returnFunc() } else { r0 = ret.Error(0) } - return r0 } @@ -520,8 +618,8 @@ func (_c *Client_GetLastError_Call) Run(run func()) *Client_GetLastError_Call { return _c } -func (_c *Client_GetLastError_Call) Return(_a0 error) *Client_GetLastError_Call { - _c.Call.Return(_a0) +func (_c *Client_GetLastError_Call) Return(err error) *Client_GetLastError_Call { + _c.Call.Return(err) return _c } @@ -530,21 +628,20 @@ func (_c *Client_GetLastError_Call) RunAndReturn(run func() error) *Client_GetLa return _c } -// IsClosing provides a mock function with no fields -func (_m *Client) IsClosing() bool { - ret := _m.Called() +// IsClosing provides a mock function for the type Client +func (_mock *Client) IsClosing() bool { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for IsClosing") } var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() bool); ok { + r0 = returnFunc() } else { r0 = ret.Get(0).(bool) } - return r0 } @@ -565,8 +662,8 @@ func (_c *Client_IsClosing_Call) Run(run func()) *Client_IsClosing_Call { return _c } -func (_c *Client_IsClosing_Call) Return(_a0 bool) *Client_IsClosing_Call { - _c.Call.Return(_a0) +func (_c *Client_IsClosing_Call) Return(b bool) *Client_IsClosing_Call { + _c.Call.Return(b) return _c } @@ -575,21 +672,20 @@ func (_c *Client_IsClosing_Call) RunAndReturn(run func() bool) *Client_IsClosing return _c } -// Modify provides a mock function with given fields: _a0 -func (_m *Client) Modify(_a0 *ldap.ModifyRequest) error { - ret := _m.Called(_a0) +// Modify provides a mock function for the type Client +func (_mock *Client) Modify(modifyRequest *ldap.ModifyRequest) error { + ret := _mock.Called(modifyRequest) if len(ret) == 0 { panic("no return value specified for Modify") } var r0 error - if rf, ok := ret.Get(0).(func(*ldap.ModifyRequest) error); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(*ldap.ModifyRequest) error); ok { + r0 = returnFunc(modifyRequest) } else { r0 = ret.Error(0) } - return r0 } @@ -599,43 +695,48 @@ type Client_Modify_Call struct { } // Modify is a helper method to define mock.On call -// - _a0 *ldap.ModifyRequest -func (_e *Client_Expecter) Modify(_a0 interface{}) *Client_Modify_Call { - return &Client_Modify_Call{Call: _e.mock.On("Modify", _a0)} +// - modifyRequest *ldap.ModifyRequest +func (_e *Client_Expecter) Modify(modifyRequest interface{}) *Client_Modify_Call { + return &Client_Modify_Call{Call: _e.mock.On("Modify", modifyRequest)} } -func (_c *Client_Modify_Call) Run(run func(_a0 *ldap.ModifyRequest)) *Client_Modify_Call { +func (_c *Client_Modify_Call) Run(run func(modifyRequest *ldap.ModifyRequest)) *Client_Modify_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*ldap.ModifyRequest)) + var arg0 *ldap.ModifyRequest + if args[0] != nil { + arg0 = args[0].(*ldap.ModifyRequest) + } + run( + arg0, + ) }) return _c } -func (_c *Client_Modify_Call) Return(_a0 error) *Client_Modify_Call { - _c.Call.Return(_a0) +func (_c *Client_Modify_Call) Return(err error) *Client_Modify_Call { + _c.Call.Return(err) return _c } -func (_c *Client_Modify_Call) RunAndReturn(run func(*ldap.ModifyRequest) error) *Client_Modify_Call { +func (_c *Client_Modify_Call) RunAndReturn(run func(modifyRequest *ldap.ModifyRequest) error) *Client_Modify_Call { _c.Call.Return(run) return _c } -// ModifyDN provides a mock function with given fields: _a0 -func (_m *Client) ModifyDN(_a0 *ldap.ModifyDNRequest) error { - ret := _m.Called(_a0) +// ModifyDN provides a mock function for the type Client +func (_mock *Client) ModifyDN(modifyDNRequest *ldap.ModifyDNRequest) error { + ret := _mock.Called(modifyDNRequest) if len(ret) == 0 { panic("no return value specified for ModifyDN") } var r0 error - if rf, ok := ret.Get(0).(func(*ldap.ModifyDNRequest) error); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(*ldap.ModifyDNRequest) error); ok { + r0 = returnFunc(modifyDNRequest) } else { r0 = ret.Error(0) } - return r0 } @@ -645,31 +746,37 @@ type Client_ModifyDN_Call struct { } // ModifyDN is a helper method to define mock.On call -// - _a0 *ldap.ModifyDNRequest -func (_e *Client_Expecter) ModifyDN(_a0 interface{}) *Client_ModifyDN_Call { - return &Client_ModifyDN_Call{Call: _e.mock.On("ModifyDN", _a0)} +// - modifyDNRequest *ldap.ModifyDNRequest +func (_e *Client_Expecter) ModifyDN(modifyDNRequest interface{}) *Client_ModifyDN_Call { + return &Client_ModifyDN_Call{Call: _e.mock.On("ModifyDN", modifyDNRequest)} } -func (_c *Client_ModifyDN_Call) Run(run func(_a0 *ldap.ModifyDNRequest)) *Client_ModifyDN_Call { +func (_c *Client_ModifyDN_Call) Run(run func(modifyDNRequest *ldap.ModifyDNRequest)) *Client_ModifyDN_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*ldap.ModifyDNRequest)) + var arg0 *ldap.ModifyDNRequest + if args[0] != nil { + arg0 = args[0].(*ldap.ModifyDNRequest) + } + run( + arg0, + ) }) return _c } -func (_c *Client_ModifyDN_Call) Return(_a0 error) *Client_ModifyDN_Call { - _c.Call.Return(_a0) +func (_c *Client_ModifyDN_Call) Return(err error) *Client_ModifyDN_Call { + _c.Call.Return(err) return _c } -func (_c *Client_ModifyDN_Call) RunAndReturn(run func(*ldap.ModifyDNRequest) error) *Client_ModifyDN_Call { +func (_c *Client_ModifyDN_Call) RunAndReturn(run func(modifyDNRequest *ldap.ModifyDNRequest) error) *Client_ModifyDN_Call { _c.Call.Return(run) return _c } -// ModifyWithResult provides a mock function with given fields: _a0 -func (_m *Client) ModifyWithResult(_a0 *ldap.ModifyRequest) (*ldap.ModifyResult, error) { - ret := _m.Called(_a0) +// ModifyWithResult provides a mock function for the type Client +func (_mock *Client) ModifyWithResult(modifyRequest *ldap.ModifyRequest) (*ldap.ModifyResult, error) { + ret := _mock.Called(modifyRequest) if len(ret) == 0 { panic("no return value specified for ModifyWithResult") @@ -677,23 +784,21 @@ func (_m *Client) ModifyWithResult(_a0 *ldap.ModifyRequest) (*ldap.ModifyResult, var r0 *ldap.ModifyResult var r1 error - if rf, ok := ret.Get(0).(func(*ldap.ModifyRequest) (*ldap.ModifyResult, error)); ok { - return rf(_a0) + if returnFunc, ok := ret.Get(0).(func(*ldap.ModifyRequest) (*ldap.ModifyResult, error)); ok { + return returnFunc(modifyRequest) } - if rf, ok := ret.Get(0).(func(*ldap.ModifyRequest) *ldap.ModifyResult); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(*ldap.ModifyRequest) *ldap.ModifyResult); ok { + r0 = returnFunc(modifyRequest) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*ldap.ModifyResult) } } - - if rf, ok := ret.Get(1).(func(*ldap.ModifyRequest) error); ok { - r1 = rf(_a0) + if returnFunc, ok := ret.Get(1).(func(*ldap.ModifyRequest) error); ok { + r1 = returnFunc(modifyRequest) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -703,43 +808,48 @@ type Client_ModifyWithResult_Call struct { } // ModifyWithResult is a helper method to define mock.On call -// - _a0 *ldap.ModifyRequest -func (_e *Client_Expecter) ModifyWithResult(_a0 interface{}) *Client_ModifyWithResult_Call { - return &Client_ModifyWithResult_Call{Call: _e.mock.On("ModifyWithResult", _a0)} +// - modifyRequest *ldap.ModifyRequest +func (_e *Client_Expecter) ModifyWithResult(modifyRequest interface{}) *Client_ModifyWithResult_Call { + return &Client_ModifyWithResult_Call{Call: _e.mock.On("ModifyWithResult", modifyRequest)} } -func (_c *Client_ModifyWithResult_Call) Run(run func(_a0 *ldap.ModifyRequest)) *Client_ModifyWithResult_Call { +func (_c *Client_ModifyWithResult_Call) Run(run func(modifyRequest *ldap.ModifyRequest)) *Client_ModifyWithResult_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*ldap.ModifyRequest)) + var arg0 *ldap.ModifyRequest + if args[0] != nil { + arg0 = args[0].(*ldap.ModifyRequest) + } + run( + arg0, + ) }) return _c } -func (_c *Client_ModifyWithResult_Call) Return(_a0 *ldap.ModifyResult, _a1 error) *Client_ModifyWithResult_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_ModifyWithResult_Call) Return(modifyResult *ldap.ModifyResult, err error) *Client_ModifyWithResult_Call { + _c.Call.Return(modifyResult, err) return _c } -func (_c *Client_ModifyWithResult_Call) RunAndReturn(run func(*ldap.ModifyRequest) (*ldap.ModifyResult, error)) *Client_ModifyWithResult_Call { +func (_c *Client_ModifyWithResult_Call) RunAndReturn(run func(modifyRequest *ldap.ModifyRequest) (*ldap.ModifyResult, error)) *Client_ModifyWithResult_Call { _c.Call.Return(run) return _c } -// NTLMUnauthenticatedBind provides a mock function with given fields: domain, username -func (_m *Client) NTLMUnauthenticatedBind(domain string, username string) error { - ret := _m.Called(domain, username) +// NTLMUnauthenticatedBind provides a mock function for the type Client +func (_mock *Client) NTLMUnauthenticatedBind(domain string, username string) error { + ret := _mock.Called(domain, username) if len(ret) == 0 { panic("no return value specified for NTLMUnauthenticatedBind") } var r0 error - if rf, ok := ret.Get(0).(func(string, string) error); ok { - r0 = rf(domain, username) + if returnFunc, ok := ret.Get(0).(func(string, string) error); ok { + r0 = returnFunc(domain, username) } else { r0 = ret.Error(0) } - return r0 } @@ -757,24 +867,35 @@ func (_e *Client_Expecter) NTLMUnauthenticatedBind(domain interface{}, username func (_c *Client_NTLMUnauthenticatedBind_Call) Run(run func(domain string, username string)) *Client_NTLMUnauthenticatedBind_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(string)) + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Client_NTLMUnauthenticatedBind_Call) Return(_a0 error) *Client_NTLMUnauthenticatedBind_Call { - _c.Call.Return(_a0) +func (_c *Client_NTLMUnauthenticatedBind_Call) Return(err error) *Client_NTLMUnauthenticatedBind_Call { + _c.Call.Return(err) return _c } -func (_c *Client_NTLMUnauthenticatedBind_Call) RunAndReturn(run func(string, string) error) *Client_NTLMUnauthenticatedBind_Call { +func (_c *Client_NTLMUnauthenticatedBind_Call) RunAndReturn(run func(domain string, username string) error) *Client_NTLMUnauthenticatedBind_Call { _c.Call.Return(run) return _c } -// PasswordModify provides a mock function with given fields: _a0 -func (_m *Client) PasswordModify(_a0 *ldap.PasswordModifyRequest) (*ldap.PasswordModifyResult, error) { - ret := _m.Called(_a0) +// PasswordModify provides a mock function for the type Client +func (_mock *Client) PasswordModify(passwordModifyRequest *ldap.PasswordModifyRequest) (*ldap.PasswordModifyResult, error) { + ret := _mock.Called(passwordModifyRequest) if len(ret) == 0 { panic("no return value specified for PasswordModify") @@ -782,23 +903,21 @@ func (_m *Client) PasswordModify(_a0 *ldap.PasswordModifyRequest) (*ldap.Passwor var r0 *ldap.PasswordModifyResult var r1 error - if rf, ok := ret.Get(0).(func(*ldap.PasswordModifyRequest) (*ldap.PasswordModifyResult, error)); ok { - return rf(_a0) + if returnFunc, ok := ret.Get(0).(func(*ldap.PasswordModifyRequest) (*ldap.PasswordModifyResult, error)); ok { + return returnFunc(passwordModifyRequest) } - if rf, ok := ret.Get(0).(func(*ldap.PasswordModifyRequest) *ldap.PasswordModifyResult); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(*ldap.PasswordModifyRequest) *ldap.PasswordModifyResult); ok { + r0 = returnFunc(passwordModifyRequest) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*ldap.PasswordModifyResult) } } - - if rf, ok := ret.Get(1).(func(*ldap.PasswordModifyRequest) error); ok { - r1 = rf(_a0) + if returnFunc, ok := ret.Get(1).(func(*ldap.PasswordModifyRequest) error); ok { + r1 = returnFunc(passwordModifyRequest) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -808,31 +927,37 @@ type Client_PasswordModify_Call struct { } // PasswordModify is a helper method to define mock.On call -// - _a0 *ldap.PasswordModifyRequest -func (_e *Client_Expecter) PasswordModify(_a0 interface{}) *Client_PasswordModify_Call { - return &Client_PasswordModify_Call{Call: _e.mock.On("PasswordModify", _a0)} +// - passwordModifyRequest *ldap.PasswordModifyRequest +func (_e *Client_Expecter) PasswordModify(passwordModifyRequest interface{}) *Client_PasswordModify_Call { + return &Client_PasswordModify_Call{Call: _e.mock.On("PasswordModify", passwordModifyRequest)} } -func (_c *Client_PasswordModify_Call) Run(run func(_a0 *ldap.PasswordModifyRequest)) *Client_PasswordModify_Call { +func (_c *Client_PasswordModify_Call) Run(run func(passwordModifyRequest *ldap.PasswordModifyRequest)) *Client_PasswordModify_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*ldap.PasswordModifyRequest)) + var arg0 *ldap.PasswordModifyRequest + if args[0] != nil { + arg0 = args[0].(*ldap.PasswordModifyRequest) + } + run( + arg0, + ) }) return _c } -func (_c *Client_PasswordModify_Call) Return(_a0 *ldap.PasswordModifyResult, _a1 error) *Client_PasswordModify_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_PasswordModify_Call) Return(passwordModifyResult *ldap.PasswordModifyResult, err error) *Client_PasswordModify_Call { + _c.Call.Return(passwordModifyResult, err) return _c } -func (_c *Client_PasswordModify_Call) RunAndReturn(run func(*ldap.PasswordModifyRequest) (*ldap.PasswordModifyResult, error)) *Client_PasswordModify_Call { +func (_c *Client_PasswordModify_Call) RunAndReturn(run func(passwordModifyRequest *ldap.PasswordModifyRequest) (*ldap.PasswordModifyResult, error)) *Client_PasswordModify_Call { _c.Call.Return(run) return _c } -// Search provides a mock function with given fields: _a0 -func (_m *Client) Search(_a0 *ldap.SearchRequest) (*ldap.SearchResult, error) { - ret := _m.Called(_a0) +// Search provides a mock function for the type Client +func (_mock *Client) Search(searchRequest *ldap.SearchRequest) (*ldap.SearchResult, error) { + ret := _mock.Called(searchRequest) if len(ret) == 0 { panic("no return value specified for Search") @@ -840,23 +965,21 @@ func (_m *Client) Search(_a0 *ldap.SearchRequest) (*ldap.SearchResult, error) { var r0 *ldap.SearchResult var r1 error - if rf, ok := ret.Get(0).(func(*ldap.SearchRequest) (*ldap.SearchResult, error)); ok { - return rf(_a0) + if returnFunc, ok := ret.Get(0).(func(*ldap.SearchRequest) (*ldap.SearchResult, error)); ok { + return returnFunc(searchRequest) } - if rf, ok := ret.Get(0).(func(*ldap.SearchRequest) *ldap.SearchResult); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(*ldap.SearchRequest) *ldap.SearchResult); ok { + r0 = returnFunc(searchRequest) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*ldap.SearchResult) } } - - if rf, ok := ret.Get(1).(func(*ldap.SearchRequest) error); ok { - r1 = rf(_a0) + if returnFunc, ok := ret.Get(1).(func(*ldap.SearchRequest) error); ok { + r1 = returnFunc(searchRequest) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -866,45 +989,50 @@ type Client_Search_Call struct { } // Search is a helper method to define mock.On call -// - _a0 *ldap.SearchRequest -func (_e *Client_Expecter) Search(_a0 interface{}) *Client_Search_Call { - return &Client_Search_Call{Call: _e.mock.On("Search", _a0)} +// - searchRequest *ldap.SearchRequest +func (_e *Client_Expecter) Search(searchRequest interface{}) *Client_Search_Call { + return &Client_Search_Call{Call: _e.mock.On("Search", searchRequest)} } -func (_c *Client_Search_Call) Run(run func(_a0 *ldap.SearchRequest)) *Client_Search_Call { +func (_c *Client_Search_Call) Run(run func(searchRequest *ldap.SearchRequest)) *Client_Search_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*ldap.SearchRequest)) + var arg0 *ldap.SearchRequest + if args[0] != nil { + arg0 = args[0].(*ldap.SearchRequest) + } + run( + arg0, + ) }) return _c } -func (_c *Client_Search_Call) Return(_a0 *ldap.SearchResult, _a1 error) *Client_Search_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_Search_Call) Return(searchResult *ldap.SearchResult, err error) *Client_Search_Call { + _c.Call.Return(searchResult, err) return _c } -func (_c *Client_Search_Call) RunAndReturn(run func(*ldap.SearchRequest) (*ldap.SearchResult, error)) *Client_Search_Call { +func (_c *Client_Search_Call) RunAndReturn(run func(searchRequest *ldap.SearchRequest) (*ldap.SearchResult, error)) *Client_Search_Call { _c.Call.Return(run) return _c } -// SearchAsync provides a mock function with given fields: ctx, searchRequest, bufferSize -func (_m *Client) SearchAsync(ctx context.Context, searchRequest *ldap.SearchRequest, bufferSize int) ldap.Response { - ret := _m.Called(ctx, searchRequest, bufferSize) +// SearchAsync provides a mock function for the type Client +func (_mock *Client) SearchAsync(ctx context.Context, searchRequest *ldap.SearchRequest, bufferSize int) ldap.Response { + ret := _mock.Called(ctx, searchRequest, bufferSize) if len(ret) == 0 { panic("no return value specified for SearchAsync") } var r0 ldap.Response - if rf, ok := ret.Get(0).(func(context.Context, *ldap.SearchRequest, int) ldap.Response); ok { - r0 = rf(ctx, searchRequest, bufferSize) + if returnFunc, ok := ret.Get(0).(func(context.Context, *ldap.SearchRequest, int) ldap.Response); ok { + r0 = returnFunc(ctx, searchRequest, bufferSize) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(ldap.Response) } } - return r0 } @@ -923,24 +1051,40 @@ func (_e *Client_Expecter) SearchAsync(ctx interface{}, searchRequest interface{ func (_c *Client_SearchAsync_Call) Run(run func(ctx context.Context, searchRequest *ldap.SearchRequest, bufferSize int)) *Client_SearchAsync_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*ldap.SearchRequest), args[2].(int)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *ldap.SearchRequest + if args[1] != nil { + arg1 = args[1].(*ldap.SearchRequest) + } + var arg2 int + if args[2] != nil { + arg2 = args[2].(int) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *Client_SearchAsync_Call) Return(_a0 ldap.Response) *Client_SearchAsync_Call { - _c.Call.Return(_a0) +func (_c *Client_SearchAsync_Call) Return(response ldap.Response) *Client_SearchAsync_Call { + _c.Call.Return(response) return _c } -func (_c *Client_SearchAsync_Call) RunAndReturn(run func(context.Context, *ldap.SearchRequest, int) ldap.Response) *Client_SearchAsync_Call { +func (_c *Client_SearchAsync_Call) RunAndReturn(run func(ctx context.Context, searchRequest *ldap.SearchRequest, bufferSize int) ldap.Response) *Client_SearchAsync_Call { _c.Call.Return(run) return _c } -// SearchWithPaging provides a mock function with given fields: searchRequest, pagingSize -func (_m *Client) SearchWithPaging(searchRequest *ldap.SearchRequest, pagingSize uint32) (*ldap.SearchResult, error) { - ret := _m.Called(searchRequest, pagingSize) +// SearchWithPaging provides a mock function for the type Client +func (_mock *Client) SearchWithPaging(searchRequest *ldap.SearchRequest, pagingSize uint32) (*ldap.SearchResult, error) { + ret := _mock.Called(searchRequest, pagingSize) if len(ret) == 0 { panic("no return value specified for SearchWithPaging") @@ -948,23 +1092,21 @@ func (_m *Client) SearchWithPaging(searchRequest *ldap.SearchRequest, pagingSize var r0 *ldap.SearchResult var r1 error - if rf, ok := ret.Get(0).(func(*ldap.SearchRequest, uint32) (*ldap.SearchResult, error)); ok { - return rf(searchRequest, pagingSize) + if returnFunc, ok := ret.Get(0).(func(*ldap.SearchRequest, uint32) (*ldap.SearchResult, error)); ok { + return returnFunc(searchRequest, pagingSize) } - if rf, ok := ret.Get(0).(func(*ldap.SearchRequest, uint32) *ldap.SearchResult); ok { - r0 = rf(searchRequest, pagingSize) + if returnFunc, ok := ret.Get(0).(func(*ldap.SearchRequest, uint32) *ldap.SearchResult); ok { + r0 = returnFunc(searchRequest, pagingSize) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*ldap.SearchResult) } } - - if rf, ok := ret.Get(1).(func(*ldap.SearchRequest, uint32) error); ok { - r1 = rf(searchRequest, pagingSize) + if returnFunc, ok := ret.Get(1).(func(*ldap.SearchRequest, uint32) error); ok { + r1 = returnFunc(searchRequest, pagingSize) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -982,24 +1124,36 @@ func (_e *Client_Expecter) SearchWithPaging(searchRequest interface{}, pagingSiz func (_c *Client_SearchWithPaging_Call) Run(run func(searchRequest *ldap.SearchRequest, pagingSize uint32)) *Client_SearchWithPaging_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*ldap.SearchRequest), args[1].(uint32)) + var arg0 *ldap.SearchRequest + if args[0] != nil { + arg0 = args[0].(*ldap.SearchRequest) + } + var arg1 uint32 + if args[1] != nil { + arg1 = args[1].(uint32) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Client_SearchWithPaging_Call) Return(_a0 *ldap.SearchResult, _a1 error) *Client_SearchWithPaging_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_SearchWithPaging_Call) Return(searchResult *ldap.SearchResult, err error) *Client_SearchWithPaging_Call { + _c.Call.Return(searchResult, err) return _c } -func (_c *Client_SearchWithPaging_Call) RunAndReturn(run func(*ldap.SearchRequest, uint32) (*ldap.SearchResult, error)) *Client_SearchWithPaging_Call { +func (_c *Client_SearchWithPaging_Call) RunAndReturn(run func(searchRequest *ldap.SearchRequest, pagingSize uint32) (*ldap.SearchResult, error)) *Client_SearchWithPaging_Call { _c.Call.Return(run) return _c } -// SetTimeout provides a mock function with given fields: _a0 -func (_m *Client) SetTimeout(_a0 time.Duration) { - _m.Called(_a0) +// SetTimeout provides a mock function for the type Client +func (_mock *Client) SetTimeout(duration time.Duration) { + _mock.Called(duration) + return } // Client_SetTimeout_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetTimeout' @@ -1008,14 +1162,20 @@ type Client_SetTimeout_Call struct { } // SetTimeout is a helper method to define mock.On call -// - _a0 time.Duration -func (_e *Client_Expecter) SetTimeout(_a0 interface{}) *Client_SetTimeout_Call { - return &Client_SetTimeout_Call{Call: _e.mock.On("SetTimeout", _a0)} +// - duration time.Duration +func (_e *Client_Expecter) SetTimeout(duration interface{}) *Client_SetTimeout_Call { + return &Client_SetTimeout_Call{Call: _e.mock.On("SetTimeout", duration)} } -func (_c *Client_SetTimeout_Call) Run(run func(_a0 time.Duration)) *Client_SetTimeout_Call { +func (_c *Client_SetTimeout_Call) Run(run func(duration time.Duration)) *Client_SetTimeout_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(time.Duration)) + var arg0 time.Duration + if args[0] != nil { + arg0 = args[0].(time.Duration) + } + run( + arg0, + ) }) return _c } @@ -1025,14 +1185,14 @@ func (_c *Client_SetTimeout_Call) Return() *Client_SetTimeout_Call { return _c } -func (_c *Client_SetTimeout_Call) RunAndReturn(run func(time.Duration)) *Client_SetTimeout_Call { +func (_c *Client_SetTimeout_Call) RunAndReturn(run func(duration time.Duration)) *Client_SetTimeout_Call { _c.Run(run) return _c } -// SimpleBind provides a mock function with given fields: _a0 -func (_m *Client) SimpleBind(_a0 *ldap.SimpleBindRequest) (*ldap.SimpleBindResult, error) { - ret := _m.Called(_a0) +// SimpleBind provides a mock function for the type Client +func (_mock *Client) SimpleBind(simpleBindRequest *ldap.SimpleBindRequest) (*ldap.SimpleBindResult, error) { + ret := _mock.Called(simpleBindRequest) if len(ret) == 0 { panic("no return value specified for SimpleBind") @@ -1040,23 +1200,21 @@ func (_m *Client) SimpleBind(_a0 *ldap.SimpleBindRequest) (*ldap.SimpleBindResul var r0 *ldap.SimpleBindResult var r1 error - if rf, ok := ret.Get(0).(func(*ldap.SimpleBindRequest) (*ldap.SimpleBindResult, error)); ok { - return rf(_a0) + if returnFunc, ok := ret.Get(0).(func(*ldap.SimpleBindRequest) (*ldap.SimpleBindResult, error)); ok { + return returnFunc(simpleBindRequest) } - if rf, ok := ret.Get(0).(func(*ldap.SimpleBindRequest) *ldap.SimpleBindResult); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(*ldap.SimpleBindRequest) *ldap.SimpleBindResult); ok { + r0 = returnFunc(simpleBindRequest) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*ldap.SimpleBindResult) } } - - if rf, ok := ret.Get(1).(func(*ldap.SimpleBindRequest) error); ok { - r1 = rf(_a0) + if returnFunc, ok := ret.Get(1).(func(*ldap.SimpleBindRequest) error); ok { + r1 = returnFunc(simpleBindRequest) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1066,31 +1224,38 @@ type Client_SimpleBind_Call struct { } // SimpleBind is a helper method to define mock.On call -// - _a0 *ldap.SimpleBindRequest -func (_e *Client_Expecter) SimpleBind(_a0 interface{}) *Client_SimpleBind_Call { - return &Client_SimpleBind_Call{Call: _e.mock.On("SimpleBind", _a0)} +// - simpleBindRequest *ldap.SimpleBindRequest +func (_e *Client_Expecter) SimpleBind(simpleBindRequest interface{}) *Client_SimpleBind_Call { + return &Client_SimpleBind_Call{Call: _e.mock.On("SimpleBind", simpleBindRequest)} } -func (_c *Client_SimpleBind_Call) Run(run func(_a0 *ldap.SimpleBindRequest)) *Client_SimpleBind_Call { +func (_c *Client_SimpleBind_Call) Run(run func(simpleBindRequest *ldap.SimpleBindRequest)) *Client_SimpleBind_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*ldap.SimpleBindRequest)) + var arg0 *ldap.SimpleBindRequest + if args[0] != nil { + arg0 = args[0].(*ldap.SimpleBindRequest) + } + run( + arg0, + ) }) return _c } -func (_c *Client_SimpleBind_Call) Return(_a0 *ldap.SimpleBindResult, _a1 error) *Client_SimpleBind_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_SimpleBind_Call) Return(simpleBindResult *ldap.SimpleBindResult, err error) *Client_SimpleBind_Call { + _c.Call.Return(simpleBindResult, err) return _c } -func (_c *Client_SimpleBind_Call) RunAndReturn(run func(*ldap.SimpleBindRequest) (*ldap.SimpleBindResult, error)) *Client_SimpleBind_Call { +func (_c *Client_SimpleBind_Call) RunAndReturn(run func(simpleBindRequest *ldap.SimpleBindRequest) (*ldap.SimpleBindResult, error)) *Client_SimpleBind_Call { _c.Call.Return(run) return _c } -// Start provides a mock function with no fields -func (_m *Client) Start() { - _m.Called() +// Start provides a mock function for the type Client +func (_mock *Client) Start() { + _mock.Called() + return } // Client_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' @@ -1120,21 +1285,20 @@ func (_c *Client_Start_Call) RunAndReturn(run func()) *Client_Start_Call { return _c } -// StartTLS provides a mock function with given fields: _a0 -func (_m *Client) StartTLS(_a0 *tls.Config) error { - ret := _m.Called(_a0) +// StartTLS provides a mock function for the type Client +func (_mock *Client) StartTLS(config *tls.Config) error { + ret := _mock.Called(config) if len(ret) == 0 { panic("no return value specified for StartTLS") } var r0 error - if rf, ok := ret.Get(0).(func(*tls.Config) error); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(*tls.Config) error); ok { + r0 = returnFunc(config) } else { r0 = ret.Error(0) } - return r0 } @@ -1144,45 +1308,50 @@ type Client_StartTLS_Call struct { } // StartTLS is a helper method to define mock.On call -// - _a0 *tls.Config -func (_e *Client_Expecter) StartTLS(_a0 interface{}) *Client_StartTLS_Call { - return &Client_StartTLS_Call{Call: _e.mock.On("StartTLS", _a0)} +// - config *tls.Config +func (_e *Client_Expecter) StartTLS(config interface{}) *Client_StartTLS_Call { + return &Client_StartTLS_Call{Call: _e.mock.On("StartTLS", config)} } -func (_c *Client_StartTLS_Call) Run(run func(_a0 *tls.Config)) *Client_StartTLS_Call { +func (_c *Client_StartTLS_Call) Run(run func(config *tls.Config)) *Client_StartTLS_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*tls.Config)) + var arg0 *tls.Config + if args[0] != nil { + arg0 = args[0].(*tls.Config) + } + run( + arg0, + ) }) return _c } -func (_c *Client_StartTLS_Call) Return(_a0 error) *Client_StartTLS_Call { - _c.Call.Return(_a0) +func (_c *Client_StartTLS_Call) Return(err error) *Client_StartTLS_Call { + _c.Call.Return(err) return _c } -func (_c *Client_StartTLS_Call) RunAndReturn(run func(*tls.Config) error) *Client_StartTLS_Call { +func (_c *Client_StartTLS_Call) RunAndReturn(run func(config *tls.Config) error) *Client_StartTLS_Call { _c.Call.Return(run) return _c } -// Syncrepl provides a mock function with given fields: ctx, searchRequest, bufferSize, mode, cookie, reloadHint -func (_m *Client) Syncrepl(ctx context.Context, searchRequest *ldap.SearchRequest, bufferSize int, mode ldap.ControlSyncRequestMode, cookie []byte, reloadHint bool) ldap.Response { - ret := _m.Called(ctx, searchRequest, bufferSize, mode, cookie, reloadHint) +// Syncrepl provides a mock function for the type Client +func (_mock *Client) Syncrepl(ctx context.Context, searchRequest *ldap.SearchRequest, bufferSize int, mode ldap.ControlSyncRequestMode, cookie []byte, reloadHint bool) ldap.Response { + ret := _mock.Called(ctx, searchRequest, bufferSize, mode, cookie, reloadHint) if len(ret) == 0 { panic("no return value specified for Syncrepl") } var r0 ldap.Response - if rf, ok := ret.Get(0).(func(context.Context, *ldap.SearchRequest, int, ldap.ControlSyncRequestMode, []byte, bool) ldap.Response); ok { - r0 = rf(ctx, searchRequest, bufferSize, mode, cookie, reloadHint) + if returnFunc, ok := ret.Get(0).(func(context.Context, *ldap.SearchRequest, int, ldap.ControlSyncRequestMode, []byte, bool) ldap.Response); ok { + r0 = returnFunc(ctx, searchRequest, bufferSize, mode, cookie, reloadHint) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(ldap.Response) } } - return r0 } @@ -1204,24 +1373,55 @@ func (_e *Client_Expecter) Syncrepl(ctx interface{}, searchRequest interface{}, func (_c *Client_Syncrepl_Call) Run(run func(ctx context.Context, searchRequest *ldap.SearchRequest, bufferSize int, mode ldap.ControlSyncRequestMode, cookie []byte, reloadHint bool)) *Client_Syncrepl_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*ldap.SearchRequest), args[2].(int), args[3].(ldap.ControlSyncRequestMode), args[4].([]byte), args[5].(bool)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *ldap.SearchRequest + if args[1] != nil { + arg1 = args[1].(*ldap.SearchRequest) + } + var arg2 int + if args[2] != nil { + arg2 = args[2].(int) + } + var arg3 ldap.ControlSyncRequestMode + if args[3] != nil { + arg3 = args[3].(ldap.ControlSyncRequestMode) + } + var arg4 []byte + if args[4] != nil { + arg4 = args[4].([]byte) + } + var arg5 bool + if args[5] != nil { + arg5 = args[5].(bool) + } + run( + arg0, + arg1, + arg2, + arg3, + arg4, + arg5, + ) }) return _c } -func (_c *Client_Syncrepl_Call) Return(_a0 ldap.Response) *Client_Syncrepl_Call { - _c.Call.Return(_a0) +func (_c *Client_Syncrepl_Call) Return(response ldap.Response) *Client_Syncrepl_Call { + _c.Call.Return(response) return _c } -func (_c *Client_Syncrepl_Call) RunAndReturn(run func(context.Context, *ldap.SearchRequest, int, ldap.ControlSyncRequestMode, []byte, bool) ldap.Response) *Client_Syncrepl_Call { +func (_c *Client_Syncrepl_Call) RunAndReturn(run func(ctx context.Context, searchRequest *ldap.SearchRequest, bufferSize int, mode ldap.ControlSyncRequestMode, cookie []byte, reloadHint bool) ldap.Response) *Client_Syncrepl_Call { _c.Call.Return(run) return _c } -// TLSConnectionState provides a mock function with no fields -func (_m *Client) TLSConnectionState() (tls.ConnectionState, bool) { - ret := _m.Called() +// TLSConnectionState provides a mock function for the type Client +func (_mock *Client) TLSConnectionState() (tls.ConnectionState, bool) { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for TLSConnectionState") @@ -1229,21 +1429,19 @@ func (_m *Client) TLSConnectionState() (tls.ConnectionState, bool) { var r0 tls.ConnectionState var r1 bool - if rf, ok := ret.Get(0).(func() (tls.ConnectionState, bool)); ok { - return rf() + if returnFunc, ok := ret.Get(0).(func() (tls.ConnectionState, bool)); ok { + return returnFunc() } - if rf, ok := ret.Get(0).(func() tls.ConnectionState); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() tls.ConnectionState); ok { + r0 = returnFunc() } else { r0 = ret.Get(0).(tls.ConnectionState) } - - if rf, ok := ret.Get(1).(func() bool); ok { - r1 = rf() + if returnFunc, ok := ret.Get(1).(func() bool); ok { + r1 = returnFunc() } else { r1 = ret.Get(1).(bool) } - return r0, r1 } @@ -1264,8 +1462,8 @@ func (_c *Client_TLSConnectionState_Call) Run(run func()) *Client_TLSConnectionS return _c } -func (_c *Client_TLSConnectionState_Call) Return(_a0 tls.ConnectionState, _a1 bool) *Client_TLSConnectionState_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_TLSConnectionState_Call) Return(connectionState tls.ConnectionState, b bool) *Client_TLSConnectionState_Call { + _c.Call.Return(connectionState, b) return _c } @@ -1274,21 +1472,20 @@ func (_c *Client_TLSConnectionState_Call) RunAndReturn(run func() (tls.Connectio return _c } -// UnauthenticatedBind provides a mock function with given fields: username -func (_m *Client) UnauthenticatedBind(username string) error { - ret := _m.Called(username) +// UnauthenticatedBind provides a mock function for the type Client +func (_mock *Client) UnauthenticatedBind(username string) error { + ret := _mock.Called(username) if len(ret) == 0 { panic("no return value specified for UnauthenticatedBind") } var r0 error - if rf, ok := ret.Get(0).(func(string) error); ok { - r0 = rf(username) + if returnFunc, ok := ret.Get(0).(func(string) error); ok { + r0 = returnFunc(username) } else { r0 = ret.Error(0) } - return r0 } @@ -1305,36 +1502,41 @@ func (_e *Client_Expecter) UnauthenticatedBind(username interface{}) *Client_Una func (_c *Client_UnauthenticatedBind_Call) Run(run func(username string)) *Client_UnauthenticatedBind_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) }) return _c } -func (_c *Client_UnauthenticatedBind_Call) Return(_a0 error) *Client_UnauthenticatedBind_Call { - _c.Call.Return(_a0) +func (_c *Client_UnauthenticatedBind_Call) Return(err error) *Client_UnauthenticatedBind_Call { + _c.Call.Return(err) return _c } -func (_c *Client_UnauthenticatedBind_Call) RunAndReturn(run func(string) error) *Client_UnauthenticatedBind_Call { +func (_c *Client_UnauthenticatedBind_Call) RunAndReturn(run func(username string) error) *Client_UnauthenticatedBind_Call { _c.Call.Return(run) return _c } -// Unbind provides a mock function with no fields -func (_m *Client) Unbind() error { - ret := _m.Called() +// Unbind provides a mock function for the type Client +func (_mock *Client) Unbind() error { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Unbind") } var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() error); ok { + r0 = returnFunc() } else { r0 = ret.Error(0) } - return r0 } @@ -1355,8 +1557,8 @@ func (_c *Client_Unbind_Call) Run(run func()) *Client_Unbind_Call { return _c } -func (_c *Client_Unbind_Call) Return(_a0 error) *Client_Unbind_Call { - _c.Call.Return(_a0) +func (_c *Client_Unbind_Call) Return(err error) *Client_Unbind_Call { + _c.Call.Return(err) return _c } @@ -1364,17 +1566,3 @@ func (_c *Client_Unbind_Call) RunAndReturn(run func() error) *Client_Unbind_Call _c.Call.Return(run) return _c } - -// NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewClient(t interface { - mock.TestingT - Cleanup(func()) -}) *Client { - mock := &Client{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/services/invitations/.mockery.yaml b/services/invitations/.mockery.yaml index 84d1859941..b56d6c0dce 100644 --- a/services/invitations/.mockery.yaml +++ b/services/invitations/.mockery.yaml @@ -1,13 +1,13 @@ -issue-845-fix: True -resolve-type-alias: False -with-expecter: true -disable-version-string: True +# maintain v2 separate mocks dir +dir: "{{.InterfaceDir}}/mocks" +structname: "{{.InterfaceName}}" filename: "{{.InterfaceName | snakecase }}.go" -mockname: "{{.InterfaceName}}" -outpkg: "mocks" +pkgname: mocks + +template: testify packages: - github.com/opencloud-eu/opencloud/pkg/keycloak: - config: - dir: "pkg/backends/keycloak/mocks" - interfaces: - Client: + github.com/opencloud-eu/opencloud/pkg/keycloak: + config: + dir: pkg/backends/keycloak/mocks + interfaces: + Client: {} diff --git a/services/invitations/pkg/backends/keycloak/mocks/client.go b/services/invitations/pkg/backends/keycloak/mocks/client.go index ac0d13f9dd..4683c0d8ce 100644 --- a/services/invitations/pkg/backends/keycloak/mocks/client.go +++ b/services/invitations/pkg/backends/keycloak/mocks/client.go @@ -1,16 +1,31 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" - - keycloak "github.com/opencloud-eu/opencloud/pkg/keycloak" - libregraph "github.com/opencloud-eu/libre-graph-api-go" + "context" + "github.com/opencloud-eu/libre-graph-api-go" + "github.com/opencloud-eu/opencloud/pkg/keycloak" mock "github.com/stretchr/testify/mock" ) +// NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewClient(t interface { + mock.TestingT + Cleanup(func()) +}) *Client { + mock := &Client{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // Client is an autogenerated mock type for the Client type type Client struct { mock.Mock @@ -24,9 +39,9 @@ func (_m *Client) EXPECT() *Client_Expecter { return &Client_Expecter{mock: &_m.Mock} } -// CreateUser provides a mock function with given fields: ctx, realm, user, userActions -func (_m *Client) CreateUser(ctx context.Context, realm string, user *libregraph.User, userActions []keycloak.UserAction) (string, error) { - ret := _m.Called(ctx, realm, user, userActions) +// CreateUser provides a mock function for the type Client +func (_mock *Client) CreateUser(ctx context.Context, realm string, user *libregraph.User, userActions []keycloak.UserAction) (string, error) { + ret := _mock.Called(ctx, realm, user, userActions) if len(ret) == 0 { panic("no return value specified for CreateUser") @@ -34,21 +49,19 @@ func (_m *Client) CreateUser(ctx context.Context, realm string, user *libregraph var r0 string var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, *libregraph.User, []keycloak.UserAction) (string, error)); ok { - return rf(ctx, realm, user, userActions) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, *libregraph.User, []keycloak.UserAction) (string, error)); ok { + return returnFunc(ctx, realm, user, userActions) } - if rf, ok := ret.Get(0).(func(context.Context, string, *libregraph.User, []keycloak.UserAction) string); ok { - r0 = rf(ctx, realm, user, userActions) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, *libregraph.User, []keycloak.UserAction) string); ok { + r0 = returnFunc(ctx, realm, user, userActions) } else { r0 = ret.Get(0).(string) } - - if rf, ok := ret.Get(1).(func(context.Context, string, *libregraph.User, []keycloak.UserAction) error); ok { - r1 = rf(ctx, realm, user, userActions) + if returnFunc, ok := ret.Get(1).(func(context.Context, string, *libregraph.User, []keycloak.UserAction) error); ok { + r1 = returnFunc(ctx, realm, user, userActions) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -68,24 +81,45 @@ func (_e *Client_Expecter) CreateUser(ctx interface{}, realm interface{}, user i func (_c *Client_CreateUser_Call) Run(run func(ctx context.Context, realm string, user *libregraph.User, userActions []keycloak.UserAction)) *Client_CreateUser_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(*libregraph.User), args[3].([]keycloak.UserAction)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 *libregraph.User + if args[2] != nil { + arg2 = args[2].(*libregraph.User) + } + var arg3 []keycloak.UserAction + if args[3] != nil { + arg3 = args[3].([]keycloak.UserAction) + } + run( + arg0, + arg1, + arg2, + arg3, + ) }) return _c } -func (_c *Client_CreateUser_Call) Return(_a0 string, _a1 error) *Client_CreateUser_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_CreateUser_Call) Return(s string, err error) *Client_CreateUser_Call { + _c.Call.Return(s, err) return _c } -func (_c *Client_CreateUser_Call) RunAndReturn(run func(context.Context, string, *libregraph.User, []keycloak.UserAction) (string, error)) *Client_CreateUser_Call { +func (_c *Client_CreateUser_Call) RunAndReturn(run func(ctx context.Context, realm string, user *libregraph.User, userActions []keycloak.UserAction) (string, error)) *Client_CreateUser_Call { _c.Call.Return(run) return _c } -// GetPIIReport provides a mock function with given fields: ctx, realm, username -func (_m *Client) GetPIIReport(ctx context.Context, realm string, username string) (*keycloak.PIIReport, error) { - ret := _m.Called(ctx, realm, username) +// GetPIIReport provides a mock function for the type Client +func (_mock *Client) GetPIIReport(ctx context.Context, realm string, username string) (*keycloak.PIIReport, error) { + ret := _mock.Called(ctx, realm, username) if len(ret) == 0 { panic("no return value specified for GetPIIReport") @@ -93,23 +127,21 @@ func (_m *Client) GetPIIReport(ctx context.Context, realm string, username strin var r0 *keycloak.PIIReport var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) (*keycloak.PIIReport, error)); ok { - return rf(ctx, realm, username) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (*keycloak.PIIReport, error)); ok { + return returnFunc(ctx, realm, username) } - if rf, ok := ret.Get(0).(func(context.Context, string, string) *keycloak.PIIReport); ok { - r0 = rf(ctx, realm, username) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) *keycloak.PIIReport); ok { + r0 = returnFunc(ctx, realm, username) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*keycloak.PIIReport) } } - - if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { - r1 = rf(ctx, realm, username) + if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = returnFunc(ctx, realm, username) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -128,24 +160,40 @@ func (_e *Client_Expecter) GetPIIReport(ctx interface{}, realm interface{}, user func (_c *Client_GetPIIReport_Call) Run(run func(ctx context.Context, realm string, username string)) *Client_GetPIIReport_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *Client_GetPIIReport_Call) Return(_a0 *keycloak.PIIReport, _a1 error) *Client_GetPIIReport_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_GetPIIReport_Call) Return(pIIReport *keycloak.PIIReport, err error) *Client_GetPIIReport_Call { + _c.Call.Return(pIIReport, err) return _c } -func (_c *Client_GetPIIReport_Call) RunAndReturn(run func(context.Context, string, string) (*keycloak.PIIReport, error)) *Client_GetPIIReport_Call { +func (_c *Client_GetPIIReport_Call) RunAndReturn(run func(ctx context.Context, realm string, username string) (*keycloak.PIIReport, error)) *Client_GetPIIReport_Call { _c.Call.Return(run) return _c } -// GetUserByUsername provides a mock function with given fields: ctx, realm, username -func (_m *Client) GetUserByUsername(ctx context.Context, realm string, username string) (*libregraph.User, error) { - ret := _m.Called(ctx, realm, username) +// GetUserByUsername provides a mock function for the type Client +func (_mock *Client) GetUserByUsername(ctx context.Context, realm string, username string) (*libregraph.User, error) { + ret := _mock.Called(ctx, realm, username) if len(ret) == 0 { panic("no return value specified for GetUserByUsername") @@ -153,23 +201,21 @@ func (_m *Client) GetUserByUsername(ctx context.Context, realm string, username var r0 *libregraph.User var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) (*libregraph.User, error)); ok { - return rf(ctx, realm, username) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (*libregraph.User, error)); ok { + return returnFunc(ctx, realm, username) } - if rf, ok := ret.Get(0).(func(context.Context, string, string) *libregraph.User); ok { - r0 = rf(ctx, realm, username) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) *libregraph.User); ok { + r0 = returnFunc(ctx, realm, username) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*libregraph.User) } } - - if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { - r1 = rf(ctx, realm, username) + if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = returnFunc(ctx, realm, username) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -188,36 +234,51 @@ func (_e *Client_Expecter) GetUserByUsername(ctx interface{}, realm interface{}, func (_c *Client_GetUserByUsername_Call) Run(run func(ctx context.Context, realm string, username string)) *Client_GetUserByUsername_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *Client_GetUserByUsername_Call) Return(_a0 *libregraph.User, _a1 error) *Client_GetUserByUsername_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_GetUserByUsername_Call) Return(user *libregraph.User, err error) *Client_GetUserByUsername_Call { + _c.Call.Return(user, err) return _c } -func (_c *Client_GetUserByUsername_Call) RunAndReturn(run func(context.Context, string, string) (*libregraph.User, error)) *Client_GetUserByUsername_Call { +func (_c *Client_GetUserByUsername_Call) RunAndReturn(run func(ctx context.Context, realm string, username string) (*libregraph.User, error)) *Client_GetUserByUsername_Call { _c.Call.Return(run) return _c } -// SendActionsMail provides a mock function with given fields: ctx, realm, userID, userActions -func (_m *Client) SendActionsMail(ctx context.Context, realm string, userID string, userActions []keycloak.UserAction) error { - ret := _m.Called(ctx, realm, userID, userActions) +// SendActionsMail provides a mock function for the type Client +func (_mock *Client) SendActionsMail(ctx context.Context, realm string, userID string, userActions []keycloak.UserAction) error { + ret := _mock.Called(ctx, realm, userID, userActions) if len(ret) == 0 { panic("no return value specified for SendActionsMail") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, string, []keycloak.UserAction) error); ok { - r0 = rf(ctx, realm, userID, userActions) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, []keycloak.UserAction) error); ok { + r0 = returnFunc(ctx, realm, userID, userActions) } else { r0 = ret.Error(0) } - return r0 } @@ -237,31 +298,38 @@ func (_e *Client_Expecter) SendActionsMail(ctx interface{}, realm interface{}, u func (_c *Client_SendActionsMail_Call) Run(run func(ctx context.Context, realm string, userID string, userActions []keycloak.UserAction)) *Client_SendActionsMail_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].([]keycloak.UserAction)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + var arg3 []keycloak.UserAction + if args[3] != nil { + arg3 = args[3].([]keycloak.UserAction) + } + run( + arg0, + arg1, + arg2, + arg3, + ) }) return _c } -func (_c *Client_SendActionsMail_Call) Return(_a0 error) *Client_SendActionsMail_Call { - _c.Call.Return(_a0) +func (_c *Client_SendActionsMail_Call) Return(err error) *Client_SendActionsMail_Call { + _c.Call.Return(err) return _c } -func (_c *Client_SendActionsMail_Call) RunAndReturn(run func(context.Context, string, string, []keycloak.UserAction) error) *Client_SendActionsMail_Call { +func (_c *Client_SendActionsMail_Call) RunAndReturn(run func(ctx context.Context, realm string, userID string, userActions []keycloak.UserAction) error) *Client_SendActionsMail_Call { _c.Call.Return(run) return _c } - -// NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewClient(t interface { - mock.TestingT - Cleanup(func()) -}) *Client { - mock := &Client{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/services/proxy/.mockery.yaml b/services/proxy/.mockery.yaml index 7491d9e4c4..a490457301 100644 --- a/services/proxy/.mockery.yaml +++ b/services/proxy/.mockery.yaml @@ -1,18 +1,14 @@ -issue-845-fix: True -resolve-type-alias: False -with-expecter: true -disable-version-string: True +# maintain v2 separate mocks dir +dir: "{{.InterfaceDir}}/mocks" +structname: "{{.InterfaceName}}" filename: "{{.InterfaceName | snakecase }}.go" -mockname: "{{.InterfaceName}}" -outpkg: "mocks" +pkgname: mocks + +template: testify packages: - github.com/opencloud-eu/opencloud/services/proxy/pkg/user/backend: - config: - dir: "pkg/user/backend/mocks" - interfaces: - UserBackend: - github.com/opencloud-eu/opencloud/services/proxy/pkg/userroles: - config: - dir: "pkg/userroles/mocks" - interfaces: - UserRoleAssigner: + github.com/opencloud-eu/opencloud/services/proxy/pkg/user/backend: + interfaces: + UserBackend: {} + github.com/opencloud-eu/opencloud/services/proxy/pkg/userroles: + interfaces: + UserRoleAssigner: {} diff --git a/services/proxy/pkg/user/backend/mocks/user_backend.go b/services/proxy/pkg/user/backend/mocks/user_backend.go index 101f8f6f6a..987b00d5d3 100644 --- a/services/proxy/pkg/user/backend/mocks/user_backend.go +++ b/services/proxy/pkg/user/backend/mocks/user_backend.go @@ -1,14 +1,30 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" + "context" - userv1beta1 "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1" + "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1" mock "github.com/stretchr/testify/mock" ) +// NewUserBackend creates a new instance of UserBackend. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewUserBackend(t interface { + mock.TestingT + Cleanup(func()) +}) *UserBackend { + mock := &UserBackend{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // UserBackend is an autogenerated mock type for the UserBackend type type UserBackend struct { mock.Mock @@ -22,9 +38,9 @@ func (_m *UserBackend) EXPECT() *UserBackend_Expecter { return &UserBackend_Expecter{mock: &_m.Mock} } -// Authenticate provides a mock function with given fields: ctx, username, password -func (_m *UserBackend) Authenticate(ctx context.Context, username string, password string) (*userv1beta1.User, string, error) { - ret := _m.Called(ctx, username, password) +// Authenticate provides a mock function for the type UserBackend +func (_mock *UserBackend) Authenticate(ctx context.Context, username string, password string) (*userv1beta1.User, string, error) { + ret := _mock.Called(ctx, username, password) if len(ret) == 0 { panic("no return value specified for Authenticate") @@ -33,29 +49,26 @@ func (_m *UserBackend) Authenticate(ctx context.Context, username string, passwo var r0 *userv1beta1.User var r1 string var r2 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) (*userv1beta1.User, string, error)); ok { - return rf(ctx, username, password) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (*userv1beta1.User, string, error)); ok { + return returnFunc(ctx, username, password) } - if rf, ok := ret.Get(0).(func(context.Context, string, string) *userv1beta1.User); ok { - r0 = rf(ctx, username, password) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) *userv1beta1.User); ok { + r0 = returnFunc(ctx, username, password) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*userv1beta1.User) } } - - if rf, ok := ret.Get(1).(func(context.Context, string, string) string); ok { - r1 = rf(ctx, username, password) + if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) string); ok { + r1 = returnFunc(ctx, username, password) } else { r1 = ret.Get(1).(string) } - - if rf, ok := ret.Get(2).(func(context.Context, string, string) error); ok { - r2 = rf(ctx, username, password) + if returnFunc, ok := ret.Get(2).(func(context.Context, string, string) error); ok { + r2 = returnFunc(ctx, username, password) } else { r2 = ret.Error(2) } - return r0, r1, r2 } @@ -74,24 +87,40 @@ func (_e *UserBackend_Expecter) Authenticate(ctx interface{}, username interface func (_c *UserBackend_Authenticate_Call) Run(run func(ctx context.Context, username string, password string)) *UserBackend_Authenticate_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *UserBackend_Authenticate_Call) Return(_a0 *userv1beta1.User, _a1 string, _a2 error) *UserBackend_Authenticate_Call { - _c.Call.Return(_a0, _a1, _a2) +func (_c *UserBackend_Authenticate_Call) Return(user *userv1beta1.User, s string, err error) *UserBackend_Authenticate_Call { + _c.Call.Return(user, s, err) return _c } -func (_c *UserBackend_Authenticate_Call) RunAndReturn(run func(context.Context, string, string) (*userv1beta1.User, string, error)) *UserBackend_Authenticate_Call { +func (_c *UserBackend_Authenticate_Call) RunAndReturn(run func(ctx context.Context, username string, password string) (*userv1beta1.User, string, error)) *UserBackend_Authenticate_Call { _c.Call.Return(run) return _c } -// CreateUserFromClaims provides a mock function with given fields: ctx, claims -func (_m *UserBackend) CreateUserFromClaims(ctx context.Context, claims map[string]interface{}) (*userv1beta1.User, error) { - ret := _m.Called(ctx, claims) +// CreateUserFromClaims provides a mock function for the type UserBackend +func (_mock *UserBackend) CreateUserFromClaims(ctx context.Context, claims map[string]interface{}) (*userv1beta1.User, error) { + ret := _mock.Called(ctx, claims) if len(ret) == 0 { panic("no return value specified for CreateUserFromClaims") @@ -99,23 +128,21 @@ func (_m *UserBackend) CreateUserFromClaims(ctx context.Context, claims map[stri var r0 *userv1beta1.User var r1 error - if rf, ok := ret.Get(0).(func(context.Context, map[string]interface{}) (*userv1beta1.User, error)); ok { - return rf(ctx, claims) + if returnFunc, ok := ret.Get(0).(func(context.Context, map[string]interface{}) (*userv1beta1.User, error)); ok { + return returnFunc(ctx, claims) } - if rf, ok := ret.Get(0).(func(context.Context, map[string]interface{}) *userv1beta1.User); ok { - r0 = rf(ctx, claims) + if returnFunc, ok := ret.Get(0).(func(context.Context, map[string]interface{}) *userv1beta1.User); ok { + r0 = returnFunc(ctx, claims) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*userv1beta1.User) } } - - if rf, ok := ret.Get(1).(func(context.Context, map[string]interface{}) error); ok { - r1 = rf(ctx, claims) + if returnFunc, ok := ret.Get(1).(func(context.Context, map[string]interface{}) error); ok { + r1 = returnFunc(ctx, claims) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -133,24 +160,35 @@ func (_e *UserBackend_Expecter) CreateUserFromClaims(ctx interface{}, claims int func (_c *UserBackend_CreateUserFromClaims_Call) Run(run func(ctx context.Context, claims map[string]interface{})) *UserBackend_CreateUserFromClaims_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(map[string]interface{})) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 map[string]interface{} + if args[1] != nil { + arg1 = args[1].(map[string]interface{}) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *UserBackend_CreateUserFromClaims_Call) Return(_a0 *userv1beta1.User, _a1 error) *UserBackend_CreateUserFromClaims_Call { - _c.Call.Return(_a0, _a1) +func (_c *UserBackend_CreateUserFromClaims_Call) Return(user *userv1beta1.User, err error) *UserBackend_CreateUserFromClaims_Call { + _c.Call.Return(user, err) return _c } -func (_c *UserBackend_CreateUserFromClaims_Call) RunAndReturn(run func(context.Context, map[string]interface{}) (*userv1beta1.User, error)) *UserBackend_CreateUserFromClaims_Call { +func (_c *UserBackend_CreateUserFromClaims_Call) RunAndReturn(run func(ctx context.Context, claims map[string]interface{}) (*userv1beta1.User, error)) *UserBackend_CreateUserFromClaims_Call { _c.Call.Return(run) return _c } -// GetUserByClaims provides a mock function with given fields: ctx, claim, value -func (_m *UserBackend) GetUserByClaims(ctx context.Context, claim string, value string) (*userv1beta1.User, string, error) { - ret := _m.Called(ctx, claim, value) +// GetUserByClaims provides a mock function for the type UserBackend +func (_mock *UserBackend) GetUserByClaims(ctx context.Context, claim string, value string) (*userv1beta1.User, string, error) { + ret := _mock.Called(ctx, claim, value) if len(ret) == 0 { panic("no return value specified for GetUserByClaims") @@ -159,29 +197,26 @@ func (_m *UserBackend) GetUserByClaims(ctx context.Context, claim string, value var r0 *userv1beta1.User var r1 string var r2 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) (*userv1beta1.User, string, error)); ok { - return rf(ctx, claim, value) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (*userv1beta1.User, string, error)); ok { + return returnFunc(ctx, claim, value) } - if rf, ok := ret.Get(0).(func(context.Context, string, string) *userv1beta1.User); ok { - r0 = rf(ctx, claim, value) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) *userv1beta1.User); ok { + r0 = returnFunc(ctx, claim, value) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*userv1beta1.User) } } - - if rf, ok := ret.Get(1).(func(context.Context, string, string) string); ok { - r1 = rf(ctx, claim, value) + if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) string); ok { + r1 = returnFunc(ctx, claim, value) } else { r1 = ret.Get(1).(string) } - - if rf, ok := ret.Get(2).(func(context.Context, string, string) error); ok { - r2 = rf(ctx, claim, value) + if returnFunc, ok := ret.Get(2).(func(context.Context, string, string) error); ok { + r2 = returnFunc(ctx, claim, value) } else { r2 = ret.Error(2) } - return r0, r1, r2 } @@ -200,36 +235,51 @@ func (_e *UserBackend_Expecter) GetUserByClaims(ctx interface{}, claim interface func (_c *UserBackend_GetUserByClaims_Call) Run(run func(ctx context.Context, claim string, value string)) *UserBackend_GetUserByClaims_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(string)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *UserBackend_GetUserByClaims_Call) Return(_a0 *userv1beta1.User, _a1 string, _a2 error) *UserBackend_GetUserByClaims_Call { - _c.Call.Return(_a0, _a1, _a2) +func (_c *UserBackend_GetUserByClaims_Call) Return(user *userv1beta1.User, s string, err error) *UserBackend_GetUserByClaims_Call { + _c.Call.Return(user, s, err) return _c } -func (_c *UserBackend_GetUserByClaims_Call) RunAndReturn(run func(context.Context, string, string) (*userv1beta1.User, string, error)) *UserBackend_GetUserByClaims_Call { +func (_c *UserBackend_GetUserByClaims_Call) RunAndReturn(run func(ctx context.Context, claim string, value string) (*userv1beta1.User, string, error)) *UserBackend_GetUserByClaims_Call { _c.Call.Return(run) return _c } -// SyncGroupMemberships provides a mock function with given fields: ctx, user, claims -func (_m *UserBackend) SyncGroupMemberships(ctx context.Context, user *userv1beta1.User, claims map[string]interface{}) error { - ret := _m.Called(ctx, user, claims) +// SyncGroupMemberships provides a mock function for the type UserBackend +func (_mock *UserBackend) SyncGroupMemberships(ctx context.Context, user *userv1beta1.User, claims map[string]interface{}) error { + ret := _mock.Called(ctx, user, claims) if len(ret) == 0 { panic("no return value specified for SyncGroupMemberships") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *userv1beta1.User, map[string]interface{}) error); ok { - r0 = rf(ctx, user, claims) + if returnFunc, ok := ret.Get(0).(func(context.Context, *userv1beta1.User, map[string]interface{}) error); ok { + r0 = returnFunc(ctx, user, claims) } else { r0 = ret.Error(0) } - return r0 } @@ -248,36 +298,51 @@ func (_e *UserBackend_Expecter) SyncGroupMemberships(ctx interface{}, user inter func (_c *UserBackend_SyncGroupMemberships_Call) Run(run func(ctx context.Context, user *userv1beta1.User, claims map[string]interface{})) *UserBackend_SyncGroupMemberships_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*userv1beta1.User), args[2].(map[string]interface{})) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *userv1beta1.User + if args[1] != nil { + arg1 = args[1].(*userv1beta1.User) + } + var arg2 map[string]interface{} + if args[2] != nil { + arg2 = args[2].(map[string]interface{}) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *UserBackend_SyncGroupMemberships_Call) Return(_a0 error) *UserBackend_SyncGroupMemberships_Call { - _c.Call.Return(_a0) +func (_c *UserBackend_SyncGroupMemberships_Call) Return(err error) *UserBackend_SyncGroupMemberships_Call { + _c.Call.Return(err) return _c } -func (_c *UserBackend_SyncGroupMemberships_Call) RunAndReturn(run func(context.Context, *userv1beta1.User, map[string]interface{}) error) *UserBackend_SyncGroupMemberships_Call { +func (_c *UserBackend_SyncGroupMemberships_Call) RunAndReturn(run func(ctx context.Context, user *userv1beta1.User, claims map[string]interface{}) error) *UserBackend_SyncGroupMemberships_Call { _c.Call.Return(run) return _c } -// UpdateUserIfNeeded provides a mock function with given fields: ctx, user, claims -func (_m *UserBackend) UpdateUserIfNeeded(ctx context.Context, user *userv1beta1.User, claims map[string]interface{}) error { - ret := _m.Called(ctx, user, claims) +// UpdateUserIfNeeded provides a mock function for the type UserBackend +func (_mock *UserBackend) UpdateUserIfNeeded(ctx context.Context, user *userv1beta1.User, claims map[string]interface{}) error { + ret := _mock.Called(ctx, user, claims) if len(ret) == 0 { panic("no return value specified for UpdateUserIfNeeded") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *userv1beta1.User, map[string]interface{}) error); ok { - r0 = rf(ctx, user, claims) + if returnFunc, ok := ret.Get(0).(func(context.Context, *userv1beta1.User, map[string]interface{}) error); ok { + r0 = returnFunc(ctx, user, claims) } else { r0 = ret.Error(0) } - return r0 } @@ -296,31 +361,33 @@ func (_e *UserBackend_Expecter) UpdateUserIfNeeded(ctx interface{}, user interfa func (_c *UserBackend_UpdateUserIfNeeded_Call) Run(run func(ctx context.Context, user *userv1beta1.User, claims map[string]interface{})) *UserBackend_UpdateUserIfNeeded_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*userv1beta1.User), args[2].(map[string]interface{})) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *userv1beta1.User + if args[1] != nil { + arg1 = args[1].(*userv1beta1.User) + } + var arg2 map[string]interface{} + if args[2] != nil { + arg2 = args[2].(map[string]interface{}) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *UserBackend_UpdateUserIfNeeded_Call) Return(_a0 error) *UserBackend_UpdateUserIfNeeded_Call { - _c.Call.Return(_a0) +func (_c *UserBackend_UpdateUserIfNeeded_Call) Return(err error) *UserBackend_UpdateUserIfNeeded_Call { + _c.Call.Return(err) return _c } -func (_c *UserBackend_UpdateUserIfNeeded_Call) RunAndReturn(run func(context.Context, *userv1beta1.User, map[string]interface{}) error) *UserBackend_UpdateUserIfNeeded_Call { +func (_c *UserBackend_UpdateUserIfNeeded_Call) RunAndReturn(run func(ctx context.Context, user *userv1beta1.User, claims map[string]interface{}) error) *UserBackend_UpdateUserIfNeeded_Call { _c.Call.Return(run) return _c } - -// NewUserBackend creates a new instance of UserBackend. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewUserBackend(t interface { - mock.TestingT - Cleanup(func()) -}) *UserBackend { - mock := &UserBackend{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/services/proxy/pkg/userroles/mocks/user_role_assigner.go b/services/proxy/pkg/userroles/mocks/user_role_assigner.go index 0549f79598..1fb1f35b89 100644 --- a/services/proxy/pkg/userroles/mocks/user_role_assigner.go +++ b/services/proxy/pkg/userroles/mocks/user_role_assigner.go @@ -1,15 +1,30 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" + "context" + "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1" mock "github.com/stretchr/testify/mock" - - userv1beta1 "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1" ) +// NewUserRoleAssigner creates a new instance of UserRoleAssigner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewUserRoleAssigner(t interface { + mock.TestingT + Cleanup(func()) +}) *UserRoleAssigner { + mock := &UserRoleAssigner{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // UserRoleAssigner is an autogenerated mock type for the UserRoleAssigner type type UserRoleAssigner struct { mock.Mock @@ -23,9 +38,9 @@ func (_m *UserRoleAssigner) EXPECT() *UserRoleAssigner_Expecter { return &UserRoleAssigner_Expecter{mock: &_m.Mock} } -// ApplyUserRole provides a mock function with given fields: ctx, user -func (_m *UserRoleAssigner) ApplyUserRole(ctx context.Context, user *userv1beta1.User) (*userv1beta1.User, error) { - ret := _m.Called(ctx, user) +// ApplyUserRole provides a mock function for the type UserRoleAssigner +func (_mock *UserRoleAssigner) ApplyUserRole(ctx context.Context, user *userv1beta1.User) (*userv1beta1.User, error) { + ret := _mock.Called(ctx, user) if len(ret) == 0 { panic("no return value specified for ApplyUserRole") @@ -33,23 +48,21 @@ func (_m *UserRoleAssigner) ApplyUserRole(ctx context.Context, user *userv1beta1 var r0 *userv1beta1.User var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *userv1beta1.User) (*userv1beta1.User, error)); ok { - return rf(ctx, user) + if returnFunc, ok := ret.Get(0).(func(context.Context, *userv1beta1.User) (*userv1beta1.User, error)); ok { + return returnFunc(ctx, user) } - if rf, ok := ret.Get(0).(func(context.Context, *userv1beta1.User) *userv1beta1.User); ok { - r0 = rf(ctx, user) + if returnFunc, ok := ret.Get(0).(func(context.Context, *userv1beta1.User) *userv1beta1.User); ok { + r0 = returnFunc(ctx, user) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*userv1beta1.User) } } - - if rf, ok := ret.Get(1).(func(context.Context, *userv1beta1.User) error); ok { - r1 = rf(ctx, user) + if returnFunc, ok := ret.Get(1).(func(context.Context, *userv1beta1.User) error); ok { + r1 = returnFunc(ctx, user) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -67,24 +80,35 @@ func (_e *UserRoleAssigner_Expecter) ApplyUserRole(ctx interface{}, user interfa func (_c *UserRoleAssigner_ApplyUserRole_Call) Run(run func(ctx context.Context, user *userv1beta1.User)) *UserRoleAssigner_ApplyUserRole_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*userv1beta1.User)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *userv1beta1.User + if args[1] != nil { + arg1 = args[1].(*userv1beta1.User) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *UserRoleAssigner_ApplyUserRole_Call) Return(_a0 *userv1beta1.User, _a1 error) *UserRoleAssigner_ApplyUserRole_Call { - _c.Call.Return(_a0, _a1) +func (_c *UserRoleAssigner_ApplyUserRole_Call) Return(user1 *userv1beta1.User, err error) *UserRoleAssigner_ApplyUserRole_Call { + _c.Call.Return(user1, err) return _c } -func (_c *UserRoleAssigner_ApplyUserRole_Call) RunAndReturn(run func(context.Context, *userv1beta1.User) (*userv1beta1.User, error)) *UserRoleAssigner_ApplyUserRole_Call { +func (_c *UserRoleAssigner_ApplyUserRole_Call) RunAndReturn(run func(ctx context.Context, user *userv1beta1.User) (*userv1beta1.User, error)) *UserRoleAssigner_ApplyUserRole_Call { _c.Call.Return(run) return _c } -// UpdateUserRoleAssignment provides a mock function with given fields: ctx, user, claims -func (_m *UserRoleAssigner) UpdateUserRoleAssignment(ctx context.Context, user *userv1beta1.User, claims map[string]interface{}) (*userv1beta1.User, error) { - ret := _m.Called(ctx, user, claims) +// UpdateUserRoleAssignment provides a mock function for the type UserRoleAssigner +func (_mock *UserRoleAssigner) UpdateUserRoleAssignment(ctx context.Context, user *userv1beta1.User, claims map[string]interface{}) (*userv1beta1.User, error) { + ret := _mock.Called(ctx, user, claims) if len(ret) == 0 { panic("no return value specified for UpdateUserRoleAssignment") @@ -92,23 +116,21 @@ func (_m *UserRoleAssigner) UpdateUserRoleAssignment(ctx context.Context, user * var r0 *userv1beta1.User var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *userv1beta1.User, map[string]interface{}) (*userv1beta1.User, error)); ok { - return rf(ctx, user, claims) + if returnFunc, ok := ret.Get(0).(func(context.Context, *userv1beta1.User, map[string]interface{}) (*userv1beta1.User, error)); ok { + return returnFunc(ctx, user, claims) } - if rf, ok := ret.Get(0).(func(context.Context, *userv1beta1.User, map[string]interface{}) *userv1beta1.User); ok { - r0 = rf(ctx, user, claims) + if returnFunc, ok := ret.Get(0).(func(context.Context, *userv1beta1.User, map[string]interface{}) *userv1beta1.User); ok { + r0 = returnFunc(ctx, user, claims) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*userv1beta1.User) } } - - if rf, ok := ret.Get(1).(func(context.Context, *userv1beta1.User, map[string]interface{}) error); ok { - r1 = rf(ctx, user, claims) + if returnFunc, ok := ret.Get(1).(func(context.Context, *userv1beta1.User, map[string]interface{}) error); ok { + r1 = returnFunc(ctx, user, claims) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -127,31 +149,33 @@ func (_e *UserRoleAssigner_Expecter) UpdateUserRoleAssignment(ctx interface{}, u func (_c *UserRoleAssigner_UpdateUserRoleAssignment_Call) Run(run func(ctx context.Context, user *userv1beta1.User, claims map[string]interface{})) *UserRoleAssigner_UpdateUserRoleAssignment_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*userv1beta1.User), args[2].(map[string]interface{})) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *userv1beta1.User + if args[1] != nil { + arg1 = args[1].(*userv1beta1.User) + } + var arg2 map[string]interface{} + if args[2] != nil { + arg2 = args[2].(map[string]interface{}) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *UserRoleAssigner_UpdateUserRoleAssignment_Call) Return(_a0 *userv1beta1.User, _a1 error) *UserRoleAssigner_UpdateUserRoleAssignment_Call { - _c.Call.Return(_a0, _a1) +func (_c *UserRoleAssigner_UpdateUserRoleAssignment_Call) Return(user1 *userv1beta1.User, err error) *UserRoleAssigner_UpdateUserRoleAssignment_Call { + _c.Call.Return(user1, err) return _c } -func (_c *UserRoleAssigner_UpdateUserRoleAssignment_Call) RunAndReturn(run func(context.Context, *userv1beta1.User, map[string]interface{}) (*userv1beta1.User, error)) *UserRoleAssigner_UpdateUserRoleAssignment_Call { +func (_c *UserRoleAssigner_UpdateUserRoleAssignment_Call) RunAndReturn(run func(ctx context.Context, user *userv1beta1.User, claims map[string]interface{}) (*userv1beta1.User, error)) *UserRoleAssigner_UpdateUserRoleAssignment_Call { _c.Call.Return(run) return _c } - -// NewUserRoleAssigner creates a new instance of UserRoleAssigner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewUserRoleAssigner(t interface { - mock.TestingT - Cleanup(func()) -}) *UserRoleAssigner { - mock := &UserRoleAssigner{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/services/search/.mockery.yaml b/services/search/.mockery.yaml index b106c9b0d7..12e0d3e066 100644 --- a/services/search/.mockery.yaml +++ b/services/search/.mockery.yaml @@ -1,19 +1,18 @@ -issue-845-fix: True -resolve-type-alias: False -with-expecter: true -disable-version-string: True +# maintain v2 separate mocks dir +dir: "{{.InterfaceDir}}/mocks" +structname: "{{.InterfaceName}}" filename: "{{.InterfaceName | snakecase }}.go" -dir: "pkg/{{.PackageName}}/mocks" -mockname: "{{.InterfaceName}}" -outpkg: "mocks" +pkgname: mocks + +template: testify packages: - github.com/opencloud-eu/opencloud/services/search/pkg/engine: - interfaces: - Engine: - github.com/opencloud-eu/opencloud/services/search/pkg/content: - interfaces: - Extractor: - Retriever: - github.com/opencloud-eu/opencloud/services/search/pkg/search: - interfaces: - Searcher: + github.com/opencloud-eu/opencloud/services/search/pkg/engine: + interfaces: + Engine: {} + github.com/opencloud-eu/opencloud/services/search/pkg/content: + interfaces: + Extractor: {} + Retriever: {} + github.com/opencloud-eu/opencloud/services/search/pkg/search: + interfaces: + Searcher: {} diff --git a/services/search/pkg/content/mocks/extractor.go b/services/search/pkg/content/mocks/extractor.go index 8c3a03b75e..0322486a37 100644 --- a/services/search/pkg/content/mocks/extractor.go +++ b/services/search/pkg/content/mocks/extractor.go @@ -1,17 +1,31 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" - - content "github.com/opencloud-eu/opencloud/services/search/pkg/content" + "context" + "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" + "github.com/opencloud-eu/opencloud/services/search/pkg/content" mock "github.com/stretchr/testify/mock" - - providerv1beta1 "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" ) +// NewExtractor creates a new instance of Extractor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewExtractor(t interface { + mock.TestingT + Cleanup(func()) +}) *Extractor { + mock := &Extractor{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // Extractor is an autogenerated mock type for the Extractor type type Extractor struct { mock.Mock @@ -25,9 +39,9 @@ func (_m *Extractor) EXPECT() *Extractor_Expecter { return &Extractor_Expecter{mock: &_m.Mock} } -// Extract provides a mock function with given fields: ctx, ri -func (_m *Extractor) Extract(ctx context.Context, ri *providerv1beta1.ResourceInfo) (content.Document, error) { - ret := _m.Called(ctx, ri) +// Extract provides a mock function for the type Extractor +func (_mock *Extractor) Extract(ctx context.Context, ri *providerv1beta1.ResourceInfo) (content.Document, error) { + ret := _mock.Called(ctx, ri) if len(ret) == 0 { panic("no return value specified for Extract") @@ -35,21 +49,19 @@ func (_m *Extractor) Extract(ctx context.Context, ri *providerv1beta1.ResourceIn var r0 content.Document var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceInfo) (content.Document, error)); ok { - return rf(ctx, ri) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceInfo) (content.Document, error)); ok { + return returnFunc(ctx, ri) } - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceInfo) content.Document); ok { - r0 = rf(ctx, ri) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceInfo) content.Document); ok { + r0 = returnFunc(ctx, ri) } else { r0 = ret.Get(0).(content.Document) } - - if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceInfo) error); ok { - r1 = rf(ctx, ri) + if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceInfo) error); ok { + r1 = returnFunc(ctx, ri) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -67,31 +79,28 @@ func (_e *Extractor_Expecter) Extract(ctx interface{}, ri interface{}) *Extracto func (_c *Extractor_Extract_Call) Run(run func(ctx context.Context, ri *providerv1beta1.ResourceInfo)) *Extractor_Extract_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceInfo)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *providerv1beta1.ResourceInfo + if args[1] != nil { + arg1 = args[1].(*providerv1beta1.ResourceInfo) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Extractor_Extract_Call) Return(_a0 content.Document, _a1 error) *Extractor_Extract_Call { - _c.Call.Return(_a0, _a1) +func (_c *Extractor_Extract_Call) Return(document content.Document, err error) *Extractor_Extract_Call { + _c.Call.Return(document, err) return _c } -func (_c *Extractor_Extract_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceInfo) (content.Document, error)) *Extractor_Extract_Call { +func (_c *Extractor_Extract_Call) RunAndReturn(run func(ctx context.Context, ri *providerv1beta1.ResourceInfo) (content.Document, error)) *Extractor_Extract_Call { _c.Call.Return(run) return _c } - -// NewExtractor creates a new instance of Extractor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewExtractor(t interface { - mock.TestingT - Cleanup(func()) -}) *Extractor { - mock := &Extractor{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/services/search/pkg/content/mocks/retriever.go b/services/search/pkg/content/mocks/retriever.go index b0b73b20d5..5060f071a3 100644 --- a/services/search/pkg/content/mocks/retriever.go +++ b/services/search/pkg/content/mocks/retriever.go @@ -1,16 +1,31 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" - io "io" + "context" + "io" + "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" mock "github.com/stretchr/testify/mock" - - providerv1beta1 "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" ) +// NewRetriever creates a new instance of Retriever. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewRetriever(t interface { + mock.TestingT + Cleanup(func()) +}) *Retriever { + mock := &Retriever{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // Retriever is an autogenerated mock type for the Retriever type type Retriever struct { mock.Mock @@ -24,9 +39,9 @@ func (_m *Retriever) EXPECT() *Retriever_Expecter { return &Retriever_Expecter{mock: &_m.Mock} } -// Retrieve provides a mock function with given fields: ctx, rID -func (_m *Retriever) Retrieve(ctx context.Context, rID *providerv1beta1.ResourceId) (io.ReadCloser, error) { - ret := _m.Called(ctx, rID) +// Retrieve provides a mock function for the type Retriever +func (_mock *Retriever) Retrieve(ctx context.Context, rID *providerv1beta1.ResourceId) (io.ReadCloser, error) { + ret := _mock.Called(ctx, rID) if len(ret) == 0 { panic("no return value specified for Retrieve") @@ -34,23 +49,21 @@ func (_m *Retriever) Retrieve(ctx context.Context, rID *providerv1beta1.Resource var r0 io.ReadCloser var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId) (io.ReadCloser, error)); ok { - return rf(ctx, rID) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId) (io.ReadCloser, error)); ok { + return returnFunc(ctx, rID) } - if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId) io.ReadCloser); ok { - r0 = rf(ctx, rID) + if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId) io.ReadCloser); ok { + r0 = returnFunc(ctx, rID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(io.ReadCloser) } } - - if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId) error); ok { - r1 = rf(ctx, rID) + if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId) error); ok { + r1 = returnFunc(ctx, rID) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -68,31 +81,28 @@ func (_e *Retriever_Expecter) Retrieve(ctx interface{}, rID interface{}) *Retrie func (_c *Retriever_Retrieve_Call) Run(run func(ctx context.Context, rID *providerv1beta1.ResourceId)) *Retriever_Retrieve_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *providerv1beta1.ResourceId + if args[1] != nil { + arg1 = args[1].(*providerv1beta1.ResourceId) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Retriever_Retrieve_Call) Return(_a0 io.ReadCloser, _a1 error) *Retriever_Retrieve_Call { - _c.Call.Return(_a0, _a1) +func (_c *Retriever_Retrieve_Call) Return(readCloser io.ReadCloser, err error) *Retriever_Retrieve_Call { + _c.Call.Return(readCloser, err) return _c } -func (_c *Retriever_Retrieve_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId) (io.ReadCloser, error)) *Retriever_Retrieve_Call { +func (_c *Retriever_Retrieve_Call) RunAndReturn(run func(ctx context.Context, rID *providerv1beta1.ResourceId) (io.ReadCloser, error)) *Retriever_Retrieve_Call { _c.Call.Return(run) return _c } - -// NewRetriever creates a new instance of Retriever. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewRetriever(t interface { - mock.TestingT - Cleanup(func()) -}) *Retriever { - mock := &Retriever{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/services/search/pkg/engine/mocks/engine.go b/services/search/pkg/engine/mocks/engine.go index 37c284671f..5159c0e0d6 100644 --- a/services/search/pkg/engine/mocks/engine.go +++ b/services/search/pkg/engine/mocks/engine.go @@ -1,16 +1,31 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" + "context" - engine "github.com/opencloud-eu/opencloud/services/search/pkg/engine" + "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/search/v0" + "github.com/opencloud-eu/opencloud/services/search/pkg/engine" mock "github.com/stretchr/testify/mock" - - v0 "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/search/v0" ) +// NewEngine creates a new instance of Engine. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewEngine(t interface { + mock.TestingT + Cleanup(func()) +}) *Engine { + mock := &Engine{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // Engine is an autogenerated mock type for the Engine type type Engine struct { mock.Mock @@ -24,21 +39,20 @@ func (_m *Engine) EXPECT() *Engine_Expecter { return &Engine_Expecter{mock: &_m.Mock} } -// Delete provides a mock function with given fields: id -func (_m *Engine) Delete(id string) error { - ret := _m.Called(id) +// Delete provides a mock function for the type Engine +func (_mock *Engine) Delete(id string) error { + ret := _mock.Called(id) if len(ret) == 0 { panic("no return value specified for Delete") } var r0 error - if rf, ok := ret.Get(0).(func(string) error); ok { - r0 = rf(id) + if returnFunc, ok := ret.Get(0).(func(string) error); ok { + r0 = returnFunc(id) } else { r0 = ret.Error(0) } - return r0 } @@ -55,24 +69,30 @@ func (_e *Engine_Expecter) Delete(id interface{}) *Engine_Delete_Call { func (_c *Engine_Delete_Call) Run(run func(id string)) *Engine_Delete_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) }) return _c } -func (_c *Engine_Delete_Call) Return(_a0 error) *Engine_Delete_Call { - _c.Call.Return(_a0) +func (_c *Engine_Delete_Call) Return(err error) *Engine_Delete_Call { + _c.Call.Return(err) return _c } -func (_c *Engine_Delete_Call) RunAndReturn(run func(string) error) *Engine_Delete_Call { +func (_c *Engine_Delete_Call) RunAndReturn(run func(id string) error) *Engine_Delete_Call { _c.Call.Return(run) return _c } -// DocCount provides a mock function with no fields -func (_m *Engine) DocCount() (uint64, error) { - ret := _m.Called() +// DocCount provides a mock function for the type Engine +func (_mock *Engine) DocCount() (uint64, error) { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for DocCount") @@ -80,21 +100,19 @@ func (_m *Engine) DocCount() (uint64, error) { var r0 uint64 var r1 error - if rf, ok := ret.Get(0).(func() (uint64, error)); ok { - return rf() + if returnFunc, ok := ret.Get(0).(func() (uint64, error)); ok { + return returnFunc() } - if rf, ok := ret.Get(0).(func() uint64); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() uint64); ok { + r0 = returnFunc() } else { r0 = ret.Get(0).(uint64) } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() + if returnFunc, ok := ret.Get(1).(func() error); ok { + r1 = returnFunc() } else { r1 = ret.Error(1) } - return r0, r1 } @@ -115,8 +133,8 @@ func (_c *Engine_DocCount_Call) Run(run func()) *Engine_DocCount_Call { return _c } -func (_c *Engine_DocCount_Call) Return(_a0 uint64, _a1 error) *Engine_DocCount_Call { - _c.Call.Return(_a0, _a1) +func (_c *Engine_DocCount_Call) Return(v uint64, err error) *Engine_DocCount_Call { + _c.Call.Return(v, err) return _c } @@ -125,21 +143,20 @@ func (_c *Engine_DocCount_Call) RunAndReturn(run func() (uint64, error)) *Engine return _c } -// Move provides a mock function with given fields: id, parentid, target -func (_m *Engine) Move(id string, parentid string, target string) error { - ret := _m.Called(id, parentid, target) +// Move provides a mock function for the type Engine +func (_mock *Engine) Move(id string, parentid string, target string) error { + ret := _mock.Called(id, parentid, target) if len(ret) == 0 { panic("no return value specified for Move") } var r0 error - if rf, ok := ret.Get(0).(func(string, string, string) error); ok { - r0 = rf(id, parentid, target) + if returnFunc, ok := ret.Get(0).(func(string, string, string) error); ok { + r0 = returnFunc(id, parentid, target) } else { r0 = ret.Error(0) } - return r0 } @@ -158,36 +175,51 @@ func (_e *Engine_Expecter) Move(id interface{}, parentid interface{}, target int func (_c *Engine_Move_Call) Run(run func(id string, parentid string, target string)) *Engine_Move_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(string), args[2].(string)) + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) }) return _c } -func (_c *Engine_Move_Call) Return(_a0 error) *Engine_Move_Call { - _c.Call.Return(_a0) +func (_c *Engine_Move_Call) Return(err error) *Engine_Move_Call { + _c.Call.Return(err) return _c } -func (_c *Engine_Move_Call) RunAndReturn(run func(string, string, string) error) *Engine_Move_Call { +func (_c *Engine_Move_Call) RunAndReturn(run func(id string, parentid string, target string) error) *Engine_Move_Call { _c.Call.Return(run) return _c } -// Purge provides a mock function with given fields: id -func (_m *Engine) Purge(id string) error { - ret := _m.Called(id) +// Purge provides a mock function for the type Engine +func (_mock *Engine) Purge(id string) error { + ret := _mock.Called(id) if len(ret) == 0 { panic("no return value specified for Purge") } var r0 error - if rf, ok := ret.Get(0).(func(string) error); ok { - r0 = rf(id) + if returnFunc, ok := ret.Get(0).(func(string) error); ok { + r0 = returnFunc(id) } else { r0 = ret.Error(0) } - return r0 } @@ -204,36 +236,41 @@ func (_e *Engine_Expecter) Purge(id interface{}) *Engine_Purge_Call { func (_c *Engine_Purge_Call) Run(run func(id string)) *Engine_Purge_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) }) return _c } -func (_c *Engine_Purge_Call) Return(_a0 error) *Engine_Purge_Call { - _c.Call.Return(_a0) +func (_c *Engine_Purge_Call) Return(err error) *Engine_Purge_Call { + _c.Call.Return(err) return _c } -func (_c *Engine_Purge_Call) RunAndReturn(run func(string) error) *Engine_Purge_Call { +func (_c *Engine_Purge_Call) RunAndReturn(run func(id string) error) *Engine_Purge_Call { _c.Call.Return(run) return _c } -// Restore provides a mock function with given fields: id -func (_m *Engine) Restore(id string) error { - ret := _m.Called(id) +// Restore provides a mock function for the type Engine +func (_mock *Engine) Restore(id string) error { + ret := _mock.Called(id) if len(ret) == 0 { panic("no return value specified for Restore") } var r0 error - if rf, ok := ret.Get(0).(func(string) error); ok { - r0 = rf(id) + if returnFunc, ok := ret.Get(0).(func(string) error); ok { + r0 = returnFunc(id) } else { r0 = ret.Error(0) } - return r0 } @@ -250,24 +287,30 @@ func (_e *Engine_Expecter) Restore(id interface{}) *Engine_Restore_Call { func (_c *Engine_Restore_Call) Run(run func(id string)) *Engine_Restore_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) }) return _c } -func (_c *Engine_Restore_Call) Return(_a0 error) *Engine_Restore_Call { - _c.Call.Return(_a0) +func (_c *Engine_Restore_Call) Return(err error) *Engine_Restore_Call { + _c.Call.Return(err) return _c } -func (_c *Engine_Restore_Call) RunAndReturn(run func(string) error) *Engine_Restore_Call { +func (_c *Engine_Restore_Call) RunAndReturn(run func(id string) error) *Engine_Restore_Call { _c.Call.Return(run) return _c } -// Search provides a mock function with given fields: ctx, req -func (_m *Engine) Search(ctx context.Context, req *v0.SearchIndexRequest) (*v0.SearchIndexResponse, error) { - ret := _m.Called(ctx, req) +// Search provides a mock function for the type Engine +func (_mock *Engine) Search(ctx context.Context, req *v0.SearchIndexRequest) (*v0.SearchIndexResponse, error) { + ret := _mock.Called(ctx, req) if len(ret) == 0 { panic("no return value specified for Search") @@ -275,23 +318,21 @@ func (_m *Engine) Search(ctx context.Context, req *v0.SearchIndexRequest) (*v0.S var r0 *v0.SearchIndexResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v0.SearchIndexRequest) (*v0.SearchIndexResponse, error)); ok { - return rf(ctx, req) + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.SearchIndexRequest) (*v0.SearchIndexResponse, error)); ok { + return returnFunc(ctx, req) } - if rf, ok := ret.Get(0).(func(context.Context, *v0.SearchIndexRequest) *v0.SearchIndexResponse); ok { - r0 = rf(ctx, req) + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.SearchIndexRequest) *v0.SearchIndexResponse); ok { + r0 = returnFunc(ctx, req) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v0.SearchIndexResponse) } } - - if rf, ok := ret.Get(1).(func(context.Context, *v0.SearchIndexRequest) error); ok { - r1 = rf(ctx, req) + if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.SearchIndexRequest) error); ok { + r1 = returnFunc(ctx, req) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -309,36 +350,46 @@ func (_e *Engine_Expecter) Search(ctx interface{}, req interface{}) *Engine_Sear func (_c *Engine_Search_Call) Run(run func(ctx context.Context, req *v0.SearchIndexRequest)) *Engine_Search_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*v0.SearchIndexRequest)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *v0.SearchIndexRequest + if args[1] != nil { + arg1 = args[1].(*v0.SearchIndexRequest) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Engine_Search_Call) Return(_a0 *v0.SearchIndexResponse, _a1 error) *Engine_Search_Call { - _c.Call.Return(_a0, _a1) +func (_c *Engine_Search_Call) Return(searchIndexResponse *v0.SearchIndexResponse, err error) *Engine_Search_Call { + _c.Call.Return(searchIndexResponse, err) return _c } -func (_c *Engine_Search_Call) RunAndReturn(run func(context.Context, *v0.SearchIndexRequest) (*v0.SearchIndexResponse, error)) *Engine_Search_Call { +func (_c *Engine_Search_Call) RunAndReturn(run func(ctx context.Context, req *v0.SearchIndexRequest) (*v0.SearchIndexResponse, error)) *Engine_Search_Call { _c.Call.Return(run) return _c } -// Upsert provides a mock function with given fields: id, r -func (_m *Engine) Upsert(id string, r engine.Resource) error { - ret := _m.Called(id, r) +// Upsert provides a mock function for the type Engine +func (_mock *Engine) Upsert(id string, r engine.Resource) error { + ret := _mock.Called(id, r) if len(ret) == 0 { panic("no return value specified for Upsert") } var r0 error - if rf, ok := ret.Get(0).(func(string, engine.Resource) error); ok { - r0 = rf(id, r) + if returnFunc, ok := ret.Get(0).(func(string, engine.Resource) error); ok { + r0 = returnFunc(id, r) } else { r0 = ret.Error(0) } - return r0 } @@ -356,31 +407,28 @@ func (_e *Engine_Expecter) Upsert(id interface{}, r interface{}) *Engine_Upsert_ func (_c *Engine_Upsert_Call) Run(run func(id string, r engine.Resource)) *Engine_Upsert_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(engine.Resource)) + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 engine.Resource + if args[1] != nil { + arg1 = args[1].(engine.Resource) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Engine_Upsert_Call) Return(_a0 error) *Engine_Upsert_Call { - _c.Call.Return(_a0) +func (_c *Engine_Upsert_Call) Return(err error) *Engine_Upsert_Call { + _c.Call.Return(err) return _c } -func (_c *Engine_Upsert_Call) RunAndReturn(run func(string, engine.Resource) error) *Engine_Upsert_Call { +func (_c *Engine_Upsert_Call) RunAndReturn(run func(id string, r engine.Resource) error) *Engine_Upsert_Call { _c.Call.Return(run) return _c } - -// NewEngine creates a new instance of Engine. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewEngine(t interface { - mock.TestingT - Cleanup(func()) -}) *Engine { - mock := &Engine{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/services/search/pkg/search/mocks/searcher.go b/services/search/pkg/search/mocks/searcher.go index 1ac11e700c..ba9a4560bf 100644 --- a/services/search/pkg/search/mocks/searcher.go +++ b/services/search/pkg/search/mocks/searcher.go @@ -1,16 +1,31 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" + "context" - providerv1beta1 "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" + "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" + "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/search/v0" mock "github.com/stretchr/testify/mock" - - v0 "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/search/v0" ) +// NewSearcher creates a new instance of Searcher. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewSearcher(t interface { + mock.TestingT + Cleanup(func()) +}) *Searcher { + mock := &Searcher{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // Searcher is an autogenerated mock type for the Searcher type type Searcher struct { mock.Mock @@ -24,21 +39,20 @@ func (_m *Searcher) EXPECT() *Searcher_Expecter { return &Searcher_Expecter{mock: &_m.Mock} } -// IndexSpace provides a mock function with given fields: rID -func (_m *Searcher) IndexSpace(rID *providerv1beta1.StorageSpaceId) error { - ret := _m.Called(rID) +// IndexSpace provides a mock function for the type Searcher +func (_mock *Searcher) IndexSpace(rID *providerv1beta1.StorageSpaceId) error { + ret := _mock.Called(rID) if len(ret) == 0 { panic("no return value specified for IndexSpace") } var r0 error - if rf, ok := ret.Get(0).(func(*providerv1beta1.StorageSpaceId) error); ok { - r0 = rf(rID) + if returnFunc, ok := ret.Get(0).(func(*providerv1beta1.StorageSpaceId) error); ok { + r0 = returnFunc(rID) } else { r0 = ret.Error(0) } - return r0 } @@ -55,24 +69,31 @@ func (_e *Searcher_Expecter) IndexSpace(rID interface{}) *Searcher_IndexSpace_Ca func (_c *Searcher_IndexSpace_Call) Run(run func(rID *providerv1beta1.StorageSpaceId)) *Searcher_IndexSpace_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*providerv1beta1.StorageSpaceId)) + var arg0 *providerv1beta1.StorageSpaceId + if args[0] != nil { + arg0 = args[0].(*providerv1beta1.StorageSpaceId) + } + run( + arg0, + ) }) return _c } -func (_c *Searcher_IndexSpace_Call) Return(_a0 error) *Searcher_IndexSpace_Call { - _c.Call.Return(_a0) +func (_c *Searcher_IndexSpace_Call) Return(err error) *Searcher_IndexSpace_Call { + _c.Call.Return(err) return _c } -func (_c *Searcher_IndexSpace_Call) RunAndReturn(run func(*providerv1beta1.StorageSpaceId) error) *Searcher_IndexSpace_Call { +func (_c *Searcher_IndexSpace_Call) RunAndReturn(run func(rID *providerv1beta1.StorageSpaceId) error) *Searcher_IndexSpace_Call { _c.Call.Return(run) return _c } -// MoveItem provides a mock function with given fields: ref -func (_m *Searcher) MoveItem(ref *providerv1beta1.Reference) { - _m.Called(ref) +// MoveItem provides a mock function for the type Searcher +func (_mock *Searcher) MoveItem(ref *providerv1beta1.Reference) { + _mock.Called(ref) + return } // Searcher_MoveItem_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MoveItem' @@ -88,7 +109,13 @@ func (_e *Searcher_Expecter) MoveItem(ref interface{}) *Searcher_MoveItem_Call { func (_c *Searcher_MoveItem_Call) Run(run func(ref *providerv1beta1.Reference)) *Searcher_MoveItem_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*providerv1beta1.Reference)) + var arg0 *providerv1beta1.Reference + if args[0] != nil { + arg0 = args[0].(*providerv1beta1.Reference) + } + run( + arg0, + ) }) return _c } @@ -98,14 +125,15 @@ func (_c *Searcher_MoveItem_Call) Return() *Searcher_MoveItem_Call { return _c } -func (_c *Searcher_MoveItem_Call) RunAndReturn(run func(*providerv1beta1.Reference)) *Searcher_MoveItem_Call { +func (_c *Searcher_MoveItem_Call) RunAndReturn(run func(ref *providerv1beta1.Reference)) *Searcher_MoveItem_Call { _c.Run(run) return _c } -// RestoreItem provides a mock function with given fields: ref -func (_m *Searcher) RestoreItem(ref *providerv1beta1.Reference) { - _m.Called(ref) +// RestoreItem provides a mock function for the type Searcher +func (_mock *Searcher) RestoreItem(ref *providerv1beta1.Reference) { + _mock.Called(ref) + return } // Searcher_RestoreItem_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RestoreItem' @@ -121,7 +149,13 @@ func (_e *Searcher_Expecter) RestoreItem(ref interface{}) *Searcher_RestoreItem_ func (_c *Searcher_RestoreItem_Call) Run(run func(ref *providerv1beta1.Reference)) *Searcher_RestoreItem_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*providerv1beta1.Reference)) + var arg0 *providerv1beta1.Reference + if args[0] != nil { + arg0 = args[0].(*providerv1beta1.Reference) + } + run( + arg0, + ) }) return _c } @@ -131,14 +165,14 @@ func (_c *Searcher_RestoreItem_Call) Return() *Searcher_RestoreItem_Call { return _c } -func (_c *Searcher_RestoreItem_Call) RunAndReturn(run func(*providerv1beta1.Reference)) *Searcher_RestoreItem_Call { +func (_c *Searcher_RestoreItem_Call) RunAndReturn(run func(ref *providerv1beta1.Reference)) *Searcher_RestoreItem_Call { _c.Run(run) return _c } -// Search provides a mock function with given fields: ctx, req -func (_m *Searcher) Search(ctx context.Context, req *v0.SearchRequest) (*v0.SearchResponse, error) { - ret := _m.Called(ctx, req) +// Search provides a mock function for the type Searcher +func (_mock *Searcher) Search(ctx context.Context, req *v0.SearchRequest) (*v0.SearchResponse, error) { + ret := _mock.Called(ctx, req) if len(ret) == 0 { panic("no return value specified for Search") @@ -146,23 +180,21 @@ func (_m *Searcher) Search(ctx context.Context, req *v0.SearchRequest) (*v0.Sear var r0 *v0.SearchResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v0.SearchRequest) (*v0.SearchResponse, error)); ok { - return rf(ctx, req) + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.SearchRequest) (*v0.SearchResponse, error)); ok { + return returnFunc(ctx, req) } - if rf, ok := ret.Get(0).(func(context.Context, *v0.SearchRequest) *v0.SearchResponse); ok { - r0 = rf(ctx, req) + if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.SearchRequest) *v0.SearchResponse); ok { + r0 = returnFunc(ctx, req) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v0.SearchResponse) } } - - if rf, ok := ret.Get(1).(func(context.Context, *v0.SearchRequest) error); ok { - r1 = rf(ctx, req) + if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.SearchRequest) error); ok { + r1 = returnFunc(ctx, req) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -180,24 +212,36 @@ func (_e *Searcher_Expecter) Search(ctx interface{}, req interface{}) *Searcher_ func (_c *Searcher_Search_Call) Run(run func(ctx context.Context, req *v0.SearchRequest)) *Searcher_Search_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*v0.SearchRequest)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *v0.SearchRequest + if args[1] != nil { + arg1 = args[1].(*v0.SearchRequest) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Searcher_Search_Call) Return(_a0 *v0.SearchResponse, _a1 error) *Searcher_Search_Call { - _c.Call.Return(_a0, _a1) +func (_c *Searcher_Search_Call) Return(searchResponse *v0.SearchResponse, err error) *Searcher_Search_Call { + _c.Call.Return(searchResponse, err) return _c } -func (_c *Searcher_Search_Call) RunAndReturn(run func(context.Context, *v0.SearchRequest) (*v0.SearchResponse, error)) *Searcher_Search_Call { +func (_c *Searcher_Search_Call) RunAndReturn(run func(ctx context.Context, req *v0.SearchRequest) (*v0.SearchResponse, error)) *Searcher_Search_Call { _c.Call.Return(run) return _c } -// TrashItem provides a mock function with given fields: rID -func (_m *Searcher) TrashItem(rID *providerv1beta1.ResourceId) { - _m.Called(rID) +// TrashItem provides a mock function for the type Searcher +func (_mock *Searcher) TrashItem(rID *providerv1beta1.ResourceId) { + _mock.Called(rID) + return } // Searcher_TrashItem_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TrashItem' @@ -213,7 +257,13 @@ func (_e *Searcher_Expecter) TrashItem(rID interface{}) *Searcher_TrashItem_Call func (_c *Searcher_TrashItem_Call) Run(run func(rID *providerv1beta1.ResourceId)) *Searcher_TrashItem_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*providerv1beta1.ResourceId)) + var arg0 *providerv1beta1.ResourceId + if args[0] != nil { + arg0 = args[0].(*providerv1beta1.ResourceId) + } + run( + arg0, + ) }) return _c } @@ -223,14 +273,15 @@ func (_c *Searcher_TrashItem_Call) Return() *Searcher_TrashItem_Call { return _c } -func (_c *Searcher_TrashItem_Call) RunAndReturn(run func(*providerv1beta1.ResourceId)) *Searcher_TrashItem_Call { +func (_c *Searcher_TrashItem_Call) RunAndReturn(run func(rID *providerv1beta1.ResourceId)) *Searcher_TrashItem_Call { _c.Run(run) return _c } -// UpsertItem provides a mock function with given fields: ref -func (_m *Searcher) UpsertItem(ref *providerv1beta1.Reference) { - _m.Called(ref) +// UpsertItem provides a mock function for the type Searcher +func (_mock *Searcher) UpsertItem(ref *providerv1beta1.Reference) { + _mock.Called(ref) + return } // Searcher_UpsertItem_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpsertItem' @@ -246,7 +297,13 @@ func (_e *Searcher_Expecter) UpsertItem(ref interface{}) *Searcher_UpsertItem_Ca func (_c *Searcher_UpsertItem_Call) Run(run func(ref *providerv1beta1.Reference)) *Searcher_UpsertItem_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*providerv1beta1.Reference)) + var arg0 *providerv1beta1.Reference + if args[0] != nil { + arg0 = args[0].(*providerv1beta1.Reference) + } + run( + arg0, + ) }) return _c } @@ -256,21 +313,7 @@ func (_c *Searcher_UpsertItem_Call) Return() *Searcher_UpsertItem_Call { return _c } -func (_c *Searcher_UpsertItem_Call) RunAndReturn(run func(*providerv1beta1.Reference)) *Searcher_UpsertItem_Call { +func (_c *Searcher_UpsertItem_Call) RunAndReturn(run func(ref *providerv1beta1.Reference)) *Searcher_UpsertItem_Call { _c.Run(run) return _c } - -// NewSearcher creates a new instance of Searcher. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewSearcher(t interface { - mock.TestingT - Cleanup(func()) -}) *Searcher { - mock := &Searcher{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/services/settings/.mockery.yaml b/services/settings/.mockery.yaml index 13059caef7..244bb71240 100644 --- a/services/settings/.mockery.yaml +++ b/services/settings/.mockery.yaml @@ -1,13 +1,11 @@ -issue-845-fix: True -resolve-type-alias: False -with-expecter: true -disable-version-string: True +# maintain v2 separate mocks dir +dir: "{{.InterfaceDir}}/mocks" +structname: "{{.InterfaceName}}" filename: "{{.InterfaceName | snakecase }}.go" -mockname: "{{.InterfaceName}}" -outpkg: "mocks" +pkgname: mocks + +template: testify packages: - github.com/opencloud-eu/opencloud/services/settings/pkg/settings: - config: - dir: "pkg/settings/mocks" - interfaces: - Manager: + github.com/opencloud-eu/opencloud/services/settings/pkg/settings: + interfaces: + Manager: {} diff --git a/services/settings/pkg/settings/mocks/manager.go b/services/settings/pkg/settings/mocks/manager.go index acd8097766..ebf18cf675 100644 --- a/services/settings/pkg/settings/mocks/manager.go +++ b/services/settings/pkg/settings/mocks/manager.go @@ -1,13 +1,28 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( + "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/messages/settings/v0" mock "github.com/stretchr/testify/mock" - - v0 "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/messages/settings/v0" ) +// NewManager creates a new instance of Manager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewManager(t interface { + mock.TestingT + Cleanup(func()) +}) *Manager { + mock := &Manager{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // Manager is an autogenerated mock type for the Manager type type Manager struct { mock.Mock @@ -21,9 +36,9 @@ func (_m *Manager) EXPECT() *Manager_Expecter { return &Manager_Expecter{mock: &_m.Mock} } -// AddSettingToBundle provides a mock function with given fields: bundleID, setting -func (_m *Manager) AddSettingToBundle(bundleID string, setting *v0.Setting) (*v0.Setting, error) { - ret := _m.Called(bundleID, setting) +// AddSettingToBundle provides a mock function for the type Manager +func (_mock *Manager) AddSettingToBundle(bundleID string, setting *v0.Setting) (*v0.Setting, error) { + ret := _mock.Called(bundleID, setting) if len(ret) == 0 { panic("no return value specified for AddSettingToBundle") @@ -31,23 +46,21 @@ func (_m *Manager) AddSettingToBundle(bundleID string, setting *v0.Setting) (*v0 var r0 *v0.Setting var r1 error - if rf, ok := ret.Get(0).(func(string, *v0.Setting) (*v0.Setting, error)); ok { - return rf(bundleID, setting) + if returnFunc, ok := ret.Get(0).(func(string, *v0.Setting) (*v0.Setting, error)); ok { + return returnFunc(bundleID, setting) } - if rf, ok := ret.Get(0).(func(string, *v0.Setting) *v0.Setting); ok { - r0 = rf(bundleID, setting) + if returnFunc, ok := ret.Get(0).(func(string, *v0.Setting) *v0.Setting); ok { + r0 = returnFunc(bundleID, setting) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v0.Setting) } } - - if rf, ok := ret.Get(1).(func(string, *v0.Setting) error); ok { - r1 = rf(bundleID, setting) + if returnFunc, ok := ret.Get(1).(func(string, *v0.Setting) error); ok { + r1 = returnFunc(bundleID, setting) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -65,24 +78,35 @@ func (_e *Manager_Expecter) AddSettingToBundle(bundleID interface{}, setting int func (_c *Manager_AddSettingToBundle_Call) Run(run func(bundleID string, setting *v0.Setting)) *Manager_AddSettingToBundle_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(*v0.Setting)) + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 *v0.Setting + if args[1] != nil { + arg1 = args[1].(*v0.Setting) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Manager_AddSettingToBundle_Call) Return(_a0 *v0.Setting, _a1 error) *Manager_AddSettingToBundle_Call { - _c.Call.Return(_a0, _a1) +func (_c *Manager_AddSettingToBundle_Call) Return(setting1 *v0.Setting, err error) *Manager_AddSettingToBundle_Call { + _c.Call.Return(setting1, err) return _c } -func (_c *Manager_AddSettingToBundle_Call) RunAndReturn(run func(string, *v0.Setting) (*v0.Setting, error)) *Manager_AddSettingToBundle_Call { +func (_c *Manager_AddSettingToBundle_Call) RunAndReturn(run func(bundleID string, setting *v0.Setting) (*v0.Setting, error)) *Manager_AddSettingToBundle_Call { _c.Call.Return(run) return _c } -// ListBundles provides a mock function with given fields: bundleType, bundleIDs -func (_m *Manager) ListBundles(bundleType v0.Bundle_Type, bundleIDs []string) ([]*v0.Bundle, error) { - ret := _m.Called(bundleType, bundleIDs) +// ListBundles provides a mock function for the type Manager +func (_mock *Manager) ListBundles(bundleType v0.Bundle_Type, bundleIDs []string) ([]*v0.Bundle, error) { + ret := _mock.Called(bundleType, bundleIDs) if len(ret) == 0 { panic("no return value specified for ListBundles") @@ -90,23 +114,21 @@ func (_m *Manager) ListBundles(bundleType v0.Bundle_Type, bundleIDs []string) ([ var r0 []*v0.Bundle var r1 error - if rf, ok := ret.Get(0).(func(v0.Bundle_Type, []string) ([]*v0.Bundle, error)); ok { - return rf(bundleType, bundleIDs) + if returnFunc, ok := ret.Get(0).(func(v0.Bundle_Type, []string) ([]*v0.Bundle, error)); ok { + return returnFunc(bundleType, bundleIDs) } - if rf, ok := ret.Get(0).(func(v0.Bundle_Type, []string) []*v0.Bundle); ok { - r0 = rf(bundleType, bundleIDs) + if returnFunc, ok := ret.Get(0).(func(v0.Bundle_Type, []string) []*v0.Bundle); ok { + r0 = returnFunc(bundleType, bundleIDs) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*v0.Bundle) } } - - if rf, ok := ret.Get(1).(func(v0.Bundle_Type, []string) error); ok { - r1 = rf(bundleType, bundleIDs) + if returnFunc, ok := ret.Get(1).(func(v0.Bundle_Type, []string) error); ok { + r1 = returnFunc(bundleType, bundleIDs) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -124,24 +146,35 @@ func (_e *Manager_Expecter) ListBundles(bundleType interface{}, bundleIDs interf func (_c *Manager_ListBundles_Call) Run(run func(bundleType v0.Bundle_Type, bundleIDs []string)) *Manager_ListBundles_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(v0.Bundle_Type), args[1].([]string)) + var arg0 v0.Bundle_Type + if args[0] != nil { + arg0 = args[0].(v0.Bundle_Type) + } + var arg1 []string + if args[1] != nil { + arg1 = args[1].([]string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Manager_ListBundles_Call) Return(_a0 []*v0.Bundle, _a1 error) *Manager_ListBundles_Call { - _c.Call.Return(_a0, _a1) +func (_c *Manager_ListBundles_Call) Return(bundles []*v0.Bundle, err error) *Manager_ListBundles_Call { + _c.Call.Return(bundles, err) return _c } -func (_c *Manager_ListBundles_Call) RunAndReturn(run func(v0.Bundle_Type, []string) ([]*v0.Bundle, error)) *Manager_ListBundles_Call { +func (_c *Manager_ListBundles_Call) RunAndReturn(run func(bundleType v0.Bundle_Type, bundleIDs []string) ([]*v0.Bundle, error)) *Manager_ListBundles_Call { _c.Call.Return(run) return _c } -// ListPermissionsByResource provides a mock function with given fields: resource, roleIDs -func (_m *Manager) ListPermissionsByResource(resource *v0.Resource, roleIDs []string) ([]*v0.Permission, error) { - ret := _m.Called(resource, roleIDs) +// ListPermissionsByResource provides a mock function for the type Manager +func (_mock *Manager) ListPermissionsByResource(resource *v0.Resource, roleIDs []string) ([]*v0.Permission, error) { + ret := _mock.Called(resource, roleIDs) if len(ret) == 0 { panic("no return value specified for ListPermissionsByResource") @@ -149,23 +182,21 @@ func (_m *Manager) ListPermissionsByResource(resource *v0.Resource, roleIDs []st var r0 []*v0.Permission var r1 error - if rf, ok := ret.Get(0).(func(*v0.Resource, []string) ([]*v0.Permission, error)); ok { - return rf(resource, roleIDs) + if returnFunc, ok := ret.Get(0).(func(*v0.Resource, []string) ([]*v0.Permission, error)); ok { + return returnFunc(resource, roleIDs) } - if rf, ok := ret.Get(0).(func(*v0.Resource, []string) []*v0.Permission); ok { - r0 = rf(resource, roleIDs) + if returnFunc, ok := ret.Get(0).(func(*v0.Resource, []string) []*v0.Permission); ok { + r0 = returnFunc(resource, roleIDs) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*v0.Permission) } } - - if rf, ok := ret.Get(1).(func(*v0.Resource, []string) error); ok { - r1 = rf(resource, roleIDs) + if returnFunc, ok := ret.Get(1).(func(*v0.Resource, []string) error); ok { + r1 = returnFunc(resource, roleIDs) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -183,24 +214,35 @@ func (_e *Manager_Expecter) ListPermissionsByResource(resource interface{}, role func (_c *Manager_ListPermissionsByResource_Call) Run(run func(resource *v0.Resource, roleIDs []string)) *Manager_ListPermissionsByResource_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*v0.Resource), args[1].([]string)) + var arg0 *v0.Resource + if args[0] != nil { + arg0 = args[0].(*v0.Resource) + } + var arg1 []string + if args[1] != nil { + arg1 = args[1].([]string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Manager_ListPermissionsByResource_Call) Return(_a0 []*v0.Permission, _a1 error) *Manager_ListPermissionsByResource_Call { - _c.Call.Return(_a0, _a1) +func (_c *Manager_ListPermissionsByResource_Call) Return(permissions []*v0.Permission, err error) *Manager_ListPermissionsByResource_Call { + _c.Call.Return(permissions, err) return _c } -func (_c *Manager_ListPermissionsByResource_Call) RunAndReturn(run func(*v0.Resource, []string) ([]*v0.Permission, error)) *Manager_ListPermissionsByResource_Call { +func (_c *Manager_ListPermissionsByResource_Call) RunAndReturn(run func(resource *v0.Resource, roleIDs []string) ([]*v0.Permission, error)) *Manager_ListPermissionsByResource_Call { _c.Call.Return(run) return _c } -// ListRoleAssignments provides a mock function with given fields: accountUUID -func (_m *Manager) ListRoleAssignments(accountUUID string) ([]*v0.UserRoleAssignment, error) { - ret := _m.Called(accountUUID) +// ListRoleAssignments provides a mock function for the type Manager +func (_mock *Manager) ListRoleAssignments(accountUUID string) ([]*v0.UserRoleAssignment, error) { + ret := _mock.Called(accountUUID) if len(ret) == 0 { panic("no return value specified for ListRoleAssignments") @@ -208,23 +250,21 @@ func (_m *Manager) ListRoleAssignments(accountUUID string) ([]*v0.UserRoleAssign var r0 []*v0.UserRoleAssignment var r1 error - if rf, ok := ret.Get(0).(func(string) ([]*v0.UserRoleAssignment, error)); ok { - return rf(accountUUID) + if returnFunc, ok := ret.Get(0).(func(string) ([]*v0.UserRoleAssignment, error)); ok { + return returnFunc(accountUUID) } - if rf, ok := ret.Get(0).(func(string) []*v0.UserRoleAssignment); ok { - r0 = rf(accountUUID) + if returnFunc, ok := ret.Get(0).(func(string) []*v0.UserRoleAssignment); ok { + r0 = returnFunc(accountUUID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*v0.UserRoleAssignment) } } - - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(accountUUID) + if returnFunc, ok := ret.Get(1).(func(string) error); ok { + r1 = returnFunc(accountUUID) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -241,24 +281,30 @@ func (_e *Manager_Expecter) ListRoleAssignments(accountUUID interface{}) *Manage func (_c *Manager_ListRoleAssignments_Call) Run(run func(accountUUID string)) *Manager_ListRoleAssignments_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) }) return _c } -func (_c *Manager_ListRoleAssignments_Call) Return(_a0 []*v0.UserRoleAssignment, _a1 error) *Manager_ListRoleAssignments_Call { - _c.Call.Return(_a0, _a1) +func (_c *Manager_ListRoleAssignments_Call) Return(userRoleAssignments []*v0.UserRoleAssignment, err error) *Manager_ListRoleAssignments_Call { + _c.Call.Return(userRoleAssignments, err) return _c } -func (_c *Manager_ListRoleAssignments_Call) RunAndReturn(run func(string) ([]*v0.UserRoleAssignment, error)) *Manager_ListRoleAssignments_Call { +func (_c *Manager_ListRoleAssignments_Call) RunAndReturn(run func(accountUUID string) ([]*v0.UserRoleAssignment, error)) *Manager_ListRoleAssignments_Call { _c.Call.Return(run) return _c } -// ListRoleAssignmentsByRole provides a mock function with given fields: roleID -func (_m *Manager) ListRoleAssignmentsByRole(roleID string) ([]*v0.UserRoleAssignment, error) { - ret := _m.Called(roleID) +// ListRoleAssignmentsByRole provides a mock function for the type Manager +func (_mock *Manager) ListRoleAssignmentsByRole(roleID string) ([]*v0.UserRoleAssignment, error) { + ret := _mock.Called(roleID) if len(ret) == 0 { panic("no return value specified for ListRoleAssignmentsByRole") @@ -266,23 +312,21 @@ func (_m *Manager) ListRoleAssignmentsByRole(roleID string) ([]*v0.UserRoleAssig var r0 []*v0.UserRoleAssignment var r1 error - if rf, ok := ret.Get(0).(func(string) ([]*v0.UserRoleAssignment, error)); ok { - return rf(roleID) + if returnFunc, ok := ret.Get(0).(func(string) ([]*v0.UserRoleAssignment, error)); ok { + return returnFunc(roleID) } - if rf, ok := ret.Get(0).(func(string) []*v0.UserRoleAssignment); ok { - r0 = rf(roleID) + if returnFunc, ok := ret.Get(0).(func(string) []*v0.UserRoleAssignment); ok { + r0 = returnFunc(roleID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*v0.UserRoleAssignment) } } - - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(roleID) + if returnFunc, ok := ret.Get(1).(func(string) error); ok { + r1 = returnFunc(roleID) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -299,24 +343,30 @@ func (_e *Manager_Expecter) ListRoleAssignmentsByRole(roleID interface{}) *Manag func (_c *Manager_ListRoleAssignmentsByRole_Call) Run(run func(roleID string)) *Manager_ListRoleAssignmentsByRole_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) }) return _c } -func (_c *Manager_ListRoleAssignmentsByRole_Call) Return(_a0 []*v0.UserRoleAssignment, _a1 error) *Manager_ListRoleAssignmentsByRole_Call { - _c.Call.Return(_a0, _a1) +func (_c *Manager_ListRoleAssignmentsByRole_Call) Return(userRoleAssignments []*v0.UserRoleAssignment, err error) *Manager_ListRoleAssignmentsByRole_Call { + _c.Call.Return(userRoleAssignments, err) return _c } -func (_c *Manager_ListRoleAssignmentsByRole_Call) RunAndReturn(run func(string) ([]*v0.UserRoleAssignment, error)) *Manager_ListRoleAssignmentsByRole_Call { +func (_c *Manager_ListRoleAssignmentsByRole_Call) RunAndReturn(run func(roleID string) ([]*v0.UserRoleAssignment, error)) *Manager_ListRoleAssignmentsByRole_Call { _c.Call.Return(run) return _c } -// ListValues provides a mock function with given fields: bundleID, accountUUID -func (_m *Manager) ListValues(bundleID string, accountUUID string) ([]*v0.Value, error) { - ret := _m.Called(bundleID, accountUUID) +// ListValues provides a mock function for the type Manager +func (_mock *Manager) ListValues(bundleID string, accountUUID string) ([]*v0.Value, error) { + ret := _mock.Called(bundleID, accountUUID) if len(ret) == 0 { panic("no return value specified for ListValues") @@ -324,23 +374,21 @@ func (_m *Manager) ListValues(bundleID string, accountUUID string) ([]*v0.Value, var r0 []*v0.Value var r1 error - if rf, ok := ret.Get(0).(func(string, string) ([]*v0.Value, error)); ok { - return rf(bundleID, accountUUID) + if returnFunc, ok := ret.Get(0).(func(string, string) ([]*v0.Value, error)); ok { + return returnFunc(bundleID, accountUUID) } - if rf, ok := ret.Get(0).(func(string, string) []*v0.Value); ok { - r0 = rf(bundleID, accountUUID) + if returnFunc, ok := ret.Get(0).(func(string, string) []*v0.Value); ok { + r0 = returnFunc(bundleID, accountUUID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*v0.Value) } } - - if rf, ok := ret.Get(1).(func(string, string) error); ok { - r1 = rf(bundleID, accountUUID) + if returnFunc, ok := ret.Get(1).(func(string, string) error); ok { + r1 = returnFunc(bundleID, accountUUID) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -358,24 +406,35 @@ func (_e *Manager_Expecter) ListValues(bundleID interface{}, accountUUID interfa func (_c *Manager_ListValues_Call) Run(run func(bundleID string, accountUUID string)) *Manager_ListValues_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(string)) + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Manager_ListValues_Call) Return(_a0 []*v0.Value, _a1 error) *Manager_ListValues_Call { - _c.Call.Return(_a0, _a1) +func (_c *Manager_ListValues_Call) Return(values []*v0.Value, err error) *Manager_ListValues_Call { + _c.Call.Return(values, err) return _c } -func (_c *Manager_ListValues_Call) RunAndReturn(run func(string, string) ([]*v0.Value, error)) *Manager_ListValues_Call { +func (_c *Manager_ListValues_Call) RunAndReturn(run func(bundleID string, accountUUID string) ([]*v0.Value, error)) *Manager_ListValues_Call { _c.Call.Return(run) return _c } -// ReadBundle provides a mock function with given fields: bundleID -func (_m *Manager) ReadBundle(bundleID string) (*v0.Bundle, error) { - ret := _m.Called(bundleID) +// ReadBundle provides a mock function for the type Manager +func (_mock *Manager) ReadBundle(bundleID string) (*v0.Bundle, error) { + ret := _mock.Called(bundleID) if len(ret) == 0 { panic("no return value specified for ReadBundle") @@ -383,23 +442,21 @@ func (_m *Manager) ReadBundle(bundleID string) (*v0.Bundle, error) { var r0 *v0.Bundle var r1 error - if rf, ok := ret.Get(0).(func(string) (*v0.Bundle, error)); ok { - return rf(bundleID) + if returnFunc, ok := ret.Get(0).(func(string) (*v0.Bundle, error)); ok { + return returnFunc(bundleID) } - if rf, ok := ret.Get(0).(func(string) *v0.Bundle); ok { - r0 = rf(bundleID) + if returnFunc, ok := ret.Get(0).(func(string) *v0.Bundle); ok { + r0 = returnFunc(bundleID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v0.Bundle) } } - - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(bundleID) + if returnFunc, ok := ret.Get(1).(func(string) error); ok { + r1 = returnFunc(bundleID) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -416,24 +473,30 @@ func (_e *Manager_Expecter) ReadBundle(bundleID interface{}) *Manager_ReadBundle func (_c *Manager_ReadBundle_Call) Run(run func(bundleID string)) *Manager_ReadBundle_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) }) return _c } -func (_c *Manager_ReadBundle_Call) Return(_a0 *v0.Bundle, _a1 error) *Manager_ReadBundle_Call { - _c.Call.Return(_a0, _a1) +func (_c *Manager_ReadBundle_Call) Return(bundle *v0.Bundle, err error) *Manager_ReadBundle_Call { + _c.Call.Return(bundle, err) return _c } -func (_c *Manager_ReadBundle_Call) RunAndReturn(run func(string) (*v0.Bundle, error)) *Manager_ReadBundle_Call { +func (_c *Manager_ReadBundle_Call) RunAndReturn(run func(bundleID string) (*v0.Bundle, error)) *Manager_ReadBundle_Call { _c.Call.Return(run) return _c } -// ReadPermissionByID provides a mock function with given fields: permissionID, roleIDs -func (_m *Manager) ReadPermissionByID(permissionID string, roleIDs []string) (*v0.Permission, error) { - ret := _m.Called(permissionID, roleIDs) +// ReadPermissionByID provides a mock function for the type Manager +func (_mock *Manager) ReadPermissionByID(permissionID string, roleIDs []string) (*v0.Permission, error) { + ret := _mock.Called(permissionID, roleIDs) if len(ret) == 0 { panic("no return value specified for ReadPermissionByID") @@ -441,23 +504,21 @@ func (_m *Manager) ReadPermissionByID(permissionID string, roleIDs []string) (*v var r0 *v0.Permission var r1 error - if rf, ok := ret.Get(0).(func(string, []string) (*v0.Permission, error)); ok { - return rf(permissionID, roleIDs) + if returnFunc, ok := ret.Get(0).(func(string, []string) (*v0.Permission, error)); ok { + return returnFunc(permissionID, roleIDs) } - if rf, ok := ret.Get(0).(func(string, []string) *v0.Permission); ok { - r0 = rf(permissionID, roleIDs) + if returnFunc, ok := ret.Get(0).(func(string, []string) *v0.Permission); ok { + r0 = returnFunc(permissionID, roleIDs) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v0.Permission) } } - - if rf, ok := ret.Get(1).(func(string, []string) error); ok { - r1 = rf(permissionID, roleIDs) + if returnFunc, ok := ret.Get(1).(func(string, []string) error); ok { + r1 = returnFunc(permissionID, roleIDs) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -475,24 +536,35 @@ func (_e *Manager_Expecter) ReadPermissionByID(permissionID interface{}, roleIDs func (_c *Manager_ReadPermissionByID_Call) Run(run func(permissionID string, roleIDs []string)) *Manager_ReadPermissionByID_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].([]string)) + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 []string + if args[1] != nil { + arg1 = args[1].([]string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Manager_ReadPermissionByID_Call) Return(_a0 *v0.Permission, _a1 error) *Manager_ReadPermissionByID_Call { - _c.Call.Return(_a0, _a1) +func (_c *Manager_ReadPermissionByID_Call) Return(permission *v0.Permission, err error) *Manager_ReadPermissionByID_Call { + _c.Call.Return(permission, err) return _c } -func (_c *Manager_ReadPermissionByID_Call) RunAndReturn(run func(string, []string) (*v0.Permission, error)) *Manager_ReadPermissionByID_Call { +func (_c *Manager_ReadPermissionByID_Call) RunAndReturn(run func(permissionID string, roleIDs []string) (*v0.Permission, error)) *Manager_ReadPermissionByID_Call { _c.Call.Return(run) return _c } -// ReadPermissionByName provides a mock function with given fields: name, roleIDs -func (_m *Manager) ReadPermissionByName(name string, roleIDs []string) (*v0.Permission, error) { - ret := _m.Called(name, roleIDs) +// ReadPermissionByName provides a mock function for the type Manager +func (_mock *Manager) ReadPermissionByName(name string, roleIDs []string) (*v0.Permission, error) { + ret := _mock.Called(name, roleIDs) if len(ret) == 0 { panic("no return value specified for ReadPermissionByName") @@ -500,23 +572,21 @@ func (_m *Manager) ReadPermissionByName(name string, roleIDs []string) (*v0.Perm var r0 *v0.Permission var r1 error - if rf, ok := ret.Get(0).(func(string, []string) (*v0.Permission, error)); ok { - return rf(name, roleIDs) + if returnFunc, ok := ret.Get(0).(func(string, []string) (*v0.Permission, error)); ok { + return returnFunc(name, roleIDs) } - if rf, ok := ret.Get(0).(func(string, []string) *v0.Permission); ok { - r0 = rf(name, roleIDs) + if returnFunc, ok := ret.Get(0).(func(string, []string) *v0.Permission); ok { + r0 = returnFunc(name, roleIDs) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v0.Permission) } } - - if rf, ok := ret.Get(1).(func(string, []string) error); ok { - r1 = rf(name, roleIDs) + if returnFunc, ok := ret.Get(1).(func(string, []string) error); ok { + r1 = returnFunc(name, roleIDs) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -534,24 +604,35 @@ func (_e *Manager_Expecter) ReadPermissionByName(name interface{}, roleIDs inter func (_c *Manager_ReadPermissionByName_Call) Run(run func(name string, roleIDs []string)) *Manager_ReadPermissionByName_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].([]string)) + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 []string + if args[1] != nil { + arg1 = args[1].([]string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Manager_ReadPermissionByName_Call) Return(_a0 *v0.Permission, _a1 error) *Manager_ReadPermissionByName_Call { - _c.Call.Return(_a0, _a1) +func (_c *Manager_ReadPermissionByName_Call) Return(permission *v0.Permission, err error) *Manager_ReadPermissionByName_Call { + _c.Call.Return(permission, err) return _c } -func (_c *Manager_ReadPermissionByName_Call) RunAndReturn(run func(string, []string) (*v0.Permission, error)) *Manager_ReadPermissionByName_Call { +func (_c *Manager_ReadPermissionByName_Call) RunAndReturn(run func(name string, roleIDs []string) (*v0.Permission, error)) *Manager_ReadPermissionByName_Call { _c.Call.Return(run) return _c } -// ReadSetting provides a mock function with given fields: settingID -func (_m *Manager) ReadSetting(settingID string) (*v0.Setting, error) { - ret := _m.Called(settingID) +// ReadSetting provides a mock function for the type Manager +func (_mock *Manager) ReadSetting(settingID string) (*v0.Setting, error) { + ret := _mock.Called(settingID) if len(ret) == 0 { panic("no return value specified for ReadSetting") @@ -559,23 +640,21 @@ func (_m *Manager) ReadSetting(settingID string) (*v0.Setting, error) { var r0 *v0.Setting var r1 error - if rf, ok := ret.Get(0).(func(string) (*v0.Setting, error)); ok { - return rf(settingID) + if returnFunc, ok := ret.Get(0).(func(string) (*v0.Setting, error)); ok { + return returnFunc(settingID) } - if rf, ok := ret.Get(0).(func(string) *v0.Setting); ok { - r0 = rf(settingID) + if returnFunc, ok := ret.Get(0).(func(string) *v0.Setting); ok { + r0 = returnFunc(settingID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v0.Setting) } } - - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(settingID) + if returnFunc, ok := ret.Get(1).(func(string) error); ok { + r1 = returnFunc(settingID) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -592,24 +671,30 @@ func (_e *Manager_Expecter) ReadSetting(settingID interface{}) *Manager_ReadSett func (_c *Manager_ReadSetting_Call) Run(run func(settingID string)) *Manager_ReadSetting_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) }) return _c } -func (_c *Manager_ReadSetting_Call) Return(_a0 *v0.Setting, _a1 error) *Manager_ReadSetting_Call { - _c.Call.Return(_a0, _a1) +func (_c *Manager_ReadSetting_Call) Return(setting *v0.Setting, err error) *Manager_ReadSetting_Call { + _c.Call.Return(setting, err) return _c } -func (_c *Manager_ReadSetting_Call) RunAndReturn(run func(string) (*v0.Setting, error)) *Manager_ReadSetting_Call { +func (_c *Manager_ReadSetting_Call) RunAndReturn(run func(settingID string) (*v0.Setting, error)) *Manager_ReadSetting_Call { _c.Call.Return(run) return _c } -// ReadValue provides a mock function with given fields: valueID -func (_m *Manager) ReadValue(valueID string) (*v0.Value, error) { - ret := _m.Called(valueID) +// ReadValue provides a mock function for the type Manager +func (_mock *Manager) ReadValue(valueID string) (*v0.Value, error) { + ret := _mock.Called(valueID) if len(ret) == 0 { panic("no return value specified for ReadValue") @@ -617,23 +702,21 @@ func (_m *Manager) ReadValue(valueID string) (*v0.Value, error) { var r0 *v0.Value var r1 error - if rf, ok := ret.Get(0).(func(string) (*v0.Value, error)); ok { - return rf(valueID) + if returnFunc, ok := ret.Get(0).(func(string) (*v0.Value, error)); ok { + return returnFunc(valueID) } - if rf, ok := ret.Get(0).(func(string) *v0.Value); ok { - r0 = rf(valueID) + if returnFunc, ok := ret.Get(0).(func(string) *v0.Value); ok { + r0 = returnFunc(valueID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v0.Value) } } - - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(valueID) + if returnFunc, ok := ret.Get(1).(func(string) error); ok { + r1 = returnFunc(valueID) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -650,24 +733,30 @@ func (_e *Manager_Expecter) ReadValue(valueID interface{}) *Manager_ReadValue_Ca func (_c *Manager_ReadValue_Call) Run(run func(valueID string)) *Manager_ReadValue_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) }) return _c } -func (_c *Manager_ReadValue_Call) Return(_a0 *v0.Value, _a1 error) *Manager_ReadValue_Call { - _c.Call.Return(_a0, _a1) +func (_c *Manager_ReadValue_Call) Return(value *v0.Value, err error) *Manager_ReadValue_Call { + _c.Call.Return(value, err) return _c } -func (_c *Manager_ReadValue_Call) RunAndReturn(run func(string) (*v0.Value, error)) *Manager_ReadValue_Call { +func (_c *Manager_ReadValue_Call) RunAndReturn(run func(valueID string) (*v0.Value, error)) *Manager_ReadValue_Call { _c.Call.Return(run) return _c } -// ReadValueByUniqueIdentifiers provides a mock function with given fields: accountUUID, settingID -func (_m *Manager) ReadValueByUniqueIdentifiers(accountUUID string, settingID string) (*v0.Value, error) { - ret := _m.Called(accountUUID, settingID) +// ReadValueByUniqueIdentifiers provides a mock function for the type Manager +func (_mock *Manager) ReadValueByUniqueIdentifiers(accountUUID string, settingID string) (*v0.Value, error) { + ret := _mock.Called(accountUUID, settingID) if len(ret) == 0 { panic("no return value specified for ReadValueByUniqueIdentifiers") @@ -675,23 +764,21 @@ func (_m *Manager) ReadValueByUniqueIdentifiers(accountUUID string, settingID st var r0 *v0.Value var r1 error - if rf, ok := ret.Get(0).(func(string, string) (*v0.Value, error)); ok { - return rf(accountUUID, settingID) + if returnFunc, ok := ret.Get(0).(func(string, string) (*v0.Value, error)); ok { + return returnFunc(accountUUID, settingID) } - if rf, ok := ret.Get(0).(func(string, string) *v0.Value); ok { - r0 = rf(accountUUID, settingID) + if returnFunc, ok := ret.Get(0).(func(string, string) *v0.Value); ok { + r0 = returnFunc(accountUUID, settingID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v0.Value) } } - - if rf, ok := ret.Get(1).(func(string, string) error); ok { - r1 = rf(accountUUID, settingID) + if returnFunc, ok := ret.Get(1).(func(string, string) error); ok { + r1 = returnFunc(accountUUID, settingID) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -709,36 +796,46 @@ func (_e *Manager_Expecter) ReadValueByUniqueIdentifiers(accountUUID interface{} func (_c *Manager_ReadValueByUniqueIdentifiers_Call) Run(run func(accountUUID string, settingID string)) *Manager_ReadValueByUniqueIdentifiers_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(string)) + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Manager_ReadValueByUniqueIdentifiers_Call) Return(_a0 *v0.Value, _a1 error) *Manager_ReadValueByUniqueIdentifiers_Call { - _c.Call.Return(_a0, _a1) +func (_c *Manager_ReadValueByUniqueIdentifiers_Call) Return(value *v0.Value, err error) *Manager_ReadValueByUniqueIdentifiers_Call { + _c.Call.Return(value, err) return _c } -func (_c *Manager_ReadValueByUniqueIdentifiers_Call) RunAndReturn(run func(string, string) (*v0.Value, error)) *Manager_ReadValueByUniqueIdentifiers_Call { +func (_c *Manager_ReadValueByUniqueIdentifiers_Call) RunAndReturn(run func(accountUUID string, settingID string) (*v0.Value, error)) *Manager_ReadValueByUniqueIdentifiers_Call { _c.Call.Return(run) return _c } -// RemoveRoleAssignment provides a mock function with given fields: assignmentID -func (_m *Manager) RemoveRoleAssignment(assignmentID string) error { - ret := _m.Called(assignmentID) +// RemoveRoleAssignment provides a mock function for the type Manager +func (_mock *Manager) RemoveRoleAssignment(assignmentID string) error { + ret := _mock.Called(assignmentID) if len(ret) == 0 { panic("no return value specified for RemoveRoleAssignment") } var r0 error - if rf, ok := ret.Get(0).(func(string) error); ok { - r0 = rf(assignmentID) + if returnFunc, ok := ret.Get(0).(func(string) error); ok { + r0 = returnFunc(assignmentID) } else { r0 = ret.Error(0) } - return r0 } @@ -755,36 +852,41 @@ func (_e *Manager_Expecter) RemoveRoleAssignment(assignmentID interface{}) *Mana func (_c *Manager_RemoveRoleAssignment_Call) Run(run func(assignmentID string)) *Manager_RemoveRoleAssignment_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) }) return _c } -func (_c *Manager_RemoveRoleAssignment_Call) Return(_a0 error) *Manager_RemoveRoleAssignment_Call { - _c.Call.Return(_a0) +func (_c *Manager_RemoveRoleAssignment_Call) Return(err error) *Manager_RemoveRoleAssignment_Call { + _c.Call.Return(err) return _c } -func (_c *Manager_RemoveRoleAssignment_Call) RunAndReturn(run func(string) error) *Manager_RemoveRoleAssignment_Call { +func (_c *Manager_RemoveRoleAssignment_Call) RunAndReturn(run func(assignmentID string) error) *Manager_RemoveRoleAssignment_Call { _c.Call.Return(run) return _c } -// RemoveSettingFromBundle provides a mock function with given fields: bundleID, settingID -func (_m *Manager) RemoveSettingFromBundle(bundleID string, settingID string) error { - ret := _m.Called(bundleID, settingID) +// RemoveSettingFromBundle provides a mock function for the type Manager +func (_mock *Manager) RemoveSettingFromBundle(bundleID string, settingID string) error { + ret := _mock.Called(bundleID, settingID) if len(ret) == 0 { panic("no return value specified for RemoveSettingFromBundle") } var r0 error - if rf, ok := ret.Get(0).(func(string, string) error); ok { - r0 = rf(bundleID, settingID) + if returnFunc, ok := ret.Get(0).(func(string, string) error); ok { + r0 = returnFunc(bundleID, settingID) } else { r0 = ret.Error(0) } - return r0 } @@ -802,24 +904,35 @@ func (_e *Manager_Expecter) RemoveSettingFromBundle(bundleID interface{}, settin func (_c *Manager_RemoveSettingFromBundle_Call) Run(run func(bundleID string, settingID string)) *Manager_RemoveSettingFromBundle_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(string)) + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Manager_RemoveSettingFromBundle_Call) Return(_a0 error) *Manager_RemoveSettingFromBundle_Call { - _c.Call.Return(_a0) +func (_c *Manager_RemoveSettingFromBundle_Call) Return(err error) *Manager_RemoveSettingFromBundle_Call { + _c.Call.Return(err) return _c } -func (_c *Manager_RemoveSettingFromBundle_Call) RunAndReturn(run func(string, string) error) *Manager_RemoveSettingFromBundle_Call { +func (_c *Manager_RemoveSettingFromBundle_Call) RunAndReturn(run func(bundleID string, settingID string) error) *Manager_RemoveSettingFromBundle_Call { _c.Call.Return(run) return _c } -// WriteBundle provides a mock function with given fields: bundle -func (_m *Manager) WriteBundle(bundle *v0.Bundle) (*v0.Bundle, error) { - ret := _m.Called(bundle) +// WriteBundle provides a mock function for the type Manager +func (_mock *Manager) WriteBundle(bundle *v0.Bundle) (*v0.Bundle, error) { + ret := _mock.Called(bundle) if len(ret) == 0 { panic("no return value specified for WriteBundle") @@ -827,23 +940,21 @@ func (_m *Manager) WriteBundle(bundle *v0.Bundle) (*v0.Bundle, error) { var r0 *v0.Bundle var r1 error - if rf, ok := ret.Get(0).(func(*v0.Bundle) (*v0.Bundle, error)); ok { - return rf(bundle) + if returnFunc, ok := ret.Get(0).(func(*v0.Bundle) (*v0.Bundle, error)); ok { + return returnFunc(bundle) } - if rf, ok := ret.Get(0).(func(*v0.Bundle) *v0.Bundle); ok { - r0 = rf(bundle) + if returnFunc, ok := ret.Get(0).(func(*v0.Bundle) *v0.Bundle); ok { + r0 = returnFunc(bundle) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v0.Bundle) } } - - if rf, ok := ret.Get(1).(func(*v0.Bundle) error); ok { - r1 = rf(bundle) + if returnFunc, ok := ret.Get(1).(func(*v0.Bundle) error); ok { + r1 = returnFunc(bundle) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -860,24 +971,30 @@ func (_e *Manager_Expecter) WriteBundle(bundle interface{}) *Manager_WriteBundle func (_c *Manager_WriteBundle_Call) Run(run func(bundle *v0.Bundle)) *Manager_WriteBundle_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*v0.Bundle)) + var arg0 *v0.Bundle + if args[0] != nil { + arg0 = args[0].(*v0.Bundle) + } + run( + arg0, + ) }) return _c } -func (_c *Manager_WriteBundle_Call) Return(_a0 *v0.Bundle, _a1 error) *Manager_WriteBundle_Call { - _c.Call.Return(_a0, _a1) +func (_c *Manager_WriteBundle_Call) Return(bundle1 *v0.Bundle, err error) *Manager_WriteBundle_Call { + _c.Call.Return(bundle1, err) return _c } -func (_c *Manager_WriteBundle_Call) RunAndReturn(run func(*v0.Bundle) (*v0.Bundle, error)) *Manager_WriteBundle_Call { +func (_c *Manager_WriteBundle_Call) RunAndReturn(run func(bundle *v0.Bundle) (*v0.Bundle, error)) *Manager_WriteBundle_Call { _c.Call.Return(run) return _c } -// WriteRoleAssignment provides a mock function with given fields: accountUUID, roleID -func (_m *Manager) WriteRoleAssignment(accountUUID string, roleID string) (*v0.UserRoleAssignment, error) { - ret := _m.Called(accountUUID, roleID) +// WriteRoleAssignment provides a mock function for the type Manager +func (_mock *Manager) WriteRoleAssignment(accountUUID string, roleID string) (*v0.UserRoleAssignment, error) { + ret := _mock.Called(accountUUID, roleID) if len(ret) == 0 { panic("no return value specified for WriteRoleAssignment") @@ -885,23 +1002,21 @@ func (_m *Manager) WriteRoleAssignment(accountUUID string, roleID string) (*v0.U var r0 *v0.UserRoleAssignment var r1 error - if rf, ok := ret.Get(0).(func(string, string) (*v0.UserRoleAssignment, error)); ok { - return rf(accountUUID, roleID) + if returnFunc, ok := ret.Get(0).(func(string, string) (*v0.UserRoleAssignment, error)); ok { + return returnFunc(accountUUID, roleID) } - if rf, ok := ret.Get(0).(func(string, string) *v0.UserRoleAssignment); ok { - r0 = rf(accountUUID, roleID) + if returnFunc, ok := ret.Get(0).(func(string, string) *v0.UserRoleAssignment); ok { + r0 = returnFunc(accountUUID, roleID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v0.UserRoleAssignment) } } - - if rf, ok := ret.Get(1).(func(string, string) error); ok { - r1 = rf(accountUUID, roleID) + if returnFunc, ok := ret.Get(1).(func(string, string) error); ok { + r1 = returnFunc(accountUUID, roleID) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -919,24 +1034,35 @@ func (_e *Manager_Expecter) WriteRoleAssignment(accountUUID interface{}, roleID func (_c *Manager_WriteRoleAssignment_Call) Run(run func(accountUUID string, roleID string)) *Manager_WriteRoleAssignment_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(string)) + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *Manager_WriteRoleAssignment_Call) Return(_a0 *v0.UserRoleAssignment, _a1 error) *Manager_WriteRoleAssignment_Call { - _c.Call.Return(_a0, _a1) +func (_c *Manager_WriteRoleAssignment_Call) Return(userRoleAssignment *v0.UserRoleAssignment, err error) *Manager_WriteRoleAssignment_Call { + _c.Call.Return(userRoleAssignment, err) return _c } -func (_c *Manager_WriteRoleAssignment_Call) RunAndReturn(run func(string, string) (*v0.UserRoleAssignment, error)) *Manager_WriteRoleAssignment_Call { +func (_c *Manager_WriteRoleAssignment_Call) RunAndReturn(run func(accountUUID string, roleID string) (*v0.UserRoleAssignment, error)) *Manager_WriteRoleAssignment_Call { _c.Call.Return(run) return _c } -// WriteValue provides a mock function with given fields: value -func (_m *Manager) WriteValue(value *v0.Value) (*v0.Value, error) { - ret := _m.Called(value) +// WriteValue provides a mock function for the type Manager +func (_mock *Manager) WriteValue(value *v0.Value) (*v0.Value, error) { + ret := _mock.Called(value) if len(ret) == 0 { panic("no return value specified for WriteValue") @@ -944,23 +1070,21 @@ func (_m *Manager) WriteValue(value *v0.Value) (*v0.Value, error) { var r0 *v0.Value var r1 error - if rf, ok := ret.Get(0).(func(*v0.Value) (*v0.Value, error)); ok { - return rf(value) + if returnFunc, ok := ret.Get(0).(func(*v0.Value) (*v0.Value, error)); ok { + return returnFunc(value) } - if rf, ok := ret.Get(0).(func(*v0.Value) *v0.Value); ok { - r0 = rf(value) + if returnFunc, ok := ret.Get(0).(func(*v0.Value) *v0.Value); ok { + r0 = returnFunc(value) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v0.Value) } } - - if rf, ok := ret.Get(1).(func(*v0.Value) error); ok { - r1 = rf(value) + if returnFunc, ok := ret.Get(1).(func(*v0.Value) error); ok { + r1 = returnFunc(value) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -977,31 +1101,23 @@ func (_e *Manager_Expecter) WriteValue(value interface{}) *Manager_WriteValue_Ca func (_c *Manager_WriteValue_Call) Run(run func(value *v0.Value)) *Manager_WriteValue_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*v0.Value)) + var arg0 *v0.Value + if args[0] != nil { + arg0 = args[0].(*v0.Value) + } + run( + arg0, + ) }) return _c } -func (_c *Manager_WriteValue_Call) Return(_a0 *v0.Value, _a1 error) *Manager_WriteValue_Call { - _c.Call.Return(_a0, _a1) +func (_c *Manager_WriteValue_Call) Return(value1 *v0.Value, err error) *Manager_WriteValue_Call { + _c.Call.Return(value1, err) return _c } -func (_c *Manager_WriteValue_Call) RunAndReturn(run func(*v0.Value) (*v0.Value, error)) *Manager_WriteValue_Call { +func (_c *Manager_WriteValue_Call) RunAndReturn(run func(value *v0.Value) (*v0.Value, error)) *Manager_WriteValue_Call { _c.Call.Return(run) return _c } - -// NewManager creates a new instance of Manager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewManager(t interface { - mock.TestingT - Cleanup(func()) -}) *Manager { - mock := &Manager{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} From 29f9e7104420c3e8f4b38493a66195d407b89fa9 Mon Sep 17 00:00:00 2001 From: 06kellyjac Date: Wed, 18 Jun 2025 12:56:25 +0100 Subject: [PATCH 4/4] build: add protogen to modules list fix Makefile Added protogen to the OC_MODULES list since it uses mockery so has generated files. Removed `include` for file which no-longer exists. --- Makefile | 4 ++-- protogen/Makefile | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index ca10398421..944f8a32ad 100644 --- a/Makefile +++ b/Makefile @@ -65,7 +65,8 @@ OC_MODULES = \ services/webdav\ services/webfinger\ opencloud \ - pkg + pkg \ + protogen # bin file definitions PHP_CS_FIXER=php -d zend.enable_gc=0 vendor-bin/opencloud-codestyle/vendor/bin/php-cs-fixer @@ -350,4 +351,3 @@ generate-qa-activity-report: node_modules exit 1; \ fi go run tests/qa-activity-report/generate-qa-activity-report.go --month ${MONTH} --year ${YEAR} - diff --git a/protogen/Makefile b/protogen/Makefile index 7a1f6677ca..8d3f0fdd83 100644 --- a/protogen/Makefile +++ b/protogen/Makefile @@ -5,7 +5,6 @@ ifneq (, $(shell command -v go 2> /dev/null)) # suppress `command not found warn include ../.bingo/Variables.mk endif include ../.make/default.mk -include ../.make/generate.mk .PHONY: go-generate go-generate: $(MOCKERY)