From e7e794e729ce82f29c6b38e7f78f924c30715bec Mon Sep 17 00:00:00 2001 From: Thomas Obenaus Date: Tue, 12 Oct 2021 23:12:07 +0200 Subject: [PATCH] [#154] Update reproduce bug --- go.mod | 4 +- go.sum | 73 +++++-------- main_test.go | 1 + test/mocks/aws/mock_autoscaling_IF.go | 63 +++++------ .../capacityplanner/mock_scaleschedule_IF.go | 17 +-- test/mocks/metrics/mock_metrics.go | 103 +++++++++--------- test/mocks/nomad/mock_nomadclient_IF.go | 43 ++++---- test/mocks/nomadWorker/mock_nomadclient_IF.go | 83 +++++++------- test/mocks/scaler/mock_scalingtarget_IF.go | 27 ++--- test/mocks/sokar/mock_capacity_planner_IF.go | 43 ++++---- test/mocks/sokar/mock_scaleEventEmitter_IF.go | 15 +-- test/mocks/sokar/mock_scaler_IF.go | 47 ++++---- test/mocks/sokar/mock_scaleschedule_IF.go | 45 ++++---- 13 files changed, 277 insertions(+), 287 deletions(-) diff --git a/go.mod b/go.mod index b6eb5ddc..2bf61ef1 100644 --- a/go.mod +++ b/go.mod @@ -3,9 +3,9 @@ module github.com/thomasobenaus/sokar go 1.13 require ( - github.com/ThomasObenaus/go-base v0.0.8 + github.com/ThomasObenaus/go-base v0.0.11 github.com/aws/aws-sdk-go v1.25.37 - github.com/golang/mock v1.4.4 + github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.3.4 // indirect github.com/hashicorp/nomad/api v0.0.0-20200519162023-99f117a28892 github.com/julienschmidt/httprouter v1.2.0 diff --git a/go.sum b/go.sum index a111e985..c1cdbac2 100644 --- a/go.sum +++ b/go.sum @@ -15,10 +15,10 @@ github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ 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/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/ThomasObenaus/go-base v0.0.8 h1:nAFUwHjiBtjWX7vf+K2MFskf0NT+X5eIN6lh1S2q9eI= -github.com/ThomasObenaus/go-base v0.0.8/go.mod h1:T11bGScVNnugc4X6mje4EcZKQZQ8KdRvS1zcTYreMC8= -github.com/ThomasObenaus/go-conf v0.0.3 h1:lU2RNgztTFRP25v9t4w1RZMNcZdjWGXZAeFvSAHNt7k= -github.com/ThomasObenaus/go-conf v0.0.3/go.mod h1:d0MXd6Q0jSWtfwfKSruFkqT5LmKDqH1vbWSkDeB2O8g= +github.com/ThomasObenaus/go-base v0.0.11 h1:sDv24Mq3wgNprPgIg7cSgjeCrPprc2oqcqY3Twg2fG0= +github.com/ThomasObenaus/go-base v0.0.11/go.mod h1:6VOknh0O4ZW2cZsKv/59L7qMkc9zTr5VNY8BbfbOHU8= +github.com/ThomasObenaus/go-conf v0.1.2 h1:PtZUdnUbCTAsIYCLxpMR/aFz7jMWkJJXcgSaDc+4cJs= +github.com/ThomasObenaus/go-conf v0.1.2/go.mod h1:J9r5Rh/fpJ932jKYf32W5UOmTOJO/n1Vh3zSv5qmhUA= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -63,22 +63,19 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/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.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= 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.4 h1:87PNWwrRvUSnqS4dlcBU/ftvOIBep4sYuBLlh6rX2wk= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= 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= @@ -94,7 +91,6 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -143,7 +139,6 @@ github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvW github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -154,7 +149,6 @@ github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzR github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/goveralls v0.0.7/go.mod h1:h8b4ow6FxSPMQHF6o2ve3qsclnffZjYTNEKmLesRwqw= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= @@ -180,7 +174,6 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9 github.com/pelletier/go-toml v1.4.0 h1:u3Z1r+oOXJIkxqw34zVhyPgjBsm6X2wn21NWs/HfSeg= github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -189,12 +182,10 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_golang v1.0.0 h1:vrDKnkGzuGvhNAL56c7DBz29ZL+KxnoR0x7enabFceM= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.4.1 h1:FFSuS004yOQEtDdTq+TAOLP5xUq63KqAFYyOi8zA+Y8= github.com/prometheus/client_golang v1.4.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 h1:S/YWwWx/RA8rT8tKFRuGUZhuA90OyIBpPCXkcbwU8DE= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -227,26 +218,22 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= 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.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 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/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -254,8 +241,8 @@ github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= @@ -266,12 +253,10 @@ go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= 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/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= @@ -291,9 +276,8 @@ golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU 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.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 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-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -307,13 +291,11 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn 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-20190613194153-d28f0bde5980 h1:dfGZHvZk057jK2MCeWus/TowKpJ8y4AmooUzdBSR9GU= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b h1:0mm1VjtFUOIlE1SbDlwjYaDxZVDP2S5ou6y0gSgXHu8= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d h1:20cMwl2fHAzkJMEA+8J4JgqBQcQGzbisXo31MIeenXI= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= 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= @@ -321,17 +303,15 @@ golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJ 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 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= 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-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= 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= @@ -341,17 +321,19 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w 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-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 h1:myAQVi0cGEoqQVR5POX+8RR2mrocKqNN1hmeMqhX27k= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e h1:WUoyKPm6nCo1BnNUvPGnFG3T5DUVem42yDJZZ4CNxMA= +golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= 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 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 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/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -374,12 +356,11 @@ golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/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-20200522201501-cb1345f3a375/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.7 h1:6j8CgantCy3yc8JGBqkDLMKWqZ0RDU2g1HVgacojGWQ= +golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= 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 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -406,7 +387,6 @@ google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiq google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -416,7 +396,6 @@ gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/main_test.go b/main_test.go index 016ea8be..d5d14310 100644 --- a/main_test.go +++ b/main_test.go @@ -80,6 +80,7 @@ func Test_CliAndConfig(t *testing.T) { require.NoError(t, err) assert.NotNil(t, cfg) assert.Equal(t, nomadSrvAddr, cfg.Scaler.Nomad.ServerAddr) + assert.Len(t, cfg.CapacityPlanner.ScaleSchedule, 2) args = []string{"./sokar-bin", "--co"} cfg, err = cliAndConfig(args) diff --git a/test/mocks/aws/mock_autoscaling_IF.go b/test/mocks/aws/mock_autoscaling_IF.go index 426865aa..511c419a 100644 --- a/test/mocks/aws/mock_autoscaling_IF.go +++ b/test/mocks/aws/mock_autoscaling_IF.go @@ -5,38 +5,39 @@ package mock_aws import ( + reflect "reflect" + request "github.com/aws/aws-sdk-go/aws/request" session "github.com/aws/aws-sdk-go/aws/session" autoscaling "github.com/aws/aws-sdk-go/service/autoscaling" gomock "github.com/golang/mock/gomock" aws "github.com/thomasobenaus/sokar/aws/iface" - reflect "reflect" ) -// MockAutoScaling is a mock of AutoScaling interface +// MockAutoScaling is a mock of AutoScaling interface. type MockAutoScaling struct { ctrl *gomock.Controller recorder *MockAutoScalingMockRecorder } -// MockAutoScalingMockRecorder is the mock recorder for MockAutoScaling +// MockAutoScalingMockRecorder is the mock recorder for MockAutoScaling. type MockAutoScalingMockRecorder struct { mock *MockAutoScaling } -// NewMockAutoScaling creates a new mock instance +// NewMockAutoScaling creates a new mock instance. func NewMockAutoScaling(ctrl *gomock.Controller) *MockAutoScaling { mock := &MockAutoScaling{ctrl: ctrl} mock.recorder = &MockAutoScalingMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockAutoScaling) EXPECT() *MockAutoScalingMockRecorder { return m.recorder } -// DescribeAutoScalingGroups mocks base method +// DescribeAutoScalingGroups mocks base method. func (m *MockAutoScaling) DescribeAutoScalingGroups(input *autoscaling.DescribeAutoScalingGroupsInput) (*autoscaling.DescribeAutoScalingGroupsOutput, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DescribeAutoScalingGroups", input) @@ -45,28 +46,28 @@ func (m *MockAutoScaling) DescribeAutoScalingGroups(input *autoscaling.DescribeA return ret0, ret1 } -// DescribeAutoScalingGroups indicates an expected call of DescribeAutoScalingGroups +// DescribeAutoScalingGroups indicates an expected call of DescribeAutoScalingGroups. func (mr *MockAutoScalingMockRecorder) DescribeAutoScalingGroups(input interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeAutoScalingGroups", reflect.TypeOf((*MockAutoScaling)(nil).DescribeAutoScalingGroups), input) } -// UpdateAutoScalingGroup mocks base method -func (m *MockAutoScaling) UpdateAutoScalingGroup(input *autoscaling.UpdateAutoScalingGroupInput) (*autoscaling.UpdateAutoScalingGroupOutput, error) { +// DescribeScalingActivitiesRequest mocks base method. +func (m *MockAutoScaling) DescribeScalingActivitiesRequest(input *autoscaling.DescribeScalingActivitiesInput) (*request.Request, *autoscaling.DescribeScalingActivitiesOutput) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "UpdateAutoScalingGroup", input) - ret0, _ := ret[0].(*autoscaling.UpdateAutoScalingGroupOutput) - ret1, _ := ret[1].(error) + ret := m.ctrl.Call(m, "DescribeScalingActivitiesRequest", input) + ret0, _ := ret[0].(*request.Request) + ret1, _ := ret[1].(*autoscaling.DescribeScalingActivitiesOutput) return ret0, ret1 } -// UpdateAutoScalingGroup indicates an expected call of UpdateAutoScalingGroup -func (mr *MockAutoScalingMockRecorder) UpdateAutoScalingGroup(input interface{}) *gomock.Call { +// DescribeScalingActivitiesRequest indicates an expected call of DescribeScalingActivitiesRequest. +func (mr *MockAutoScalingMockRecorder) DescribeScalingActivitiesRequest(input interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateAutoScalingGroup", reflect.TypeOf((*MockAutoScaling)(nil).UpdateAutoScalingGroup), input) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeScalingActivitiesRequest", reflect.TypeOf((*MockAutoScaling)(nil).DescribeScalingActivitiesRequest), input) } -// TerminateInstanceInAutoScalingGroupRequest mocks base method +// TerminateInstanceInAutoScalingGroupRequest mocks base method. func (m *MockAutoScaling) TerminateInstanceInAutoScalingGroupRequest(input *autoscaling.TerminateInstanceInAutoScalingGroupInput) (*request.Request, *autoscaling.TerminateInstanceInAutoScalingGroupOutput) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "TerminateInstanceInAutoScalingGroupRequest", input) @@ -75,51 +76,51 @@ func (m *MockAutoScaling) TerminateInstanceInAutoScalingGroupRequest(input *auto return ret0, ret1 } -// TerminateInstanceInAutoScalingGroupRequest indicates an expected call of TerminateInstanceInAutoScalingGroupRequest +// TerminateInstanceInAutoScalingGroupRequest indicates an expected call of TerminateInstanceInAutoScalingGroupRequest. func (mr *MockAutoScalingMockRecorder) TerminateInstanceInAutoScalingGroupRequest(input interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TerminateInstanceInAutoScalingGroupRequest", reflect.TypeOf((*MockAutoScaling)(nil).TerminateInstanceInAutoScalingGroupRequest), input) } -// DescribeScalingActivitiesRequest mocks base method -func (m *MockAutoScaling) DescribeScalingActivitiesRequest(input *autoscaling.DescribeScalingActivitiesInput) (*request.Request, *autoscaling.DescribeScalingActivitiesOutput) { +// UpdateAutoScalingGroup mocks base method. +func (m *MockAutoScaling) UpdateAutoScalingGroup(input *autoscaling.UpdateAutoScalingGroupInput) (*autoscaling.UpdateAutoScalingGroupOutput, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DescribeScalingActivitiesRequest", input) - ret0, _ := ret[0].(*request.Request) - ret1, _ := ret[1].(*autoscaling.DescribeScalingActivitiesOutput) + ret := m.ctrl.Call(m, "UpdateAutoScalingGroup", input) + ret0, _ := ret[0].(*autoscaling.UpdateAutoScalingGroupOutput) + ret1, _ := ret[1].(error) return ret0, ret1 } -// DescribeScalingActivitiesRequest indicates an expected call of DescribeScalingActivitiesRequest -func (mr *MockAutoScalingMockRecorder) DescribeScalingActivitiesRequest(input interface{}) *gomock.Call { +// UpdateAutoScalingGroup indicates an expected call of UpdateAutoScalingGroup. +func (mr *MockAutoScalingMockRecorder) UpdateAutoScalingGroup(input interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeScalingActivitiesRequest", reflect.TypeOf((*MockAutoScaling)(nil).DescribeScalingActivitiesRequest), input) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateAutoScalingGroup", reflect.TypeOf((*MockAutoScaling)(nil).UpdateAutoScalingGroup), input) } -// MockAutoScalingFactory is a mock of AutoScalingFactory interface +// MockAutoScalingFactory is a mock of AutoScalingFactory interface. type MockAutoScalingFactory struct { ctrl *gomock.Controller recorder *MockAutoScalingFactoryMockRecorder } -// MockAutoScalingFactoryMockRecorder is the mock recorder for MockAutoScalingFactory +// MockAutoScalingFactoryMockRecorder is the mock recorder for MockAutoScalingFactory. type MockAutoScalingFactoryMockRecorder struct { mock *MockAutoScalingFactory } -// NewMockAutoScalingFactory creates a new mock instance +// NewMockAutoScalingFactory creates a new mock instance. func NewMockAutoScalingFactory(ctrl *gomock.Controller) *MockAutoScalingFactory { mock := &MockAutoScalingFactory{ctrl: ctrl} mock.recorder = &MockAutoScalingFactoryMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockAutoScalingFactory) EXPECT() *MockAutoScalingFactoryMockRecorder { return m.recorder } -// CreateAutoScaling mocks base method +// CreateAutoScaling mocks base method. func (m *MockAutoScalingFactory) CreateAutoScaling(session *session.Session) aws.AutoScaling { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreateAutoScaling", session) @@ -127,7 +128,7 @@ func (m *MockAutoScalingFactory) CreateAutoScaling(session *session.Session) aws return ret0 } -// CreateAutoScaling indicates an expected call of CreateAutoScaling +// CreateAutoScaling indicates an expected call of CreateAutoScaling. func (mr *MockAutoScalingFactoryMockRecorder) CreateAutoScaling(session interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateAutoScaling", reflect.TypeOf((*MockAutoScalingFactory)(nil).CreateAutoScaling), session) diff --git a/test/mocks/capacityplanner/mock_scaleschedule_IF.go b/test/mocks/capacityplanner/mock_scaleschedule_IF.go index 579ce5b1..4b3d35a7 100644 --- a/test/mocks/capacityplanner/mock_scaleschedule_IF.go +++ b/test/mocks/capacityplanner/mock_scaleschedule_IF.go @@ -5,36 +5,37 @@ package mock_capacityplanner import ( - gomock "github.com/golang/mock/gomock" - helper "github.com/thomasobenaus/sokar/helper" reflect "reflect" time "time" + + gomock "github.com/golang/mock/gomock" + helper "github.com/thomasobenaus/sokar/helper" ) -// MockScaleSchedule is a mock of ScaleSchedule interface +// MockScaleSchedule is a mock of ScaleSchedule interface. type MockScaleSchedule struct { ctrl *gomock.Controller recorder *MockScaleScheduleMockRecorder } -// MockScaleScheduleMockRecorder is the mock recorder for MockScaleSchedule +// MockScaleScheduleMockRecorder is the mock recorder for MockScaleSchedule. type MockScaleScheduleMockRecorder struct { mock *MockScaleSchedule } -// NewMockScaleSchedule creates a new mock instance +// NewMockScaleSchedule creates a new mock instance. func NewMockScaleSchedule(ctrl *gomock.Controller) *MockScaleSchedule { mock := &MockScaleSchedule{ctrl: ctrl} mock.recorder = &MockScaleScheduleMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockScaleSchedule) EXPECT() *MockScaleScheduleMockRecorder { return m.recorder } -// ScaleRangeAt mocks base method +// ScaleRangeAt mocks base method. func (m *MockScaleSchedule) ScaleRangeAt(day time.Weekday, at helper.SimpleTime) (uint, uint, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ScaleRangeAt", day, at) @@ -44,7 +45,7 @@ func (m *MockScaleSchedule) ScaleRangeAt(day time.Weekday, at helper.SimpleTime) return ret0, ret1, ret2 } -// ScaleRangeAt indicates an expected call of ScaleRangeAt +// ScaleRangeAt indicates an expected call of ScaleRangeAt. func (mr *MockScaleScheduleMockRecorder) ScaleRangeAt(day, at interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ScaleRangeAt", reflect.TypeOf((*MockScaleSchedule)(nil).ScaleRangeAt), day, at) diff --git a/test/mocks/metrics/mock_metrics.go b/test/mocks/metrics/mock_metrics.go index 7ab4bd6d..b7352020 100644 --- a/test/mocks/metrics/mock_metrics.go +++ b/test/mocks/metrics/mock_metrics.go @@ -5,129 +5,130 @@ package mock_metrics import ( + reflect "reflect" + gomock "github.com/golang/mock/gomock" metrics "github.com/thomasobenaus/sokar/metrics" - reflect "reflect" ) -// MockCounter is a mock of Counter interface +// MockCounter is a mock of Counter interface. type MockCounter struct { ctrl *gomock.Controller recorder *MockCounterMockRecorder } -// MockCounterMockRecorder is the mock recorder for MockCounter +// MockCounterMockRecorder is the mock recorder for MockCounter. type MockCounterMockRecorder struct { mock *MockCounter } -// NewMockCounter creates a new mock instance +// NewMockCounter creates a new mock instance. func NewMockCounter(ctrl *gomock.Controller) *MockCounter { mock := &MockCounter{ctrl: ctrl} mock.recorder = &MockCounterMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockCounter) EXPECT() *MockCounterMockRecorder { return m.recorder } -// Inc mocks base method -func (m *MockCounter) Inc() { +// Add mocks base method. +func (m *MockCounter) Add(arg0 float64) { m.ctrl.T.Helper() - m.ctrl.Call(m, "Inc") + m.ctrl.Call(m, "Add", arg0) } -// Inc indicates an expected call of Inc -func (mr *MockCounterMockRecorder) Inc() *gomock.Call { +// Add indicates an expected call of Add. +func (mr *MockCounterMockRecorder) Add(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Inc", reflect.TypeOf((*MockCounter)(nil).Inc)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Add", reflect.TypeOf((*MockCounter)(nil).Add), arg0) } -// Add mocks base method -func (m *MockCounter) Add(arg0 float64) { +// Inc mocks base method. +func (m *MockCounter) Inc() { m.ctrl.T.Helper() - m.ctrl.Call(m, "Add", arg0) + m.ctrl.Call(m, "Inc") } -// Add indicates an expected call of Add -func (mr *MockCounterMockRecorder) Add(arg0 interface{}) *gomock.Call { +// Inc indicates an expected call of Inc. +func (mr *MockCounterMockRecorder) Inc() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Add", reflect.TypeOf((*MockCounter)(nil).Add), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Inc", reflect.TypeOf((*MockCounter)(nil).Inc)) } -// MockGauge is a mock of Gauge interface +// MockGauge is a mock of Gauge interface. type MockGauge struct { ctrl *gomock.Controller recorder *MockGaugeMockRecorder } -// MockGaugeMockRecorder is the mock recorder for MockGauge +// MockGaugeMockRecorder is the mock recorder for MockGauge. type MockGaugeMockRecorder struct { mock *MockGauge } -// NewMockGauge creates a new mock instance +// NewMockGauge creates a new mock instance. func NewMockGauge(ctrl *gomock.Controller) *MockGauge { mock := &MockGauge{ctrl: ctrl} mock.recorder = &MockGaugeMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockGauge) EXPECT() *MockGaugeMockRecorder { return m.recorder } -// Set mocks base method -func (m *MockGauge) Set(arg0 float64) { +// Add mocks base method. +func (m *MockGauge) Add(arg0 float64) { m.ctrl.T.Helper() - m.ctrl.Call(m, "Set", arg0) + m.ctrl.Call(m, "Add", arg0) } -// Set indicates an expected call of Set -func (mr *MockGaugeMockRecorder) Set(arg0 interface{}) *gomock.Call { +// Add indicates an expected call of Add. +func (mr *MockGaugeMockRecorder) Add(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Set", reflect.TypeOf((*MockGauge)(nil).Set), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Add", reflect.TypeOf((*MockGauge)(nil).Add), arg0) } -// Add mocks base method -func (m *MockGauge) Add(arg0 float64) { +// Set mocks base method. +func (m *MockGauge) Set(arg0 float64) { m.ctrl.T.Helper() - m.ctrl.Call(m, "Add", arg0) + m.ctrl.Call(m, "Set", arg0) } -// Add indicates an expected call of Add -func (mr *MockGaugeMockRecorder) Add(arg0 interface{}) *gomock.Call { +// Set indicates an expected call of Set. +func (mr *MockGaugeMockRecorder) Set(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Add", reflect.TypeOf((*MockGauge)(nil).Add), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Set", reflect.TypeOf((*MockGauge)(nil).Set), arg0) } -// MockGaugeVec is a mock of GaugeVec interface +// MockGaugeVec is a mock of GaugeVec interface. type MockGaugeVec struct { ctrl *gomock.Controller recorder *MockGaugeVecMockRecorder } -// MockGaugeVecMockRecorder is the mock recorder for MockGaugeVec +// MockGaugeVecMockRecorder is the mock recorder for MockGaugeVec. type MockGaugeVecMockRecorder struct { mock *MockGaugeVec } -// NewMockGaugeVec creates a new mock instance +// NewMockGaugeVec creates a new mock instance. func NewMockGaugeVec(ctrl *gomock.Controller) *MockGaugeVec { mock := &MockGaugeVec{ctrl: ctrl} mock.recorder = &MockGaugeVecMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockGaugeVec) EXPECT() *MockGaugeVecMockRecorder { return m.recorder } -// WithLabelValues mocks base method +// WithLabelValues mocks base method. func (m *MockGaugeVec) WithLabelValues(lvs ...string) metrics.Gauge { m.ctrl.T.Helper() varargs := []interface{}{} @@ -139,36 +140,36 @@ func (m *MockGaugeVec) WithLabelValues(lvs ...string) metrics.Gauge { return ret0 } -// WithLabelValues indicates an expected call of WithLabelValues +// WithLabelValues indicates an expected call of WithLabelValues. func (mr *MockGaugeVecMockRecorder) WithLabelValues(lvs ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithLabelValues", reflect.TypeOf((*MockGaugeVec)(nil).WithLabelValues), lvs...) } -// MockCounterVec is a mock of CounterVec interface +// MockCounterVec is a mock of CounterVec interface. type MockCounterVec struct { ctrl *gomock.Controller recorder *MockCounterVecMockRecorder } -// MockCounterVecMockRecorder is the mock recorder for MockCounterVec +// MockCounterVecMockRecorder is the mock recorder for MockCounterVec. type MockCounterVecMockRecorder struct { mock *MockCounterVec } -// NewMockCounterVec creates a new mock instance +// NewMockCounterVec creates a new mock instance. func NewMockCounterVec(ctrl *gomock.Controller) *MockCounterVec { mock := &MockCounterVec{ctrl: ctrl} mock.recorder = &MockCounterVecMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockCounterVec) EXPECT() *MockCounterVecMockRecorder { return m.recorder } -// WithLabelValues mocks base method +// WithLabelValues mocks base method. func (m *MockCounterVec) WithLabelValues(lvs ...string) metrics.Counter { m.ctrl.T.Helper() varargs := []interface{}{} @@ -180,42 +181,42 @@ func (m *MockCounterVec) WithLabelValues(lvs ...string) metrics.Counter { return ret0 } -// WithLabelValues indicates an expected call of WithLabelValues +// WithLabelValues indicates an expected call of WithLabelValues. func (mr *MockCounterVecMockRecorder) WithLabelValues(lvs ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithLabelValues", reflect.TypeOf((*MockCounterVec)(nil).WithLabelValues), lvs...) } -// MockHistogram is a mock of Histogram interface +// MockHistogram is a mock of Histogram interface. type MockHistogram struct { ctrl *gomock.Controller recorder *MockHistogramMockRecorder } -// MockHistogramMockRecorder is the mock recorder for MockHistogram +// MockHistogramMockRecorder is the mock recorder for MockHistogram. type MockHistogramMockRecorder struct { mock *MockHistogram } -// NewMockHistogram creates a new mock instance +// NewMockHistogram creates a new mock instance. func NewMockHistogram(ctrl *gomock.Controller) *MockHistogram { mock := &MockHistogram{ctrl: ctrl} mock.recorder = &MockHistogramMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockHistogram) EXPECT() *MockHistogramMockRecorder { return m.recorder } -// Observe mocks base method +// Observe mocks base method. func (m *MockHistogram) Observe(arg0 float64) { m.ctrl.T.Helper() m.ctrl.Call(m, "Observe", arg0) } -// Observe indicates an expected call of Observe +// Observe indicates an expected call of Observe. func (mr *MockHistogramMockRecorder) Observe(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Observe", reflect.TypeOf((*MockHistogram)(nil).Observe), arg0) diff --git a/test/mocks/nomad/mock_nomadclient_IF.go b/test/mocks/nomad/mock_nomadclient_IF.go index c4b29b94..f98aae1a 100644 --- a/test/mocks/nomad/mock_nomadclient_IF.go +++ b/test/mocks/nomad/mock_nomadclient_IF.go @@ -5,35 +5,36 @@ package mock_nomad import ( + reflect "reflect" + gomock "github.com/golang/mock/gomock" api "github.com/hashicorp/nomad/api" - reflect "reflect" ) -// MockJobs is a mock of Jobs interface +// MockJobs is a mock of Jobs interface. type MockJobs struct { ctrl *gomock.Controller recorder *MockJobsMockRecorder } -// MockJobsMockRecorder is the mock recorder for MockJobs +// MockJobsMockRecorder is the mock recorder for MockJobs. type MockJobsMockRecorder struct { mock *MockJobs } -// NewMockJobs creates a new mock instance +// NewMockJobs creates a new mock instance. func NewMockJobs(ctrl *gomock.Controller) *MockJobs { mock := &MockJobs{ctrl: ctrl} mock.recorder = &MockJobsMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockJobs) EXPECT() *MockJobsMockRecorder { return m.recorder } -// Info mocks base method +// Info mocks base method. func (m *MockJobs) Info(jobID string, q *api.QueryOptions) (*api.Job, *api.QueryMeta, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Info", jobID, q) @@ -43,13 +44,13 @@ func (m *MockJobs) Info(jobID string, q *api.QueryOptions) (*api.Job, *api.Query return ret0, ret1, ret2 } -// Info indicates an expected call of Info +// Info indicates an expected call of Info. func (mr *MockJobsMockRecorder) Info(jobID, q interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockJobs)(nil).Info), jobID, q) } -// Register mocks base method +// Register mocks base method. func (m *MockJobs) Register(job *api.Job, q *api.WriteOptions) (*api.JobRegisterResponse, *api.WriteMeta, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Register", job, q) @@ -59,36 +60,36 @@ func (m *MockJobs) Register(job *api.Job, q *api.WriteOptions) (*api.JobRegister return ret0, ret1, ret2 } -// Register indicates an expected call of Register +// Register indicates an expected call of Register. func (mr *MockJobsMockRecorder) Register(job, q interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Register", reflect.TypeOf((*MockJobs)(nil).Register), job, q) } -// MockDeployments is a mock of Deployments interface +// MockDeployments is a mock of Deployments interface. type MockDeployments struct { ctrl *gomock.Controller recorder *MockDeploymentsMockRecorder } -// MockDeploymentsMockRecorder is the mock recorder for MockDeployments +// MockDeploymentsMockRecorder is the mock recorder for MockDeployments. type MockDeploymentsMockRecorder struct { mock *MockDeployments } -// NewMockDeployments creates a new mock instance +// NewMockDeployments creates a new mock instance. func NewMockDeployments(ctrl *gomock.Controller) *MockDeployments { mock := &MockDeployments{ctrl: ctrl} mock.recorder = &MockDeploymentsMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockDeployments) EXPECT() *MockDeploymentsMockRecorder { return m.recorder } -// Info mocks base method +// Info mocks base method. func (m *MockDeployments) Info(deploymentID string, q *api.QueryOptions) (*api.Deployment, *api.QueryMeta, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Info", deploymentID, q) @@ -98,36 +99,36 @@ func (m *MockDeployments) Info(deploymentID string, q *api.QueryOptions) (*api.D return ret0, ret1, ret2 } -// Info indicates an expected call of Info +// Info indicates an expected call of Info. func (mr *MockDeploymentsMockRecorder) Info(deploymentID, q interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockDeployments)(nil).Info), deploymentID, q) } -// MockEvaluations is a mock of Evaluations interface +// MockEvaluations is a mock of Evaluations interface. type MockEvaluations struct { ctrl *gomock.Controller recorder *MockEvaluationsMockRecorder } -// MockEvaluationsMockRecorder is the mock recorder for MockEvaluations +// MockEvaluationsMockRecorder is the mock recorder for MockEvaluations. type MockEvaluationsMockRecorder struct { mock *MockEvaluations } -// NewMockEvaluations creates a new mock instance +// NewMockEvaluations creates a new mock instance. func NewMockEvaluations(ctrl *gomock.Controller) *MockEvaluations { mock := &MockEvaluations{ctrl: ctrl} mock.recorder = &MockEvaluationsMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockEvaluations) EXPECT() *MockEvaluationsMockRecorder { return m.recorder } -// Info mocks base method +// Info mocks base method. func (m *MockEvaluations) Info(evalID string, q *api.QueryOptions) (*api.Evaluation, *api.QueryMeta, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Info", evalID, q) @@ -137,7 +138,7 @@ func (m *MockEvaluations) Info(evalID string, q *api.QueryOptions) (*api.Evaluat return ret0, ret1, ret2 } -// Info indicates an expected call of Info +// Info indicates an expected call of Info. func (mr *MockEvaluationsMockRecorder) Info(evalID, q interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockEvaluations)(nil).Info), evalID, q) diff --git a/test/mocks/nomadWorker/mock_nomadclient_IF.go b/test/mocks/nomadWorker/mock_nomadclient_IF.go index 5c0e52ee..f46ce9b4 100644 --- a/test/mocks/nomadWorker/mock_nomadclient_IF.go +++ b/test/mocks/nomadWorker/mock_nomadclient_IF.go @@ -6,35 +6,52 @@ package mock_nomadWorker import ( context "context" + reflect "reflect" + gomock "github.com/golang/mock/gomock" api "github.com/hashicorp/nomad/api" - reflect "reflect" ) -// MockNodes is a mock of Nodes interface +// MockNodes is a mock of Nodes interface. type MockNodes struct { ctrl *gomock.Controller recorder *MockNodesMockRecorder } -// MockNodesMockRecorder is the mock recorder for MockNodes +// MockNodesMockRecorder is the mock recorder for MockNodes. type MockNodesMockRecorder struct { mock *MockNodes } -// NewMockNodes creates a new mock instance +// NewMockNodes creates a new mock instance. func NewMockNodes(ctrl *gomock.Controller) *MockNodes { mock := &MockNodes{ctrl: ctrl} mock.recorder = &MockNodesMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockNodes) EXPECT() *MockNodesMockRecorder { return m.recorder } -// List mocks base method +// Allocations mocks base method. +func (m *MockNodes) Allocations(nodeID string, q *api.QueryOptions) ([]*api.Allocation, *api.QueryMeta, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Allocations", nodeID, q) + ret0, _ := ret[0].([]*api.Allocation) + ret1, _ := ret[1].(*api.QueryMeta) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// Allocations indicates an expected call of Allocations. +func (mr *MockNodesMockRecorder) Allocations(nodeID, q interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Allocations", reflect.TypeOf((*MockNodes)(nil).Allocations), nodeID, q) +} + +// List mocks base method. func (m *MockNodes) List(q *api.QueryOptions) ([]*api.NodeListStub, *api.QueryMeta, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "List", q) @@ -44,13 +61,27 @@ func (m *MockNodes) List(q *api.QueryOptions) ([]*api.NodeListStub, *api.QueryMe return ret0, ret1, ret2 } -// List indicates an expected call of List +// List indicates an expected call of List. func (mr *MockNodesMockRecorder) List(q interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockNodes)(nil).List), q) } -// ToggleEligibility mocks base method +// MonitorDrain mocks base method. +func (m *MockNodes) MonitorDrain(ctx context.Context, nodeID string, index uint64, ignoreSys bool) <-chan *api.MonitorMessage { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MonitorDrain", ctx, nodeID, index, ignoreSys) + ret0, _ := ret[0].(<-chan *api.MonitorMessage) + return ret0 +} + +// MonitorDrain indicates an expected call of MonitorDrain. +func (mr *MockNodesMockRecorder) MonitorDrain(ctx, nodeID, index, ignoreSys interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MonitorDrain", reflect.TypeOf((*MockNodes)(nil).MonitorDrain), ctx, nodeID, index, ignoreSys) +} + +// ToggleEligibility mocks base method. func (m *MockNodes) ToggleEligibility(nodeID string, eligible bool, q *api.WriteOptions) (*api.NodeEligibilityUpdateResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ToggleEligibility", nodeID, eligible, q) @@ -59,13 +90,13 @@ func (m *MockNodes) ToggleEligibility(nodeID string, eligible bool, q *api.Write return ret0, ret1 } -// ToggleEligibility indicates an expected call of ToggleEligibility +// ToggleEligibility indicates an expected call of ToggleEligibility. func (mr *MockNodesMockRecorder) ToggleEligibility(nodeID, eligible, q interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ToggleEligibility", reflect.TypeOf((*MockNodes)(nil).ToggleEligibility), nodeID, eligible, q) } -// UpdateDrain mocks base method +// UpdateDrain mocks base method. func (m *MockNodes) UpdateDrain(nodeID string, spec *api.DrainSpec, markEligible bool, q *api.WriteOptions) (*api.NodeDrainUpdateResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "UpdateDrain", nodeID, spec, markEligible, q) @@ -74,38 +105,8 @@ func (m *MockNodes) UpdateDrain(nodeID string, spec *api.DrainSpec, markEligible return ret0, ret1 } -// UpdateDrain indicates an expected call of UpdateDrain +// UpdateDrain indicates an expected call of UpdateDrain. func (mr *MockNodesMockRecorder) UpdateDrain(nodeID, spec, markEligible, q interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateDrain", reflect.TypeOf((*MockNodes)(nil).UpdateDrain), nodeID, spec, markEligible, q) } - -// MonitorDrain mocks base method -func (m *MockNodes) MonitorDrain(ctx context.Context, nodeID string, index uint64, ignoreSys bool) <-chan *api.MonitorMessage { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "MonitorDrain", ctx, nodeID, index, ignoreSys) - ret0, _ := ret[0].(<-chan *api.MonitorMessage) - return ret0 -} - -// MonitorDrain indicates an expected call of MonitorDrain -func (mr *MockNodesMockRecorder) MonitorDrain(ctx, nodeID, index, ignoreSys interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MonitorDrain", reflect.TypeOf((*MockNodes)(nil).MonitorDrain), ctx, nodeID, index, ignoreSys) -} - -// Allocations mocks base method -func (m *MockNodes) Allocations(nodeID string, q *api.QueryOptions) ([]*api.Allocation, *api.QueryMeta, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Allocations", nodeID, q) - ret0, _ := ret[0].([]*api.Allocation) - ret1, _ := ret[1].(*api.QueryMeta) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 -} - -// Allocations indicates an expected call of Allocations -func (mr *MockNodesMockRecorder) Allocations(nodeID, q interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Allocations", reflect.TypeOf((*MockNodes)(nil).Allocations), nodeID, q) -} diff --git a/test/mocks/scaler/mock_scalingtarget_IF.go b/test/mocks/scaler/mock_scalingtarget_IF.go index 67d35a5f..60e97a16 100644 --- a/test/mocks/scaler/mock_scalingtarget_IF.go +++ b/test/mocks/scaler/mock_scalingtarget_IF.go @@ -5,34 +5,35 @@ package mock_scaler import ( - gomock "github.com/golang/mock/gomock" reflect "reflect" + + gomock "github.com/golang/mock/gomock" ) -// MockScalingTarget is a mock of ScalingTarget interface +// MockScalingTarget is a mock of ScalingTarget interface. type MockScalingTarget struct { ctrl *gomock.Controller recorder *MockScalingTargetMockRecorder } -// MockScalingTargetMockRecorder is the mock recorder for MockScalingTarget +// MockScalingTargetMockRecorder is the mock recorder for MockScalingTarget. type MockScalingTargetMockRecorder struct { mock *MockScalingTarget } -// NewMockScalingTarget creates a new mock instance +// NewMockScalingTarget creates a new mock instance. func NewMockScalingTarget(ctrl *gomock.Controller) *MockScalingTarget { mock := &MockScalingTarget{ctrl: ctrl} mock.recorder = &MockScalingTargetMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockScalingTarget) EXPECT() *MockScalingTargetMockRecorder { return m.recorder } -// AdjustScalingObjectCount mocks base method +// AdjustScalingObjectCount mocks base method. func (m *MockScalingTarget) AdjustScalingObjectCount(scalingObject string, min, max, from, to uint) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AdjustScalingObjectCount", scalingObject, min, max, from, to) @@ -40,13 +41,13 @@ func (m *MockScalingTarget) AdjustScalingObjectCount(scalingObject string, min, return ret0 } -// AdjustScalingObjectCount indicates an expected call of AdjustScalingObjectCount +// AdjustScalingObjectCount indicates an expected call of AdjustScalingObjectCount. func (mr *MockScalingTargetMockRecorder) AdjustScalingObjectCount(scalingObject, min, max, from, to interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AdjustScalingObjectCount", reflect.TypeOf((*MockScalingTarget)(nil).AdjustScalingObjectCount), scalingObject, min, max, from, to) } -// GetScalingObjectCount mocks base method +// GetScalingObjectCount mocks base method. func (m *MockScalingTarget) GetScalingObjectCount(scalingObject string) (uint, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetScalingObjectCount", scalingObject) @@ -55,13 +56,13 @@ func (m *MockScalingTarget) GetScalingObjectCount(scalingObject string) (uint, e return ret0, ret1 } -// GetScalingObjectCount indicates an expected call of GetScalingObjectCount +// GetScalingObjectCount indicates an expected call of GetScalingObjectCount. func (mr *MockScalingTargetMockRecorder) GetScalingObjectCount(scalingObject interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetScalingObjectCount", reflect.TypeOf((*MockScalingTarget)(nil).GetScalingObjectCount), scalingObject) } -// IsScalingObjectDead mocks base method +// IsScalingObjectDead mocks base method. func (m *MockScalingTarget) IsScalingObjectDead(scalingObject string) (bool, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "IsScalingObjectDead", scalingObject) @@ -70,13 +71,13 @@ func (m *MockScalingTarget) IsScalingObjectDead(scalingObject string) (bool, err return ret0, ret1 } -// IsScalingObjectDead indicates an expected call of IsScalingObjectDead +// IsScalingObjectDead indicates an expected call of IsScalingObjectDead. func (mr *MockScalingTargetMockRecorder) IsScalingObjectDead(scalingObject interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsScalingObjectDead", reflect.TypeOf((*MockScalingTarget)(nil).IsScalingObjectDead), scalingObject) } -// String mocks base method +// String mocks base method. func (m *MockScalingTarget) String() string { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "String") @@ -84,7 +85,7 @@ func (m *MockScalingTarget) String() string { return ret0 } -// String indicates an expected call of String +// String indicates an expected call of String. func (mr *MockScalingTargetMockRecorder) String() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "String", reflect.TypeOf((*MockScalingTarget)(nil).String)) diff --git a/test/mocks/sokar/mock_capacity_planner_IF.go b/test/mocks/sokar/mock_capacity_planner_IF.go index 3d4f37b2..65d84cd9 100644 --- a/test/mocks/sokar/mock_capacity_planner_IF.go +++ b/test/mocks/sokar/mock_capacity_planner_IF.go @@ -5,49 +5,36 @@ package mock_sokar import ( - gomock "github.com/golang/mock/gomock" reflect "reflect" time "time" + + gomock "github.com/golang/mock/gomock" ) -// MockCapacityPlanner is a mock of CapacityPlanner interface +// MockCapacityPlanner is a mock of CapacityPlanner interface. type MockCapacityPlanner struct { ctrl *gomock.Controller recorder *MockCapacityPlannerMockRecorder } -// MockCapacityPlannerMockRecorder is the mock recorder for MockCapacityPlanner +// MockCapacityPlannerMockRecorder is the mock recorder for MockCapacityPlanner. type MockCapacityPlannerMockRecorder struct { mock *MockCapacityPlanner } -// NewMockCapacityPlanner creates a new mock instance +// NewMockCapacityPlanner creates a new mock instance. func NewMockCapacityPlanner(ctrl *gomock.Controller) *MockCapacityPlanner { mock := &MockCapacityPlanner{ctrl: ctrl} mock.recorder = &MockCapacityPlannerMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockCapacityPlanner) EXPECT() *MockCapacityPlannerMockRecorder { return m.recorder } -// Plan mocks base method -func (m *MockCapacityPlanner) Plan(scaleFactor float32, currentScale uint) uint { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Plan", scaleFactor, currentScale) - ret0, _ := ret[0].(uint) - return ret0 -} - -// Plan indicates an expected call of Plan -func (mr *MockCapacityPlannerMockRecorder) Plan(scaleFactor, currentScale interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Plan", reflect.TypeOf((*MockCapacityPlanner)(nil).Plan), scaleFactor, currentScale) -} - -// IsCoolingDown mocks base method +// IsCoolingDown mocks base method. func (m *MockCapacityPlanner) IsCoolingDown(timeOfLastScale time.Time, scaleDown bool) (bool, time.Duration) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "IsCoolingDown", timeOfLastScale, scaleDown) @@ -56,8 +43,22 @@ func (m *MockCapacityPlanner) IsCoolingDown(timeOfLastScale time.Time, scaleDown return ret0, ret1 } -// IsCoolingDown indicates an expected call of IsCoolingDown +// IsCoolingDown indicates an expected call of IsCoolingDown. func (mr *MockCapacityPlannerMockRecorder) IsCoolingDown(timeOfLastScale, scaleDown interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsCoolingDown", reflect.TypeOf((*MockCapacityPlanner)(nil).IsCoolingDown), timeOfLastScale, scaleDown) } + +// Plan mocks base method. +func (m *MockCapacityPlanner) Plan(scaleFactor float32, currentScale uint) uint { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Plan", scaleFactor, currentScale) + ret0, _ := ret[0].(uint) + return ret0 +} + +// Plan indicates an expected call of Plan. +func (mr *MockCapacityPlannerMockRecorder) Plan(scaleFactor, currentScale interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Plan", reflect.TypeOf((*MockCapacityPlanner)(nil).Plan), scaleFactor, currentScale) +} diff --git a/test/mocks/sokar/mock_scaleEventEmitter_IF.go b/test/mocks/sokar/mock_scaleEventEmitter_IF.go index 6a38a4b0..924a2c2d 100644 --- a/test/mocks/sokar/mock_scaleEventEmitter_IF.go +++ b/test/mocks/sokar/mock_scaleEventEmitter_IF.go @@ -5,41 +5,42 @@ package mock_sokar import ( + reflect "reflect" + gomock "github.com/golang/mock/gomock" sokar "github.com/thomasobenaus/sokar/sokar/iface" - reflect "reflect" ) -// MockScaleEventEmitter is a mock of ScaleEventEmitter interface +// MockScaleEventEmitter is a mock of ScaleEventEmitter interface. type MockScaleEventEmitter struct { ctrl *gomock.Controller recorder *MockScaleEventEmitterMockRecorder } -// MockScaleEventEmitterMockRecorder is the mock recorder for MockScaleEventEmitter +// MockScaleEventEmitterMockRecorder is the mock recorder for MockScaleEventEmitter. type MockScaleEventEmitterMockRecorder struct { mock *MockScaleEventEmitter } -// NewMockScaleEventEmitter creates a new mock instance +// NewMockScaleEventEmitter creates a new mock instance. func NewMockScaleEventEmitter(ctrl *gomock.Controller) *MockScaleEventEmitter { mock := &MockScaleEventEmitter{ctrl: ctrl} mock.recorder = &MockScaleEventEmitterMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockScaleEventEmitter) EXPECT() *MockScaleEventEmitterMockRecorder { return m.recorder } -// Subscribe mocks base method +// Subscribe mocks base method. func (m *MockScaleEventEmitter) Subscribe(eventChannel chan sokar.ScaleEvent) { m.ctrl.T.Helper() m.ctrl.Call(m, "Subscribe", eventChannel) } -// Subscribe indicates an expected call of Subscribe +// Subscribe indicates an expected call of Subscribe. func (mr *MockScaleEventEmitterMockRecorder) Subscribe(eventChannel interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Subscribe", reflect.TypeOf((*MockScaleEventEmitter)(nil).Subscribe), eventChannel) diff --git a/test/mocks/sokar/mock_scaler_IF.go b/test/mocks/sokar/mock_scaler_IF.go index 3245c62f..18c4a532 100644 --- a/test/mocks/sokar/mock_scaler_IF.go +++ b/test/mocks/sokar/mock_scaler_IF.go @@ -5,49 +5,36 @@ package mock_sokar import ( - gomock "github.com/golang/mock/gomock" reflect "reflect" time "time" + + gomock "github.com/golang/mock/gomock" ) -// MockScaler is a mock of Scaler interface +// MockScaler is a mock of Scaler interface. type MockScaler struct { ctrl *gomock.Controller recorder *MockScalerMockRecorder } -// MockScalerMockRecorder is the mock recorder for MockScaler +// MockScalerMockRecorder is the mock recorder for MockScaler. type MockScalerMockRecorder struct { mock *MockScaler } -// NewMockScaler creates a new mock instance +// NewMockScaler creates a new mock instance. func NewMockScaler(ctrl *gomock.Controller) *MockScaler { mock := &MockScaler{ctrl: ctrl} mock.recorder = &MockScalerMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockScaler) EXPECT() *MockScalerMockRecorder { return m.recorder } -// ScaleTo mocks base method -func (m *MockScaler) ScaleTo(count uint, force bool) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ScaleTo", count, force) - ret0, _ := ret[0].(error) - return ret0 -} - -// ScaleTo indicates an expected call of ScaleTo -func (mr *MockScalerMockRecorder) ScaleTo(count, force interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ScaleTo", reflect.TypeOf((*MockScaler)(nil).ScaleTo), count, force) -} - -// GetCount mocks base method +// GetCount mocks base method. func (m *MockScaler) GetCount() (uint, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetCount") @@ -56,13 +43,13 @@ func (m *MockScaler) GetCount() (uint, error) { return ret0, ret1 } -// GetCount indicates an expected call of GetCount +// GetCount indicates an expected call of GetCount. func (mr *MockScalerMockRecorder) GetCount() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCount", reflect.TypeOf((*MockScaler)(nil).GetCount)) } -// GetTimeOfLastScaleAction mocks base method +// GetTimeOfLastScaleAction mocks base method. func (m *MockScaler) GetTimeOfLastScaleAction() time.Time { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetTimeOfLastScaleAction") @@ -70,8 +57,22 @@ func (m *MockScaler) GetTimeOfLastScaleAction() time.Time { return ret0 } -// GetTimeOfLastScaleAction indicates an expected call of GetTimeOfLastScaleAction +// GetTimeOfLastScaleAction indicates an expected call of GetTimeOfLastScaleAction. func (mr *MockScalerMockRecorder) GetTimeOfLastScaleAction() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTimeOfLastScaleAction", reflect.TypeOf((*MockScaler)(nil).GetTimeOfLastScaleAction)) } + +// ScaleTo mocks base method. +func (m *MockScaler) ScaleTo(count uint, force bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ScaleTo", count, force) + ret0, _ := ret[0].(error) + return ret0 +} + +// ScaleTo indicates an expected call of ScaleTo. +func (mr *MockScalerMockRecorder) ScaleTo(count, force interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ScaleTo", reflect.TypeOf((*MockScaler)(nil).ScaleTo), count, force) +} diff --git a/test/mocks/sokar/mock_scaleschedule_IF.go b/test/mocks/sokar/mock_scaleschedule_IF.go index f15f68e7..b3dd5d38 100644 --- a/test/mocks/sokar/mock_scaleschedule_IF.go +++ b/test/mocks/sokar/mock_scaleschedule_IF.go @@ -5,36 +5,51 @@ package mock_sokar import ( - gomock "github.com/golang/mock/gomock" - helper "github.com/thomasobenaus/sokar/helper" reflect "reflect" time "time" + + gomock "github.com/golang/mock/gomock" + helper "github.com/thomasobenaus/sokar/helper" ) -// MockScaleSchedule is a mock of ScaleSchedule interface +// MockScaleSchedule is a mock of ScaleSchedule interface. type MockScaleSchedule struct { ctrl *gomock.Controller recorder *MockScaleScheduleMockRecorder } -// MockScaleScheduleMockRecorder is the mock recorder for MockScaleSchedule +// MockScaleScheduleMockRecorder is the mock recorder for MockScaleSchedule. type MockScaleScheduleMockRecorder struct { mock *MockScaleSchedule } -// NewMockScaleSchedule creates a new mock instance +// NewMockScaleSchedule creates a new mock instance. func NewMockScaleSchedule(ctrl *gomock.Controller) *MockScaleSchedule { mock := &MockScaleSchedule{ctrl: ctrl} mock.recorder = &MockScaleScheduleMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockScaleSchedule) EXPECT() *MockScaleScheduleMockRecorder { return m.recorder } -// ScaleRangeAt mocks base method +// IsActiveAt mocks base method. +func (m *MockScaleSchedule) IsActiveAt(day time.Weekday, at helper.SimpleTime) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsActiveAt", day, at) + ret0, _ := ret[0].(bool) + return ret0 +} + +// IsActiveAt indicates an expected call of IsActiveAt. +func (mr *MockScaleScheduleMockRecorder) IsActiveAt(day, at interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsActiveAt", reflect.TypeOf((*MockScaleSchedule)(nil).IsActiveAt), day, at) +} + +// ScaleRangeAt mocks base method. func (m *MockScaleSchedule) ScaleRangeAt(day time.Weekday, at helper.SimpleTime) (uint, uint, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ScaleRangeAt", day, at) @@ -44,22 +59,8 @@ func (m *MockScaleSchedule) ScaleRangeAt(day time.Weekday, at helper.SimpleTime) return ret0, ret1, ret2 } -// ScaleRangeAt indicates an expected call of ScaleRangeAt +// ScaleRangeAt indicates an expected call of ScaleRangeAt. func (mr *MockScaleScheduleMockRecorder) ScaleRangeAt(day, at interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ScaleRangeAt", reflect.TypeOf((*MockScaleSchedule)(nil).ScaleRangeAt), day, at) } - -// IsActiveAt mocks base method -func (m *MockScaleSchedule) IsActiveAt(day time.Weekday, at helper.SimpleTime) bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsActiveAt", day, at) - ret0, _ := ret[0].(bool) - return ret0 -} - -// IsActiveAt indicates an expected call of IsActiveAt -func (mr *MockScaleScheduleMockRecorder) IsActiveAt(day, at interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsActiveAt", reflect.TypeOf((*MockScaleSchedule)(nil).IsActiveAt), day, at) -}