From 70482f15ba663c6f044010e32396999c0a72368e Mon Sep 17 00:00:00 2001 From: Bowen Date: Thu, 14 Mar 2024 21:18:06 +0800 Subject: [PATCH] feat: [#280] Refactor Migration feature --- .github/workflows/mockery.yml | 2 +- .mockery.yaml | 4 + contracts/database/schema/blueprint.go | 98 + contracts/database/schema/column.go | 33 + contracts/database/schema/grammar.go | 105 + contracts/database/schema/processor.go | 6 + contracts/database/schema/schema.go | 71 + contracts/foundation/container.go | 7 +- database/gorm/query_test.go | 4 +- database/gorm/test_utils.go | 2 +- database/orm.go | 3 +- database/processors/postgres.go | 24 + database/schema/blueprint.go | 325 +++ database/schema/blueprint_test.go | 130 + database/schema/column.go | 52 + database/schema/grammars/mysql.go | 251 ++ database/schema/grammars/postgres.go | 301 +++ database/schema/grammars/postgres_test.go | 172 ++ database/schema/grammars/sqlite.go | 251 ++ database/schema/grammars/sqlserver.go | 251 ++ database/schema/main_test.go | 31 + database/schema/schema.go | 222 ++ database/schema/schema_test.go | 259 ++ database/{ => seeder}/factory.go | 2 +- database/{ => seeder}/factory_test.go | 9 +- database/seeder/main_test.go | 31 + database/{ => seeder}/seeder.go | 19 +- database/{ => seeder}/seeder_test.go | 6 +- database/service_provider.go | 8 +- facades/schema.go | 9 + foundation/container.go | 34 +- mocks/auth/Auth.go | 232 +- mocks/auth/access/Gate.go | 292 ++- mocks/auth/access/Response.go | 72 +- mocks/cache/Cache.go | 697 ++++- mocks/cache/Driver.go | 665 ++++- mocks/cache/Lock.go | 151 +- mocks/config/Config.go | 239 +- mocks/console/Artisan.go | 123 +- mocks/console/Command.go | 135 +- mocks/console/Context.go | 361 ++- mocks/console/command/Flag.go | 41 +- mocks/crypt/Crypt.go | 74 +- mocks/database/factory/Factory.go | 41 +- mocks/database/factory/Model.go | 41 +- mocks/database/gorm/Gorm.go | 41 +- mocks/database/gorm/Initialize.go | 77 +- mocks/database/orm/Association.go | 229 +- mocks/database/orm/ConnectionModel.go | 41 +- mocks/database/orm/Cursor.go | 42 +- mocks/database/orm/DispatchesEvents.go | 41 +- mocks/database/orm/Event.go | 251 +- mocks/database/orm/Factory.go | 162 +- mocks/database/orm/Observer.go | 362 ++- mocks/database/orm/Orm.go | 228 +- mocks/database/orm/Query.go | 2154 +++++++++++++++- mocks/database/orm/Transaction.go | 2216 +++++++++++++++- mocks/database/schema/Blueprint.go | 2223 ++++++++++++++++ mocks/database/schema/Column.go | 426 +++ mocks/database/schema/Grammar.go | 2273 +++++++++++++++++ mocks/database/schema/Migration.go | 167 ++ mocks/database/schema/Schema.go | 1036 ++++++++ mocks/database/seeder/Facade.go | 165 +- mocks/database/seeder/Seeder.go | 72 +- mocks/event/Event.go | 42 +- mocks/event/Instance.go | 102 +- mocks/event/Listener.go | 119 +- mocks/event/Task.go | 41 +- mocks/filesystem/Driver.go | 760 +++++- mocks/filesystem/File.go | 363 ++- mocks/filesystem/Storage.go | 792 +++++- mocks/foundation/Application.go | 1412 +++++++++- mocks/foundation/Container.go | 955 ++++++- mocks/foundation/ServiceProvider.go | 66 +- mocks/grpc/Grpc.go | 169 +- mocks/hash/Hash.go | 107 +- mocks/http/Context.go | 257 +- mocks/http/ContextRequest.go | 1180 ++++++++- mocks/http/ContextResponse.go | 496 +++- mocks/http/FormRequest.go | 171 +- mocks/http/HandlerFunc.go | 42 +- mocks/http/Limit.go | 74 +- mocks/http/Middleware.go | 38 +- mocks/http/RateLimiter.go | 100 +- mocks/http/ResourceController.go | 170 +- mocks/http/Response.go | 41 +- mocks/http/ResponseOrigin.go | 134 +- mocks/http/ResponseStatus.go | 115 +- mocks/http/ResponseSuccess.go | 115 +- mocks/http/ResponseView.go | 90 +- mocks/http/View.go | 142 +- mocks/log/Entry.go | 134 +- mocks/log/Hook.go | 73 +- mocks/log/Log.go | 794 +++++- mocks/log/Logger.go | 42 +- mocks/log/Writer.go | 762 +++++- mocks/mail/Mail.go | 272 +- mocks/queue/Job.go | 80 +- mocks/queue/Queue.go | 166 +- mocks/queue/Task.go | 168 +- mocks/queue/Worker.go | 41 +- mocks/route/GroupFunc.go | 38 +- mocks/route/Route.go | 632 ++++- mocks/route/Router.go | 428 +++- mocks/schedule/Event.go | 914 ++++++- mocks/schedule/Schedule.go | 129 +- mocks/session/Driver.go | 203 +- mocks/session/Manager.go | 122 +- mocks/testing/Database.go | 197 +- mocks/testing/DatabaseDriver.go | 193 +- mocks/testing/Docker.go | 49 +- mocks/testing/Testing.go | 41 +- mocks/translation/Loader.go | 43 +- mocks/translation/Translator.go | 257 +- mocks/validation/Data.go | 75 +- mocks/validation/Errors.go | 144 +- mocks/validation/Option.go | 38 +- mocks/validation/Rule.go | 113 +- mocks/validation/Validation.go | 114 +- mocks/validation/Validator.go | 104 +- support/convert/pointer.go | 5 + support/docker/database.go | 98 +- support/docker/database_test.go | 4 +- support/docker/{postgresql.go => postgres.go} | 28 +- .../{postgresql_test.go => postgres_test.go} | 4 +- testing/docker/database.go | 2 +- testing/docker/database_test.go | 2 +- 127 files changed, 32498 insertions(+), 196 deletions(-) create mode 100644 .mockery.yaml create mode 100644 contracts/database/schema/blueprint.go create mode 100644 contracts/database/schema/column.go create mode 100644 contracts/database/schema/grammar.go create mode 100644 contracts/database/schema/processor.go create mode 100644 contracts/database/schema/schema.go create mode 100644 database/processors/postgres.go create mode 100644 database/schema/blueprint.go create mode 100644 database/schema/blueprint_test.go create mode 100644 database/schema/column.go create mode 100644 database/schema/grammars/mysql.go create mode 100644 database/schema/grammars/postgres.go create mode 100644 database/schema/grammars/postgres_test.go create mode 100644 database/schema/grammars/sqlite.go create mode 100644 database/schema/grammars/sqlserver.go create mode 100644 database/schema/main_test.go create mode 100644 database/schema/schema.go create mode 100644 database/schema/schema_test.go rename database/{ => seeder}/factory.go (99%) rename database/{ => seeder}/factory_test.go (98%) create mode 100644 database/seeder/main_test.go rename database/{ => seeder}/seeder.go (77%) rename database/{ => seeder}/seeder_test.go (96%) create mode 100644 facades/schema.go create mode 100644 mocks/database/schema/Blueprint.go create mode 100644 mocks/database/schema/Column.go create mode 100644 mocks/database/schema/Grammar.go create mode 100644 mocks/database/schema/Migration.go create mode 100644 mocks/database/schema/Schema.go create mode 100644 support/convert/pointer.go rename support/docker/{postgresql.go => postgres.go} (77%) rename support/docker/{postgresql_test.go => postgres_test.go} (95%) diff --git a/.github/workflows/mockery.yml b/.github/workflows/mockery.yml index a73921250..a49d2d1ec 100644 --- a/.github/workflows/mockery.yml +++ b/.github/workflows/mockery.yml @@ -9,7 +9,7 @@ jobs: uses: actions/checkout@v4 - name: Install Mockery run: | - go install github.com/vektra/mockery/v2@v2.34.2 + go install github.com/vektra/mockery/v2@v2.39.1 - name: Generate Mocks run: | ~/go/bin/mockery --all --keeptree --dir=contracts diff --git a/.mockery.yaml b/.mockery.yaml new file mode 100644 index 000000000..f23ef4540 --- /dev/null +++ b/.mockery.yaml @@ -0,0 +1,4 @@ +with-expecter: True +dir: "contracts" +keeptree: True +all: True diff --git a/contracts/database/schema/blueprint.go b/contracts/database/schema/blueprint.go new file mode 100644 index 000000000..fa1eb82f8 --- /dev/null +++ b/contracts/database/schema/blueprint.go @@ -0,0 +1,98 @@ +package schema + +import ( + ormcontract "github.com/goravel/framework/contracts/database/orm" +) + +type Blueprint interface { + // Boolean Create a new boolean column on the table. + Boolean(column string) ColumnDefinition + // BigInteger Create a new big integer (8-byte) column on the table. + BigInteger(column string) ColumnDefinition + // Binary Create a new binary column on the table. + Binary(column string) ColumnDefinition + // Build Execute the blueprint to build / modify the table. + Build(query ormcontract.Query, grammar Grammar) error + // Char Create a new char column on the table. + Char(column string, length ...int) ColumnDefinition + // Comment Add a comment to the table. + Comment(comment string) error + // Create Indicate that the table needs to be created. + Create() + // Date Create a new date column on the table. + Date(column string) ColumnDefinition + // DateTime Create a new date-time column on the table. + DateTime(column string) ColumnDefinition + // DateTimeTz Create a new date-time column (with time zone) on the table. + DateTimeTz(column string) ColumnDefinition + // Decimal Create a new decimal column on the table. + Decimal(column string) ColumnDefinition + // Double Create a new double column on the table. + Double(column string) ColumnDefinition + // DropColumn Indicate that the given columns should be dropped. + DropColumn(column string) error + // DropForeign Indicate that the given foreign key should be dropped. + DropForeign(index string) error + // DropIndex Indicate that the given index should be dropped. + DropIndex(index string) error + // DropSoftDeletes Indicate that the soft delete column should be dropped. + DropSoftDeletes() error + // DropTimestamps Indicate that the timestamp columns should be dropped. + DropTimestamps() error + // Enum Create a new enum column on the table. + Enum(column string, array []any) ColumnDefinition + // Float Create a new float column on the table. + Float(column string) ColumnDefinition + // Foreign Specify a foreign key for the table. + Foreign(columns []string, name ...string) error + // GetAddedColumns Get the added columns. + GetAddedColumns() []ColumnDefinition + // GetChangedColumns Get the changed columns. + GetChangedColumns() []ColumnDefinition + // GetTableName Get the table name with prefix. + GetTableName() string + // ID Create a new auto-incrementing big integer (8-byte) column on the table. + ID() ColumnDefinition + // Index Specify an index for the table. + Index(columns []string, name string) error + // Integer Create a new integer (4-byte) column on the table. + Integer(column string) ColumnDefinition + // Json Create a new json column on the table. + Json(column string) ColumnDefinition + // Jsonb Create a new jsonb column on the table. + Jsonb(column string) ColumnDefinition + // Primary Specify the primary key(s) for the table. + Primary(columns []string, name string) error + // RenameColumn Indicate that the given columns should be renamed. + RenameColumn(from, to string) error + // RenameIndex Indicate that the given indexes should be renamed. + RenameIndex(from, to string) error + // SoftDeletes Add a "deleted at" timestamp for the table. + SoftDeletes(column ...string) ColumnDefinition + // SoftDeletesTz Add a "deleted at" timestampTz for the table. + SoftDeletesTz(column ...string) ColumnDefinition + // String Create a new string column on the table. + String(column string, length ...int) ColumnDefinition + // Text Create a new text column on the table. + Text(column string) ColumnDefinition + // Time Create a new time column on the table. + Time(column string) ColumnDefinition + // TimeTz Create a new time column (with time zone) on the table. + TimeTz(column string) ColumnDefinition + // Timestamp Create a new time column on the table. + Timestamp(column string) ColumnDefinition + // Timestamps Add nullable creation and update timestamps to the table. + Timestamps() ColumnDefinition + // TimestampsTz Add creation and update timestampTz columns to the table. + TimestampsTz() ColumnDefinition + // TimestampTz Create a new time column (with time zone) on the table. + TimestampTz(column string) ColumnDefinition + // ToSql Get the raw SQL statements for the blueprint. + ToSql(query ormcontract.Query, grammar Grammar) []string + // Unique Specify a unique index for the table. + Unique(columns []string, name string) error + // UnsignedInteger Create a new unsigned integer (4-byte) column on the table. + UnsignedInteger(column string) ColumnDefinition + // UnsignedBigInteger Create a new unsigned big integer (8-byte) column on the table. + UnsignedBigInteger(column string) ColumnDefinition +} diff --git a/contracts/database/schema/column.go b/contracts/database/schema/column.go new file mode 100644 index 000000000..6dffaf1e3 --- /dev/null +++ b/contracts/database/schema/column.go @@ -0,0 +1,33 @@ +package schema + +type Column struct { + AutoIncrement bool + Collation string + Comment string + Default any + Name string + Nullable bool + TypeName string + Type string +} + +type ColumnDefinition interface { + // Change the column + Change() + // GetAllowed returns the allowed value + GetAllowed() []string + // GetAutoIncrement returns the autoIncrement value + GetAutoIncrement() bool + // GetLength returns the length value + GetLength() int + // GetName returns the name value + GetName() string + // GetPlaces returns the places value + GetPlaces() int + // GetPrecision returns the precision value + GetPrecision() int + // GetTotal returns the total value + GetTotal() int + // GetType returns the type value + GetType() string +} diff --git a/contracts/database/schema/grammar.go b/contracts/database/schema/grammar.go new file mode 100644 index 000000000..5cc41bb0e --- /dev/null +++ b/contracts/database/schema/grammar.go @@ -0,0 +1,105 @@ +package schema + +import ( + ormcontract "github.com/goravel/framework/contracts/database/orm" +) + +type Grammar interface { + // CompileAdd Compile an add column command. + CompileAdd(blueprint Blueprint, command string) string + // CompileAutoIncrementStartingValues Compile the auto-incrementing column starting values. + CompileAutoIncrementStartingValues(blueprint Blueprint, command string) string + // CompileChange Compile a change column command into a series of SQL statements. + CompileChange(blueprint Blueprint, command, connection string) string + // CompileColumns Compile the query to determine the columns. + // TODO check if the database is required + CompileColumns(database, table, schema string) string + // CompileCreate Compile a create table command. + CompileCreate(blueprint Blueprint, query ormcontract.Query) string + // CompileCreateEncoding Append the character set specifications to a command. + CompileCreateEncoding(sql, connection string, blueprint Blueprint) string + // CompileCreateEngine Append the engine specifications to a command. + CompileCreateEngine(sql, connection string, blueprint Blueprint) string + // CompileCreateTable Create the main create table clause. + CompileCreateTable(blueprint Blueprint, command, connection string) string + // CompileDrop Compile a drop table command. + CompileDrop(blueprint Blueprint, command string) string + // CompileDropAllTables Compile the SQL needed to drop all tables. + CompileDropAllTables(tables []string) string + // CompileDropAllViews Compile the SQL needed to drop all views. + CompileDropAllViews(views []string) string + // CompileDropColumn Compile a drop column command. + CompileDropColumn(blueprint Blueprint, command string) string + // CompileDropIfExists Compile a drop table (if exists) command. + CompileDropIfExists(blueprint Blueprint, command string) string + // CompileDropIndex Compile a drop index command. + CompileDropIndex(blueprint Blueprint, command string) string + // CompileDropPrimary Compile a drop primary key command. + CompileDropPrimary(blueprint Blueprint, command string) string + // CompileDropUnique Compile a drop unique key command. + CompileDropUnique(blueprint Blueprint, command string) string + // CompilePrimary Compile a primary key command. + CompilePrimary(blueprint Blueprint, command string) string + // CompileIndex Compile a plain index key command. + CompileIndex(blueprint Blueprint, command string) string + // CompileIndexes Compile the query to determine the indexes. + CompileIndexes(database, table string) string + // CompileRename Compile a rename table command. + CompileRename(blueprint Blueprint, command string) string + // CompileRenameColumn Compile a rename column command. + CompileRenameColumn(blueprint Blueprint, command, connection string) string + // CompileRenameIndex Compile a rename index command. + CompileRenameIndex(blueprint Blueprint, command string) string + // CompileTableComment Compile a table comment command. + CompileTableComment(blueprint Blueprint, command string) string + // CompileTables Compile the query to determine the tables. + CompileTables(database string) string + // CompileUnique Compile a unique key command. + CompileUnique(blueprint Blueprint, command string) string + // CompileViews Compile the query to determine the views. + CompileViews(database string) string + // ModifyNullable Get the SQL for a nullable column modifier. + ModifyNullable(blueprint Blueprint, column string) string + // ModifyDefault Get the SQL for a default column modifier. + ModifyDefault(blueprint Blueprint, column string) string + // TypeBigInteger Create the column definition for a big integer type. + TypeBigInteger(column ColumnDefinition) string + // TypeBinary Create the column definition for a binary type. + TypeBinary(column ColumnDefinition) string + // TypeBoolean Create the column definition for a boolean type. + TypeBoolean(column ColumnDefinition) string + // TypeChar Create the column definition for a char type. + TypeChar(column ColumnDefinition) string + // TypeDate Create the column definition for a date type. + TypeDate(column ColumnDefinition) string + // TypeDateTime Create the column definition for a date-time type. + TypeDateTime(column ColumnDefinition) string + // TypeDateTimeTz Create the column definition for a date-time (with time zone) type. + TypeDateTimeTz(column ColumnDefinition) string + // TypeDecimal Create the column definition for a decimal type. + TypeDecimal(column ColumnDefinition) string + // TypeDouble Create the column definition for a double type. + TypeDouble(column ColumnDefinition) string + // TypeEnum Create the column definition for an enumeration type. + TypeEnum(column ColumnDefinition) string + // TypeFloat Create the column definition for a float type. + TypeFloat(column ColumnDefinition) string + // TypeInteger Create the column definition for an integer type. + TypeInteger(column ColumnDefinition) string + // TypeJson Create the column definition for a json type. + TypeJson(column ColumnDefinition) string + // TypeJsonb Create the column definition for a jsonb type. + TypeJsonb(column ColumnDefinition) string + // TypeString Create the column definition for a string type. + TypeString(column ColumnDefinition) string + // TypeText Create the column definition for a text type. + TypeText(column ColumnDefinition) string + // TypeTime Create the column definition for a time type. + TypeTime(column ColumnDefinition) string + // TypeTimeTz Create the column definition for a time (with time zone) type. + TypeTimeTz(column ColumnDefinition) string + // TypeTimestamp Create the column definition for a timestamp type. + TypeTimestamp(column ColumnDefinition) string + // TypeTimestampTz Create the column definition for a timestamp (with time zone) type. + TypeTimestampTz(column ColumnDefinition) string +} diff --git a/contracts/database/schema/processor.go b/contracts/database/schema/processor.go new file mode 100644 index 000000000..05d683011 --- /dev/null +++ b/contracts/database/schema/processor.go @@ -0,0 +1,6 @@ +package schema + +type Processor interface { + // ProcessColumns Process the results of a columns query. + ProcessColumns(columns []Column) []Column +} diff --git a/contracts/database/schema/schema.go b/contracts/database/schema/schema.go new file mode 100644 index 000000000..407cc107f --- /dev/null +++ b/contracts/database/schema/schema.go @@ -0,0 +1,71 @@ +package schema + +type Schema interface { + Connection(name string) Schema + // Create a new table on the schema. + Create(table string, callback func(table Blueprint)) error + // Drop a table from the schema. + Drop(table string) error + // DropAllTables Drop all tables from the database. + DropAllTables() error + // DropAllViews Drop all views from the database. + DropAllViews() error + // DropColumns Drop columns from a table schema. + DropColumns(table string, columns []string) error + // DropIfExists Drop a table from the schema if it exists. + DropIfExists(table string) error + // GetColumns Get the columns for a given table. + GetColumns(table string) ([]Column, error) + // GetColumnListing Get the column listing for a given table. + GetColumnListing(table string) []string + // GetIndexes Get the indexes for a given table. + GetIndexes(table string) []Index + // GetIndexListing Get the names of the indexes for a given table. + GetIndexListing(table string) []string + // GetTableListing Get the names of the tables that belong to the database. + GetTableListing() []string + // GetTables Get the tables that belong to the database. + GetTables() ([]Table, error) + // GetViews Get the views that belong to the database. + GetViews() []View + // HasColumn Determine if the given table has a given column. + HasColumn(table, column string) bool + // HasColumns Determine if the given table has given columns. + HasColumns(table string, columns []string) bool + // HasIndex Determine if the given table has a given index. + HasIndex(table, index string) + // HasTable Determine if the given table exists. + HasTable(table string) bool + // HasView Determine if the given view exists. + HasView(view string) bool + // Register migrations. + Register([]Migration) + // Rename a table on the schema. + Rename(from, to string) + // Table Modify a table on the schema. + Table(table string, callback func(table Blueprint)) error +} + +type Migration interface { + Signature() string + Up() error + Down() error +} + +type Index struct { + Columns []string + Name string + Primary bool + Type string + Unique bool +} + +type Table struct { + Name string + Size int +} + +type View struct { + Definition string + Name string +} diff --git a/contracts/foundation/container.go b/contracts/foundation/container.go index cfacbd63e..d53a72ce0 100644 --- a/contracts/foundation/container.go +++ b/contracts/foundation/container.go @@ -10,6 +10,7 @@ import ( "github.com/goravel/framework/contracts/console" "github.com/goravel/framework/contracts/crypt" "github.com/goravel/framework/contracts/database/orm" + "github.com/goravel/framework/contracts/database/schema" "github.com/goravel/framework/contracts/database/seeder" "github.com/goravel/framework/contracts/event" "github.com/goravel/framework/contracts/filesystem" @@ -70,6 +71,10 @@ type Container interface { MakeRoute() route.Route // MakeSchedule resolves the schedule instance. MakeSchedule() schedule.Schedule + // MakeSchema resolves the schema instance. + MakeSchema() schema.Schema + // MakeSeeder resolves the seeder instance. + MakeSeeder() seeder.Facade // MakeSession resolves the session instance. MakeSession() session.Manager // MakeStorage resolves the storage instance. @@ -80,8 +85,6 @@ type Container interface { MakeValidation() validation.Validation // MakeView resolves the view instance. MakeView() http.View - // MakeSeeder resolves the seeder instance. - MakeSeeder() seeder.Facade // MakeWith resolves the given type with the given parameters from the container. MakeWith(key any, parameters map[string]any) (any, error) // Singleton registers a shared binding in the container. diff --git a/database/gorm/query_test.go b/database/gorm/query_test.go index 65cc87ab2..6126f72fa 100644 --- a/database/gorm/query_test.go +++ b/database/gorm/query_test.go @@ -2277,7 +2277,7 @@ func (s *QueryTestSuite) TestRefreshConnection() { return product }(), setup: func() { - mockPostgresqlConnection(s.mysqlDocker.MockConfig, testDatabaseDocker.Postgresql.Config()) + mockPostgresqlConnection(s.mysqlDocker.MockConfig, testDatabaseDocker.Postgres.Config()) }, expectConnection: "postgresql", }, @@ -3057,7 +3057,7 @@ func TestCustomConnection(t *testing.T) { assert.Nil(t, query.Where("body", "create_review").First(&review1)) assert.True(t, review1.ID > 0) - mockPostgresqlConnection(mysqlDocker.MockConfig, testDatabaseDocker.Postgresql.Config()) + mockPostgresqlConnection(mysqlDocker.MockConfig, testDatabaseDocker.Postgres.Config()) product := Product{Name: "create_product"} assert.Nil(t, query.Create(&product)) diff --git a/database/gorm/test_utils.go b/database/gorm/test_utils.go index a04c99d76..702469e79 100644 --- a/database/gorm/test_utils.go +++ b/database/gorm/test_utils.go @@ -147,7 +147,7 @@ type PostgresqlDocker struct { } func NewPostgresqlDocker(database *supportdocker.Database) *PostgresqlDocker { - config := database.Postgresql.Config() + config := database.Postgres.Config() return &PostgresqlDocker{MockConfig: &mocksconfig.Config{}, Port: config.Port, user: config.Username, password: config.Password, database: config.Database} } diff --git a/database/orm.go b/database/orm.go index 3a23e06c6..7181e43fc 100644 --- a/database/orm.go +++ b/database/orm.go @@ -12,6 +12,7 @@ import ( ormcontract "github.com/goravel/framework/contracts/database/orm" databasegorm "github.com/goravel/framework/database/gorm" "github.com/goravel/framework/database/orm" + "github.com/goravel/framework/database/seeder" ) type OrmImpl struct { @@ -77,7 +78,7 @@ func (r *OrmImpl) Query() ormcontract.Query { } func (r *OrmImpl) Factory() ormcontract.Factory { - return NewFactoryImpl(r.Query()) + return seeder.NewFactoryImpl(r.Query()) } func (r *OrmImpl) Observe(model any, observer ormcontract.Observer) { diff --git a/database/processors/postgres.go b/database/processors/postgres.go new file mode 100644 index 000000000..497e45553 --- /dev/null +++ b/database/processors/postgres.go @@ -0,0 +1,24 @@ +package processors + +import ( + "strings" + + "github.com/spf13/cast" + + schemacontract "github.com/goravel/framework/contracts/database/schema" +) + +type Postgres struct { +} + +func NewPostgres() *Postgres { + return &Postgres{} +} + +func (r *Postgres) ProcessColumns(columns []schemacontract.Column) []schemacontract.Column { + for _, column := range columns { + column.AutoIncrement = column.Default != nil && strings.HasPrefix(cast.ToString(column.Default), "nextval(") + } + + return columns +} diff --git a/database/schema/blueprint.go b/database/schema/blueprint.go new file mode 100644 index 000000000..04d6befe9 --- /dev/null +++ b/database/schema/blueprint.go @@ -0,0 +1,325 @@ +package schema + +import ( + ormcontract "github.com/goravel/framework/contracts/database/orm" + schemacontract "github.com/goravel/framework/contracts/database/schema" + "github.com/goravel/framework/support/convert" +) + +const defaultStringLength = 255 + +type Blueprint struct { + columns []*ColumnDefinition + commands []*Command + prefix string + table string +} + +func NewBlueprint(prefix, table string) *Blueprint { + return &Blueprint{ + prefix: prefix, + table: table, + } +} + +func (r *Blueprint) Boolean(column string) schemacontract.ColumnDefinition { + columnImpl := &ColumnDefinition{ + name: &column, + ttype: convert.Pointer("boolean"), + } + r.addColumn(columnImpl) + + return columnImpl +} + +func (r *Blueprint) BigInteger(column string) schemacontract.ColumnDefinition { + columnImpl := &ColumnDefinition{ + name: &column, + ttype: convert.Pointer("bigInteger"), + } + r.addColumn(columnImpl) + + return columnImpl +} + +func (r *Blueprint) Binary(column string) schemacontract.ColumnDefinition { + columnImpl := &ColumnDefinition{ + name: &column, + ttype: convert.Pointer("binary"), + } + r.addColumn(columnImpl) + + return columnImpl +} + +func (r *Blueprint) Build(query ormcontract.Query, grammar schemacontract.Grammar) error { + for _, sql := range r.ToSql(query, grammar) { + if _, err := query.Exec(sql); err != nil { + return err + } + } + + return nil +} + +func (r *Blueprint) Char(column string, length ...int) schemacontract.ColumnDefinition { + defaultLength := defaultStringLength + if len(length) > 0 { + defaultLength = length[0] + } + + columnImpl := &ColumnDefinition{ + length: &defaultLength, + name: &column, + ttype: convert.Pointer("char"), + } + r.addColumn(columnImpl) + + return columnImpl +} + +func (r *Blueprint) Comment(comment string) error { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) Create() { + r.addCommand("create") +} + +func (r *Blueprint) Date(column string) schemacontract.ColumnDefinition { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) DateTime(column string) schemacontract.ColumnDefinition { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) DateTimeTz(column string) schemacontract.ColumnDefinition { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) Decimal(column string) schemacontract.ColumnDefinition { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) Double(column string) schemacontract.ColumnDefinition { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) DropColumn(column string) error { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) DropForeign(index string) error { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) DropIndex(index string) error { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) DropSoftDeletes() error { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) DropTimestamps() error { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) Enum(column string, array []any) schemacontract.ColumnDefinition { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) Float(column string) schemacontract.ColumnDefinition { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) Foreign(columns []string, name ...string) error { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) GetAddedColumns() []schemacontract.ColumnDefinition { + var columns []schemacontract.ColumnDefinition + for _, column := range r.columns { + if column.change == nil || !*column.change { + columns = append(columns, column) + } + } + + return columns +} + +func (r *Blueprint) GetChangedColumns() []schemacontract.ColumnDefinition { + var columns []schemacontract.ColumnDefinition + for _, column := range r.columns { + if column.change != nil && *column.change { + columns = append(columns, column) + } + } + + return columns +} + +func (r *Blueprint) GetTableName() string { + return r.prefix + r.table +} + +func (r *Blueprint) ID() schemacontract.ColumnDefinition { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) Index(columns []string, name string) error { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) Integer(column string) schemacontract.ColumnDefinition { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) Json(column string) schemacontract.ColumnDefinition { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) Jsonb(column string) schemacontract.ColumnDefinition { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) Primary(columns []string, name string) error { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) RenameColumn(from, to string) error { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) RenameIndex(from, to string) error { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) SoftDeletes(column ...string) schemacontract.ColumnDefinition { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) SoftDeletesTz(column ...string) schemacontract.ColumnDefinition { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) String(column string, length ...int) schemacontract.ColumnDefinition { + defaultLength := defaultStringLength + if len(length) > 0 { + defaultLength = length[0] + } + + columnImpl := &ColumnDefinition{ + length: &defaultLength, + name: &column, + ttype: convert.Pointer("string"), + } + r.addColumn(columnImpl) + + return columnImpl +} + +func (r *Blueprint) Text(column string) schemacontract.ColumnDefinition { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) Time(column string) schemacontract.ColumnDefinition { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) TimeTz(column string) schemacontract.ColumnDefinition { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) Timestamp(column string) schemacontract.ColumnDefinition { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) Timestamps() schemacontract.ColumnDefinition { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) TimestampsTz() schemacontract.ColumnDefinition { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) TimestampTz(column string) schemacontract.ColumnDefinition { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) ToSql(query ormcontract.Query, grammar schemacontract.Grammar) []string { + var statements []string + for _, command := range r.commands { + switch command.Name { + case "create": + statements = append(statements, grammar.CompileCreate(r, query)) + } + } + + return statements +} + +func (r *Blueprint) Unique(columns []string, name string) error { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) UnsignedInteger(column string) schemacontract.ColumnDefinition { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) UnsignedBigInteger(column string) schemacontract.ColumnDefinition { + //TODO implement me + panic("implement me") +} + +func (r *Blueprint) addColumn(column *ColumnDefinition) { + r.columns = append(r.columns, column) +} + +func (r *Blueprint) addCommand(name string) { + r.commands = append(r.commands, r.createCommand(name)) +} + +func (r *Blueprint) createCommand(name string) *Command { + return &Command{ + Name: name, + } +} + +type Command struct { + Name string +} diff --git a/database/schema/blueprint_test.go b/database/schema/blueprint_test.go new file mode 100644 index 000000000..c3f01d05e --- /dev/null +++ b/database/schema/blueprint_test.go @@ -0,0 +1,130 @@ +package schema + +import ( + "errors" + "testing" + + "github.com/stretchr/testify/suite" + + "github.com/goravel/framework/contracts/database/schema" + "github.com/goravel/framework/database/schema/grammars" + ormmock "github.com/goravel/framework/mocks/database/orm" +) + +type BlueprintTestSuite struct { + suite.Suite + blueprint *Blueprint + grammars []schema.Grammar +} + +func TestBlueprintTestSuite(t *testing.T) { + suite.Run(t, &BlueprintTestSuite{ + grammars: []schema.Grammar{ + grammars.NewPostgres(), + }, + }) +} + +func (s *BlueprintTestSuite) SetupTest() { + s.blueprint = NewBlueprint("goravel_", "users") +} + +func (s *BlueprintTestSuite) TestBuild() { + for _, grammar := range s.grammars { + mockQuery := &ormmock.Query{} + + s.blueprint.Create() + s.blueprint.String("name") + + mockQuery.On("Exec", s.blueprint.ToSql(mockQuery, grammar)[0]).Return(nil, nil).Once() + s.Nil(s.blueprint.Build(mockQuery, grammar)) + + mockQuery.On("Exec", s.blueprint.ToSql(mockQuery, grammar)[0]).Return(nil, errors.New("error")).Once() + s.EqualError(s.blueprint.Build(mockQuery, grammar), "error") + + mockQuery.AssertExpectations(s.T()) + } +} + +func (s *BlueprintTestSuite) TestChar() { + column := "name" + customLength := 100 + length := defaultStringLength + ttype := "char" + s.blueprint.Char(column) + s.Contains(s.blueprint.GetAddedColumns(), &ColumnDefinition{ + length: &length, + name: &column, + ttype: &ttype, + }) + + s.blueprint.Char(column, customLength) + s.Contains(s.blueprint.GetAddedColumns(), &ColumnDefinition{ + length: &customLength, + name: &column, + ttype: &ttype, + }) +} + +func (s *BlueprintTestSuite) TestGetAddedColumns() { + name := "name" + change := true + addedColumn := &ColumnDefinition{ + name: &name, + } + changedColumn := &ColumnDefinition{ + change: &change, + name: &name, + } + + s.blueprint.columns = []*ColumnDefinition{addedColumn, changedColumn} + + s.Len(s.blueprint.GetAddedColumns(), 1) + s.Equal(addedColumn, s.blueprint.GetAddedColumns()[0]) +} + +func (s *BlueprintTestSuite) TestGetChangedColumns() { + name := "name" + change := true + addedColumn := &ColumnDefinition{ + name: &name, + } + changedColumn := &ColumnDefinition{ + change: &change, + name: &name, + } + + s.blueprint.columns = []*ColumnDefinition{addedColumn, changedColumn} + + s.Len(s.blueprint.GetChangedColumns(), 1) + s.Equal(changedColumn, s.blueprint.GetChangedColumns()[0]) +} + +func (s *BlueprintTestSuite) TestString() { + column := "name" + customLength := 100 + length := defaultStringLength + ttype := "string" + s.blueprint.String(column) + s.Contains(s.blueprint.GetAddedColumns(), &ColumnDefinition{ + length: &length, + name: &column, + ttype: &ttype, + }) + + s.blueprint.String(column, customLength) + s.Contains(s.blueprint.GetAddedColumns(), &ColumnDefinition{ + length: &customLength, + name: &column, + ttype: &ttype, + }) +} + +func (s *BlueprintTestSuite) TestToSql() { + for _, grammar := range s.grammars { + mockQuery := &ormmock.Query{} + s.blueprint.Create() + s.blueprint.String("name") + s.NotEmpty(s.blueprint.ToSql(mockQuery, grammar)) + } +} diff --git a/database/schema/column.go b/database/schema/column.go new file mode 100644 index 000000000..bfc1138cc --- /dev/null +++ b/database/schema/column.go @@ -0,0 +1,52 @@ +package schema + +type ColumnDefinition struct { + allowed []string + autoIncrement *bool + change *bool + comment *string + def *string + length *int + name *string + nullable *bool + places *int + precision *int + total *int + ttype *string +} + +func (r *ColumnDefinition) Change() { + *r.change = true +} + +func (r *ColumnDefinition) GetAllowed() []string { + return r.allowed +} + +func (r *ColumnDefinition) GetAutoIncrement() bool { + return *r.autoIncrement +} + +func (r *ColumnDefinition) GetLength() int { + return *r.length +} + +func (r *ColumnDefinition) GetName() string { + return *r.name +} + +func (r *ColumnDefinition) GetPlaces() int { + return *r.places +} + +func (r *ColumnDefinition) GetPrecision() int { + return *r.precision +} + +func (r *ColumnDefinition) GetTotal() int { + return *r.total +} + +func (r *ColumnDefinition) GetType() string { + return *r.ttype +} diff --git a/database/schema/grammars/mysql.go b/database/schema/grammars/mysql.go new file mode 100644 index 000000000..d97f0671b --- /dev/null +++ b/database/schema/grammars/mysql.go @@ -0,0 +1,251 @@ +package grammars + +import ( + schemacontract "github.com/goravel/framework/contracts/database/schema" +) + +type Mysql struct{} + +func NewMysql() *Mysql { + return &Mysql{} +} + +func (r *Mysql) CompileAdd(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) CompileAutoIncrementStartingValues(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) CompileChange(blueprint schemacontract.Blueprint, command, connection string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) CompileColumns(database, table string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) CompileCreate(blueprint schemacontract.Blueprint, command, connection string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) CompileCreateEncoding(sql, connection string, blueprint schemacontract.Blueprint) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) CompileCreateEngine(sql, connection string, blueprint schemacontract.Blueprint) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) CompileCreateTable(blueprint schemacontract.Blueprint, command, connection string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) CompileDrop(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) CompileDropAllTables(tables []string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) CompileDropAllViews(views []string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) CompileDropColumn(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) CompileDropIfExists(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) CompileDropIndex(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) CompileDropPrimary(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) CompileDropUnique(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) CompilePrimary(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) CompileIndex(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) CompileIndexes(database, table string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) CompileRename(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) CompileRenameColumn(blueprint schemacontract.Blueprint, command, connection string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) CompileRenameIndex(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) CompileTableComment(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) CompileTables(database string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) CompileUnique(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) CompileViews(database string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) ModifyNullable(blueprint schemacontract.Blueprint, column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) ModifyDefault(blueprint schemacontract.Blueprint, column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) TypeBigInteger(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) TypeBinary(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) TypeBoolean(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) TypeChar(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) TypeDate(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) TypeDateTime(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) TypeDateTimeTz(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) TypeDecimal(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) TypeDouble(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) TypeEnum(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) TypeFloat(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) TypeInteger(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) TypeJson(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) TypeJsonb(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) TypeString(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) TypeText(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) TypeTime(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) TypeTimeTz(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) TypeTimestamp(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Mysql) TypeTimestampTz(column string) string { + //TODO implement me + panic("implement me") +} diff --git a/database/schema/grammars/postgres.go b/database/schema/grammars/postgres.go new file mode 100644 index 000000000..979971e35 --- /dev/null +++ b/database/schema/grammars/postgres.go @@ -0,0 +1,301 @@ +package grammars + +import ( + "fmt" + "strings" + + ormcontract "github.com/goravel/framework/contracts/database/orm" + schemacontract "github.com/goravel/framework/contracts/database/schema" +) + +type Postgres struct{} + +func NewPostgres() *Postgres { + return &Postgres{} +} + +func (r *Postgres) CompileAdd(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Postgres) CompileAutoIncrementStartingValues(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Postgres) CompileChange(blueprint schemacontract.Blueprint, command, connection string) string { + //TODO implement me + panic("implement me") +} + +func (r *Postgres) CompileColumns(database, table, schema string) string { + return fmt.Sprintf( + "select a.attname as name, t.typname as type_name, format_type(a.atttypid, a.atttypmod) as type, "+ + "(select tc.collcollate from pg_catalog.pg_collation tc where tc.oid = a.attcollation) as collation, "+ + "not a.attnotnull as nullable, "+ + "(select pg_get_expr(adbin, adrelid) from pg_attrdef where c.oid = pg_attrdef.adrelid and pg_attrdef.adnum = a.attnum) as default, "+ + "col_description(c.oid, a.attnum) as comment "+ + "from pg_attribute a, pg_class c, pg_type t, pg_namespace n "+ + "where c.relname = '%s' and n.nspname = '%s' and a.attnum > 0 and a.attrelid = c.oid and a.atttypid = t.oid and n.oid = c.relnamespace "+ + "order by a.attnum", table, schema) +} + +func (r *Postgres) CompileCreate(blueprint schemacontract.Blueprint, query ormcontract.Query) string { + return fmt.Sprintf("create table %s (%s)", blueprint.GetTableName(), strings.Join(r.getColumns(blueprint), ",")) +} + +func (r *Postgres) CompileCreateEncoding(sql, connection string, blueprint schemacontract.Blueprint) string { + //TODO implement me + panic("implement me") +} + +func (r *Postgres) CompileCreateEngine(sql, connection string, blueprint schemacontract.Blueprint) string { + //TODO implement me + panic("implement me") +} + +func (r *Postgres) CompileCreateTable(blueprint schemacontract.Blueprint, command, connection string) string { + //TODO implement me + panic("implement me") +} + +func (r *Postgres) CompileDrop(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Postgres) CompileDropAllTables(tables []string) string { + //TODO implement me + panic("implement me") +} + +func (r *Postgres) CompileDropAllViews(views []string) string { + //TODO implement me + panic("implement me") +} + +func (r *Postgres) CompileDropColumn(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Postgres) CompileDropIfExists(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Postgres) CompileDropIndex(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Postgres) CompileDropPrimary(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Postgres) CompileDropUnique(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Postgres) CompilePrimary(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Postgres) CompileIndex(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Postgres) CompileIndexes(database, table string) string { + //TODO implement me + panic("implement me") +} + +func (r *Postgres) CompileRename(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Postgres) CompileRenameColumn(blueprint schemacontract.Blueprint, command, connection string) string { + //TODO implement me + panic("implement me") +} + +func (r *Postgres) CompileRenameIndex(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Postgres) CompileTableComment(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Postgres) CompileTables(database string) string { + return "select c.relname as name, n.nspname as schema, pg_total_relation_size(c.oid) as size, " + + "obj_description(c.oid, 'pg_class') as comment from pg_class c, pg_namespace n " + + "where c.relkind in ('r', 'p') and n.oid = c.relnamespace and n.nspname not in ('pg_catalog', 'information_schema') " + + "order by c.relname" +} + +func (r *Postgres) CompileUnique(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Postgres) CompileViews(database string) string { + //TODO implement me + panic("implement me") +} + +func (r *Postgres) ModifyNullable(blueprint schemacontract.Blueprint, column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Postgres) ModifyDefault(blueprint schemacontract.Blueprint, column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Postgres) TypeBigInteger(column schemacontract.ColumnDefinition) string { + if column.GetAutoIncrement() { + return "bigserial" + } + + return "bigint" +} + +func (r *Postgres) TypeBinary(column schemacontract.ColumnDefinition) string { + return "bytea" +} + +func (r *Postgres) TypeBoolean(column schemacontract.ColumnDefinition) string { + return "boolean" +} + +func (r *Postgres) TypeChar(column schemacontract.ColumnDefinition) string { + length := column.GetLength() + if length > 0 { + return fmt.Sprintf("char(%d)", length) + } + + return "char" +} + +func (r *Postgres) TypeDate(column schemacontract.ColumnDefinition) string { + return "date" +} + +func (r *Postgres) TypeDateTime(column schemacontract.ColumnDefinition) string { + return r.TypeTimestamp(column) +} + +func (r *Postgres) TypeDateTimeTz(column schemacontract.ColumnDefinition) string { + return r.TypeTimestampTz(column) +} + +func (r *Postgres) TypeDecimal(column schemacontract.ColumnDefinition) string { + return fmt.Sprintf("decimal(%d, %d)", column.GetTotal(), column.GetPlaces()) +} + +func (r *Postgres) TypeDouble(column schemacontract.ColumnDefinition) string { + return "double precision" +} + +func (r *Postgres) TypeEnum(column schemacontract.ColumnDefinition) string { + return fmt.Sprintf(`varchar(255) check ("%s" in (%s))`, column.GetName(), strings.Join(column.GetAllowed(), ",")) +} + +func (r *Postgres) TypeFloat(column schemacontract.ColumnDefinition) string { + return r.TypeDouble(column) +} + +func (r *Postgres) TypeInteger(column schemacontract.ColumnDefinition) string { + if column.GetAutoIncrement() { + return "serial" + } + + return "integer" +} + +func (r *Postgres) TypeJson(column schemacontract.ColumnDefinition) string { + return "json" +} + +func (r *Postgres) TypeJsonb(column schemacontract.ColumnDefinition) string { + return "jsonb" +} + +func (r *Postgres) TypeString(column schemacontract.ColumnDefinition) string { + length := column.GetLength() + if length > 0 { + return fmt.Sprintf("varchar(%d)", length) + } + + return "varchar" +} + +func (r *Postgres) TypeText(column schemacontract.ColumnDefinition) string { + return "text" +} + +func (r *Postgres) TypeTime(column schemacontract.ColumnDefinition) string { + precision := column.GetPrecision() + if precision > 0 { + return fmt.Sprintf("time(%d) without time zone", precision) + } + + return "time" +} + +func (r *Postgres) TypeTimeTz(column schemacontract.ColumnDefinition) string { + precision := column.GetPrecision() + if precision > 0 { + return fmt.Sprintf("time(%d) with time zone", precision) + } + + return "time" +} + +func (r *Postgres) TypeTimestamp(column schemacontract.ColumnDefinition) string { + precision := column.GetPrecision() + if precision > 0 { + return fmt.Sprintf("timestamp(%d) without time zone", precision) + } + + return "timestamp" +} + +func (r *Postgres) TypeTimestampTz(column schemacontract.ColumnDefinition) string { + precision := column.GetPrecision() + if precision > 0 { + return fmt.Sprintf("timestamp(%d) with time zone", precision) + } + + return "timestamp" +} + +func (r *Postgres) getColumns(blueprint schemacontract.Blueprint) []string { + var columns []string + for _, column := range blueprint.GetAddedColumns() { + columns = append(columns, fmt.Sprintf("%s %s", column.GetName(), r.getType(column))) + } + + return columns +} + +func (r *Postgres) getType(column schemacontract.ColumnDefinition) string { + switch column.GetType() { + case "char": + return r.TypeChar(column) + case "string": + return r.TypeString(column) + default: + panic(fmt.Sprintf("unsupported column type: %s", column.GetType())) + } +} diff --git a/database/schema/grammars/postgres_test.go b/database/schema/grammars/postgres_test.go new file mode 100644 index 000000000..05aeb74e1 --- /dev/null +++ b/database/schema/grammars/postgres_test.go @@ -0,0 +1,172 @@ +package grammars + +import ( + "testing" + + "github.com/stretchr/testify/suite" + + schemacontract "github.com/goravel/framework/contracts/database/schema" + mockschema "github.com/goravel/framework/mocks/database/schema" +) + +type PostgresSuite struct { + suite.Suite + grammar *Postgres +} + +func TestPostgresSuite(t *testing.T) { + suite.Run(t, &PostgresSuite{}) +} + +func (s *PostgresSuite) SetupTest() { + s.grammar = NewPostgres() +} + +func (s *PostgresSuite) TestCompileCreate() { + mockColumn1 := &mockschema.Column{} + mockColumn1.On("GetName").Return("id").Once() + mockColumn1.On("GetType").Return("string").Once() + mockColumn1.On("GetLength").Return(100).Once() + mockColumn2 := &mockschema.Column{} + mockColumn2.On("GetName").Return("name").Once() + mockColumn2.On("GetType").Return("string").Once() + mockColumn2.On("GetLength").Return(0).Once() + mockBlueprint := &mockschema.Blueprint{} + mockBlueprint.On("GetTableName").Return("users").Once() + mockBlueprint.On("GetAddedColumns").Return([]schemacontract.ColumnDefinition{ + mockColumn1, mockColumn2, + }).Once() + + s.Equal("create table users (id varchar(100),name varchar)", + s.grammar.CompileCreate(mockBlueprint, nil)) +} + +func (s *PostgresSuite) TestTypeBigInteger() { + mockColumn1 := &mockschema.Column{} + mockColumn1.On("GetAutoIncrement").Return(true).Once() + + s.Equal("bigserial", s.grammar.TypeBigInteger(mockColumn1)) + + mockColumn2 := &mockschema.Column{} + mockColumn2.On("GetAutoIncrement").Return(false).Once() + + s.Equal("bigint", s.grammar.TypeBigInteger(mockColumn2)) +} + +func (s *PostgresSuite) TestTypeChar() { + mockColumn1 := &mockschema.Column{} + mockColumn1.On("GetLength").Return(100).Once() + + s.Equal("char(100)", s.grammar.TypeChar(mockColumn1)) + + mockColumn2 := &mockschema.Column{} + mockColumn2.On("GetLength").Return(0).Once() + + s.Equal("char", s.grammar.TypeChar(mockColumn2)) +} + +func (s *PostgresSuite) TestTypeDecimal() { + mockColumn := &mockschema.Column{} + mockColumn.On("GetTotal").Return(4).Once() + mockColumn.On("GetPlaces").Return(2).Once() + + s.Equal("decimal(4, 2)", s.grammar.TypeDecimal(mockColumn)) +} + +func (s *PostgresSuite) TestTypeEnum() { + mockColumn := &mockschema.Column{} + mockColumn.On("GetName").Return("name").Once() + mockColumn.On("GetAllowed").Return([]string{"a", "b"}).Once() + + s.Equal(`varchar(255) check ("name" in (a,b))`, s.grammar.TypeEnum(mockColumn)) +} + +func (s *PostgresSuite) TestTypeInteger() { + mockColumn1 := &mockschema.Column{} + mockColumn1.On("GetAutoIncrement").Return(true).Once() + + s.Equal("serial", s.grammar.TypeInteger(mockColumn1)) + + mockColumn2 := &mockschema.Column{} + mockColumn2.On("GetAutoIncrement").Return(false).Once() + + s.Equal("integer", s.grammar.TypeInteger(mockColumn2)) +} + +func (s *PostgresSuite) TestTypeString() { + mockColumn1 := &mockschema.Column{} + mockColumn1.On("GetLength").Return(100).Once() + + s.Equal("varchar(100)", s.grammar.TypeString(mockColumn1)) + + mockColumn2 := &mockschema.Column{} + mockColumn2.On("GetLength").Return(0).Once() + + s.Equal("varchar", s.grammar.TypeString(mockColumn2)) +} + +func (s *PostgresSuite) TestTypeTime() { + mockColumn1 := &mockschema.Column{} + mockColumn1.On("GetPrecision").Return(1).Once() + + s.Equal("time(1) without time zone", s.grammar.TypeTime(mockColumn1)) + + mockColumn2 := &mockschema.Column{} + mockColumn2.On("GetPrecision").Return(0).Once() + + s.Equal("time", s.grammar.TypeTime(mockColumn2)) +} + +func (s *PostgresSuite) TestTypeTimeTz() { + mockColumn1 := &mockschema.Column{} + mockColumn1.On("GetPrecision").Return(1).Once() + + s.Equal("time(1) with time zone", s.grammar.TypeTimeTz(mockColumn1)) + + mockColumn2 := &mockschema.Column{} + mockColumn2.On("GetPrecision").Return(0).Once() + + s.Equal("time", s.grammar.TypeTimeTz(mockColumn2)) +} + +func (s *PostgresSuite) TestTypeTimestamp() { + mockColumn1 := &mockschema.Column{} + mockColumn1.On("GetPrecision").Return(1).Once() + + s.Equal("timestamp(1) without time zone", s.grammar.TypeTimestamp(mockColumn1)) + + mockColumn2 := &mockschema.Column{} + mockColumn2.On("GetPrecision").Return(0).Once() + + s.Equal("timestamp", s.grammar.TypeTimestamp(mockColumn2)) +} + +func (s *PostgresSuite) TestTypeTimestampTz() { + mockColumn1 := &mockschema.Column{} + mockColumn1.On("GetPrecision").Return(1).Once() + + s.Equal("timestamp(1) with time zone", s.grammar.TypeTimestampTz(mockColumn1)) + + mockColumn2 := &mockschema.Column{} + mockColumn2.On("GetPrecision").Return(0).Once() + + s.Equal("timestamp", s.grammar.TypeTimestampTz(mockColumn2)) +} + +func (s *PostgresSuite) TestGetColumns() { + mockColumn1 := &mockschema.Column{} + mockColumn1.On("GetName").Return("id").Once() + mockColumn1.On("GetType").Return("string").Once() + mockColumn1.On("GetLength").Return(100).Once() + mockColumn2 := &mockschema.Column{} + mockColumn2.On("GetName").Return("name").Once() + mockColumn2.On("GetType").Return("string").Once() + mockColumn2.On("GetLength").Return(0).Once() + mockBlueprint := &mockschema.Blueprint{} + mockBlueprint.On("GetTableName").Return("users").Once() + mockBlueprint.On("GetAddedColumns").Return([]schemacontract.ColumnDefinition{ + mockColumn1, mockColumn2, + }).Once() + + s.Equal([]string{"id varchar(100)", "name varchar"}, s.grammar.getColumns(mockBlueprint)) +} diff --git a/database/schema/grammars/sqlite.go b/database/schema/grammars/sqlite.go new file mode 100644 index 000000000..8d9af95e9 --- /dev/null +++ b/database/schema/grammars/sqlite.go @@ -0,0 +1,251 @@ +package grammars + +import ( + schemacontract "github.com/goravel/framework/contracts/database/schema" +) + +type Sqlite struct{} + +func NewSqlite() *Sqlite { + return &Sqlite{} +} + +func (r *Sqlite) CompileAdd(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) CompileAutoIncrementStartingValues(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) CompileChange(blueprint schemacontract.Blueprint, command, connection string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) CompileColumns(database, table string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) CompileCreate(blueprint schemacontract.Blueprint, command, connection string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) CompileCreateEncoding(sql, connection string, blueprint schemacontract.Blueprint) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) CompileCreateEngine(sql, connection string, blueprint schemacontract.Blueprint) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) CompileCreateTable(blueprint schemacontract.Blueprint, command, connection string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) CompileDrop(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) CompileDropAllTables(tables []string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) CompileDropAllViews(views []string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) CompileDropColumn(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) CompileDropIfExists(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) CompileDropIndex(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) CompileDropPrimary(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) CompileDropUnique(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) CompilePrimary(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) CompileIndex(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) CompileIndexes(database, table string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) CompileRename(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) CompileRenameColumn(blueprint schemacontract.Blueprint, command, connection string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) CompileRenameIndex(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) CompileTableComment(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) CompileTables(database string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) CompileUnique(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) CompileViews(database string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) ModifyNullable(blueprint schemacontract.Blueprint, column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) ModifyDefault(blueprint schemacontract.Blueprint, column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) TypeBigInteger(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) TypeBinary(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) TypeBoolean(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) TypeChar(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) TypeDate(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) TypeDateTime(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) TypeDateTimeTz(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) TypeDecimal(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) TypeDouble(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) TypeEnum(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) TypeFloat(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) TypeInteger(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) TypeJson(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) TypeJsonb(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) TypeString(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) TypeText(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) TypeTime(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) TypeTimeTz(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) TypeTimestamp(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlite) TypeTimestampTz(column string) string { + //TODO implement me + panic("implement me") +} diff --git a/database/schema/grammars/sqlserver.go b/database/schema/grammars/sqlserver.go new file mode 100644 index 000000000..55b82e08c --- /dev/null +++ b/database/schema/grammars/sqlserver.go @@ -0,0 +1,251 @@ +package grammars + +import ( + schemacontract "github.com/goravel/framework/contracts/database/schema" +) + +type Sqlserver struct{} + +func NewSqlserver() *Sqlserver { + return &Sqlserver{} +} + +func (r *Sqlserver) CompileAdd(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) CompileAutoIncrementStartingValues(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) CompileChange(blueprint schemacontract.Blueprint, command, connection string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) CompileColumns(database, table string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) CompileCreate(blueprint schemacontract.Blueprint, command, connection string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) CompileCreateEncoding(sql, connection string, blueprint schemacontract.Blueprint) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) CompileCreateEngine(sql, connection string, blueprint schemacontract.Blueprint) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) CompileCreateTable(blueprint schemacontract.Blueprint, command, connection string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) CompileDrop(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) CompileDropAllTables(tables []string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) CompileDropAllViews(views []string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) CompileDropColumn(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) CompileDropIfExists(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) CompileDropIndex(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) CompileDropPrimary(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) CompileDropUnique(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) CompilePrimary(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) CompileIndex(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) CompileIndexes(database, table string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) CompileRename(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) CompileRenameColumn(blueprint schemacontract.Blueprint, command, connection string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) CompileRenameIndex(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) CompileTableComment(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) CompileTables(database string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) CompileUnique(blueprint schemacontract.Blueprint, command string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) CompileViews(database string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) ModifyNullable(blueprint schemacontract.Blueprint, column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) ModifyDefault(blueprint schemacontract.Blueprint, column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) TypeBigInteger(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) TypeBinary(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) TypeBoolean(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) TypeChar(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) TypeDate(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) TypeDateTime(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) TypeDateTimeTz(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) TypeDecimal(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) TypeDouble(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) TypeEnum(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) TypeFloat(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) TypeInteger(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) TypeJson(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) TypeJsonb(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) TypeString(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) TypeText(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) TypeTime(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) TypeTimeTz(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) TypeTimestamp(column string) string { + //TODO implement me + panic("implement me") +} + +func (r *Sqlserver) TypeTimestampTz(column string) string { + //TODO implement me + panic("implement me") +} diff --git a/database/schema/main_test.go b/database/schema/main_test.go new file mode 100644 index 000000000..73f3a6233 --- /dev/null +++ b/database/schema/main_test.go @@ -0,0 +1,31 @@ +package schema + +import ( + "log" + "testing" + + supportdocker "github.com/goravel/framework/support/docker" + "github.com/goravel/framework/support/env" +) + +var testDatabaseDocker *supportdocker.Database + +func TestMain(m *testing.M) { + if !env.IsWindows() { + var err error + testDatabaseDocker, err = supportdocker.InitDatabase() + if err != nil { + log.Fatalf("Init docker error: %s", err) + } + } + + m.Run() + + if !env.IsWindows() { + defer func() { + if err := testDatabaseDocker.Stop(); err != nil { + log.Fatalf("Stop docker error: %s", err) + } + }() + } +} diff --git a/database/schema/schema.go b/database/schema/schema.go new file mode 100644 index 000000000..a4dbeb965 --- /dev/null +++ b/database/schema/schema.go @@ -0,0 +1,222 @@ +package schema + +import ( + "fmt" + "strings" + + configcontract "github.com/goravel/framework/contracts/config" + ormcontract "github.com/goravel/framework/contracts/database/orm" + schemacontract "github.com/goravel/framework/contracts/database/schema" + logcontract "github.com/goravel/framework/contracts/log" + "github.com/goravel/framework/database/processors" + "github.com/goravel/framework/database/schema/grammars" +) + +type Schema struct { + config configcontract.Config + connection string + grammar schemacontract.Grammar + log logcontract.Log + migrations []schemacontract.Migration + orm ormcontract.Orm + processor schemacontract.Processor + query ormcontract.Query +} + +func NewSchema(connection string, config configcontract.Config, orm ormcontract.Orm, log logcontract.Log) (*Schema, error) { + if connection == "" { + connection = config.GetString("database.default") + } + + schema := &Schema{ + config: config, + connection: connection, + log: log, + orm: orm, + query: orm.Connection(connection).Query(), + } + + if err := schema.initGrammarAndProcess(); err != nil { + return nil, err + } + + return schema, nil +} + +func (r *Schema) Connection(name string) schemacontract.Schema { + schema, err := NewSchema(name, r.config, r.orm, r.log) + if err != nil { + panic(err) + } + + return schema +} + +func (r *Schema) Create(table string, callback func(table schemacontract.Blueprint)) error { + blueprint := NewBlueprint(r.getTablePrefix(), table) + blueprint.Create() + callback(blueprint) + + return blueprint.Build(r.query, r.grammar) +} + +func (r *Schema) Drop(table string) error { + //TODO implement me + panic("implement me") +} + +func (r *Schema) DropAllTables() error { + //TODO implement me + panic("implement me") +} + +func (r *Schema) DropAllViews() error { + //TODO implement me + panic("implement me") +} + +func (r *Schema) DropColumns(table string, columns []string) error { + //TODO implement me + panic("implement me") +} + +func (r *Schema) DropIfExists(table string) error { + //TODO implement me + panic("implement me") +} + +func (r *Schema) GetColumns(table string) ([]schemacontract.Column, error) { + database, schema, table := r.parseDatabaseAndSchemaAndTable(table) + table = r.getTablePrefix() + table + + var columns []schemacontract.Column + if err := r.query.Raw(r.grammar.CompileColumns(database, table, schema)).Scan(&columns); err != nil { + return nil, err + } + + return r.processor.ProcessColumns(columns), nil +} + +func (r *Schema) GetColumnListing(table string) []string { + //TODO implement me + panic("implement me") +} + +func (r *Schema) GetIndexes(table string) []schemacontract.Index { + //TODO implement me + panic("implement me") +} + +func (r *Schema) GetIndexListing(table string) []string { + //TODO implement me + panic("implement me") +} + +func (r *Schema) GetTableListing() []string { + //TODO implement me + panic("implement me") +} + +func (r *Schema) GetTables() ([]schemacontract.Table, error) { + var tables []schemacontract.Table + if err := r.query.Raw(r.grammar.CompileTables("")).Scan(&tables); err != nil { + return nil, err + } + + return tables, nil +} + +func (r *Schema) GetViews() []schemacontract.View { + //TODO implement me + panic("implement me") +} + +func (r *Schema) HasColumn(table, column string) bool { + //TODO implement me + panic("implement me") +} + +func (r *Schema) HasColumns(table string, columns []string) bool { + //TODO implement me + panic("implement me") +} + +func (r *Schema) HasIndex(table, index string) { + //TODO implement me + panic("implement me") +} + +func (r *Schema) HasTable(name string) bool { + tables, err := r.GetTables() + if err != nil { + r.log.Errorf("failed to get %s tables: %v", r.connection, err) + return false + } + + for _, table := range tables { + if table.Name == name { + return true + } + } + + return false +} + +func (r *Schema) HasView(view string) bool { + //TODO implement me + panic("implement me") +} + +func (r *Schema) Register(migrations []schemacontract.Migration) { + r.migrations = append(r.migrations, migrations...) +} + +func (r *Schema) Rename(from, to string) { + //TODO implement me + panic("implement me") +} + +func (r *Schema) Table(table string, callback func(table schemacontract.Blueprint)) error { + //TODO implement me + panic("implement me") +} + +func (r *Schema) initGrammarAndProcess() error { + switch r.query.Driver() { + //case ormcontract.DriverMysql: + // grammar = grammars.NewMysql() + case ormcontract.DriverPostgres: + r.grammar = grammars.NewPostgres() + r.processor = processors.NewPostgres() + return nil + //case ormcontract.DriverSqlserver: + // grammar = grammars.NewSqlserver() + //case ormcontract.DriverSqlite: + // grammar = grammars.NewSqlite() + default: + return fmt.Errorf("unsupported database driver: %s", r.query.Driver()) + } +} + +func (r *Schema) getTablePrefix() string { + return r.config.GetString(fmt.Sprintf("database.connections.%s.prefix", r.connection)) +} + +// parseSchemaAndTable Parse the database object reference and extract the database, schema, and table. +func (r *Schema) parseDatabaseAndSchemaAndTable(reference string) (database, schema, table string) { + parts := strings.Split(reference, ".") + database = r.config.GetString(fmt.Sprintf("database.connections.%s.database", r.connection)) + schema = r.config.GetString(fmt.Sprintf("database.connections.%s.schema", r.connection)) + if schema == "" { + schema = "public" + } + + if len(parts) == 2 { + schema = parts[0] + parts = parts[1:] + } + + table = parts[0] + + return +} diff --git a/database/schema/schema_test.go b/database/schema/schema_test.go new file mode 100644 index 000000000..2babfcdc2 --- /dev/null +++ b/database/schema/schema_test.go @@ -0,0 +1,259 @@ +package schema + +import ( + "fmt" + "log" + "reflect" + "testing" + + "github.com/stretchr/testify/suite" + + ormcontract "github.com/goravel/framework/contracts/database/orm" + schemacontract "github.com/goravel/framework/contracts/database/schema" + testingcontract "github.com/goravel/framework/contracts/testing" + "github.com/goravel/framework/database/gorm" + configmock "github.com/goravel/framework/mocks/config" + ormmock "github.com/goravel/framework/mocks/database/orm" + logmock "github.com/goravel/framework/mocks/log" + "github.com/goravel/framework/support/env" +) + +type TestSchema struct { + dbConfig testingcontract.DatabaseConfig + driver ormcontract.Driver + mockConfig *configmock.Config + mockOrm *ormmock.Orm + mockLog *logmock.Log + query ormcontract.Query + schema *Schema +} + +type SchemaSuite struct { + suite.Suite + schemas []TestSchema + //mysqlQuery ormcontract.Query + postgresQuery ormcontract.Query + //sqliteQuery ormcontract.Query + //sqlserverDB ormcontract.Query +} + +func TestSchemaSuite(t *testing.T) { + if env.IsWindows() { + t.Skip("Skipping tests of using docker") + } + + if err := testDatabaseDocker.Fresh(); err != nil { + t.Fatal(err) + } + + //mysqlDocker := gorm.NewMysqlDocker(testDatabaseDocker) + //mysqlQuery, err := mysqlDocker.New() + //if err != nil { + // log.Fatalf("Init mysql docker error: %v", err) + //} + + postgresqlDocker := gorm.NewPostgresqlDocker(testDatabaseDocker) + postgresqlQuery, err := postgresqlDocker.New() + if err != nil { + log.Fatalf("Init postgresql docker error: %v", err) + } + + //sqliteDocker := gorm.NewSqliteDocker("goravel") + //sqliteQuery, err := sqliteDocker.New() + //if err != nil { + // log.Fatalf("Get sqlite error: %s", err) + //} + // + //sqlserverDocker := gorm.NewSqlserverDocker(testDatabaseDocker) + //sqlserverQuery, err := sqlserverDocker.New() + //if err != nil { + // log.Fatalf("Init sqlserver docker error: %v", err) + //} + + suite.Run(t, &SchemaSuite{ + //mysqlQuery: mysqlQuery, + postgresQuery: postgresqlQuery, + //sqliteQuery: sqliteQuery, + //sqlserverDB: sqlserverQuery, + }) + + //assert.Nil(t, file.Remove("goravel")) +} + +func (s *SchemaSuite) SetupTest() { + mockConfig := &configmock.Config{} + mockOrm := &ormmock.Orm{} + //mockOrmOfConnection := &ormmock.Orm{} + mockLog := &logmock.Log{} + mockConfig.On("GetString", "database.default").Return("mysql").Once() + mockOrm.On("Connection", "mysql").Return(mockOrm).Once() + mockOrm.On("Query").Return(s.postgresQuery).Once() + postgresSchema, err := NewSchema("", mockConfig, mockOrm, mockLog) + s.Nil(err) + s.schemas = append(s.schemas, TestSchema{ + dbConfig: testDatabaseDocker.Postgres.Config(), + driver: ormcontract.DriverPostgres, + mockConfig: mockConfig, + mockOrm: mockOrm, + mockLog: mockLog, + query: s.postgresQuery, + schema: postgresSchema, + }) +} + +func (s *SchemaSuite) TestConnection() { + for _, schema := range s.schemas { + schema.mockOrm.On("Connection", "postgres").Return(schema.mockOrm).Once() + schema.mockOrm.On("Query").Return(schema.query).Once() + s.NotNil(schema.schema.Connection("postgres")) + + schema.mockOrm.AssertExpectations(s.T()) + } +} + +func (s *SchemaSuite) TestCreate() { + for _, schema := range s.schemas { + s.Run(schema.driver.String(), func() { + schema.mockConfig.On("GetString", fmt.Sprintf("database.connections.%s.prefix", schema.schema.connection)). + Return("goravel_").Once() + + err := schema.schema.Create("create", func(table schemacontract.Blueprint) { + table.String("name") + }) + s.Nil(err) + s.True(schema.schema.HasTable("goravel_create")) + }) + } +} + +func (s *SchemaSuite) TestGetColumns() { + for _, schema := range s.schemas { + s.Run(schema.driver.String(), func() { + table := "get_columns" + schema.mockConfig.On("GetString", fmt.Sprintf("database.connections.%s.database", schema.schema.connection)). + Return(schema.dbConfig.Database).Once() + schema.mockConfig.On("GetString", fmt.Sprintf("database.connections.%s.schema", schema.schema.connection)). + Return("").Once() + schema.mockConfig.On("GetString", fmt.Sprintf("database.connections.%s.prefix", schema.schema.connection)). + Return("").Twice() + + err := schema.schema.Create(table, func(table schemacontract.Blueprint) { + table.Char("char") + table.String("string") + }) + + s.Nil(err) + s.True(schema.schema.HasTable(table)) + + columns, err := schema.schema.GetColumns(table) + + s.Nil(err) + s.Equal(2, len(columns)) + for _, column := range columns { + if column.Name == "char" { + s.False(column.AutoIncrement) + s.Empty(column.Collation) + s.Empty(column.Comment) + s.Nil(column.Default) + s.True(column.Nullable) + s.Equal("character(255)", column.Type) + s.Equal("bpchar", column.TypeName) + } + if column.Name == "string" { + s.False(column.AutoIncrement) + s.Empty(column.Collation) + s.Empty(column.Comment) + s.Nil(column.Default) + s.True(column.Nullable) + s.Equal("character varying(255)", column.Type) + s.Equal("varchar", column.TypeName) + } + } + + schema.mockConfig.AssertExpectations(s.T()) + }) + } +} + +func (s *SchemaSuite) TestGetTables() { + for _, schema := range s.schemas { + s.Run(schema.driver.String(), func() { + tables, err := schema.schema.GetTables() + s.Greater(len(tables), 0) + s.Nil(err) + }) + } +} + +func (s *SchemaSuite) TestHasTable() { + for _, schema := range s.schemas { + s.Run(schema.driver.String(), func() { + s.True(schema.schema.HasTable("users")) + s.False(schema.schema.HasTable("unknow")) + }) + } +} + +func (s *SchemaSuite) TestInitGrammarAndProcess() { + for _, schema := range s.schemas { + s.Run(schema.driver.String(), func() { + s.Nil(schema.schema.initGrammarAndProcess()) + grammarType := reflect.TypeOf(schema.schema.grammar) + grammarName := grammarType.Elem().Name() + processorType := reflect.TypeOf(schema.schema.processor) + processorName := processorType.Elem().Name() + + switch schema.driver { + case ormcontract.DriverMysql: + s.Equal("Mysql", grammarName) + s.Equal("Mysql", processorName) + case ormcontract.DriverPostgres: + s.Equal("Postgres", grammarName) + s.Equal("Postgres", processorName) + case ormcontract.DriverSqlserver: + s.Equal("Sqlserver", grammarName) + s.Equal("Sqlserver", processorName) + case ormcontract.DriverSqlite: + s.Equal("Sqlite", grammarName) + s.Equal("Sqlite", processorName) + default: + s.Fail("unsupported database driver") + } + }) + } +} + +func (s *SchemaSuite) TestParseDatabaseAndSchemaAndTable() { + for _, schema := range s.schemas { + s.Run(schema.driver.String(), func() { + schema.mockConfig.On("GetString", fmt.Sprintf("database.connections.%s.database", schema.schema.connection)). + Return(schema.dbConfig.Database).Once() + schema.mockConfig.On("GetString", fmt.Sprintf("database.connections.%s.schema", schema.schema.connection)). + Return("").Once() + database, schemaName, table := schema.schema.parseDatabaseAndSchemaAndTable("users") + s.Equal(schema.dbConfig.Database, database) + s.Equal("public", schemaName) + s.Equal("users", table) + + schema.mockConfig.On("GetString", fmt.Sprintf("database.connections.%s.database", schema.schema.connection)). + Return(schema.dbConfig.Database).Once() + schema.mockConfig.On("GetString", fmt.Sprintf("database.connections.%s.schema", schema.schema.connection)). + Return("").Once() + database, schemaName, table = schema.schema.parseDatabaseAndSchemaAndTable("goravel.users") + s.Equal(schema.dbConfig.Database, database) + s.Equal("goravel", schemaName) + s.Equal("users", table) + + schema.mockConfig.On("GetString", fmt.Sprintf("database.connections.%s.database", schema.schema.connection)). + Return(schema.dbConfig.Database).Once() + schema.mockConfig.On("GetString", fmt.Sprintf("database.connections.%s.schema", schema.schema.connection)). + Return("hello").Once() + database, schemaName, table = schema.schema.parseDatabaseAndSchemaAndTable("goravel.users") + s.Equal(schema.dbConfig.Database, database) + s.Equal("goravel", schemaName) + s.Equal("users", table) + + schema.mockConfig.AssertExpectations(s.T()) + }) + } +} diff --git a/database/factory.go b/database/seeder/factory.go similarity index 99% rename from database/factory.go rename to database/seeder/factory.go index e870bbd57..20bacd8d8 100644 --- a/database/factory.go +++ b/database/seeder/factory.go @@ -1,4 +1,4 @@ -package database +package seeder import ( "errors" diff --git a/database/factory_test.go b/database/seeder/factory_test.go similarity index 98% rename from database/factory_test.go rename to database/seeder/factory_test.go index aaae64503..830a0b0ad 100644 --- a/database/factory_test.go +++ b/database/seeder/factory_test.go @@ -1,4 +1,4 @@ -package database +package seeder import ( "log" @@ -17,6 +17,13 @@ import ( "github.com/goravel/framework/support/env" ) +type User struct { + orm.Model + orm.SoftDeletes + Name string + Avatar string +} + func (u *User) Factory() factory.Factory { return &UserFactory{} } diff --git a/database/seeder/main_test.go b/database/seeder/main_test.go new file mode 100644 index 000000000..8df9d0a3e --- /dev/null +++ b/database/seeder/main_test.go @@ -0,0 +1,31 @@ +package seeder + +import ( + "log" + "testing" + + supportdocker "github.com/goravel/framework/support/docker" + "github.com/goravel/framework/support/env" +) + +var testDatabaseDocker *supportdocker.Database + +func TestMain(m *testing.M) { + if !env.IsWindows() { + var err error + testDatabaseDocker, err = supportdocker.InitDatabase() + if err != nil { + log.Fatalf("Init docker error: %s", err) + } + } + + m.Run() + + if !env.IsWindows() { + defer func() { + if err := testDatabaseDocker.Stop(); err != nil { + log.Fatalf("Stop docker error: %s", err) + } + }() + } +} diff --git a/database/seeder.go b/database/seeder/seeder.go similarity index 77% rename from database/seeder.go rename to database/seeder/seeder.go index 862dff481..ddd855709 100644 --- a/database/seeder.go +++ b/database/seeder/seeder.go @@ -1,20 +1,21 @@ -package database +package seeder import ( "github.com/gookit/color" + "github.com/goravel/framework/contracts/database/seeder" ) -type SeederFacade struct { +type Seeder struct { Seeders []seeder.Seeder Called []string } -func NewSeederFacade() *SeederFacade { - return &SeederFacade{} +func NewSeeder() *Seeder { + return &Seeder{} } -func (s *SeederFacade) Register(seeders []seeder.Seeder) { +func (s *Seeder) Register(seeders []seeder.Seeder) { existingSignatures := make(map[string]bool) for _, seeder := range seeders { @@ -29,7 +30,7 @@ func (s *SeederFacade) Register(seeders []seeder.Seeder) { } } -func (s *SeederFacade) GetSeeder(name string) seeder.Seeder { +func (s *Seeder) GetSeeder(name string) seeder.Seeder { var seeder seeder.Seeder for _, item := range s.Seeders { if item.Signature() == name { @@ -41,12 +42,12 @@ func (s *SeederFacade) GetSeeder(name string) seeder.Seeder { return seeder } -func (s *SeederFacade) GetSeeders() []seeder.Seeder { +func (s *Seeder) GetSeeders() []seeder.Seeder { return s.Seeders } // Call executes the specified seeder(s). -func (s *SeederFacade) Call(seeders []seeder.Seeder) error { +func (s *Seeder) Call(seeders []seeder.Seeder) error { for _, seeder := range seeders { signature := seeder.Signature() @@ -62,7 +63,7 @@ func (s *SeederFacade) Call(seeders []seeder.Seeder) error { } // CallOnce executes the specified seeder(s) only if they haven't been executed before. -func (s *SeederFacade) CallOnce(seeders []seeder.Seeder) error { +func (s *Seeder) CallOnce(seeders []seeder.Seeder) error { for _, item := range seeders { signature := item.Signature() diff --git a/database/seeder_test.go b/database/seeder/seeder_test.go similarity index 96% rename from database/seeder_test.go rename to database/seeder/seeder_test.go index 7c97a7cf5..bfb52d120 100644 --- a/database/seeder_test.go +++ b/database/seeder/seeder_test.go @@ -1,4 +1,4 @@ -package database +package seeder import ( "log" @@ -11,7 +11,7 @@ import ( type SeederTestSuite struct { suite.Suite - seederFacade *SeederFacade + seederFacade *Seeder } func TestSeederTestSuite(t *testing.T) { @@ -19,7 +19,7 @@ func TestSeederTestSuite(t *testing.T) { } func (s *SeederTestSuite) SetupTest() { - s.seederFacade = NewSeederFacade() + s.seederFacade = NewSeeder() } func (s *SeederTestSuite) TestRegister() { diff --git a/database/service_provider.go b/database/service_provider.go index 315f57f41..2b59052f8 100644 --- a/database/service_provider.go +++ b/database/service_provider.go @@ -7,9 +7,12 @@ import ( consolecontract "github.com/goravel/framework/contracts/console" "github.com/goravel/framework/contracts/foundation" "github.com/goravel/framework/database/console" + "github.com/goravel/framework/database/schema" + "github.com/goravel/framework/database/seeder" ) const BindingOrm = "goravel.orm" +const BindingSchema = "goravel.schema" const BindingSeeder = "goravel.seeder" type ServiceProvider struct { @@ -27,8 +30,11 @@ func (database *ServiceProvider) Register(app foundation.Application) { return orm, nil }) + app.Bind(BindingSchema, func(app foundation.Application) (any, error) { + return schema.NewSchema("", app.MakeConfig(), app.MakeOrm(), app.MakeLog()) + }) app.Singleton(BindingSeeder, func(app foundation.Application) (any, error) { - return NewSeederFacade(), nil + return seeder.NewSeeder(), nil }) } diff --git a/facades/schema.go b/facades/schema.go new file mode 100644 index 000000000..a1b43afc4 --- /dev/null +++ b/facades/schema.go @@ -0,0 +1,9 @@ +package facades + +import ( + "github.com/goravel/framework/contracts/database/schema" +) + +func Schema() schema.Schema { + return App().MakeSchema() +} diff --git a/foundation/container.go b/foundation/container.go index 2206a9317..a4d114bfa 100644 --- a/foundation/container.go +++ b/foundation/container.go @@ -18,6 +18,7 @@ import ( consolecontract "github.com/goravel/framework/contracts/console" cryptcontract "github.com/goravel/framework/contracts/crypt" ormcontract "github.com/goravel/framework/contracts/database/orm" + schemacontract "github.com/goravel/framework/contracts/database/schema" seerdercontract "github.com/goravel/framework/contracts/database/seeder" eventcontract "github.com/goravel/framework/contracts/event" filesystemcontract "github.com/goravel/framework/contracts/filesystem" @@ -256,6 +257,28 @@ func (c *Container) MakeSchedule() schedulecontract.Schedule { return instance.(schedulecontract.Schedule) } +func (c *Container) MakeSchema() schemacontract.Schema { + instance, err := c.Make(database.BindingSchema) + + if err != nil { + color.Redln(err) + return nil + } + + return instance.(schemacontract.Schema) +} + +func (c *Container) MakeSeeder() seerdercontract.Facade { + instance, err := c.Make(database.BindingSeeder) + + if err != nil { + color.Redln(err) + return nil + } + + return instance.(seerdercontract.Facade) +} + func (c *Container) MakeSession() sessioncontract.Manager { instance, err := c.Make(session.Binding) if err != nil { @@ -306,17 +329,6 @@ func (c *Container) MakeView() httpcontract.View { return instance.(httpcontract.View) } -func (c *Container) MakeSeeder() seerdercontract.Facade { - instance, err := c.Make(database.BindingSeeder) - - if err != nil { - color.Redln(err) - return nil - } - - return instance.(seerdercontract.Facade) -} - func (c *Container) MakeWith(key any, parameters map[string]any) (any, error) { return c.make(key, parameters) } diff --git a/mocks/auth/Auth.go b/mocks/auth/Auth.go index 2d9aafda9..8391a9e48 100644 --- a/mocks/auth/Auth.go +++ b/mocks/auth/Auth.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,10 +12,22 @@ type Auth struct { mock.Mock } +type Auth_Expecter struct { + mock *mock.Mock +} + +func (_m *Auth) EXPECT() *Auth_Expecter { + return &Auth_Expecter{mock: &_m.Mock} +} + // Guard provides a mock function with given fields: name func (_m *Auth) Guard(name string) auth.Auth { ret := _m.Called(name) + if len(ret) == 0 { + panic("no return value specified for Guard") + } + var r0 auth.Auth if rf, ok := ret.Get(0).(func(string) auth.Auth); ok { r0 = rf(name) @@ -28,10 +40,42 @@ func (_m *Auth) Guard(name string) auth.Auth { return r0 } +// Auth_Guard_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Guard' +type Auth_Guard_Call struct { + *mock.Call +} + +// Guard is a helper method to define mock.On call +// - name string +func (_e *Auth_Expecter) Guard(name interface{}) *Auth_Guard_Call { + return &Auth_Guard_Call{Call: _e.mock.On("Guard", name)} +} + +func (_c *Auth_Guard_Call) Run(run func(name string)) *Auth_Guard_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Auth_Guard_Call) Return(_a0 auth.Auth) *Auth_Guard_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Auth_Guard_Call) RunAndReturn(run func(string) auth.Auth) *Auth_Guard_Call { + _c.Call.Return(run) + return _c +} + // Login provides a mock function with given fields: user func (_m *Auth) Login(user interface{}) (string, error) { ret := _m.Called(user) + if len(ret) == 0 { + panic("no return value specified for Login") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func(interface{}) (string, error)); ok { @@ -52,10 +96,42 @@ func (_m *Auth) Login(user interface{}) (string, error) { return r0, r1 } +// Auth_Login_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Login' +type Auth_Login_Call struct { + *mock.Call +} + +// Login is a helper method to define mock.On call +// - user interface{} +func (_e *Auth_Expecter) Login(user interface{}) *Auth_Login_Call { + return &Auth_Login_Call{Call: _e.mock.On("Login", user)} +} + +func (_c *Auth_Login_Call) Run(run func(user interface{})) *Auth_Login_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Auth_Login_Call) Return(token string, err error) *Auth_Login_Call { + _c.Call.Return(token, err) + return _c +} + +func (_c *Auth_Login_Call) RunAndReturn(run func(interface{}) (string, error)) *Auth_Login_Call { + _c.Call.Return(run) + return _c +} + // LoginUsingID provides a mock function with given fields: id func (_m *Auth) LoginUsingID(id interface{}) (string, error) { ret := _m.Called(id) + if len(ret) == 0 { + panic("no return value specified for LoginUsingID") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func(interface{}) (string, error)); ok { @@ -76,10 +152,42 @@ func (_m *Auth) LoginUsingID(id interface{}) (string, error) { return r0, r1 } +// Auth_LoginUsingID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoginUsingID' +type Auth_LoginUsingID_Call struct { + *mock.Call +} + +// LoginUsingID is a helper method to define mock.On call +// - id interface{} +func (_e *Auth_Expecter) LoginUsingID(id interface{}) *Auth_LoginUsingID_Call { + return &Auth_LoginUsingID_Call{Call: _e.mock.On("LoginUsingID", id)} +} + +func (_c *Auth_LoginUsingID_Call) Run(run func(id interface{})) *Auth_LoginUsingID_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Auth_LoginUsingID_Call) Return(token string, err error) *Auth_LoginUsingID_Call { + _c.Call.Return(token, err) + return _c +} + +func (_c *Auth_LoginUsingID_Call) RunAndReturn(run func(interface{}) (string, error)) *Auth_LoginUsingID_Call { + _c.Call.Return(run) + return _c +} + // Logout provides a mock function with given fields: func (_m *Auth) Logout() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Logout") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -90,10 +198,41 @@ func (_m *Auth) Logout() error { return r0 } +// Auth_Logout_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Logout' +type Auth_Logout_Call struct { + *mock.Call +} + +// Logout is a helper method to define mock.On call +func (_e *Auth_Expecter) Logout() *Auth_Logout_Call { + return &Auth_Logout_Call{Call: _e.mock.On("Logout")} +} + +func (_c *Auth_Logout_Call) Run(run func()) *Auth_Logout_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Auth_Logout_Call) Return(_a0 error) *Auth_Logout_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Auth_Logout_Call) RunAndReturn(run func() error) *Auth_Logout_Call { + _c.Call.Return(run) + return _c +} + // Parse provides a mock function with given fields: token func (_m *Auth) Parse(token string) (*auth.Payload, error) { ret := _m.Called(token) + if len(ret) == 0 { + panic("no return value specified for Parse") + } + var r0 *auth.Payload var r1 error if rf, ok := ret.Get(0).(func(string) (*auth.Payload, error)); ok { @@ -116,10 +255,42 @@ func (_m *Auth) Parse(token string) (*auth.Payload, error) { return r0, r1 } +// Auth_Parse_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Parse' +type Auth_Parse_Call struct { + *mock.Call +} + +// Parse is a helper method to define mock.On call +// - token string +func (_e *Auth_Expecter) Parse(token interface{}) *Auth_Parse_Call { + return &Auth_Parse_Call{Call: _e.mock.On("Parse", token)} +} + +func (_c *Auth_Parse_Call) Run(run func(token string)) *Auth_Parse_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Auth_Parse_Call) Return(_a0 *auth.Payload, _a1 error) *Auth_Parse_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Auth_Parse_Call) RunAndReturn(run func(string) (*auth.Payload, error)) *Auth_Parse_Call { + _c.Call.Return(run) + return _c +} + // Refresh provides a mock function with given fields: func (_m *Auth) Refresh() (string, error) { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Refresh") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func() (string, error)); ok { @@ -140,10 +311,41 @@ func (_m *Auth) Refresh() (string, error) { return r0, r1 } +// Auth_Refresh_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Refresh' +type Auth_Refresh_Call struct { + *mock.Call +} + +// Refresh is a helper method to define mock.On call +func (_e *Auth_Expecter) Refresh() *Auth_Refresh_Call { + return &Auth_Refresh_Call{Call: _e.mock.On("Refresh")} +} + +func (_c *Auth_Refresh_Call) Run(run func()) *Auth_Refresh_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Auth_Refresh_Call) Return(token string, err error) *Auth_Refresh_Call { + _c.Call.Return(token, err) + return _c +} + +func (_c *Auth_Refresh_Call) RunAndReturn(run func() (string, error)) *Auth_Refresh_Call { + _c.Call.Return(run) + return _c +} + // User provides a mock function with given fields: user func (_m *Auth) User(user interface{}) error { ret := _m.Called(user) + if len(ret) == 0 { + panic("no return value specified for User") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}) error); ok { r0 = rf(user) @@ -154,6 +356,34 @@ func (_m *Auth) User(user interface{}) error { return r0 } +// Auth_User_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'User' +type Auth_User_Call struct { + *mock.Call +} + +// User is a helper method to define mock.On call +// - user interface{} +func (_e *Auth_Expecter) User(user interface{}) *Auth_User_Call { + return &Auth_User_Call{Call: _e.mock.On("User", user)} +} + +func (_c *Auth_User_Call) Run(run func(user interface{})) *Auth_User_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Auth_User_Call) Return(_a0 error) *Auth_User_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Auth_User_Call) RunAndReturn(run func(interface{}) error) *Auth_User_Call { + _c.Call.Return(run) + return _c +} + // NewAuth creates a new instance of Auth. 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 NewAuth(t interface { diff --git a/mocks/auth/access/Gate.go b/mocks/auth/access/Gate.go index 376efc099..da65287bc 100644 --- a/mocks/auth/access/Gate.go +++ b/mocks/auth/access/Gate.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -15,15 +15,55 @@ type Gate struct { mock.Mock } +type Gate_Expecter struct { + mock *mock.Mock +} + +func (_m *Gate) EXPECT() *Gate_Expecter { + return &Gate_Expecter{mock: &_m.Mock} +} + // After provides a mock function with given fields: callback func (_m *Gate) After(callback func(context.Context, string, map[string]interface{}, access.Response) access.Response) { _m.Called(callback) } +// Gate_After_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'After' +type Gate_After_Call struct { + *mock.Call +} + +// After is a helper method to define mock.On call +// - callback func(context.Context , string , map[string]interface{} , access.Response) access.Response +func (_e *Gate_Expecter) After(callback interface{}) *Gate_After_Call { + return &Gate_After_Call{Call: _e.mock.On("After", callback)} +} + +func (_c *Gate_After_Call) Run(run func(callback func(context.Context, string, map[string]interface{}, access.Response) access.Response)) *Gate_After_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(func(context.Context, string, map[string]interface{}, access.Response) access.Response)) + }) + return _c +} + +func (_c *Gate_After_Call) Return() *Gate_After_Call { + _c.Call.Return() + return _c +} + +func (_c *Gate_After_Call) RunAndReturn(run func(func(context.Context, string, map[string]interface{}, access.Response) access.Response)) *Gate_After_Call { + _c.Call.Return(run) + return _c +} + // Allows provides a mock function with given fields: ability, arguments func (_m *Gate) Allows(ability string, arguments map[string]interface{}) bool { ret := _m.Called(ability, arguments) + if len(ret) == 0 { + panic("no return value specified for Allows") + } + var r0 bool if rf, ok := ret.Get(0).(func(string, map[string]interface{}) bool); ok { r0 = rf(ability, arguments) @@ -34,10 +74,43 @@ func (_m *Gate) Allows(ability string, arguments map[string]interface{}) bool { return r0 } +// Gate_Allows_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Allows' +type Gate_Allows_Call struct { + *mock.Call +} + +// Allows is a helper method to define mock.On call +// - ability string +// - arguments map[string]interface{} +func (_e *Gate_Expecter) Allows(ability interface{}, arguments interface{}) *Gate_Allows_Call { + return &Gate_Allows_Call{Call: _e.mock.On("Allows", ability, arguments)} +} + +func (_c *Gate_Allows_Call) Run(run func(ability string, arguments map[string]interface{})) *Gate_Allows_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(map[string]interface{})) + }) + return _c +} + +func (_c *Gate_Allows_Call) Return(_a0 bool) *Gate_Allows_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Gate_Allows_Call) RunAndReturn(run func(string, map[string]interface{}) bool) *Gate_Allows_Call { + _c.Call.Return(run) + return _c +} + // Any provides a mock function with given fields: abilities, arguments func (_m *Gate) Any(abilities []string, arguments map[string]interface{}) bool { ret := _m.Called(abilities, arguments) + if len(ret) == 0 { + panic("no return value specified for Any") + } + var r0 bool if rf, ok := ret.Get(0).(func([]string, map[string]interface{}) bool); ok { r0 = rf(abilities, arguments) @@ -48,20 +121,110 @@ func (_m *Gate) Any(abilities []string, arguments map[string]interface{}) bool { return r0 } +// Gate_Any_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Any' +type Gate_Any_Call struct { + *mock.Call +} + +// Any is a helper method to define mock.On call +// - abilities []string +// - arguments map[string]interface{} +func (_e *Gate_Expecter) Any(abilities interface{}, arguments interface{}) *Gate_Any_Call { + return &Gate_Any_Call{Call: _e.mock.On("Any", abilities, arguments)} +} + +func (_c *Gate_Any_Call) Run(run func(abilities []string, arguments map[string]interface{})) *Gate_Any_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]string), args[1].(map[string]interface{})) + }) + return _c +} + +func (_c *Gate_Any_Call) Return(_a0 bool) *Gate_Any_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Gate_Any_Call) RunAndReturn(run func([]string, map[string]interface{}) bool) *Gate_Any_Call { + _c.Call.Return(run) + return _c +} + // Before provides a mock function with given fields: callback func (_m *Gate) Before(callback func(context.Context, string, map[string]interface{}) access.Response) { _m.Called(callback) } +// Gate_Before_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Before' +type Gate_Before_Call struct { + *mock.Call +} + +// Before is a helper method to define mock.On call +// - callback func(context.Context , string , map[string]interface{}) access.Response +func (_e *Gate_Expecter) Before(callback interface{}) *Gate_Before_Call { + return &Gate_Before_Call{Call: _e.mock.On("Before", callback)} +} + +func (_c *Gate_Before_Call) Run(run func(callback func(context.Context, string, map[string]interface{}) access.Response)) *Gate_Before_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(func(context.Context, string, map[string]interface{}) access.Response)) + }) + return _c +} + +func (_c *Gate_Before_Call) Return() *Gate_Before_Call { + _c.Call.Return() + return _c +} + +func (_c *Gate_Before_Call) RunAndReturn(run func(func(context.Context, string, map[string]interface{}) access.Response)) *Gate_Before_Call { + _c.Call.Return(run) + return _c +} + // Define provides a mock function with given fields: ability, callback func (_m *Gate) Define(ability string, callback func(context.Context, map[string]interface{}) access.Response) { _m.Called(ability, callback) } +// Gate_Define_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Define' +type Gate_Define_Call struct { + *mock.Call +} + +// Define is a helper method to define mock.On call +// - ability string +// - callback func(context.Context , map[string]interface{}) access.Response +func (_e *Gate_Expecter) Define(ability interface{}, callback interface{}) *Gate_Define_Call { + return &Gate_Define_Call{Call: _e.mock.On("Define", ability, callback)} +} + +func (_c *Gate_Define_Call) Run(run func(ability string, callback func(context.Context, map[string]interface{}) access.Response)) *Gate_Define_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(func(context.Context, map[string]interface{}) access.Response)) + }) + return _c +} + +func (_c *Gate_Define_Call) Return() *Gate_Define_Call { + _c.Call.Return() + return _c +} + +func (_c *Gate_Define_Call) RunAndReturn(run func(string, func(context.Context, map[string]interface{}) access.Response)) *Gate_Define_Call { + _c.Call.Return(run) + return _c +} + // Denies provides a mock function with given fields: ability, arguments func (_m *Gate) Denies(ability string, arguments map[string]interface{}) bool { ret := _m.Called(ability, arguments) + if len(ret) == 0 { + panic("no return value specified for Denies") + } + var r0 bool if rf, ok := ret.Get(0).(func(string, map[string]interface{}) bool); ok { r0 = rf(ability, arguments) @@ -72,10 +235,43 @@ func (_m *Gate) Denies(ability string, arguments map[string]interface{}) bool { return r0 } +// Gate_Denies_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Denies' +type Gate_Denies_Call struct { + *mock.Call +} + +// Denies is a helper method to define mock.On call +// - ability string +// - arguments map[string]interface{} +func (_e *Gate_Expecter) Denies(ability interface{}, arguments interface{}) *Gate_Denies_Call { + return &Gate_Denies_Call{Call: _e.mock.On("Denies", ability, arguments)} +} + +func (_c *Gate_Denies_Call) Run(run func(ability string, arguments map[string]interface{})) *Gate_Denies_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(map[string]interface{})) + }) + return _c +} + +func (_c *Gate_Denies_Call) Return(_a0 bool) *Gate_Denies_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Gate_Denies_Call) RunAndReturn(run func(string, map[string]interface{}) bool) *Gate_Denies_Call { + _c.Call.Return(run) + return _c +} + // Inspect provides a mock function with given fields: ability, arguments func (_m *Gate) Inspect(ability string, arguments map[string]interface{}) access.Response { ret := _m.Called(ability, arguments) + if len(ret) == 0 { + panic("no return value specified for Inspect") + } + var r0 access.Response if rf, ok := ret.Get(0).(func(string, map[string]interface{}) access.Response); ok { r0 = rf(ability, arguments) @@ -88,10 +284,43 @@ func (_m *Gate) Inspect(ability string, arguments map[string]interface{}) access return r0 } +// Gate_Inspect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Inspect' +type Gate_Inspect_Call struct { + *mock.Call +} + +// Inspect is a helper method to define mock.On call +// - ability string +// - arguments map[string]interface{} +func (_e *Gate_Expecter) Inspect(ability interface{}, arguments interface{}) *Gate_Inspect_Call { + return &Gate_Inspect_Call{Call: _e.mock.On("Inspect", ability, arguments)} +} + +func (_c *Gate_Inspect_Call) Run(run func(ability string, arguments map[string]interface{})) *Gate_Inspect_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(map[string]interface{})) + }) + return _c +} + +func (_c *Gate_Inspect_Call) Return(_a0 access.Response) *Gate_Inspect_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Gate_Inspect_Call) RunAndReturn(run func(string, map[string]interface{}) access.Response) *Gate_Inspect_Call { + _c.Call.Return(run) + return _c +} + // None provides a mock function with given fields: abilities, arguments func (_m *Gate) None(abilities []string, arguments map[string]interface{}) bool { ret := _m.Called(abilities, arguments) + if len(ret) == 0 { + panic("no return value specified for None") + } + var r0 bool if rf, ok := ret.Get(0).(func([]string, map[string]interface{}) bool); ok { r0 = rf(abilities, arguments) @@ -102,10 +331,43 @@ func (_m *Gate) None(abilities []string, arguments map[string]interface{}) bool return r0 } +// Gate_None_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'None' +type Gate_None_Call struct { + *mock.Call +} + +// None is a helper method to define mock.On call +// - abilities []string +// - arguments map[string]interface{} +func (_e *Gate_Expecter) None(abilities interface{}, arguments interface{}) *Gate_None_Call { + return &Gate_None_Call{Call: _e.mock.On("None", abilities, arguments)} +} + +func (_c *Gate_None_Call) Run(run func(abilities []string, arguments map[string]interface{})) *Gate_None_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]string), args[1].(map[string]interface{})) + }) + return _c +} + +func (_c *Gate_None_Call) Return(_a0 bool) *Gate_None_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Gate_None_Call) RunAndReturn(run func([]string, map[string]interface{}) bool) *Gate_None_Call { + _c.Call.Return(run) + return _c +} + // WithContext provides a mock function with given fields: ctx func (_m *Gate) WithContext(ctx context.Context) access.Gate { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for WithContext") + } + var r0 access.Gate if rf, ok := ret.Get(0).(func(context.Context) access.Gate); ok { r0 = rf(ctx) @@ -118,6 +380,34 @@ func (_m *Gate) WithContext(ctx context.Context) access.Gate { return r0 } +// Gate_WithContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithContext' +type Gate_WithContext_Call struct { + *mock.Call +} + +// WithContext is a helper method to define mock.On call +// - ctx context.Context +func (_e *Gate_Expecter) WithContext(ctx interface{}) *Gate_WithContext_Call { + return &Gate_WithContext_Call{Call: _e.mock.On("WithContext", ctx)} +} + +func (_c *Gate_WithContext_Call) Run(run func(ctx context.Context)) *Gate_WithContext_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Gate_WithContext_Call) Return(_a0 access.Gate) *Gate_WithContext_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Gate_WithContext_Call) RunAndReturn(run func(context.Context) access.Gate) *Gate_WithContext_Call { + _c.Call.Return(run) + return _c +} + // NewGate creates a new instance of Gate. 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 NewGate(t interface { diff --git a/mocks/auth/access/Response.go b/mocks/auth/access/Response.go index 116a0f5a8..e2e12b641 100644 --- a/mocks/auth/access/Response.go +++ b/mocks/auth/access/Response.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -9,10 +9,22 @@ type Response struct { mock.Mock } +type Response_Expecter struct { + mock *mock.Mock +} + +func (_m *Response) EXPECT() *Response_Expecter { + return &Response_Expecter{mock: &_m.Mock} +} + // Allowed provides a mock function with given fields: func (_m *Response) Allowed() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Allowed") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -23,10 +35,41 @@ func (_m *Response) Allowed() bool { return r0 } +// Response_Allowed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Allowed' +type Response_Allowed_Call struct { + *mock.Call +} + +// Allowed is a helper method to define mock.On call +func (_e *Response_Expecter) Allowed() *Response_Allowed_Call { + return &Response_Allowed_Call{Call: _e.mock.On("Allowed")} +} + +func (_c *Response_Allowed_Call) Run(run func()) *Response_Allowed_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Response_Allowed_Call) Return(_a0 bool) *Response_Allowed_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Response_Allowed_Call) RunAndReturn(run func() bool) *Response_Allowed_Call { + _c.Call.Return(run) + return _c +} + // Message provides a mock function with given fields: func (_m *Response) Message() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Message") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -37,6 +80,33 @@ func (_m *Response) Message() string { return r0 } +// Response_Message_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Message' +type Response_Message_Call struct { + *mock.Call +} + +// Message is a helper method to define mock.On call +func (_e *Response_Expecter) Message() *Response_Message_Call { + return &Response_Message_Call{Call: _e.mock.On("Message")} +} + +func (_c *Response_Message_Call) Run(run func()) *Response_Message_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Response_Message_Call) Return(_a0 string) *Response_Message_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Response_Message_Call) RunAndReturn(run func() string) *Response_Message_Call { + _c.Call.Return(run) + return _c +} + // NewResponse creates a new instance of Response. 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 NewResponse(t interface { diff --git a/mocks/cache/Cache.go b/mocks/cache/Cache.go index e0b0b9838..328260db2 100644 --- a/mocks/cache/Cache.go +++ b/mocks/cache/Cache.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -17,10 +17,22 @@ type Cache struct { mock.Mock } +type Cache_Expecter struct { + mock *mock.Mock +} + +func (_m *Cache) EXPECT() *Cache_Expecter { + return &Cache_Expecter{mock: &_m.Mock} +} + // Add provides a mock function with given fields: key, value, t func (_m *Cache) Add(key string, value interface{}, t time.Duration) bool { ret := _m.Called(key, value, t) + if len(ret) == 0 { + panic("no return value specified for Add") + } + var r0 bool if rf, ok := ret.Get(0).(func(string, interface{}, time.Duration) bool); ok { r0 = rf(key, value, t) @@ -31,6 +43,36 @@ func (_m *Cache) Add(key string, value interface{}, t time.Duration) bool { return r0 } +// Cache_Add_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Add' +type Cache_Add_Call struct { + *mock.Call +} + +// Add is a helper method to define mock.On call +// - key string +// - value interface{} +// - t time.Duration +func (_e *Cache_Expecter) Add(key interface{}, value interface{}, t interface{}) *Cache_Add_Call { + return &Cache_Add_Call{Call: _e.mock.On("Add", key, value, t)} +} + +func (_c *Cache_Add_Call) Run(run func(key string, value interface{}, t time.Duration)) *Cache_Add_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(interface{}), args[2].(time.Duration)) + }) + return _c +} + +func (_c *Cache_Add_Call) Return(_a0 bool) *Cache_Add_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Cache_Add_Call) RunAndReturn(run func(string, interface{}, time.Duration) bool) *Cache_Add_Call { + _c.Call.Return(run) + return _c +} + // Decrement provides a mock function with given fields: key, value func (_m *Cache) Decrement(key string, value ...int) (int, error) { _va := make([]interface{}, len(value)) @@ -42,6 +84,10 @@ func (_m *Cache) Decrement(key string, value ...int) (int, error) { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Decrement") + } + var r0 int var r1 error if rf, ok := ret.Get(0).(func(string, ...int) (int, error)); ok { @@ -62,10 +108,50 @@ func (_m *Cache) Decrement(key string, value ...int) (int, error) { return r0, r1 } +// Cache_Decrement_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Decrement' +type Cache_Decrement_Call struct { + *mock.Call +} + +// Decrement is a helper method to define mock.On call +// - key string +// - value ...int +func (_e *Cache_Expecter) Decrement(key interface{}, value ...interface{}) *Cache_Decrement_Call { + return &Cache_Decrement_Call{Call: _e.mock.On("Decrement", + append([]interface{}{key}, value...)...)} +} + +func (_c *Cache_Decrement_Call) Run(run func(key string, value ...int)) *Cache_Decrement_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]int, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(int) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Cache_Decrement_Call) Return(_a0 int, _a1 error) *Cache_Decrement_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Cache_Decrement_Call) RunAndReturn(run func(string, ...int) (int, error)) *Cache_Decrement_Call { + _c.Call.Return(run) + return _c +} + // Flush provides a mock function with given fields: func (_m *Cache) Flush() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Flush") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -76,10 +162,41 @@ func (_m *Cache) Flush() bool { return r0 } +// Cache_Flush_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Flush' +type Cache_Flush_Call struct { + *mock.Call +} + +// Flush is a helper method to define mock.On call +func (_e *Cache_Expecter) Flush() *Cache_Flush_Call { + return &Cache_Flush_Call{Call: _e.mock.On("Flush")} +} + +func (_c *Cache_Flush_Call) Run(run func()) *Cache_Flush_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Cache_Flush_Call) Return(_a0 bool) *Cache_Flush_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Cache_Flush_Call) RunAndReturn(run func() bool) *Cache_Flush_Call { + _c.Call.Return(run) + return _c +} + // Forever provides a mock function with given fields: key, value func (_m *Cache) Forever(key string, value interface{}) bool { ret := _m.Called(key, value) + if len(ret) == 0 { + panic("no return value specified for Forever") + } + var r0 bool if rf, ok := ret.Get(0).(func(string, interface{}) bool); ok { r0 = rf(key, value) @@ -90,10 +207,43 @@ func (_m *Cache) Forever(key string, value interface{}) bool { return r0 } +// Cache_Forever_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Forever' +type Cache_Forever_Call struct { + *mock.Call +} + +// Forever is a helper method to define mock.On call +// - key string +// - value interface{} +func (_e *Cache_Expecter) Forever(key interface{}, value interface{}) *Cache_Forever_Call { + return &Cache_Forever_Call{Call: _e.mock.On("Forever", key, value)} +} + +func (_c *Cache_Forever_Call) Run(run func(key string, value interface{})) *Cache_Forever_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(interface{})) + }) + return _c +} + +func (_c *Cache_Forever_Call) Return(_a0 bool) *Cache_Forever_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Cache_Forever_Call) RunAndReturn(run func(string, interface{}) bool) *Cache_Forever_Call { + _c.Call.Return(run) + return _c +} + // Forget provides a mock function with given fields: key func (_m *Cache) Forget(key string) bool { ret := _m.Called(key) + if len(ret) == 0 { + panic("no return value specified for Forget") + } + var r0 bool if rf, ok := ret.Get(0).(func(string) bool); ok { r0 = rf(key) @@ -104,6 +254,34 @@ func (_m *Cache) Forget(key string) bool { return r0 } +// Cache_Forget_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Forget' +type Cache_Forget_Call struct { + *mock.Call +} + +// Forget is a helper method to define mock.On call +// - key string +func (_e *Cache_Expecter) Forget(key interface{}) *Cache_Forget_Call { + return &Cache_Forget_Call{Call: _e.mock.On("Forget", key)} +} + +func (_c *Cache_Forget_Call) Run(run func(key string)) *Cache_Forget_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Cache_Forget_Call) Return(_a0 bool) *Cache_Forget_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Cache_Forget_Call) RunAndReturn(run func(string) bool) *Cache_Forget_Call { + _c.Call.Return(run) + return _c +} + // Get provides a mock function with given fields: key, def func (_m *Cache) Get(key string, def ...interface{}) interface{} { var _ca []interface{} @@ -111,6 +289,10 @@ func (_m *Cache) Get(key string, def ...interface{}) interface{} { _ca = append(_ca, def...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Get") + } + var r0 interface{} if rf, ok := ret.Get(0).(func(string, ...interface{}) interface{}); ok { r0 = rf(key, def...) @@ -123,6 +305,42 @@ func (_m *Cache) Get(key string, def ...interface{}) interface{} { return r0 } +// Cache_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type Cache_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - key string +// - def ...interface{} +func (_e *Cache_Expecter) Get(key interface{}, def ...interface{}) *Cache_Get_Call { + return &Cache_Get_Call{Call: _e.mock.On("Get", + append([]interface{}{key}, def...)...)} +} + +func (_c *Cache_Get_Call) Run(run func(key string, def ...interface{})) *Cache_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Cache_Get_Call) Return(_a0 interface{}) *Cache_Get_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Cache_Get_Call) RunAndReturn(run func(string, ...interface{}) interface{}) *Cache_Get_Call { + _c.Call.Return(run) + return _c +} + // GetBool provides a mock function with given fields: key, def func (_m *Cache) GetBool(key string, def ...bool) bool { _va := make([]interface{}, len(def)) @@ -134,6 +352,10 @@ func (_m *Cache) GetBool(key string, def ...bool) bool { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for GetBool") + } + var r0 bool if rf, ok := ret.Get(0).(func(string, ...bool) bool); ok { r0 = rf(key, def...) @@ -144,6 +366,42 @@ func (_m *Cache) GetBool(key string, def ...bool) bool { return r0 } +// Cache_GetBool_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBool' +type Cache_GetBool_Call struct { + *mock.Call +} + +// GetBool is a helper method to define mock.On call +// - key string +// - def ...bool +func (_e *Cache_Expecter) GetBool(key interface{}, def ...interface{}) *Cache_GetBool_Call { + return &Cache_GetBool_Call{Call: _e.mock.On("GetBool", + append([]interface{}{key}, def...)...)} +} + +func (_c *Cache_GetBool_Call) Run(run func(key string, def ...bool)) *Cache_GetBool_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]bool, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(bool) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Cache_GetBool_Call) Return(_a0 bool) *Cache_GetBool_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Cache_GetBool_Call) RunAndReturn(run func(string, ...bool) bool) *Cache_GetBool_Call { + _c.Call.Return(run) + return _c +} + // GetInt provides a mock function with given fields: key, def func (_m *Cache) GetInt(key string, def ...int) int { _va := make([]interface{}, len(def)) @@ -155,6 +413,10 @@ func (_m *Cache) GetInt(key string, def ...int) int { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for GetInt") + } + var r0 int if rf, ok := ret.Get(0).(func(string, ...int) int); ok { r0 = rf(key, def...) @@ -165,6 +427,42 @@ func (_m *Cache) GetInt(key string, def ...int) int { return r0 } +// Cache_GetInt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetInt' +type Cache_GetInt_Call struct { + *mock.Call +} + +// GetInt is a helper method to define mock.On call +// - key string +// - def ...int +func (_e *Cache_Expecter) GetInt(key interface{}, def ...interface{}) *Cache_GetInt_Call { + return &Cache_GetInt_Call{Call: _e.mock.On("GetInt", + append([]interface{}{key}, def...)...)} +} + +func (_c *Cache_GetInt_Call) Run(run func(key string, def ...int)) *Cache_GetInt_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]int, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(int) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Cache_GetInt_Call) Return(_a0 int) *Cache_GetInt_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Cache_GetInt_Call) RunAndReturn(run func(string, ...int) int) *Cache_GetInt_Call { + _c.Call.Return(run) + return _c +} + // GetInt64 provides a mock function with given fields: key, def func (_m *Cache) GetInt64(key string, def ...int64) int64 { _va := make([]interface{}, len(def)) @@ -176,6 +474,10 @@ func (_m *Cache) GetInt64(key string, def ...int64) int64 { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for GetInt64") + } + var r0 int64 if rf, ok := ret.Get(0).(func(string, ...int64) int64); ok { r0 = rf(key, def...) @@ -186,6 +488,42 @@ func (_m *Cache) GetInt64(key string, def ...int64) int64 { return r0 } +// Cache_GetInt64_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetInt64' +type Cache_GetInt64_Call struct { + *mock.Call +} + +// GetInt64 is a helper method to define mock.On call +// - key string +// - def ...int64 +func (_e *Cache_Expecter) GetInt64(key interface{}, def ...interface{}) *Cache_GetInt64_Call { + return &Cache_GetInt64_Call{Call: _e.mock.On("GetInt64", + append([]interface{}{key}, def...)...)} +} + +func (_c *Cache_GetInt64_Call) Run(run func(key string, def ...int64)) *Cache_GetInt64_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]int64, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(int64) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Cache_GetInt64_Call) Return(_a0 int64) *Cache_GetInt64_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Cache_GetInt64_Call) RunAndReturn(run func(string, ...int64) int64) *Cache_GetInt64_Call { + _c.Call.Return(run) + return _c +} + // GetString provides a mock function with given fields: key, def func (_m *Cache) GetString(key string, def ...string) string { _va := make([]interface{}, len(def)) @@ -197,6 +535,10 @@ func (_m *Cache) GetString(key string, def ...string) string { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for GetString") + } + var r0 string if rf, ok := ret.Get(0).(func(string, ...string) string); ok { r0 = rf(key, def...) @@ -207,10 +549,50 @@ func (_m *Cache) GetString(key string, def ...string) string { return r0 } +// Cache_GetString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetString' +type Cache_GetString_Call struct { + *mock.Call +} + +// GetString is a helper method to define mock.On call +// - key string +// - def ...string +func (_e *Cache_Expecter) GetString(key interface{}, def ...interface{}) *Cache_GetString_Call { + return &Cache_GetString_Call{Call: _e.mock.On("GetString", + append([]interface{}{key}, def...)...)} +} + +func (_c *Cache_GetString_Call) Run(run func(key string, def ...string)) *Cache_GetString_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Cache_GetString_Call) Return(_a0 string) *Cache_GetString_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Cache_GetString_Call) RunAndReturn(run func(string, ...string) string) *Cache_GetString_Call { + _c.Call.Return(run) + return _c +} + // Has provides a mock function with given fields: key func (_m *Cache) Has(key string) bool { ret := _m.Called(key) + if len(ret) == 0 { + panic("no return value specified for Has") + } + var r0 bool if rf, ok := ret.Get(0).(func(string) bool); ok { r0 = rf(key) @@ -221,6 +603,34 @@ func (_m *Cache) Has(key string) bool { return r0 } +// Cache_Has_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Has' +type Cache_Has_Call struct { + *mock.Call +} + +// Has is a helper method to define mock.On call +// - key string +func (_e *Cache_Expecter) Has(key interface{}) *Cache_Has_Call { + return &Cache_Has_Call{Call: _e.mock.On("Has", key)} +} + +func (_c *Cache_Has_Call) Run(run func(key string)) *Cache_Has_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Cache_Has_Call) Return(_a0 bool) *Cache_Has_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Cache_Has_Call) RunAndReturn(run func(string) bool) *Cache_Has_Call { + _c.Call.Return(run) + return _c +} + // Increment provides a mock function with given fields: key, value func (_m *Cache) Increment(key string, value ...int) (int, error) { _va := make([]interface{}, len(value)) @@ -232,6 +642,10 @@ func (_m *Cache) Increment(key string, value ...int) (int, error) { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Increment") + } + var r0 int var r1 error if rf, ok := ret.Get(0).(func(string, ...int) (int, error)); ok { @@ -252,6 +666,42 @@ func (_m *Cache) Increment(key string, value ...int) (int, error) { return r0, r1 } +// Cache_Increment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Increment' +type Cache_Increment_Call struct { + *mock.Call +} + +// Increment is a helper method to define mock.On call +// - key string +// - value ...int +func (_e *Cache_Expecter) Increment(key interface{}, value ...interface{}) *Cache_Increment_Call { + return &Cache_Increment_Call{Call: _e.mock.On("Increment", + append([]interface{}{key}, value...)...)} +} + +func (_c *Cache_Increment_Call) Run(run func(key string, value ...int)) *Cache_Increment_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]int, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(int) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Cache_Increment_Call) Return(_a0 int, _a1 error) *Cache_Increment_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Cache_Increment_Call) RunAndReturn(run func(string, ...int) (int, error)) *Cache_Increment_Call { + _c.Call.Return(run) + return _c +} + // Lock provides a mock function with given fields: key, t func (_m *Cache) Lock(key string, t ...time.Duration) cache.Lock { _va := make([]interface{}, len(t)) @@ -263,6 +713,10 @@ func (_m *Cache) Lock(key string, t ...time.Duration) cache.Lock { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Lock") + } + var r0 cache.Lock if rf, ok := ret.Get(0).(func(string, ...time.Duration) cache.Lock); ok { r0 = rf(key, t...) @@ -275,6 +729,42 @@ func (_m *Cache) Lock(key string, t ...time.Duration) cache.Lock { return r0 } +// Cache_Lock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Lock' +type Cache_Lock_Call struct { + *mock.Call +} + +// Lock is a helper method to define mock.On call +// - key string +// - t ...time.Duration +func (_e *Cache_Expecter) Lock(key interface{}, t ...interface{}) *Cache_Lock_Call { + return &Cache_Lock_Call{Call: _e.mock.On("Lock", + append([]interface{}{key}, t...)...)} +} + +func (_c *Cache_Lock_Call) Run(run func(key string, t ...time.Duration)) *Cache_Lock_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]time.Duration, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(time.Duration) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Cache_Lock_Call) Return(_a0 cache.Lock) *Cache_Lock_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Cache_Lock_Call) RunAndReturn(run func(string, ...time.Duration) cache.Lock) *Cache_Lock_Call { + _c.Call.Return(run) + return _c +} + // Pull provides a mock function with given fields: key, def func (_m *Cache) Pull(key string, def ...interface{}) interface{} { var _ca []interface{} @@ -282,6 +772,10 @@ func (_m *Cache) Pull(key string, def ...interface{}) interface{} { _ca = append(_ca, def...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Pull") + } + var r0 interface{} if rf, ok := ret.Get(0).(func(string, ...interface{}) interface{}); ok { r0 = rf(key, def...) @@ -294,10 +788,50 @@ func (_m *Cache) Pull(key string, def ...interface{}) interface{} { return r0 } +// Cache_Pull_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Pull' +type Cache_Pull_Call struct { + *mock.Call +} + +// Pull is a helper method to define mock.On call +// - key string +// - def ...interface{} +func (_e *Cache_Expecter) Pull(key interface{}, def ...interface{}) *Cache_Pull_Call { + return &Cache_Pull_Call{Call: _e.mock.On("Pull", + append([]interface{}{key}, def...)...)} +} + +func (_c *Cache_Pull_Call) Run(run func(key string, def ...interface{})) *Cache_Pull_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Cache_Pull_Call) Return(_a0 interface{}) *Cache_Pull_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Cache_Pull_Call) RunAndReturn(run func(string, ...interface{}) interface{}) *Cache_Pull_Call { + _c.Call.Return(run) + return _c +} + // Put provides a mock function with given fields: key, value, t func (_m *Cache) Put(key string, value interface{}, t time.Duration) error { ret := _m.Called(key, value, t) + if len(ret) == 0 { + panic("no return value specified for Put") + } + var r0 error if rf, ok := ret.Get(0).(func(string, interface{}, time.Duration) error); ok { r0 = rf(key, value, t) @@ -308,10 +842,44 @@ func (_m *Cache) Put(key string, value interface{}, t time.Duration) error { return r0 } +// Cache_Put_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Put' +type Cache_Put_Call struct { + *mock.Call +} + +// Put is a helper method to define mock.On call +// - key string +// - value interface{} +// - t time.Duration +func (_e *Cache_Expecter) Put(key interface{}, value interface{}, t interface{}) *Cache_Put_Call { + return &Cache_Put_Call{Call: _e.mock.On("Put", key, value, t)} +} + +func (_c *Cache_Put_Call) Run(run func(key string, value interface{}, t time.Duration)) *Cache_Put_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(interface{}), args[2].(time.Duration)) + }) + return _c +} + +func (_c *Cache_Put_Call) Return(_a0 error) *Cache_Put_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Cache_Put_Call) RunAndReturn(run func(string, interface{}, time.Duration) error) *Cache_Put_Call { + _c.Call.Return(run) + return _c +} + // Remember provides a mock function with given fields: key, ttl, callback func (_m *Cache) Remember(key string, ttl time.Duration, callback func() (interface{}, error)) (interface{}, error) { ret := _m.Called(key, ttl, callback) + if len(ret) == 0 { + panic("no return value specified for Remember") + } + var r0 interface{} var r1 error if rf, ok := ret.Get(0).(func(string, time.Duration, func() (interface{}, error)) (interface{}, error)); ok { @@ -334,10 +902,44 @@ func (_m *Cache) Remember(key string, ttl time.Duration, callback func() (interf return r0, r1 } +// Cache_Remember_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Remember' +type Cache_Remember_Call struct { + *mock.Call +} + +// Remember is a helper method to define mock.On call +// - key string +// - ttl time.Duration +// - callback func()(interface{} , error) +func (_e *Cache_Expecter) Remember(key interface{}, ttl interface{}, callback interface{}) *Cache_Remember_Call { + return &Cache_Remember_Call{Call: _e.mock.On("Remember", key, ttl, callback)} +} + +func (_c *Cache_Remember_Call) Run(run func(key string, ttl time.Duration, callback func() (interface{}, error))) *Cache_Remember_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(time.Duration), args[2].(func() (interface{}, error))) + }) + return _c +} + +func (_c *Cache_Remember_Call) Return(_a0 interface{}, _a1 error) *Cache_Remember_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Cache_Remember_Call) RunAndReturn(run func(string, time.Duration, func() (interface{}, error)) (interface{}, error)) *Cache_Remember_Call { + _c.Call.Return(run) + return _c +} + // RememberForever provides a mock function with given fields: key, callback func (_m *Cache) RememberForever(key string, callback func() (interface{}, error)) (interface{}, error) { ret := _m.Called(key, callback) + if len(ret) == 0 { + panic("no return value specified for RememberForever") + } + var r0 interface{} var r1 error if rf, ok := ret.Get(0).(func(string, func() (interface{}, error)) (interface{}, error)); ok { @@ -360,10 +962,43 @@ func (_m *Cache) RememberForever(key string, callback func() (interface{}, error return r0, r1 } +// Cache_RememberForever_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RememberForever' +type Cache_RememberForever_Call struct { + *mock.Call +} + +// RememberForever is a helper method to define mock.On call +// - key string +// - callback func()(interface{} , error) +func (_e *Cache_Expecter) RememberForever(key interface{}, callback interface{}) *Cache_RememberForever_Call { + return &Cache_RememberForever_Call{Call: _e.mock.On("RememberForever", key, callback)} +} + +func (_c *Cache_RememberForever_Call) Run(run func(key string, callback func() (interface{}, error))) *Cache_RememberForever_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(func() (interface{}, error))) + }) + return _c +} + +func (_c *Cache_RememberForever_Call) Return(_a0 interface{}, _a1 error) *Cache_RememberForever_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Cache_RememberForever_Call) RunAndReturn(run func(string, func() (interface{}, error)) (interface{}, error)) *Cache_RememberForever_Call { + _c.Call.Return(run) + return _c +} + // Store provides a mock function with given fields: name func (_m *Cache) Store(name string) cache.Driver { ret := _m.Called(name) + if len(ret) == 0 { + panic("no return value specified for Store") + } + var r0 cache.Driver if rf, ok := ret.Get(0).(func(string) cache.Driver); ok { r0 = rf(name) @@ -376,10 +1011,42 @@ func (_m *Cache) Store(name string) cache.Driver { return r0 } +// Cache_Store_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Store' +type Cache_Store_Call struct { + *mock.Call +} + +// Store is a helper method to define mock.On call +// - name string +func (_e *Cache_Expecter) Store(name interface{}) *Cache_Store_Call { + return &Cache_Store_Call{Call: _e.mock.On("Store", name)} +} + +func (_c *Cache_Store_Call) Run(run func(name string)) *Cache_Store_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Cache_Store_Call) Return(_a0 cache.Driver) *Cache_Store_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Cache_Store_Call) RunAndReturn(run func(string) cache.Driver) *Cache_Store_Call { + _c.Call.Return(run) + return _c +} + // WithContext provides a mock function with given fields: ctx func (_m *Cache) WithContext(ctx context.Context) cache.Driver { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for WithContext") + } + var r0 cache.Driver if rf, ok := ret.Get(0).(func(context.Context) cache.Driver); ok { r0 = rf(ctx) @@ -392,6 +1059,34 @@ func (_m *Cache) WithContext(ctx context.Context) cache.Driver { return r0 } +// Cache_WithContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithContext' +type Cache_WithContext_Call struct { + *mock.Call +} + +// WithContext is a helper method to define mock.On call +// - ctx context.Context +func (_e *Cache_Expecter) WithContext(ctx interface{}) *Cache_WithContext_Call { + return &Cache_WithContext_Call{Call: _e.mock.On("WithContext", ctx)} +} + +func (_c *Cache_WithContext_Call) Run(run func(ctx context.Context)) *Cache_WithContext_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Cache_WithContext_Call) Return(_a0 cache.Driver) *Cache_WithContext_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Cache_WithContext_Call) RunAndReturn(run func(context.Context) cache.Driver) *Cache_WithContext_Call { + _c.Call.Return(run) + return _c +} + // NewCache creates a new instance of Cache. 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 NewCache(t interface { diff --git a/mocks/cache/Driver.go b/mocks/cache/Driver.go index fd5404eab..52d077b63 100644 --- a/mocks/cache/Driver.go +++ b/mocks/cache/Driver.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -17,10 +17,22 @@ type Driver struct { mock.Mock } +type Driver_Expecter struct { + mock *mock.Mock +} + +func (_m *Driver) EXPECT() *Driver_Expecter { + return &Driver_Expecter{mock: &_m.Mock} +} + // Add provides a mock function with given fields: key, value, t func (_m *Driver) Add(key string, value interface{}, t time.Duration) bool { ret := _m.Called(key, value, t) + if len(ret) == 0 { + panic("no return value specified for Add") + } + var r0 bool if rf, ok := ret.Get(0).(func(string, interface{}, time.Duration) bool); ok { r0 = rf(key, value, t) @@ -31,6 +43,36 @@ func (_m *Driver) Add(key string, value interface{}, t time.Duration) bool { return r0 } +// Driver_Add_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Add' +type Driver_Add_Call struct { + *mock.Call +} + +// Add is a helper method to define mock.On call +// - key string +// - value interface{} +// - t time.Duration +func (_e *Driver_Expecter) Add(key interface{}, value interface{}, t interface{}) *Driver_Add_Call { + return &Driver_Add_Call{Call: _e.mock.On("Add", key, value, t)} +} + +func (_c *Driver_Add_Call) Run(run func(key string, value interface{}, t time.Duration)) *Driver_Add_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(interface{}), args[2].(time.Duration)) + }) + return _c +} + +func (_c *Driver_Add_Call) Return(_a0 bool) *Driver_Add_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_Add_Call) RunAndReturn(run func(string, interface{}, time.Duration) bool) *Driver_Add_Call { + _c.Call.Return(run) + return _c +} + // Decrement provides a mock function with given fields: key, value func (_m *Driver) Decrement(key string, value ...int) (int, error) { _va := make([]interface{}, len(value)) @@ -42,6 +84,10 @@ func (_m *Driver) Decrement(key string, value ...int) (int, error) { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Decrement") + } + var r0 int var r1 error if rf, ok := ret.Get(0).(func(string, ...int) (int, error)); ok { @@ -62,10 +108,50 @@ func (_m *Driver) Decrement(key string, value ...int) (int, error) { return r0, r1 } +// Driver_Decrement_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Decrement' +type Driver_Decrement_Call struct { + *mock.Call +} + +// Decrement is a helper method to define mock.On call +// - key string +// - value ...int +func (_e *Driver_Expecter) Decrement(key interface{}, value ...interface{}) *Driver_Decrement_Call { + return &Driver_Decrement_Call{Call: _e.mock.On("Decrement", + append([]interface{}{key}, value...)...)} +} + +func (_c *Driver_Decrement_Call) Run(run func(key string, value ...int)) *Driver_Decrement_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]int, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(int) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Driver_Decrement_Call) Return(_a0 int, _a1 error) *Driver_Decrement_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Driver_Decrement_Call) RunAndReturn(run func(string, ...int) (int, error)) *Driver_Decrement_Call { + _c.Call.Return(run) + return _c +} + // Flush provides a mock function with given fields: func (_m *Driver) Flush() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Flush") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -76,10 +162,41 @@ func (_m *Driver) Flush() bool { return r0 } +// Driver_Flush_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Flush' +type Driver_Flush_Call struct { + *mock.Call +} + +// Flush is a helper method to define mock.On call +func (_e *Driver_Expecter) Flush() *Driver_Flush_Call { + return &Driver_Flush_Call{Call: _e.mock.On("Flush")} +} + +func (_c *Driver_Flush_Call) Run(run func()) *Driver_Flush_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Driver_Flush_Call) Return(_a0 bool) *Driver_Flush_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_Flush_Call) RunAndReturn(run func() bool) *Driver_Flush_Call { + _c.Call.Return(run) + return _c +} + // Forever provides a mock function with given fields: key, value func (_m *Driver) Forever(key string, value interface{}) bool { ret := _m.Called(key, value) + if len(ret) == 0 { + panic("no return value specified for Forever") + } + var r0 bool if rf, ok := ret.Get(0).(func(string, interface{}) bool); ok { r0 = rf(key, value) @@ -90,10 +207,43 @@ func (_m *Driver) Forever(key string, value interface{}) bool { return r0 } +// Driver_Forever_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Forever' +type Driver_Forever_Call struct { + *mock.Call +} + +// Forever is a helper method to define mock.On call +// - key string +// - value interface{} +func (_e *Driver_Expecter) Forever(key interface{}, value interface{}) *Driver_Forever_Call { + return &Driver_Forever_Call{Call: _e.mock.On("Forever", key, value)} +} + +func (_c *Driver_Forever_Call) Run(run func(key string, value interface{})) *Driver_Forever_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(interface{})) + }) + return _c +} + +func (_c *Driver_Forever_Call) Return(_a0 bool) *Driver_Forever_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_Forever_Call) RunAndReturn(run func(string, interface{}) bool) *Driver_Forever_Call { + _c.Call.Return(run) + return _c +} + // Forget provides a mock function with given fields: key func (_m *Driver) Forget(key string) bool { ret := _m.Called(key) + if len(ret) == 0 { + panic("no return value specified for Forget") + } + var r0 bool if rf, ok := ret.Get(0).(func(string) bool); ok { r0 = rf(key) @@ -104,6 +254,34 @@ func (_m *Driver) Forget(key string) bool { return r0 } +// Driver_Forget_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Forget' +type Driver_Forget_Call struct { + *mock.Call +} + +// Forget is a helper method to define mock.On call +// - key string +func (_e *Driver_Expecter) Forget(key interface{}) *Driver_Forget_Call { + return &Driver_Forget_Call{Call: _e.mock.On("Forget", key)} +} + +func (_c *Driver_Forget_Call) Run(run func(key string)) *Driver_Forget_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Driver_Forget_Call) Return(_a0 bool) *Driver_Forget_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_Forget_Call) RunAndReturn(run func(string) bool) *Driver_Forget_Call { + _c.Call.Return(run) + return _c +} + // Get provides a mock function with given fields: key, def func (_m *Driver) Get(key string, def ...interface{}) interface{} { var _ca []interface{} @@ -111,6 +289,10 @@ func (_m *Driver) Get(key string, def ...interface{}) interface{} { _ca = append(_ca, def...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Get") + } + var r0 interface{} if rf, ok := ret.Get(0).(func(string, ...interface{}) interface{}); ok { r0 = rf(key, def...) @@ -123,6 +305,42 @@ func (_m *Driver) Get(key string, def ...interface{}) interface{} { return r0 } +// Driver_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type Driver_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - key string +// - def ...interface{} +func (_e *Driver_Expecter) Get(key interface{}, def ...interface{}) *Driver_Get_Call { + return &Driver_Get_Call{Call: _e.mock.On("Get", + append([]interface{}{key}, def...)...)} +} + +func (_c *Driver_Get_Call) Run(run func(key string, def ...interface{})) *Driver_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Driver_Get_Call) Return(_a0 interface{}) *Driver_Get_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_Get_Call) RunAndReturn(run func(string, ...interface{}) interface{}) *Driver_Get_Call { + _c.Call.Return(run) + return _c +} + // GetBool provides a mock function with given fields: key, def func (_m *Driver) GetBool(key string, def ...bool) bool { _va := make([]interface{}, len(def)) @@ -134,6 +352,10 @@ func (_m *Driver) GetBool(key string, def ...bool) bool { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for GetBool") + } + var r0 bool if rf, ok := ret.Get(0).(func(string, ...bool) bool); ok { r0 = rf(key, def...) @@ -144,6 +366,42 @@ func (_m *Driver) GetBool(key string, def ...bool) bool { return r0 } +// Driver_GetBool_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBool' +type Driver_GetBool_Call struct { + *mock.Call +} + +// GetBool is a helper method to define mock.On call +// - key string +// - def ...bool +func (_e *Driver_Expecter) GetBool(key interface{}, def ...interface{}) *Driver_GetBool_Call { + return &Driver_GetBool_Call{Call: _e.mock.On("GetBool", + append([]interface{}{key}, def...)...)} +} + +func (_c *Driver_GetBool_Call) Run(run func(key string, def ...bool)) *Driver_GetBool_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]bool, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(bool) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Driver_GetBool_Call) Return(_a0 bool) *Driver_GetBool_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_GetBool_Call) RunAndReturn(run func(string, ...bool) bool) *Driver_GetBool_Call { + _c.Call.Return(run) + return _c +} + // GetInt provides a mock function with given fields: key, def func (_m *Driver) GetInt(key string, def ...int) int { _va := make([]interface{}, len(def)) @@ -155,6 +413,10 @@ func (_m *Driver) GetInt(key string, def ...int) int { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for GetInt") + } + var r0 int if rf, ok := ret.Get(0).(func(string, ...int) int); ok { r0 = rf(key, def...) @@ -165,6 +427,42 @@ func (_m *Driver) GetInt(key string, def ...int) int { return r0 } +// Driver_GetInt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetInt' +type Driver_GetInt_Call struct { + *mock.Call +} + +// GetInt is a helper method to define mock.On call +// - key string +// - def ...int +func (_e *Driver_Expecter) GetInt(key interface{}, def ...interface{}) *Driver_GetInt_Call { + return &Driver_GetInt_Call{Call: _e.mock.On("GetInt", + append([]interface{}{key}, def...)...)} +} + +func (_c *Driver_GetInt_Call) Run(run func(key string, def ...int)) *Driver_GetInt_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]int, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(int) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Driver_GetInt_Call) Return(_a0 int) *Driver_GetInt_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_GetInt_Call) RunAndReturn(run func(string, ...int) int) *Driver_GetInt_Call { + _c.Call.Return(run) + return _c +} + // GetInt64 provides a mock function with given fields: key, def func (_m *Driver) GetInt64(key string, def ...int64) int64 { _va := make([]interface{}, len(def)) @@ -176,6 +474,10 @@ func (_m *Driver) GetInt64(key string, def ...int64) int64 { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for GetInt64") + } + var r0 int64 if rf, ok := ret.Get(0).(func(string, ...int64) int64); ok { r0 = rf(key, def...) @@ -186,6 +488,42 @@ func (_m *Driver) GetInt64(key string, def ...int64) int64 { return r0 } +// Driver_GetInt64_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetInt64' +type Driver_GetInt64_Call struct { + *mock.Call +} + +// GetInt64 is a helper method to define mock.On call +// - key string +// - def ...int64 +func (_e *Driver_Expecter) GetInt64(key interface{}, def ...interface{}) *Driver_GetInt64_Call { + return &Driver_GetInt64_Call{Call: _e.mock.On("GetInt64", + append([]interface{}{key}, def...)...)} +} + +func (_c *Driver_GetInt64_Call) Run(run func(key string, def ...int64)) *Driver_GetInt64_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]int64, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(int64) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Driver_GetInt64_Call) Return(_a0 int64) *Driver_GetInt64_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_GetInt64_Call) RunAndReturn(run func(string, ...int64) int64) *Driver_GetInt64_Call { + _c.Call.Return(run) + return _c +} + // GetString provides a mock function with given fields: key, def func (_m *Driver) GetString(key string, def ...string) string { _va := make([]interface{}, len(def)) @@ -197,6 +535,10 @@ func (_m *Driver) GetString(key string, def ...string) string { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for GetString") + } + var r0 string if rf, ok := ret.Get(0).(func(string, ...string) string); ok { r0 = rf(key, def...) @@ -207,10 +549,50 @@ func (_m *Driver) GetString(key string, def ...string) string { return r0 } +// Driver_GetString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetString' +type Driver_GetString_Call struct { + *mock.Call +} + +// GetString is a helper method to define mock.On call +// - key string +// - def ...string +func (_e *Driver_Expecter) GetString(key interface{}, def ...interface{}) *Driver_GetString_Call { + return &Driver_GetString_Call{Call: _e.mock.On("GetString", + append([]interface{}{key}, def...)...)} +} + +func (_c *Driver_GetString_Call) Run(run func(key string, def ...string)) *Driver_GetString_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Driver_GetString_Call) Return(_a0 string) *Driver_GetString_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_GetString_Call) RunAndReturn(run func(string, ...string) string) *Driver_GetString_Call { + _c.Call.Return(run) + return _c +} + // Has provides a mock function with given fields: key func (_m *Driver) Has(key string) bool { ret := _m.Called(key) + if len(ret) == 0 { + panic("no return value specified for Has") + } + var r0 bool if rf, ok := ret.Get(0).(func(string) bool); ok { r0 = rf(key) @@ -221,6 +603,34 @@ func (_m *Driver) Has(key string) bool { return r0 } +// Driver_Has_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Has' +type Driver_Has_Call struct { + *mock.Call +} + +// Has is a helper method to define mock.On call +// - key string +func (_e *Driver_Expecter) Has(key interface{}) *Driver_Has_Call { + return &Driver_Has_Call{Call: _e.mock.On("Has", key)} +} + +func (_c *Driver_Has_Call) Run(run func(key string)) *Driver_Has_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Driver_Has_Call) Return(_a0 bool) *Driver_Has_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_Has_Call) RunAndReturn(run func(string) bool) *Driver_Has_Call { + _c.Call.Return(run) + return _c +} + // Increment provides a mock function with given fields: key, value func (_m *Driver) Increment(key string, value ...int) (int, error) { _va := make([]interface{}, len(value)) @@ -232,6 +642,10 @@ func (_m *Driver) Increment(key string, value ...int) (int, error) { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Increment") + } + var r0 int var r1 error if rf, ok := ret.Get(0).(func(string, ...int) (int, error)); ok { @@ -252,6 +666,42 @@ func (_m *Driver) Increment(key string, value ...int) (int, error) { return r0, r1 } +// Driver_Increment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Increment' +type Driver_Increment_Call struct { + *mock.Call +} + +// Increment is a helper method to define mock.On call +// - key string +// - value ...int +func (_e *Driver_Expecter) Increment(key interface{}, value ...interface{}) *Driver_Increment_Call { + return &Driver_Increment_Call{Call: _e.mock.On("Increment", + append([]interface{}{key}, value...)...)} +} + +func (_c *Driver_Increment_Call) Run(run func(key string, value ...int)) *Driver_Increment_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]int, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(int) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Driver_Increment_Call) Return(_a0 int, _a1 error) *Driver_Increment_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Driver_Increment_Call) RunAndReturn(run func(string, ...int) (int, error)) *Driver_Increment_Call { + _c.Call.Return(run) + return _c +} + // Lock provides a mock function with given fields: key, t func (_m *Driver) Lock(key string, t ...time.Duration) cache.Lock { _va := make([]interface{}, len(t)) @@ -263,6 +713,10 @@ func (_m *Driver) Lock(key string, t ...time.Duration) cache.Lock { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Lock") + } + var r0 cache.Lock if rf, ok := ret.Get(0).(func(string, ...time.Duration) cache.Lock); ok { r0 = rf(key, t...) @@ -275,6 +729,42 @@ func (_m *Driver) Lock(key string, t ...time.Duration) cache.Lock { return r0 } +// Driver_Lock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Lock' +type Driver_Lock_Call struct { + *mock.Call +} + +// Lock is a helper method to define mock.On call +// - key string +// - t ...time.Duration +func (_e *Driver_Expecter) Lock(key interface{}, t ...interface{}) *Driver_Lock_Call { + return &Driver_Lock_Call{Call: _e.mock.On("Lock", + append([]interface{}{key}, t...)...)} +} + +func (_c *Driver_Lock_Call) Run(run func(key string, t ...time.Duration)) *Driver_Lock_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]time.Duration, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(time.Duration) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Driver_Lock_Call) Return(_a0 cache.Lock) *Driver_Lock_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_Lock_Call) RunAndReturn(run func(string, ...time.Duration) cache.Lock) *Driver_Lock_Call { + _c.Call.Return(run) + return _c +} + // Pull provides a mock function with given fields: key, def func (_m *Driver) Pull(key string, def ...interface{}) interface{} { var _ca []interface{} @@ -282,6 +772,10 @@ func (_m *Driver) Pull(key string, def ...interface{}) interface{} { _ca = append(_ca, def...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Pull") + } + var r0 interface{} if rf, ok := ret.Get(0).(func(string, ...interface{}) interface{}); ok { r0 = rf(key, def...) @@ -294,10 +788,50 @@ func (_m *Driver) Pull(key string, def ...interface{}) interface{} { return r0 } +// Driver_Pull_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Pull' +type Driver_Pull_Call struct { + *mock.Call +} + +// Pull is a helper method to define mock.On call +// - key string +// - def ...interface{} +func (_e *Driver_Expecter) Pull(key interface{}, def ...interface{}) *Driver_Pull_Call { + return &Driver_Pull_Call{Call: _e.mock.On("Pull", + append([]interface{}{key}, def...)...)} +} + +func (_c *Driver_Pull_Call) Run(run func(key string, def ...interface{})) *Driver_Pull_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Driver_Pull_Call) Return(_a0 interface{}) *Driver_Pull_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_Pull_Call) RunAndReturn(run func(string, ...interface{}) interface{}) *Driver_Pull_Call { + _c.Call.Return(run) + return _c +} + // Put provides a mock function with given fields: key, value, t func (_m *Driver) Put(key string, value interface{}, t time.Duration) error { ret := _m.Called(key, value, t) + if len(ret) == 0 { + panic("no return value specified for Put") + } + var r0 error if rf, ok := ret.Get(0).(func(string, interface{}, time.Duration) error); ok { r0 = rf(key, value, t) @@ -308,10 +842,44 @@ func (_m *Driver) Put(key string, value interface{}, t time.Duration) error { return r0 } +// Driver_Put_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Put' +type Driver_Put_Call struct { + *mock.Call +} + +// Put is a helper method to define mock.On call +// - key string +// - value interface{} +// - t time.Duration +func (_e *Driver_Expecter) Put(key interface{}, value interface{}, t interface{}) *Driver_Put_Call { + return &Driver_Put_Call{Call: _e.mock.On("Put", key, value, t)} +} + +func (_c *Driver_Put_Call) Run(run func(key string, value interface{}, t time.Duration)) *Driver_Put_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(interface{}), args[2].(time.Duration)) + }) + return _c +} + +func (_c *Driver_Put_Call) Return(_a0 error) *Driver_Put_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_Put_Call) RunAndReturn(run func(string, interface{}, time.Duration) error) *Driver_Put_Call { + _c.Call.Return(run) + return _c +} + // Remember provides a mock function with given fields: key, ttl, callback func (_m *Driver) Remember(key string, ttl time.Duration, callback func() (interface{}, error)) (interface{}, error) { ret := _m.Called(key, ttl, callback) + if len(ret) == 0 { + panic("no return value specified for Remember") + } + var r0 interface{} var r1 error if rf, ok := ret.Get(0).(func(string, time.Duration, func() (interface{}, error)) (interface{}, error)); ok { @@ -334,10 +902,44 @@ func (_m *Driver) Remember(key string, ttl time.Duration, callback func() (inter return r0, r1 } +// Driver_Remember_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Remember' +type Driver_Remember_Call struct { + *mock.Call +} + +// Remember is a helper method to define mock.On call +// - key string +// - ttl time.Duration +// - callback func()(interface{} , error) +func (_e *Driver_Expecter) Remember(key interface{}, ttl interface{}, callback interface{}) *Driver_Remember_Call { + return &Driver_Remember_Call{Call: _e.mock.On("Remember", key, ttl, callback)} +} + +func (_c *Driver_Remember_Call) Run(run func(key string, ttl time.Duration, callback func() (interface{}, error))) *Driver_Remember_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(time.Duration), args[2].(func() (interface{}, error))) + }) + return _c +} + +func (_c *Driver_Remember_Call) Return(_a0 interface{}, _a1 error) *Driver_Remember_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Driver_Remember_Call) RunAndReturn(run func(string, time.Duration, func() (interface{}, error)) (interface{}, error)) *Driver_Remember_Call { + _c.Call.Return(run) + return _c +} + // RememberForever provides a mock function with given fields: key, callback func (_m *Driver) RememberForever(key string, callback func() (interface{}, error)) (interface{}, error) { ret := _m.Called(key, callback) + if len(ret) == 0 { + panic("no return value specified for RememberForever") + } + var r0 interface{} var r1 error if rf, ok := ret.Get(0).(func(string, func() (interface{}, error)) (interface{}, error)); ok { @@ -360,10 +962,43 @@ func (_m *Driver) RememberForever(key string, callback func() (interface{}, erro return r0, r1 } +// Driver_RememberForever_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RememberForever' +type Driver_RememberForever_Call struct { + *mock.Call +} + +// RememberForever is a helper method to define mock.On call +// - key string +// - callback func()(interface{} , error) +func (_e *Driver_Expecter) RememberForever(key interface{}, callback interface{}) *Driver_RememberForever_Call { + return &Driver_RememberForever_Call{Call: _e.mock.On("RememberForever", key, callback)} +} + +func (_c *Driver_RememberForever_Call) Run(run func(key string, callback func() (interface{}, error))) *Driver_RememberForever_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(func() (interface{}, error))) + }) + return _c +} + +func (_c *Driver_RememberForever_Call) Return(_a0 interface{}, _a1 error) *Driver_RememberForever_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Driver_RememberForever_Call) RunAndReturn(run func(string, func() (interface{}, error)) (interface{}, error)) *Driver_RememberForever_Call { + _c.Call.Return(run) + return _c +} + // WithContext provides a mock function with given fields: ctx func (_m *Driver) WithContext(ctx context.Context) cache.Driver { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for WithContext") + } + var r0 cache.Driver if rf, ok := ret.Get(0).(func(context.Context) cache.Driver); ok { r0 = rf(ctx) @@ -376,6 +1011,34 @@ func (_m *Driver) WithContext(ctx context.Context) cache.Driver { return r0 } +// Driver_WithContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithContext' +type Driver_WithContext_Call struct { + *mock.Call +} + +// WithContext is a helper method to define mock.On call +// - ctx context.Context +func (_e *Driver_Expecter) WithContext(ctx interface{}) *Driver_WithContext_Call { + return &Driver_WithContext_Call{Call: _e.mock.On("WithContext", ctx)} +} + +func (_c *Driver_WithContext_Call) Run(run func(ctx context.Context)) *Driver_WithContext_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Driver_WithContext_Call) Return(_a0 cache.Driver) *Driver_WithContext_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_WithContext_Call) RunAndReturn(run func(context.Context) cache.Driver) *Driver_WithContext_Call { + _c.Call.Return(run) + return _c +} + // NewDriver creates a new instance of Driver. 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 NewDriver(t interface { diff --git a/mocks/cache/Lock.go b/mocks/cache/Lock.go index b9787937e..96937b018 100644 --- a/mocks/cache/Lock.go +++ b/mocks/cache/Lock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -13,6 +13,14 @@ type Lock struct { mock.Mock } +type Lock_Expecter struct { + mock *mock.Mock +} + +func (_m *Lock) EXPECT() *Lock_Expecter { + return &Lock_Expecter{mock: &_m.Mock} +} + // Block provides a mock function with given fields: t, callback func (_m *Lock) Block(t time.Duration, callback ...func()) bool { _va := make([]interface{}, len(callback)) @@ -24,6 +32,10 @@ func (_m *Lock) Block(t time.Duration, callback ...func()) bool { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Block") + } + var r0 bool if rf, ok := ret.Get(0).(func(time.Duration, ...func()) bool); ok { r0 = rf(t, callback...) @@ -34,10 +46,50 @@ func (_m *Lock) Block(t time.Duration, callback ...func()) bool { return r0 } +// Lock_Block_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Block' +type Lock_Block_Call struct { + *mock.Call +} + +// Block is a helper method to define mock.On call +// - t time.Duration +// - callback ...func() +func (_e *Lock_Expecter) Block(t interface{}, callback ...interface{}) *Lock_Block_Call { + return &Lock_Block_Call{Call: _e.mock.On("Block", + append([]interface{}{t}, callback...)...)} +} + +func (_c *Lock_Block_Call) Run(run func(t time.Duration, callback ...func())) *Lock_Block_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(), len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(func()) + } + } + run(args[0].(time.Duration), variadicArgs...) + }) + return _c +} + +func (_c *Lock_Block_Call) Return(_a0 bool) *Lock_Block_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Lock_Block_Call) RunAndReturn(run func(time.Duration, ...func()) bool) *Lock_Block_Call { + _c.Call.Return(run) + return _c +} + // ForceRelease provides a mock function with given fields: func (_m *Lock) ForceRelease() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for ForceRelease") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -48,6 +100,33 @@ func (_m *Lock) ForceRelease() bool { return r0 } +// Lock_ForceRelease_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ForceRelease' +type Lock_ForceRelease_Call struct { + *mock.Call +} + +// ForceRelease is a helper method to define mock.On call +func (_e *Lock_Expecter) ForceRelease() *Lock_ForceRelease_Call { + return &Lock_ForceRelease_Call{Call: _e.mock.On("ForceRelease")} +} + +func (_c *Lock_ForceRelease_Call) Run(run func()) *Lock_ForceRelease_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Lock_ForceRelease_Call) Return(_a0 bool) *Lock_ForceRelease_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Lock_ForceRelease_Call) RunAndReturn(run func() bool) *Lock_ForceRelease_Call { + _c.Call.Return(run) + return _c +} + // Get provides a mock function with given fields: callback func (_m *Lock) Get(callback ...func()) bool { _va := make([]interface{}, len(callback)) @@ -58,6 +137,10 @@ func (_m *Lock) Get(callback ...func()) bool { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Get") + } + var r0 bool if rf, ok := ret.Get(0).(func(...func()) bool); ok { r0 = rf(callback...) @@ -68,10 +151,49 @@ func (_m *Lock) Get(callback ...func()) bool { return r0 } +// Lock_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type Lock_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - callback ...func() +func (_e *Lock_Expecter) Get(callback ...interface{}) *Lock_Get_Call { + return &Lock_Get_Call{Call: _e.mock.On("Get", + append([]interface{}{}, callback...)...)} +} + +func (_c *Lock_Get_Call) Run(run func(callback ...func())) *Lock_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(), len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(func()) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Lock_Get_Call) Return(_a0 bool) *Lock_Get_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Lock_Get_Call) RunAndReturn(run func(...func()) bool) *Lock_Get_Call { + _c.Call.Return(run) + return _c +} + // Release provides a mock function with given fields: func (_m *Lock) Release() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Release") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -82,6 +204,33 @@ func (_m *Lock) Release() bool { return r0 } +// Lock_Release_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Release' +type Lock_Release_Call struct { + *mock.Call +} + +// Release is a helper method to define mock.On call +func (_e *Lock_Expecter) Release() *Lock_Release_Call { + return &Lock_Release_Call{Call: _e.mock.On("Release")} +} + +func (_c *Lock_Release_Call) Run(run func()) *Lock_Release_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Lock_Release_Call) Return(_a0 bool) *Lock_Release_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Lock_Release_Call) RunAndReturn(run func() bool) *Lock_Release_Call { + _c.Call.Return(run) + return _c +} + // NewLock creates a new instance of Lock. 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 NewLock(t interface { diff --git a/mocks/config/Config.go b/mocks/config/Config.go index 93c2faaa5..0cc3782c7 100644 --- a/mocks/config/Config.go +++ b/mocks/config/Config.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -9,11 +9,48 @@ type Config struct { mock.Mock } +type Config_Expecter struct { + mock *mock.Mock +} + +func (_m *Config) EXPECT() *Config_Expecter { + return &Config_Expecter{mock: &_m.Mock} +} + // Add provides a mock function with given fields: name, configuration func (_m *Config) Add(name string, configuration interface{}) { _m.Called(name, configuration) } +// Config_Add_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Add' +type Config_Add_Call struct { + *mock.Call +} + +// Add is a helper method to define mock.On call +// - name string +// - configuration interface{} +func (_e *Config_Expecter) Add(name interface{}, configuration interface{}) *Config_Add_Call { + return &Config_Add_Call{Call: _e.mock.On("Add", name, configuration)} +} + +func (_c *Config_Add_Call) Run(run func(name string, configuration interface{})) *Config_Add_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(interface{})) + }) + return _c +} + +func (_c *Config_Add_Call) Return() *Config_Add_Call { + _c.Call.Return() + return _c +} + +func (_c *Config_Add_Call) RunAndReturn(run func(string, interface{})) *Config_Add_Call { + _c.Call.Return(run) + return _c +} + // Env provides a mock function with given fields: envName, defaultValue func (_m *Config) Env(envName string, defaultValue ...interface{}) interface{} { var _ca []interface{} @@ -21,6 +58,10 @@ func (_m *Config) Env(envName string, defaultValue ...interface{}) interface{} { _ca = append(_ca, defaultValue...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Env") + } + var r0 interface{} if rf, ok := ret.Get(0).(func(string, ...interface{}) interface{}); ok { r0 = rf(envName, defaultValue...) @@ -33,6 +74,42 @@ func (_m *Config) Env(envName string, defaultValue ...interface{}) interface{} { return r0 } +// Config_Env_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Env' +type Config_Env_Call struct { + *mock.Call +} + +// Env is a helper method to define mock.On call +// - envName string +// - defaultValue ...interface{} +func (_e *Config_Expecter) Env(envName interface{}, defaultValue ...interface{}) *Config_Env_Call { + return &Config_Env_Call{Call: _e.mock.On("Env", + append([]interface{}{envName}, defaultValue...)...)} +} + +func (_c *Config_Env_Call) Run(run func(envName string, defaultValue ...interface{})) *Config_Env_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Config_Env_Call) Return(_a0 interface{}) *Config_Env_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Config_Env_Call) RunAndReturn(run func(string, ...interface{}) interface{}) *Config_Env_Call { + _c.Call.Return(run) + return _c +} + // Get provides a mock function with given fields: path, defaultValue func (_m *Config) Get(path string, defaultValue ...interface{}) interface{} { var _ca []interface{} @@ -40,6 +117,10 @@ func (_m *Config) Get(path string, defaultValue ...interface{}) interface{} { _ca = append(_ca, defaultValue...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Get") + } + var r0 interface{} if rf, ok := ret.Get(0).(func(string, ...interface{}) interface{}); ok { r0 = rf(path, defaultValue...) @@ -52,6 +133,42 @@ func (_m *Config) Get(path string, defaultValue ...interface{}) interface{} { return r0 } +// Config_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type Config_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - path string +// - defaultValue ...interface{} +func (_e *Config_Expecter) Get(path interface{}, defaultValue ...interface{}) *Config_Get_Call { + return &Config_Get_Call{Call: _e.mock.On("Get", + append([]interface{}{path}, defaultValue...)...)} +} + +func (_c *Config_Get_Call) Run(run func(path string, defaultValue ...interface{})) *Config_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Config_Get_Call) Return(_a0 interface{}) *Config_Get_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Config_Get_Call) RunAndReturn(run func(string, ...interface{}) interface{}) *Config_Get_Call { + _c.Call.Return(run) + return _c +} + // GetBool provides a mock function with given fields: path, defaultValue func (_m *Config) GetBool(path string, defaultValue ...interface{}) bool { var _ca []interface{} @@ -59,6 +176,10 @@ func (_m *Config) GetBool(path string, defaultValue ...interface{}) bool { _ca = append(_ca, defaultValue...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for GetBool") + } + var r0 bool if rf, ok := ret.Get(0).(func(string, ...interface{}) bool); ok { r0 = rf(path, defaultValue...) @@ -69,6 +190,42 @@ func (_m *Config) GetBool(path string, defaultValue ...interface{}) bool { return r0 } +// Config_GetBool_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBool' +type Config_GetBool_Call struct { + *mock.Call +} + +// GetBool is a helper method to define mock.On call +// - path string +// - defaultValue ...interface{} +func (_e *Config_Expecter) GetBool(path interface{}, defaultValue ...interface{}) *Config_GetBool_Call { + return &Config_GetBool_Call{Call: _e.mock.On("GetBool", + append([]interface{}{path}, defaultValue...)...)} +} + +func (_c *Config_GetBool_Call) Run(run func(path string, defaultValue ...interface{})) *Config_GetBool_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Config_GetBool_Call) Return(_a0 bool) *Config_GetBool_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Config_GetBool_Call) RunAndReturn(run func(string, ...interface{}) bool) *Config_GetBool_Call { + _c.Call.Return(run) + return _c +} + // GetInt provides a mock function with given fields: path, defaultValue func (_m *Config) GetInt(path string, defaultValue ...interface{}) int { var _ca []interface{} @@ -76,6 +233,10 @@ func (_m *Config) GetInt(path string, defaultValue ...interface{}) int { _ca = append(_ca, defaultValue...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for GetInt") + } + var r0 int if rf, ok := ret.Get(0).(func(string, ...interface{}) int); ok { r0 = rf(path, defaultValue...) @@ -86,6 +247,42 @@ func (_m *Config) GetInt(path string, defaultValue ...interface{}) int { return r0 } +// Config_GetInt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetInt' +type Config_GetInt_Call struct { + *mock.Call +} + +// GetInt is a helper method to define mock.On call +// - path string +// - defaultValue ...interface{} +func (_e *Config_Expecter) GetInt(path interface{}, defaultValue ...interface{}) *Config_GetInt_Call { + return &Config_GetInt_Call{Call: _e.mock.On("GetInt", + append([]interface{}{path}, defaultValue...)...)} +} + +func (_c *Config_GetInt_Call) Run(run func(path string, defaultValue ...interface{})) *Config_GetInt_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Config_GetInt_Call) Return(_a0 int) *Config_GetInt_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Config_GetInt_Call) RunAndReturn(run func(string, ...interface{}) int) *Config_GetInt_Call { + _c.Call.Return(run) + return _c +} + // GetString provides a mock function with given fields: path, defaultValue func (_m *Config) GetString(path string, defaultValue ...interface{}) string { var _ca []interface{} @@ -93,6 +290,10 @@ func (_m *Config) GetString(path string, defaultValue ...interface{}) string { _ca = append(_ca, defaultValue...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for GetString") + } + var r0 string if rf, ok := ret.Get(0).(func(string, ...interface{}) string); ok { r0 = rf(path, defaultValue...) @@ -103,6 +304,42 @@ func (_m *Config) GetString(path string, defaultValue ...interface{}) string { return r0 } +// Config_GetString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetString' +type Config_GetString_Call struct { + *mock.Call +} + +// GetString is a helper method to define mock.On call +// - path string +// - defaultValue ...interface{} +func (_e *Config_Expecter) GetString(path interface{}, defaultValue ...interface{}) *Config_GetString_Call { + return &Config_GetString_Call{Call: _e.mock.On("GetString", + append([]interface{}{path}, defaultValue...)...)} +} + +func (_c *Config_GetString_Call) Run(run func(path string, defaultValue ...interface{})) *Config_GetString_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Config_GetString_Call) Return(_a0 string) *Config_GetString_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Config_GetString_Call) RunAndReturn(run func(string, ...interface{}) string) *Config_GetString_Call { + _c.Call.Return(run) + return _c +} + // NewConfig creates a new instance of Config. 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 NewConfig(t interface { diff --git a/mocks/console/Artisan.go b/mocks/console/Artisan.go index 3247a58a4..e1a6c23a4 100644 --- a/mocks/console/Artisan.go +++ b/mocks/console/Artisan.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,26 +12,147 @@ type Artisan struct { mock.Mock } +type Artisan_Expecter struct { + mock *mock.Mock +} + +func (_m *Artisan) EXPECT() *Artisan_Expecter { + return &Artisan_Expecter{mock: &_m.Mock} +} + // Call provides a mock function with given fields: command func (_m *Artisan) Call(command string) { _m.Called(command) } +// Artisan_Call_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Call' +type Artisan_Call_Call struct { + *mock.Call +} + +// Call is a helper method to define mock.On call +// - command string +func (_e *Artisan_Expecter) Call(command interface{}) *Artisan_Call_Call { + return &Artisan_Call_Call{Call: _e.mock.On("Call", command)} +} + +func (_c *Artisan_Call_Call) Run(run func(command string)) *Artisan_Call_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Artisan_Call_Call) Return() *Artisan_Call_Call { + _c.Call.Return() + return _c +} + +func (_c *Artisan_Call_Call) RunAndReturn(run func(string)) *Artisan_Call_Call { + _c.Call.Return(run) + return _c +} + // CallAndExit provides a mock function with given fields: command func (_m *Artisan) CallAndExit(command string) { _m.Called(command) } +// Artisan_CallAndExit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CallAndExit' +type Artisan_CallAndExit_Call struct { + *mock.Call +} + +// CallAndExit is a helper method to define mock.On call +// - command string +func (_e *Artisan_Expecter) CallAndExit(command interface{}) *Artisan_CallAndExit_Call { + return &Artisan_CallAndExit_Call{Call: _e.mock.On("CallAndExit", command)} +} + +func (_c *Artisan_CallAndExit_Call) Run(run func(command string)) *Artisan_CallAndExit_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Artisan_CallAndExit_Call) Return() *Artisan_CallAndExit_Call { + _c.Call.Return() + return _c +} + +func (_c *Artisan_CallAndExit_Call) RunAndReturn(run func(string)) *Artisan_CallAndExit_Call { + _c.Call.Return(run) + return _c +} + // Register provides a mock function with given fields: commands func (_m *Artisan) Register(commands []console.Command) { _m.Called(commands) } +// Artisan_Register_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Register' +type Artisan_Register_Call struct { + *mock.Call +} + +// Register is a helper method to define mock.On call +// - commands []console.Command +func (_e *Artisan_Expecter) Register(commands interface{}) *Artisan_Register_Call { + return &Artisan_Register_Call{Call: _e.mock.On("Register", commands)} +} + +func (_c *Artisan_Register_Call) Run(run func(commands []console.Command)) *Artisan_Register_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]console.Command)) + }) + return _c +} + +func (_c *Artisan_Register_Call) Return() *Artisan_Register_Call { + _c.Call.Return() + return _c +} + +func (_c *Artisan_Register_Call) RunAndReturn(run func([]console.Command)) *Artisan_Register_Call { + _c.Call.Return(run) + return _c +} + // Run provides a mock function with given fields: args, exitIfArtisan func (_m *Artisan) Run(args []string, exitIfArtisan bool) { _m.Called(args, exitIfArtisan) } +// Artisan_Run_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Run' +type Artisan_Run_Call struct { + *mock.Call +} + +// Run is a helper method to define mock.On call +// - args []string +// - exitIfArtisan bool +func (_e *Artisan_Expecter) Run(args interface{}, exitIfArtisan interface{}) *Artisan_Run_Call { + return &Artisan_Run_Call{Call: _e.mock.On("Run", args, exitIfArtisan)} +} + +func (_c *Artisan_Run_Call) Run(run func(args []string, exitIfArtisan bool)) *Artisan_Run_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]string), args[1].(bool)) + }) + return _c +} + +func (_c *Artisan_Run_Call) Return() *Artisan_Run_Call { + _c.Call.Return() + return _c +} + +func (_c *Artisan_Run_Call) RunAndReturn(run func([]string, bool)) *Artisan_Run_Call { + _c.Call.Return(run) + return _c +} + // NewArtisan creates a new instance of Artisan. 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 NewArtisan(t interface { diff --git a/mocks/console/Command.go b/mocks/console/Command.go index 0a79eed4a..2db57eb21 100644 --- a/mocks/console/Command.go +++ b/mocks/console/Command.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -14,10 +14,22 @@ type Command struct { mock.Mock } +type Command_Expecter struct { + mock *mock.Mock +} + +func (_m *Command) EXPECT() *Command_Expecter { + return &Command_Expecter{mock: &_m.Mock} +} + // Description provides a mock function with given fields: func (_m *Command) Description() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Description") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -28,10 +40,41 @@ func (_m *Command) Description() string { return r0 } +// Command_Description_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Description' +type Command_Description_Call struct { + *mock.Call +} + +// Description is a helper method to define mock.On call +func (_e *Command_Expecter) Description() *Command_Description_Call { + return &Command_Description_Call{Call: _e.mock.On("Description")} +} + +func (_c *Command_Description_Call) Run(run func()) *Command_Description_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Command_Description_Call) Return(_a0 string) *Command_Description_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Command_Description_Call) RunAndReturn(run func() string) *Command_Description_Call { + _c.Call.Return(run) + return _c +} + // Extend provides a mock function with given fields: func (_m *Command) Extend() command.Extend { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Extend") + } + var r0 command.Extend if rf, ok := ret.Get(0).(func() command.Extend); ok { r0 = rf() @@ -42,10 +85,41 @@ func (_m *Command) Extend() command.Extend { return r0 } +// Command_Extend_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Extend' +type Command_Extend_Call struct { + *mock.Call +} + +// Extend is a helper method to define mock.On call +func (_e *Command_Expecter) Extend() *Command_Extend_Call { + return &Command_Extend_Call{Call: _e.mock.On("Extend")} +} + +func (_c *Command_Extend_Call) Run(run func()) *Command_Extend_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Command_Extend_Call) Return(_a0 command.Extend) *Command_Extend_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Command_Extend_Call) RunAndReturn(run func() command.Extend) *Command_Extend_Call { + _c.Call.Return(run) + return _c +} + // Handle provides a mock function with given fields: ctx func (_m *Command) Handle(ctx console.Context) error { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for Handle") + } + var r0 error if rf, ok := ret.Get(0).(func(console.Context) error); ok { r0 = rf(ctx) @@ -56,10 +130,42 @@ func (_m *Command) Handle(ctx console.Context) error { return r0 } +// Command_Handle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Handle' +type Command_Handle_Call struct { + *mock.Call +} + +// Handle is a helper method to define mock.On call +// - ctx console.Context +func (_e *Command_Expecter) Handle(ctx interface{}) *Command_Handle_Call { + return &Command_Handle_Call{Call: _e.mock.On("Handle", ctx)} +} + +func (_c *Command_Handle_Call) Run(run func(ctx console.Context)) *Command_Handle_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(console.Context)) + }) + return _c +} + +func (_c *Command_Handle_Call) Return(_a0 error) *Command_Handle_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Command_Handle_Call) RunAndReturn(run func(console.Context) error) *Command_Handle_Call { + _c.Call.Return(run) + return _c +} + // Signature provides a mock function with given fields: func (_m *Command) Signature() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Signature") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -70,6 +176,33 @@ func (_m *Command) Signature() string { return r0 } +// Command_Signature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Signature' +type Command_Signature_Call struct { + *mock.Call +} + +// Signature is a helper method to define mock.On call +func (_e *Command_Expecter) Signature() *Command_Signature_Call { + return &Command_Signature_Call{Call: _e.mock.On("Signature")} +} + +func (_c *Command_Signature_Call) Run(run func()) *Command_Signature_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Command_Signature_Call) Return(_a0 string) *Command_Signature_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Command_Signature_Call) RunAndReturn(run func() string) *Command_Signature_Call { + _c.Call.Return(run) + return _c +} + // NewCommand creates a new instance of Command. 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 NewCommand(t interface { diff --git a/mocks/console/Context.go b/mocks/console/Context.go index 64f340e72..3936cc1c8 100644 --- a/mocks/console/Context.go +++ b/mocks/console/Context.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -9,10 +9,22 @@ type Context struct { mock.Mock } +type Context_Expecter struct { + mock *mock.Mock +} + +func (_m *Context) EXPECT() *Context_Expecter { + return &Context_Expecter{mock: &_m.Mock} +} + // Argument provides a mock function with given fields: index func (_m *Context) Argument(index int) string { ret := _m.Called(index) + if len(ret) == 0 { + panic("no return value specified for Argument") + } + var r0 string if rf, ok := ret.Get(0).(func(int) string); ok { r0 = rf(index) @@ -23,10 +35,42 @@ func (_m *Context) Argument(index int) string { return r0 } +// Context_Argument_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Argument' +type Context_Argument_Call struct { + *mock.Call +} + +// Argument is a helper method to define mock.On call +// - index int +func (_e *Context_Expecter) Argument(index interface{}) *Context_Argument_Call { + return &Context_Argument_Call{Call: _e.mock.On("Argument", index)} +} + +func (_c *Context_Argument_Call) Run(run func(index int)) *Context_Argument_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int)) + }) + return _c +} + +func (_c *Context_Argument_Call) Return(_a0 string) *Context_Argument_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_Argument_Call) RunAndReturn(run func(int) string) *Context_Argument_Call { + _c.Call.Return(run) + return _c +} + // Arguments provides a mock function with given fields: func (_m *Context) Arguments() []string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Arguments") + } + var r0 []string if rf, ok := ret.Get(0).(func() []string); ok { r0 = rf() @@ -39,10 +83,41 @@ func (_m *Context) Arguments() []string { return r0 } +// Context_Arguments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Arguments' +type Context_Arguments_Call struct { + *mock.Call +} + +// Arguments is a helper method to define mock.On call +func (_e *Context_Expecter) Arguments() *Context_Arguments_Call { + return &Context_Arguments_Call{Call: _e.mock.On("Arguments")} +} + +func (_c *Context_Arguments_Call) Run(run func()) *Context_Arguments_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Context_Arguments_Call) Return(_a0 []string) *Context_Arguments_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_Arguments_Call) RunAndReturn(run func() []string) *Context_Arguments_Call { + _c.Call.Return(run) + return _c +} + // Option provides a mock function with given fields: key func (_m *Context) Option(key string) string { ret := _m.Called(key) + if len(ret) == 0 { + panic("no return value specified for Option") + } + var r0 string if rf, ok := ret.Get(0).(func(string) string); ok { r0 = rf(key) @@ -53,10 +128,42 @@ func (_m *Context) Option(key string) string { return r0 } +// Context_Option_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Option' +type Context_Option_Call struct { + *mock.Call +} + +// Option is a helper method to define mock.On call +// - key string +func (_e *Context_Expecter) Option(key interface{}) *Context_Option_Call { + return &Context_Option_Call{Call: _e.mock.On("Option", key)} +} + +func (_c *Context_Option_Call) Run(run func(key string)) *Context_Option_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Context_Option_Call) Return(_a0 string) *Context_Option_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_Option_Call) RunAndReturn(run func(string) string) *Context_Option_Call { + _c.Call.Return(run) + return _c +} + // OptionBool provides a mock function with given fields: key func (_m *Context) OptionBool(key string) bool { ret := _m.Called(key) + if len(ret) == 0 { + panic("no return value specified for OptionBool") + } + var r0 bool if rf, ok := ret.Get(0).(func(string) bool); ok { r0 = rf(key) @@ -67,10 +174,42 @@ func (_m *Context) OptionBool(key string) bool { return r0 } +// Context_OptionBool_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OptionBool' +type Context_OptionBool_Call struct { + *mock.Call +} + +// OptionBool is a helper method to define mock.On call +// - key string +func (_e *Context_Expecter) OptionBool(key interface{}) *Context_OptionBool_Call { + return &Context_OptionBool_Call{Call: _e.mock.On("OptionBool", key)} +} + +func (_c *Context_OptionBool_Call) Run(run func(key string)) *Context_OptionBool_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Context_OptionBool_Call) Return(_a0 bool) *Context_OptionBool_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_OptionBool_Call) RunAndReturn(run func(string) bool) *Context_OptionBool_Call { + _c.Call.Return(run) + return _c +} + // OptionFloat64 provides a mock function with given fields: key func (_m *Context) OptionFloat64(key string) float64 { ret := _m.Called(key) + if len(ret) == 0 { + panic("no return value specified for OptionFloat64") + } + var r0 float64 if rf, ok := ret.Get(0).(func(string) float64); ok { r0 = rf(key) @@ -81,10 +220,42 @@ func (_m *Context) OptionFloat64(key string) float64 { return r0 } +// Context_OptionFloat64_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OptionFloat64' +type Context_OptionFloat64_Call struct { + *mock.Call +} + +// OptionFloat64 is a helper method to define mock.On call +// - key string +func (_e *Context_Expecter) OptionFloat64(key interface{}) *Context_OptionFloat64_Call { + return &Context_OptionFloat64_Call{Call: _e.mock.On("OptionFloat64", key)} +} + +func (_c *Context_OptionFloat64_Call) Run(run func(key string)) *Context_OptionFloat64_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Context_OptionFloat64_Call) Return(_a0 float64) *Context_OptionFloat64_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_OptionFloat64_Call) RunAndReturn(run func(string) float64) *Context_OptionFloat64_Call { + _c.Call.Return(run) + return _c +} + // OptionFloat64Slice provides a mock function with given fields: key func (_m *Context) OptionFloat64Slice(key string) []float64 { ret := _m.Called(key) + if len(ret) == 0 { + panic("no return value specified for OptionFloat64Slice") + } + var r0 []float64 if rf, ok := ret.Get(0).(func(string) []float64); ok { r0 = rf(key) @@ -97,10 +268,42 @@ func (_m *Context) OptionFloat64Slice(key string) []float64 { return r0 } +// Context_OptionFloat64Slice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OptionFloat64Slice' +type Context_OptionFloat64Slice_Call struct { + *mock.Call +} + +// OptionFloat64Slice is a helper method to define mock.On call +// - key string +func (_e *Context_Expecter) OptionFloat64Slice(key interface{}) *Context_OptionFloat64Slice_Call { + return &Context_OptionFloat64Slice_Call{Call: _e.mock.On("OptionFloat64Slice", key)} +} + +func (_c *Context_OptionFloat64Slice_Call) Run(run func(key string)) *Context_OptionFloat64Slice_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Context_OptionFloat64Slice_Call) Return(_a0 []float64) *Context_OptionFloat64Slice_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_OptionFloat64Slice_Call) RunAndReturn(run func(string) []float64) *Context_OptionFloat64Slice_Call { + _c.Call.Return(run) + return _c +} + // OptionInt provides a mock function with given fields: key func (_m *Context) OptionInt(key string) int { ret := _m.Called(key) + if len(ret) == 0 { + panic("no return value specified for OptionInt") + } + var r0 int if rf, ok := ret.Get(0).(func(string) int); ok { r0 = rf(key) @@ -111,10 +314,42 @@ func (_m *Context) OptionInt(key string) int { return r0 } +// Context_OptionInt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OptionInt' +type Context_OptionInt_Call struct { + *mock.Call +} + +// OptionInt is a helper method to define mock.On call +// - key string +func (_e *Context_Expecter) OptionInt(key interface{}) *Context_OptionInt_Call { + return &Context_OptionInt_Call{Call: _e.mock.On("OptionInt", key)} +} + +func (_c *Context_OptionInt_Call) Run(run func(key string)) *Context_OptionInt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Context_OptionInt_Call) Return(_a0 int) *Context_OptionInt_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_OptionInt_Call) RunAndReturn(run func(string) int) *Context_OptionInt_Call { + _c.Call.Return(run) + return _c +} + // OptionInt64 provides a mock function with given fields: key func (_m *Context) OptionInt64(key string) int64 { ret := _m.Called(key) + if len(ret) == 0 { + panic("no return value specified for OptionInt64") + } + var r0 int64 if rf, ok := ret.Get(0).(func(string) int64); ok { r0 = rf(key) @@ -125,10 +360,42 @@ func (_m *Context) OptionInt64(key string) int64 { return r0 } +// Context_OptionInt64_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OptionInt64' +type Context_OptionInt64_Call struct { + *mock.Call +} + +// OptionInt64 is a helper method to define mock.On call +// - key string +func (_e *Context_Expecter) OptionInt64(key interface{}) *Context_OptionInt64_Call { + return &Context_OptionInt64_Call{Call: _e.mock.On("OptionInt64", key)} +} + +func (_c *Context_OptionInt64_Call) Run(run func(key string)) *Context_OptionInt64_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Context_OptionInt64_Call) Return(_a0 int64) *Context_OptionInt64_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_OptionInt64_Call) RunAndReturn(run func(string) int64) *Context_OptionInt64_Call { + _c.Call.Return(run) + return _c +} + // OptionInt64Slice provides a mock function with given fields: key func (_m *Context) OptionInt64Slice(key string) []int64 { ret := _m.Called(key) + if len(ret) == 0 { + panic("no return value specified for OptionInt64Slice") + } + var r0 []int64 if rf, ok := ret.Get(0).(func(string) []int64); ok { r0 = rf(key) @@ -141,10 +408,42 @@ func (_m *Context) OptionInt64Slice(key string) []int64 { return r0 } +// Context_OptionInt64Slice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OptionInt64Slice' +type Context_OptionInt64Slice_Call struct { + *mock.Call +} + +// OptionInt64Slice is a helper method to define mock.On call +// - key string +func (_e *Context_Expecter) OptionInt64Slice(key interface{}) *Context_OptionInt64Slice_Call { + return &Context_OptionInt64Slice_Call{Call: _e.mock.On("OptionInt64Slice", key)} +} + +func (_c *Context_OptionInt64Slice_Call) Run(run func(key string)) *Context_OptionInt64Slice_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Context_OptionInt64Slice_Call) Return(_a0 []int64) *Context_OptionInt64Slice_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_OptionInt64Slice_Call) RunAndReturn(run func(string) []int64) *Context_OptionInt64Slice_Call { + _c.Call.Return(run) + return _c +} + // OptionIntSlice provides a mock function with given fields: key func (_m *Context) OptionIntSlice(key string) []int { ret := _m.Called(key) + if len(ret) == 0 { + panic("no return value specified for OptionIntSlice") + } + var r0 []int if rf, ok := ret.Get(0).(func(string) []int); ok { r0 = rf(key) @@ -157,10 +456,42 @@ func (_m *Context) OptionIntSlice(key string) []int { return r0 } +// Context_OptionIntSlice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OptionIntSlice' +type Context_OptionIntSlice_Call struct { + *mock.Call +} + +// OptionIntSlice is a helper method to define mock.On call +// - key string +func (_e *Context_Expecter) OptionIntSlice(key interface{}) *Context_OptionIntSlice_Call { + return &Context_OptionIntSlice_Call{Call: _e.mock.On("OptionIntSlice", key)} +} + +func (_c *Context_OptionIntSlice_Call) Run(run func(key string)) *Context_OptionIntSlice_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Context_OptionIntSlice_Call) Return(_a0 []int) *Context_OptionIntSlice_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_OptionIntSlice_Call) RunAndReturn(run func(string) []int) *Context_OptionIntSlice_Call { + _c.Call.Return(run) + return _c +} + // OptionSlice provides a mock function with given fields: key func (_m *Context) OptionSlice(key string) []string { ret := _m.Called(key) + if len(ret) == 0 { + panic("no return value specified for OptionSlice") + } + var r0 []string if rf, ok := ret.Get(0).(func(string) []string); ok { r0 = rf(key) @@ -173,6 +504,34 @@ func (_m *Context) OptionSlice(key string) []string { return r0 } +// Context_OptionSlice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OptionSlice' +type Context_OptionSlice_Call struct { + *mock.Call +} + +// OptionSlice is a helper method to define mock.On call +// - key string +func (_e *Context_Expecter) OptionSlice(key interface{}) *Context_OptionSlice_Call { + return &Context_OptionSlice_Call{Call: _e.mock.On("OptionSlice", key)} +} + +func (_c *Context_OptionSlice_Call) Run(run func(key string)) *Context_OptionSlice_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Context_OptionSlice_Call) Return(_a0 []string) *Context_OptionSlice_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_OptionSlice_Call) RunAndReturn(run func(string) []string) *Context_OptionSlice_Call { + _c.Call.Return(run) + return _c +} + // NewContext creates a new instance of Context. 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 NewContext(t interface { diff --git a/mocks/console/command/Flag.go b/mocks/console/command/Flag.go index ceaca4831..b18cf10e5 100644 --- a/mocks/console/command/Flag.go +++ b/mocks/console/command/Flag.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -9,10 +9,22 @@ type Flag struct { mock.Mock } +type Flag_Expecter struct { + mock *mock.Mock +} + +func (_m *Flag) EXPECT() *Flag_Expecter { + return &Flag_Expecter{mock: &_m.Mock} +} + // Type provides a mock function with given fields: func (_m *Flag) Type() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Type") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -23,6 +35,33 @@ func (_m *Flag) Type() string { return r0 } +// Flag_Type_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Type' +type Flag_Type_Call struct { + *mock.Call +} + +// Type is a helper method to define mock.On call +func (_e *Flag_Expecter) Type() *Flag_Type_Call { + return &Flag_Type_Call{Call: _e.mock.On("Type")} +} + +func (_c *Flag_Type_Call) Run(run func()) *Flag_Type_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Flag_Type_Call) Return(_a0 string) *Flag_Type_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Flag_Type_Call) RunAndReturn(run func() string) *Flag_Type_Call { + _c.Call.Return(run) + return _c +} + // NewFlag creates a new instance of Flag. 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 NewFlag(t interface { diff --git a/mocks/crypt/Crypt.go b/mocks/crypt/Crypt.go index 36ed47520..f79c713f1 100644 --- a/mocks/crypt/Crypt.go +++ b/mocks/crypt/Crypt.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -9,10 +9,22 @@ type Crypt struct { mock.Mock } +type Crypt_Expecter struct { + mock *mock.Mock +} + +func (_m *Crypt) EXPECT() *Crypt_Expecter { + return &Crypt_Expecter{mock: &_m.Mock} +} + // DecryptString provides a mock function with given fields: payload func (_m *Crypt) DecryptString(payload string) (string, error) { ret := _m.Called(payload) + if len(ret) == 0 { + panic("no return value specified for DecryptString") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func(string) (string, error)); ok { @@ -33,10 +45,42 @@ func (_m *Crypt) DecryptString(payload string) (string, error) { return r0, r1 } +// Crypt_DecryptString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DecryptString' +type Crypt_DecryptString_Call struct { + *mock.Call +} + +// DecryptString is a helper method to define mock.On call +// - payload string +func (_e *Crypt_Expecter) DecryptString(payload interface{}) *Crypt_DecryptString_Call { + return &Crypt_DecryptString_Call{Call: _e.mock.On("DecryptString", payload)} +} + +func (_c *Crypt_DecryptString_Call) Run(run func(payload string)) *Crypt_DecryptString_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Crypt_DecryptString_Call) Return(_a0 string, _a1 error) *Crypt_DecryptString_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Crypt_DecryptString_Call) RunAndReturn(run func(string) (string, error)) *Crypt_DecryptString_Call { + _c.Call.Return(run) + return _c +} + // EncryptString provides a mock function with given fields: value func (_m *Crypt) EncryptString(value string) (string, error) { ret := _m.Called(value) + if len(ret) == 0 { + panic("no return value specified for EncryptString") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func(string) (string, error)); ok { @@ -57,6 +101,34 @@ func (_m *Crypt) EncryptString(value string) (string, error) { return r0, r1 } +// Crypt_EncryptString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EncryptString' +type Crypt_EncryptString_Call struct { + *mock.Call +} + +// EncryptString is a helper method to define mock.On call +// - value string +func (_e *Crypt_Expecter) EncryptString(value interface{}) *Crypt_EncryptString_Call { + return &Crypt_EncryptString_Call{Call: _e.mock.On("EncryptString", value)} +} + +func (_c *Crypt_EncryptString_Call) Run(run func(value string)) *Crypt_EncryptString_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Crypt_EncryptString_Call) Return(_a0 string, _a1 error) *Crypt_EncryptString_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Crypt_EncryptString_Call) RunAndReturn(run func(string) (string, error)) *Crypt_EncryptString_Call { + _c.Call.Return(run) + return _c +} + // NewCrypt creates a new instance of Crypt. 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 NewCrypt(t interface { diff --git a/mocks/database/factory/Factory.go b/mocks/database/factory/Factory.go index c40074671..c79cd67d5 100644 --- a/mocks/database/factory/Factory.go +++ b/mocks/database/factory/Factory.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -9,10 +9,22 @@ type Factory struct { mock.Mock } +type Factory_Expecter struct { + mock *mock.Mock +} + +func (_m *Factory) EXPECT() *Factory_Expecter { + return &Factory_Expecter{mock: &_m.Mock} +} + // Definition provides a mock function with given fields: func (_m *Factory) Definition() map[string]interface{} { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Definition") + } + var r0 map[string]interface{} if rf, ok := ret.Get(0).(func() map[string]interface{}); ok { r0 = rf() @@ -25,6 +37,33 @@ func (_m *Factory) Definition() map[string]interface{} { return r0 } +// Factory_Definition_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Definition' +type Factory_Definition_Call struct { + *mock.Call +} + +// Definition is a helper method to define mock.On call +func (_e *Factory_Expecter) Definition() *Factory_Definition_Call { + return &Factory_Definition_Call{Call: _e.mock.On("Definition")} +} + +func (_c *Factory_Definition_Call) Run(run func()) *Factory_Definition_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Factory_Definition_Call) Return(_a0 map[string]interface{}) *Factory_Definition_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Factory_Definition_Call) RunAndReturn(run func() map[string]interface{}) *Factory_Definition_Call { + _c.Call.Return(run) + return _c +} + // NewFactory creates a new instance of Factory. 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 NewFactory(t interface { diff --git a/mocks/database/factory/Model.go b/mocks/database/factory/Model.go index 7a3c1237c..607dbfb38 100644 --- a/mocks/database/factory/Model.go +++ b/mocks/database/factory/Model.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,10 +12,22 @@ type Model struct { mock.Mock } +type Model_Expecter struct { + mock *mock.Mock +} + +func (_m *Model) EXPECT() *Model_Expecter { + return &Model_Expecter{mock: &_m.Mock} +} + // Factory provides a mock function with given fields: func (_m *Model) Factory() factory.Factory { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Factory") + } + var r0 factory.Factory if rf, ok := ret.Get(0).(func() factory.Factory); ok { r0 = rf() @@ -28,6 +40,33 @@ func (_m *Model) Factory() factory.Factory { return r0 } +// Model_Factory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Factory' +type Model_Factory_Call struct { + *mock.Call +} + +// Factory is a helper method to define mock.On call +func (_e *Model_Expecter) Factory() *Model_Factory_Call { + return &Model_Factory_Call{Call: _e.mock.On("Factory")} +} + +func (_c *Model_Factory_Call) Run(run func()) *Model_Factory_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Model_Factory_Call) Return(_a0 factory.Factory) *Model_Factory_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Model_Factory_Call) RunAndReturn(run func() factory.Factory) *Model_Factory_Call { + _c.Call.Return(run) + return _c +} + // NewModel creates a new instance of Model. 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 NewModel(t interface { diff --git a/mocks/database/gorm/Gorm.go b/mocks/database/gorm/Gorm.go index d54514ebc..fdda35abc 100644 --- a/mocks/database/gorm/Gorm.go +++ b/mocks/database/gorm/Gorm.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,10 +12,22 @@ type Gorm struct { mock.Mock } +type Gorm_Expecter struct { + mock *mock.Mock +} + +func (_m *Gorm) EXPECT() *Gorm_Expecter { + return &Gorm_Expecter{mock: &_m.Mock} +} + // Make provides a mock function with given fields: func (_m *Gorm) Make() (*gorm.DB, error) { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Make") + } + var r0 *gorm.DB var r1 error if rf, ok := ret.Get(0).(func() (*gorm.DB, error)); ok { @@ -38,6 +50,33 @@ func (_m *Gorm) Make() (*gorm.DB, error) { return r0, r1 } +// Gorm_Make_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Make' +type Gorm_Make_Call struct { + *mock.Call +} + +// Make is a helper method to define mock.On call +func (_e *Gorm_Expecter) Make() *Gorm_Make_Call { + return &Gorm_Make_Call{Call: _e.mock.On("Make")} +} + +func (_c *Gorm_Make_Call) Run(run func()) *Gorm_Make_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Gorm_Make_Call) Return(_a0 *gorm.DB, _a1 error) *Gorm_Make_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Gorm_Make_Call) RunAndReturn(run func() (*gorm.DB, error)) *Gorm_Make_Call { + _c.Call.Return(run) + return _c +} + // NewGorm creates a new instance of Gorm. 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 NewGorm(t interface { diff --git a/mocks/database/gorm/Initialize.go b/mocks/database/gorm/Initialize.go index 191ba88d5..53e22c777 100644 --- a/mocks/database/gorm/Initialize.go +++ b/mocks/database/gorm/Initialize.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -19,10 +19,22 @@ type Initialize struct { mock.Mock } +type Initialize_Expecter struct { + mock *mock.Mock +} + +func (_m *Initialize) EXPECT() *Initialize_Expecter { + return &Initialize_Expecter{mock: &_m.Mock} +} + // InitializeGorm provides a mock function with given fields: _a0, connection func (_m *Initialize) InitializeGorm(_a0 config.Config, connection string) gorm.Gorm { ret := _m.Called(_a0, connection) + if len(ret) == 0 { + panic("no return value specified for InitializeGorm") + } + var r0 gorm.Gorm if rf, ok := ret.Get(0).(func(config.Config, string) gorm.Gorm); ok { r0 = rf(_a0, connection) @@ -35,10 +47,43 @@ func (_m *Initialize) InitializeGorm(_a0 config.Config, connection string) gorm. return r0 } +// Initialize_InitializeGorm_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InitializeGorm' +type Initialize_InitializeGorm_Call struct { + *mock.Call +} + +// InitializeGorm is a helper method to define mock.On call +// - _a0 config.Config +// - connection string +func (_e *Initialize_Expecter) InitializeGorm(_a0 interface{}, connection interface{}) *Initialize_InitializeGorm_Call { + return &Initialize_InitializeGorm_Call{Call: _e.mock.On("InitializeGorm", _a0, connection)} +} + +func (_c *Initialize_InitializeGorm_Call) Run(run func(_a0 config.Config, connection string)) *Initialize_InitializeGorm_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(config.Config), args[1].(string)) + }) + return _c +} + +func (_c *Initialize_InitializeGorm_Call) Return(_a0 gorm.Gorm) *Initialize_InitializeGorm_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Initialize_InitializeGorm_Call) RunAndReturn(run func(config.Config, string) gorm.Gorm) *Initialize_InitializeGorm_Call { + _c.Call.Return(run) + return _c +} + // InitializeQuery provides a mock function with given fields: ctx, _a1, connection func (_m *Initialize) InitializeQuery(ctx context.Context, _a1 config.Config, connection string) (orm.Query, error) { ret := _m.Called(ctx, _a1, connection) + if len(ret) == 0 { + panic("no return value specified for InitializeQuery") + } + var r0 orm.Query var r1 error if rf, ok := ret.Get(0).(func(context.Context, config.Config, string) (orm.Query, error)); ok { @@ -61,6 +106,36 @@ func (_m *Initialize) InitializeQuery(ctx context.Context, _a1 config.Config, co return r0, r1 } +// Initialize_InitializeQuery_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InitializeQuery' +type Initialize_InitializeQuery_Call struct { + *mock.Call +} + +// InitializeQuery is a helper method to define mock.On call +// - ctx context.Context +// - _a1 config.Config +// - connection string +func (_e *Initialize_Expecter) InitializeQuery(ctx interface{}, _a1 interface{}, connection interface{}) *Initialize_InitializeQuery_Call { + return &Initialize_InitializeQuery_Call{Call: _e.mock.On("InitializeQuery", ctx, _a1, connection)} +} + +func (_c *Initialize_InitializeQuery_Call) Run(run func(ctx context.Context, _a1 config.Config, connection string)) *Initialize_InitializeQuery_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(config.Config), args[2].(string)) + }) + return _c +} + +func (_c *Initialize_InitializeQuery_Call) Return(_a0 orm.Query, _a1 error) *Initialize_InitializeQuery_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Initialize_InitializeQuery_Call) RunAndReturn(run func(context.Context, config.Config, string) (orm.Query, error)) *Initialize_InitializeQuery_Call { + _c.Call.Return(run) + return _c +} + // NewInitialize creates a new instance of Initialize. 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 NewInitialize(t interface { diff --git a/mocks/database/orm/Association.go b/mocks/database/orm/Association.go index 25c9e857e..949a7d73f 100644 --- a/mocks/database/orm/Association.go +++ b/mocks/database/orm/Association.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -9,12 +9,24 @@ type Association struct { mock.Mock } +type Association_Expecter struct { + mock *mock.Mock +} + +func (_m *Association) EXPECT() *Association_Expecter { + return &Association_Expecter{mock: &_m.Mock} +} + // Append provides a mock function with given fields: values func (_m *Association) Append(values ...interface{}) error { var _ca []interface{} _ca = append(_ca, values...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Append") + } + var r0 error if rf, ok := ret.Get(0).(func(...interface{}) error); ok { r0 = rf(values...) @@ -25,10 +37,49 @@ func (_m *Association) Append(values ...interface{}) error { return r0 } +// Association_Append_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Append' +type Association_Append_Call struct { + *mock.Call +} + +// Append is a helper method to define mock.On call +// - values ...interface{} +func (_e *Association_Expecter) Append(values ...interface{}) *Association_Append_Call { + return &Association_Append_Call{Call: _e.mock.On("Append", + append([]interface{}{}, values...)...)} +} + +func (_c *Association_Append_Call) Run(run func(values ...interface{})) *Association_Append_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Association_Append_Call) Return(_a0 error) *Association_Append_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Association_Append_Call) RunAndReturn(run func(...interface{}) error) *Association_Append_Call { + _c.Call.Return(run) + return _c +} + // Clear provides a mock function with given fields: func (_m *Association) Clear() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Clear") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -39,10 +90,41 @@ func (_m *Association) Clear() error { return r0 } +// Association_Clear_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Clear' +type Association_Clear_Call struct { + *mock.Call +} + +// Clear is a helper method to define mock.On call +func (_e *Association_Expecter) Clear() *Association_Clear_Call { + return &Association_Clear_Call{Call: _e.mock.On("Clear")} +} + +func (_c *Association_Clear_Call) Run(run func()) *Association_Clear_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Association_Clear_Call) Return(_a0 error) *Association_Clear_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Association_Clear_Call) RunAndReturn(run func() error) *Association_Clear_Call { + _c.Call.Return(run) + return _c +} + // Count provides a mock function with given fields: func (_m *Association) Count() int64 { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Count") + } + var r0 int64 if rf, ok := ret.Get(0).(func() int64); ok { r0 = rf() @@ -53,12 +135,43 @@ func (_m *Association) Count() int64 { return r0 } +// Association_Count_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Count' +type Association_Count_Call struct { + *mock.Call +} + +// Count is a helper method to define mock.On call +func (_e *Association_Expecter) Count() *Association_Count_Call { + return &Association_Count_Call{Call: _e.mock.On("Count")} +} + +func (_c *Association_Count_Call) Run(run func()) *Association_Count_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Association_Count_Call) Return(_a0 int64) *Association_Count_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Association_Count_Call) RunAndReturn(run func() int64) *Association_Count_Call { + _c.Call.Return(run) + return _c +} + // Delete provides a mock function with given fields: values func (_m *Association) Delete(values ...interface{}) error { var _ca []interface{} _ca = append(_ca, values...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Delete") + } + var r0 error if rf, ok := ret.Get(0).(func(...interface{}) error); ok { r0 = rf(values...) @@ -69,6 +182,41 @@ func (_m *Association) Delete(values ...interface{}) error { return r0 } +// Association_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type Association_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - values ...interface{} +func (_e *Association_Expecter) Delete(values ...interface{}) *Association_Delete_Call { + return &Association_Delete_Call{Call: _e.mock.On("Delete", + append([]interface{}{}, values...)...)} +} + +func (_c *Association_Delete_Call) Run(run func(values ...interface{})) *Association_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Association_Delete_Call) Return(_a0 error) *Association_Delete_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Association_Delete_Call) RunAndReturn(run func(...interface{}) error) *Association_Delete_Call { + _c.Call.Return(run) + return _c +} + // Find provides a mock function with given fields: out, conds func (_m *Association) Find(out interface{}, conds ...interface{}) error { var _ca []interface{} @@ -76,6 +224,10 @@ func (_m *Association) Find(out interface{}, conds ...interface{}) error { _ca = append(_ca, conds...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Find") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}, ...interface{}) error); ok { r0 = rf(out, conds...) @@ -86,12 +238,52 @@ func (_m *Association) Find(out interface{}, conds ...interface{}) error { return r0 } +// Association_Find_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Find' +type Association_Find_Call struct { + *mock.Call +} + +// Find is a helper method to define mock.On call +// - out interface{} +// - conds ...interface{} +func (_e *Association_Expecter) Find(out interface{}, conds ...interface{}) *Association_Find_Call { + return &Association_Find_Call{Call: _e.mock.On("Find", + append([]interface{}{out}, conds...)...)} +} + +func (_c *Association_Find_Call) Run(run func(out interface{}, conds ...interface{})) *Association_Find_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(interface{}), variadicArgs...) + }) + return _c +} + +func (_c *Association_Find_Call) Return(_a0 error) *Association_Find_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Association_Find_Call) RunAndReturn(run func(interface{}, ...interface{}) error) *Association_Find_Call { + _c.Call.Return(run) + return _c +} + // Replace provides a mock function with given fields: values func (_m *Association) Replace(values ...interface{}) error { var _ca []interface{} _ca = append(_ca, values...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Replace") + } + var r0 error if rf, ok := ret.Get(0).(func(...interface{}) error); ok { r0 = rf(values...) @@ -102,6 +294,41 @@ func (_m *Association) Replace(values ...interface{}) error { return r0 } +// Association_Replace_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Replace' +type Association_Replace_Call struct { + *mock.Call +} + +// Replace is a helper method to define mock.On call +// - values ...interface{} +func (_e *Association_Expecter) Replace(values ...interface{}) *Association_Replace_Call { + return &Association_Replace_Call{Call: _e.mock.On("Replace", + append([]interface{}{}, values...)...)} +} + +func (_c *Association_Replace_Call) Run(run func(values ...interface{})) *Association_Replace_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Association_Replace_Call) Return(_a0 error) *Association_Replace_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Association_Replace_Call) RunAndReturn(run func(...interface{}) error) *Association_Replace_Call { + _c.Call.Return(run) + return _c +} + // NewAssociation creates a new instance of Association. 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 NewAssociation(t interface { diff --git a/mocks/database/orm/ConnectionModel.go b/mocks/database/orm/ConnectionModel.go index a79115a4d..d51fb3f1a 100644 --- a/mocks/database/orm/ConnectionModel.go +++ b/mocks/database/orm/ConnectionModel.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -9,10 +9,22 @@ type ConnectionModel struct { mock.Mock } +type ConnectionModel_Expecter struct { + mock *mock.Mock +} + +func (_m *ConnectionModel) EXPECT() *ConnectionModel_Expecter { + return &ConnectionModel_Expecter{mock: &_m.Mock} +} + // Connection provides a mock function with given fields: func (_m *ConnectionModel) Connection() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Connection") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -23,6 +35,33 @@ func (_m *ConnectionModel) Connection() string { return r0 } +// ConnectionModel_Connection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Connection' +type ConnectionModel_Connection_Call struct { + *mock.Call +} + +// Connection is a helper method to define mock.On call +func (_e *ConnectionModel_Expecter) Connection() *ConnectionModel_Connection_Call { + return &ConnectionModel_Connection_Call{Call: _e.mock.On("Connection")} +} + +func (_c *ConnectionModel_Connection_Call) Run(run func()) *ConnectionModel_Connection_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ConnectionModel_Connection_Call) Return(_a0 string) *ConnectionModel_Connection_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ConnectionModel_Connection_Call) RunAndReturn(run func() string) *ConnectionModel_Connection_Call { + _c.Call.Return(run) + return _c +} + // NewConnectionModel creates a new instance of ConnectionModel. 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 NewConnectionModel(t interface { diff --git a/mocks/database/orm/Cursor.go b/mocks/database/orm/Cursor.go index 2e493ac4d..3cce65597 100644 --- a/mocks/database/orm/Cursor.go +++ b/mocks/database/orm/Cursor.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -9,10 +9,22 @@ type Cursor struct { mock.Mock } +type Cursor_Expecter struct { + mock *mock.Mock +} + +func (_m *Cursor) EXPECT() *Cursor_Expecter { + return &Cursor_Expecter{mock: &_m.Mock} +} + // Scan provides a mock function with given fields: value func (_m *Cursor) Scan(value interface{}) error { ret := _m.Called(value) + if len(ret) == 0 { + panic("no return value specified for Scan") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}) error); ok { r0 = rf(value) @@ -23,6 +35,34 @@ func (_m *Cursor) Scan(value interface{}) error { return r0 } +// Cursor_Scan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Scan' +type Cursor_Scan_Call struct { + *mock.Call +} + +// Scan is a helper method to define mock.On call +// - value interface{} +func (_e *Cursor_Expecter) Scan(value interface{}) *Cursor_Scan_Call { + return &Cursor_Scan_Call{Call: _e.mock.On("Scan", value)} +} + +func (_c *Cursor_Scan_Call) Run(run func(value interface{})) *Cursor_Scan_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Cursor_Scan_Call) Return(_a0 error) *Cursor_Scan_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Cursor_Scan_Call) RunAndReturn(run func(interface{}) error) *Cursor_Scan_Call { + _c.Call.Return(run) + return _c +} + // NewCursor creates a new instance of Cursor. 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 NewCursor(t interface { diff --git a/mocks/database/orm/DispatchesEvents.go b/mocks/database/orm/DispatchesEvents.go index 3426fae2c..4aef2ee27 100644 --- a/mocks/database/orm/DispatchesEvents.go +++ b/mocks/database/orm/DispatchesEvents.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,10 +12,22 @@ type DispatchesEvents struct { mock.Mock } +type DispatchesEvents_Expecter struct { + mock *mock.Mock +} + +func (_m *DispatchesEvents) EXPECT() *DispatchesEvents_Expecter { + return &DispatchesEvents_Expecter{mock: &_m.Mock} +} + // DispatchesEvents provides a mock function with given fields: func (_m *DispatchesEvents) DispatchesEvents() map[orm.EventType]func(orm.Event) error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for DispatchesEvents") + } + var r0 map[orm.EventType]func(orm.Event) error if rf, ok := ret.Get(0).(func() map[orm.EventType]func(orm.Event) error); ok { r0 = rf() @@ -28,6 +40,33 @@ func (_m *DispatchesEvents) DispatchesEvents() map[orm.EventType]func(orm.Event) return r0 } +// DispatchesEvents_DispatchesEvents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DispatchesEvents' +type DispatchesEvents_DispatchesEvents_Call struct { + *mock.Call +} + +// DispatchesEvents is a helper method to define mock.On call +func (_e *DispatchesEvents_Expecter) DispatchesEvents() *DispatchesEvents_DispatchesEvents_Call { + return &DispatchesEvents_DispatchesEvents_Call{Call: _e.mock.On("DispatchesEvents")} +} + +func (_c *DispatchesEvents_DispatchesEvents_Call) Run(run func()) *DispatchesEvents_DispatchesEvents_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DispatchesEvents_DispatchesEvents_Call) Return(_a0 map[orm.EventType]func(orm.Event) error) *DispatchesEvents_DispatchesEvents_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DispatchesEvents_DispatchesEvents_Call) RunAndReturn(run func() map[orm.EventType]func(orm.Event) error) *DispatchesEvents_DispatchesEvents_Call { + _c.Call.Return(run) + return _c +} + // NewDispatchesEvents creates a new instance of DispatchesEvents. 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 NewDispatchesEvents(t interface { diff --git a/mocks/database/orm/Event.go b/mocks/database/orm/Event.go index 3b85cb7a7..87a6695c7 100644 --- a/mocks/database/orm/Event.go +++ b/mocks/database/orm/Event.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -14,10 +14,22 @@ type Event struct { mock.Mock } +type Event_Expecter struct { + mock *mock.Mock +} + +func (_m *Event) EXPECT() *Event_Expecter { + return &Event_Expecter{mock: &_m.Mock} +} + // Context provides a mock function with given fields: func (_m *Event) Context() context.Context { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Context") + } + var r0 context.Context if rf, ok := ret.Get(0).(func() context.Context); ok { r0 = rf() @@ -30,10 +42,41 @@ func (_m *Event) Context() context.Context { return r0 } +// Event_Context_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Context' +type Event_Context_Call struct { + *mock.Call +} + +// Context is a helper method to define mock.On call +func (_e *Event_Expecter) Context() *Event_Context_Call { + return &Event_Context_Call{Call: _e.mock.On("Context")} +} + +func (_c *Event_Context_Call) Run(run func()) *Event_Context_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Event_Context_Call) Return(_a0 context.Context) *Event_Context_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_Context_Call) RunAndReturn(run func() context.Context) *Event_Context_Call { + _c.Call.Return(run) + return _c +} + // GetAttribute provides a mock function with given fields: key func (_m *Event) GetAttribute(key string) interface{} { ret := _m.Called(key) + if len(ret) == 0 { + panic("no return value specified for GetAttribute") + } + var r0 interface{} if rf, ok := ret.Get(0).(func(string) interface{}); ok { r0 = rf(key) @@ -46,6 +89,34 @@ func (_m *Event) GetAttribute(key string) interface{} { return r0 } +// Event_GetAttribute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAttribute' +type Event_GetAttribute_Call struct { + *mock.Call +} + +// GetAttribute is a helper method to define mock.On call +// - key string +func (_e *Event_Expecter) GetAttribute(key interface{}) *Event_GetAttribute_Call { + return &Event_GetAttribute_Call{Call: _e.mock.On("GetAttribute", key)} +} + +func (_c *Event_GetAttribute_Call) Run(run func(key string)) *Event_GetAttribute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Event_GetAttribute_Call) Return(_a0 interface{}) *Event_GetAttribute_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_GetAttribute_Call) RunAndReturn(run func(string) interface{}) *Event_GetAttribute_Call { + _c.Call.Return(run) + return _c +} + // GetOriginal provides a mock function with given fields: key, def func (_m *Event) GetOriginal(key string, def ...interface{}) interface{} { var _ca []interface{} @@ -53,6 +124,10 @@ func (_m *Event) GetOriginal(key string, def ...interface{}) interface{} { _ca = append(_ca, def...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for GetOriginal") + } + var r0 interface{} if rf, ok := ret.Get(0).(func(string, ...interface{}) interface{}); ok { r0 = rf(key, def...) @@ -65,6 +140,42 @@ func (_m *Event) GetOriginal(key string, def ...interface{}) interface{} { return r0 } +// Event_GetOriginal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetOriginal' +type Event_GetOriginal_Call struct { + *mock.Call +} + +// GetOriginal is a helper method to define mock.On call +// - key string +// - def ...interface{} +func (_e *Event_Expecter) GetOriginal(key interface{}, def ...interface{}) *Event_GetOriginal_Call { + return &Event_GetOriginal_Call{Call: _e.mock.On("GetOriginal", + append([]interface{}{key}, def...)...)} +} + +func (_c *Event_GetOriginal_Call) Run(run func(key string, def ...interface{})) *Event_GetOriginal_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Event_GetOriginal_Call) Return(_a0 interface{}) *Event_GetOriginal_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_GetOriginal_Call) RunAndReturn(run func(string, ...interface{}) interface{}) *Event_GetOriginal_Call { + _c.Call.Return(run) + return _c +} + // IsClean provides a mock function with given fields: columns func (_m *Event) IsClean(columns ...string) bool { _va := make([]interface{}, len(columns)) @@ -75,6 +186,10 @@ func (_m *Event) IsClean(columns ...string) bool { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for IsClean") + } + var r0 bool if rf, ok := ret.Get(0).(func(...string) bool); ok { r0 = rf(columns...) @@ -85,6 +200,41 @@ func (_m *Event) IsClean(columns ...string) bool { return r0 } +// Event_IsClean_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsClean' +type Event_IsClean_Call struct { + *mock.Call +} + +// IsClean is a helper method to define mock.On call +// - columns ...string +func (_e *Event_Expecter) IsClean(columns ...interface{}) *Event_IsClean_Call { + return &Event_IsClean_Call{Call: _e.mock.On("IsClean", + append([]interface{}{}, columns...)...)} +} + +func (_c *Event_IsClean_Call) Run(run func(columns ...string)) *Event_IsClean_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Event_IsClean_Call) Return(_a0 bool) *Event_IsClean_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_IsClean_Call) RunAndReturn(run func(...string) bool) *Event_IsClean_Call { + _c.Call.Return(run) + return _c +} + // IsDirty provides a mock function with given fields: columns func (_m *Event) IsDirty(columns ...string) bool { _va := make([]interface{}, len(columns)) @@ -95,6 +245,10 @@ func (_m *Event) IsDirty(columns ...string) bool { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for IsDirty") + } + var r0 bool if rf, ok := ret.Get(0).(func(...string) bool); ok { r0 = rf(columns...) @@ -105,10 +259,49 @@ func (_m *Event) IsDirty(columns ...string) bool { return r0 } +// Event_IsDirty_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsDirty' +type Event_IsDirty_Call struct { + *mock.Call +} + +// IsDirty is a helper method to define mock.On call +// - columns ...string +func (_e *Event_Expecter) IsDirty(columns ...interface{}) *Event_IsDirty_Call { + return &Event_IsDirty_Call{Call: _e.mock.On("IsDirty", + append([]interface{}{}, columns...)...)} +} + +func (_c *Event_IsDirty_Call) Run(run func(columns ...string)) *Event_IsDirty_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Event_IsDirty_Call) Return(_a0 bool) *Event_IsDirty_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_IsDirty_Call) RunAndReturn(run func(...string) bool) *Event_IsDirty_Call { + _c.Call.Return(run) + return _c +} + // Query provides a mock function with given fields: func (_m *Event) Query() orm.Query { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Query") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func() orm.Query); ok { r0 = rf() @@ -121,11 +314,67 @@ func (_m *Event) Query() orm.Query { return r0 } +// Event_Query_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Query' +type Event_Query_Call struct { + *mock.Call +} + +// Query is a helper method to define mock.On call +func (_e *Event_Expecter) Query() *Event_Query_Call { + return &Event_Query_Call{Call: _e.mock.On("Query")} +} + +func (_c *Event_Query_Call) Run(run func()) *Event_Query_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Event_Query_Call) Return(_a0 orm.Query) *Event_Query_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_Query_Call) RunAndReturn(run func() orm.Query) *Event_Query_Call { + _c.Call.Return(run) + return _c +} + // SetAttribute provides a mock function with given fields: key, value func (_m *Event) SetAttribute(key string, value interface{}) { _m.Called(key, value) } +// Event_SetAttribute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetAttribute' +type Event_SetAttribute_Call struct { + *mock.Call +} + +// SetAttribute is a helper method to define mock.On call +// - key string +// - value interface{} +func (_e *Event_Expecter) SetAttribute(key interface{}, value interface{}) *Event_SetAttribute_Call { + return &Event_SetAttribute_Call{Call: _e.mock.On("SetAttribute", key, value)} +} + +func (_c *Event_SetAttribute_Call) Run(run func(key string, value interface{})) *Event_SetAttribute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(interface{})) + }) + return _c +} + +func (_c *Event_SetAttribute_Call) Return() *Event_SetAttribute_Call { + _c.Call.Return() + return _c +} + +func (_c *Event_SetAttribute_Call) RunAndReturn(run func(string, interface{})) *Event_SetAttribute_Call { + _c.Call.Return(run) + return _c +} + // NewEvent creates a new instance of Event. 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 NewEvent(t interface { diff --git a/mocks/database/orm/Factory.go b/mocks/database/orm/Factory.go index 1fdf9088a..cb481baac 100644 --- a/mocks/database/orm/Factory.go +++ b/mocks/database/orm/Factory.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,10 +12,22 @@ type Factory struct { mock.Mock } +type Factory_Expecter struct { + mock *mock.Mock +} + +func (_m *Factory) EXPECT() *Factory_Expecter { + return &Factory_Expecter{mock: &_m.Mock} +} + // Count provides a mock function with given fields: count func (_m *Factory) Count(count int) orm.Factory { ret := _m.Called(count) + if len(ret) == 0 { + panic("no return value specified for Count") + } + var r0 orm.Factory if rf, ok := ret.Get(0).(func(int) orm.Factory); ok { r0 = rf(count) @@ -28,6 +40,34 @@ func (_m *Factory) Count(count int) orm.Factory { return r0 } +// Factory_Count_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Count' +type Factory_Count_Call struct { + *mock.Call +} + +// Count is a helper method to define mock.On call +// - count int +func (_e *Factory_Expecter) Count(count interface{}) *Factory_Count_Call { + return &Factory_Count_Call{Call: _e.mock.On("Count", count)} +} + +func (_c *Factory_Count_Call) Run(run func(count int)) *Factory_Count_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int)) + }) + return _c +} + +func (_c *Factory_Count_Call) Return(_a0 orm.Factory) *Factory_Count_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Factory_Count_Call) RunAndReturn(run func(int) orm.Factory) *Factory_Count_Call { + _c.Call.Return(run) + return _c +} + // Create provides a mock function with given fields: value, attributes func (_m *Factory) Create(value interface{}, attributes ...map[string]interface{}) error { _va := make([]interface{}, len(attributes)) @@ -39,6 +79,10 @@ func (_m *Factory) Create(value interface{}, attributes ...map[string]interface{ _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Create") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}, ...map[string]interface{}) error); ok { r0 = rf(value, attributes...) @@ -49,6 +93,42 @@ func (_m *Factory) Create(value interface{}, attributes ...map[string]interface{ return r0 } +// Factory_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type Factory_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - value interface{} +// - attributes ...map[string]interface{} +func (_e *Factory_Expecter) Create(value interface{}, attributes ...interface{}) *Factory_Create_Call { + return &Factory_Create_Call{Call: _e.mock.On("Create", + append([]interface{}{value}, attributes...)...)} +} + +func (_c *Factory_Create_Call) Run(run func(value interface{}, attributes ...map[string]interface{})) *Factory_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]map[string]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(map[string]interface{}) + } + } + run(args[0].(interface{}), variadicArgs...) + }) + return _c +} + +func (_c *Factory_Create_Call) Return(_a0 error) *Factory_Create_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Factory_Create_Call) RunAndReturn(run func(interface{}, ...map[string]interface{}) error) *Factory_Create_Call { + _c.Call.Return(run) + return _c +} + // CreateQuietly provides a mock function with given fields: value, attributes func (_m *Factory) CreateQuietly(value interface{}, attributes ...map[string]interface{}) error { _va := make([]interface{}, len(attributes)) @@ -60,6 +140,10 @@ func (_m *Factory) CreateQuietly(value interface{}, attributes ...map[string]int _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for CreateQuietly") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}, ...map[string]interface{}) error); ok { r0 = rf(value, attributes...) @@ -70,6 +154,42 @@ func (_m *Factory) CreateQuietly(value interface{}, attributes ...map[string]int return r0 } +// Factory_CreateQuietly_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateQuietly' +type Factory_CreateQuietly_Call struct { + *mock.Call +} + +// CreateQuietly is a helper method to define mock.On call +// - value interface{} +// - attributes ...map[string]interface{} +func (_e *Factory_Expecter) CreateQuietly(value interface{}, attributes ...interface{}) *Factory_CreateQuietly_Call { + return &Factory_CreateQuietly_Call{Call: _e.mock.On("CreateQuietly", + append([]interface{}{value}, attributes...)...)} +} + +func (_c *Factory_CreateQuietly_Call) Run(run func(value interface{}, attributes ...map[string]interface{})) *Factory_CreateQuietly_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]map[string]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(map[string]interface{}) + } + } + run(args[0].(interface{}), variadicArgs...) + }) + return _c +} + +func (_c *Factory_CreateQuietly_Call) Return(_a0 error) *Factory_CreateQuietly_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Factory_CreateQuietly_Call) RunAndReturn(run func(interface{}, ...map[string]interface{}) error) *Factory_CreateQuietly_Call { + _c.Call.Return(run) + return _c +} + // Make provides a mock function with given fields: value, attributes func (_m *Factory) Make(value interface{}, attributes ...map[string]interface{}) error { _va := make([]interface{}, len(attributes)) @@ -81,6 +201,10 @@ func (_m *Factory) Make(value interface{}, attributes ...map[string]interface{}) _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Make") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}, ...map[string]interface{}) error); ok { r0 = rf(value, attributes...) @@ -91,6 +215,42 @@ func (_m *Factory) Make(value interface{}, attributes ...map[string]interface{}) return r0 } +// Factory_Make_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Make' +type Factory_Make_Call struct { + *mock.Call +} + +// Make is a helper method to define mock.On call +// - value interface{} +// - attributes ...map[string]interface{} +func (_e *Factory_Expecter) Make(value interface{}, attributes ...interface{}) *Factory_Make_Call { + return &Factory_Make_Call{Call: _e.mock.On("Make", + append([]interface{}{value}, attributes...)...)} +} + +func (_c *Factory_Make_Call) Run(run func(value interface{}, attributes ...map[string]interface{})) *Factory_Make_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]map[string]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(map[string]interface{}) + } + } + run(args[0].(interface{}), variadicArgs...) + }) + return _c +} + +func (_c *Factory_Make_Call) Return(_a0 error) *Factory_Make_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Factory_Make_Call) RunAndReturn(run func(interface{}, ...map[string]interface{}) error) *Factory_Make_Call { + _c.Call.Return(run) + return _c +} + // NewFactory creates a new instance of Factory. 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 NewFactory(t interface { diff --git a/mocks/database/orm/Observer.go b/mocks/database/orm/Observer.go index 6bd5b8f35..b43876258 100644 --- a/mocks/database/orm/Observer.go +++ b/mocks/database/orm/Observer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,10 +12,22 @@ type Observer struct { mock.Mock } +type Observer_Expecter struct { + mock *mock.Mock +} + +func (_m *Observer) EXPECT() *Observer_Expecter { + return &Observer_Expecter{mock: &_m.Mock} +} + // Created provides a mock function with given fields: _a0 func (_m *Observer) Created(_a0 orm.Event) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Created") + } + var r0 error if rf, ok := ret.Get(0).(func(orm.Event) error); ok { r0 = rf(_a0) @@ -26,10 +38,42 @@ func (_m *Observer) Created(_a0 orm.Event) error { return r0 } +// Observer_Created_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Created' +type Observer_Created_Call struct { + *mock.Call +} + +// Created is a helper method to define mock.On call +// - _a0 orm.Event +func (_e *Observer_Expecter) Created(_a0 interface{}) *Observer_Created_Call { + return &Observer_Created_Call{Call: _e.mock.On("Created", _a0)} +} + +func (_c *Observer_Created_Call) Run(run func(_a0 orm.Event)) *Observer_Created_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(orm.Event)) + }) + return _c +} + +func (_c *Observer_Created_Call) Return(_a0 error) *Observer_Created_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Observer_Created_Call) RunAndReturn(run func(orm.Event) error) *Observer_Created_Call { + _c.Call.Return(run) + return _c +} + // Creating provides a mock function with given fields: _a0 func (_m *Observer) Creating(_a0 orm.Event) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Creating") + } + var r0 error if rf, ok := ret.Get(0).(func(orm.Event) error); ok { r0 = rf(_a0) @@ -40,10 +84,42 @@ func (_m *Observer) Creating(_a0 orm.Event) error { return r0 } +// Observer_Creating_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Creating' +type Observer_Creating_Call struct { + *mock.Call +} + +// Creating is a helper method to define mock.On call +// - _a0 orm.Event +func (_e *Observer_Expecter) Creating(_a0 interface{}) *Observer_Creating_Call { + return &Observer_Creating_Call{Call: _e.mock.On("Creating", _a0)} +} + +func (_c *Observer_Creating_Call) Run(run func(_a0 orm.Event)) *Observer_Creating_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(orm.Event)) + }) + return _c +} + +func (_c *Observer_Creating_Call) Return(_a0 error) *Observer_Creating_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Observer_Creating_Call) RunAndReturn(run func(orm.Event) error) *Observer_Creating_Call { + _c.Call.Return(run) + return _c +} + // Deleted provides a mock function with given fields: _a0 func (_m *Observer) Deleted(_a0 orm.Event) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Deleted") + } + var r0 error if rf, ok := ret.Get(0).(func(orm.Event) error); ok { r0 = rf(_a0) @@ -54,10 +130,42 @@ func (_m *Observer) Deleted(_a0 orm.Event) error { return r0 } +// Observer_Deleted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Deleted' +type Observer_Deleted_Call struct { + *mock.Call +} + +// Deleted is a helper method to define mock.On call +// - _a0 orm.Event +func (_e *Observer_Expecter) Deleted(_a0 interface{}) *Observer_Deleted_Call { + return &Observer_Deleted_Call{Call: _e.mock.On("Deleted", _a0)} +} + +func (_c *Observer_Deleted_Call) Run(run func(_a0 orm.Event)) *Observer_Deleted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(orm.Event)) + }) + return _c +} + +func (_c *Observer_Deleted_Call) Return(_a0 error) *Observer_Deleted_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Observer_Deleted_Call) RunAndReturn(run func(orm.Event) error) *Observer_Deleted_Call { + _c.Call.Return(run) + return _c +} + // Deleting provides a mock function with given fields: _a0 func (_m *Observer) Deleting(_a0 orm.Event) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Deleting") + } + var r0 error if rf, ok := ret.Get(0).(func(orm.Event) error); ok { r0 = rf(_a0) @@ -68,10 +176,42 @@ func (_m *Observer) Deleting(_a0 orm.Event) error { return r0 } +// Observer_Deleting_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Deleting' +type Observer_Deleting_Call struct { + *mock.Call +} + +// Deleting is a helper method to define mock.On call +// - _a0 orm.Event +func (_e *Observer_Expecter) Deleting(_a0 interface{}) *Observer_Deleting_Call { + return &Observer_Deleting_Call{Call: _e.mock.On("Deleting", _a0)} +} + +func (_c *Observer_Deleting_Call) Run(run func(_a0 orm.Event)) *Observer_Deleting_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(orm.Event)) + }) + return _c +} + +func (_c *Observer_Deleting_Call) Return(_a0 error) *Observer_Deleting_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Observer_Deleting_Call) RunAndReturn(run func(orm.Event) error) *Observer_Deleting_Call { + _c.Call.Return(run) + return _c +} + // ForceDeleted provides a mock function with given fields: _a0 func (_m *Observer) ForceDeleted(_a0 orm.Event) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for ForceDeleted") + } + var r0 error if rf, ok := ret.Get(0).(func(orm.Event) error); ok { r0 = rf(_a0) @@ -82,10 +222,42 @@ func (_m *Observer) ForceDeleted(_a0 orm.Event) error { return r0 } +// Observer_ForceDeleted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ForceDeleted' +type Observer_ForceDeleted_Call struct { + *mock.Call +} + +// ForceDeleted is a helper method to define mock.On call +// - _a0 orm.Event +func (_e *Observer_Expecter) ForceDeleted(_a0 interface{}) *Observer_ForceDeleted_Call { + return &Observer_ForceDeleted_Call{Call: _e.mock.On("ForceDeleted", _a0)} +} + +func (_c *Observer_ForceDeleted_Call) Run(run func(_a0 orm.Event)) *Observer_ForceDeleted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(orm.Event)) + }) + return _c +} + +func (_c *Observer_ForceDeleted_Call) Return(_a0 error) *Observer_ForceDeleted_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Observer_ForceDeleted_Call) RunAndReturn(run func(orm.Event) error) *Observer_ForceDeleted_Call { + _c.Call.Return(run) + return _c +} + // ForceDeleting provides a mock function with given fields: _a0 func (_m *Observer) ForceDeleting(_a0 orm.Event) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for ForceDeleting") + } + var r0 error if rf, ok := ret.Get(0).(func(orm.Event) error); ok { r0 = rf(_a0) @@ -96,10 +268,42 @@ func (_m *Observer) ForceDeleting(_a0 orm.Event) error { return r0 } +// Observer_ForceDeleting_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ForceDeleting' +type Observer_ForceDeleting_Call struct { + *mock.Call +} + +// ForceDeleting is a helper method to define mock.On call +// - _a0 orm.Event +func (_e *Observer_Expecter) ForceDeleting(_a0 interface{}) *Observer_ForceDeleting_Call { + return &Observer_ForceDeleting_Call{Call: _e.mock.On("ForceDeleting", _a0)} +} + +func (_c *Observer_ForceDeleting_Call) Run(run func(_a0 orm.Event)) *Observer_ForceDeleting_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(orm.Event)) + }) + return _c +} + +func (_c *Observer_ForceDeleting_Call) Return(_a0 error) *Observer_ForceDeleting_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Observer_ForceDeleting_Call) RunAndReturn(run func(orm.Event) error) *Observer_ForceDeleting_Call { + _c.Call.Return(run) + return _c +} + // Retrieved provides a mock function with given fields: _a0 func (_m *Observer) Retrieved(_a0 orm.Event) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Retrieved") + } + var r0 error if rf, ok := ret.Get(0).(func(orm.Event) error); ok { r0 = rf(_a0) @@ -110,10 +314,42 @@ func (_m *Observer) Retrieved(_a0 orm.Event) error { return r0 } +// Observer_Retrieved_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Retrieved' +type Observer_Retrieved_Call struct { + *mock.Call +} + +// Retrieved is a helper method to define mock.On call +// - _a0 orm.Event +func (_e *Observer_Expecter) Retrieved(_a0 interface{}) *Observer_Retrieved_Call { + return &Observer_Retrieved_Call{Call: _e.mock.On("Retrieved", _a0)} +} + +func (_c *Observer_Retrieved_Call) Run(run func(_a0 orm.Event)) *Observer_Retrieved_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(orm.Event)) + }) + return _c +} + +func (_c *Observer_Retrieved_Call) Return(_a0 error) *Observer_Retrieved_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Observer_Retrieved_Call) RunAndReturn(run func(orm.Event) error) *Observer_Retrieved_Call { + _c.Call.Return(run) + return _c +} + // Saved provides a mock function with given fields: _a0 func (_m *Observer) Saved(_a0 orm.Event) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Saved") + } + var r0 error if rf, ok := ret.Get(0).(func(orm.Event) error); ok { r0 = rf(_a0) @@ -124,10 +360,42 @@ func (_m *Observer) Saved(_a0 orm.Event) error { return r0 } +// Observer_Saved_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Saved' +type Observer_Saved_Call struct { + *mock.Call +} + +// Saved is a helper method to define mock.On call +// - _a0 orm.Event +func (_e *Observer_Expecter) Saved(_a0 interface{}) *Observer_Saved_Call { + return &Observer_Saved_Call{Call: _e.mock.On("Saved", _a0)} +} + +func (_c *Observer_Saved_Call) Run(run func(_a0 orm.Event)) *Observer_Saved_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(orm.Event)) + }) + return _c +} + +func (_c *Observer_Saved_Call) Return(_a0 error) *Observer_Saved_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Observer_Saved_Call) RunAndReturn(run func(orm.Event) error) *Observer_Saved_Call { + _c.Call.Return(run) + return _c +} + // Saving provides a mock function with given fields: _a0 func (_m *Observer) Saving(_a0 orm.Event) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Saving") + } + var r0 error if rf, ok := ret.Get(0).(func(orm.Event) error); ok { r0 = rf(_a0) @@ -138,10 +406,42 @@ func (_m *Observer) Saving(_a0 orm.Event) error { return r0 } +// Observer_Saving_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Saving' +type Observer_Saving_Call struct { + *mock.Call +} + +// Saving is a helper method to define mock.On call +// - _a0 orm.Event +func (_e *Observer_Expecter) Saving(_a0 interface{}) *Observer_Saving_Call { + return &Observer_Saving_Call{Call: _e.mock.On("Saving", _a0)} +} + +func (_c *Observer_Saving_Call) Run(run func(_a0 orm.Event)) *Observer_Saving_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(orm.Event)) + }) + return _c +} + +func (_c *Observer_Saving_Call) Return(_a0 error) *Observer_Saving_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Observer_Saving_Call) RunAndReturn(run func(orm.Event) error) *Observer_Saving_Call { + _c.Call.Return(run) + return _c +} + // Updated provides a mock function with given fields: _a0 func (_m *Observer) Updated(_a0 orm.Event) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Updated") + } + var r0 error if rf, ok := ret.Get(0).(func(orm.Event) error); ok { r0 = rf(_a0) @@ -152,10 +452,42 @@ func (_m *Observer) Updated(_a0 orm.Event) error { return r0 } +// Observer_Updated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Updated' +type Observer_Updated_Call struct { + *mock.Call +} + +// Updated is a helper method to define mock.On call +// - _a0 orm.Event +func (_e *Observer_Expecter) Updated(_a0 interface{}) *Observer_Updated_Call { + return &Observer_Updated_Call{Call: _e.mock.On("Updated", _a0)} +} + +func (_c *Observer_Updated_Call) Run(run func(_a0 orm.Event)) *Observer_Updated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(orm.Event)) + }) + return _c +} + +func (_c *Observer_Updated_Call) Return(_a0 error) *Observer_Updated_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Observer_Updated_Call) RunAndReturn(run func(orm.Event) error) *Observer_Updated_Call { + _c.Call.Return(run) + return _c +} + // Updating provides a mock function with given fields: _a0 func (_m *Observer) Updating(_a0 orm.Event) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Updating") + } + var r0 error if rf, ok := ret.Get(0).(func(orm.Event) error); ok { r0 = rf(_a0) @@ -166,6 +498,34 @@ func (_m *Observer) Updating(_a0 orm.Event) error { return r0 } +// Observer_Updating_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Updating' +type Observer_Updating_Call struct { + *mock.Call +} + +// Updating is a helper method to define mock.On call +// - _a0 orm.Event +func (_e *Observer_Expecter) Updating(_a0 interface{}) *Observer_Updating_Call { + return &Observer_Updating_Call{Call: _e.mock.On("Updating", _a0)} +} + +func (_c *Observer_Updating_Call) Run(run func(_a0 orm.Event)) *Observer_Updating_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(orm.Event)) + }) + return _c +} + +func (_c *Observer_Updating_Call) Return(_a0 error) *Observer_Updating_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Observer_Updating_Call) RunAndReturn(run func(orm.Event) error) *Observer_Updating_Call { + _c.Call.Return(run) + return _c +} + // NewObserver creates a new instance of Observer. 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 NewObserver(t interface { diff --git a/mocks/database/orm/Orm.go b/mocks/database/orm/Orm.go index aa0acd3a6..4c0ec6590 100644 --- a/mocks/database/orm/Orm.go +++ b/mocks/database/orm/Orm.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -16,10 +16,22 @@ type Orm struct { mock.Mock } +type Orm_Expecter struct { + mock *mock.Mock +} + +func (_m *Orm) EXPECT() *Orm_Expecter { + return &Orm_Expecter{mock: &_m.Mock} +} + // Connection provides a mock function with given fields: name func (_m *Orm) Connection(name string) orm.Orm { ret := _m.Called(name) + if len(ret) == 0 { + panic("no return value specified for Connection") + } + var r0 orm.Orm if rf, ok := ret.Get(0).(func(string) orm.Orm); ok { r0 = rf(name) @@ -32,10 +44,42 @@ func (_m *Orm) Connection(name string) orm.Orm { return r0 } +// Orm_Connection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Connection' +type Orm_Connection_Call struct { + *mock.Call +} + +// Connection is a helper method to define mock.On call +// - name string +func (_e *Orm_Expecter) Connection(name interface{}) *Orm_Connection_Call { + return &Orm_Connection_Call{Call: _e.mock.On("Connection", name)} +} + +func (_c *Orm_Connection_Call) Run(run func(name string)) *Orm_Connection_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Orm_Connection_Call) Return(_a0 orm.Orm) *Orm_Connection_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Orm_Connection_Call) RunAndReturn(run func(string) orm.Orm) *Orm_Connection_Call { + _c.Call.Return(run) + return _c +} + // DB provides a mock function with given fields: func (_m *Orm) DB() (*sql.DB, error) { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for DB") + } + var r0 *sql.DB var r1 error if rf, ok := ret.Get(0).(func() (*sql.DB, error)); ok { @@ -58,10 +102,41 @@ func (_m *Orm) DB() (*sql.DB, error) { return r0, r1 } +// Orm_DB_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DB' +type Orm_DB_Call struct { + *mock.Call +} + +// DB is a helper method to define mock.On call +func (_e *Orm_Expecter) DB() *Orm_DB_Call { + return &Orm_DB_Call{Call: _e.mock.On("DB")} +} + +func (_c *Orm_DB_Call) Run(run func()) *Orm_DB_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Orm_DB_Call) Return(_a0 *sql.DB, _a1 error) *Orm_DB_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Orm_DB_Call) RunAndReturn(run func() (*sql.DB, error)) *Orm_DB_Call { + _c.Call.Return(run) + return _c +} + // Factory provides a mock function with given fields: func (_m *Orm) Factory() orm.Factory { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Factory") + } + var r0 orm.Factory if rf, ok := ret.Get(0).(func() orm.Factory); ok { r0 = rf() @@ -74,15 +149,75 @@ func (_m *Orm) Factory() orm.Factory { return r0 } +// Orm_Factory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Factory' +type Orm_Factory_Call struct { + *mock.Call +} + +// Factory is a helper method to define mock.On call +func (_e *Orm_Expecter) Factory() *Orm_Factory_Call { + return &Orm_Factory_Call{Call: _e.mock.On("Factory")} +} + +func (_c *Orm_Factory_Call) Run(run func()) *Orm_Factory_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Orm_Factory_Call) Return(_a0 orm.Factory) *Orm_Factory_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Orm_Factory_Call) RunAndReturn(run func() orm.Factory) *Orm_Factory_Call { + _c.Call.Return(run) + return _c +} + // Observe provides a mock function with given fields: model, observer func (_m *Orm) Observe(model interface{}, observer orm.Observer) { _m.Called(model, observer) } +// Orm_Observe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Observe' +type Orm_Observe_Call struct { + *mock.Call +} + +// Observe is a helper method to define mock.On call +// - model interface{} +// - observer orm.Observer +func (_e *Orm_Expecter) Observe(model interface{}, observer interface{}) *Orm_Observe_Call { + return &Orm_Observe_Call{Call: _e.mock.On("Observe", model, observer)} +} + +func (_c *Orm_Observe_Call) Run(run func(model interface{}, observer orm.Observer)) *Orm_Observe_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{}), args[1].(orm.Observer)) + }) + return _c +} + +func (_c *Orm_Observe_Call) Return() *Orm_Observe_Call { + _c.Call.Return() + return _c +} + +func (_c *Orm_Observe_Call) RunAndReturn(run func(interface{}, orm.Observer)) *Orm_Observe_Call { + _c.Call.Return(run) + return _c +} + // Query provides a mock function with given fields: func (_m *Orm) Query() orm.Query { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Query") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func() orm.Query); ok { r0 = rf() @@ -95,10 +230,41 @@ func (_m *Orm) Query() orm.Query { return r0 } +// Orm_Query_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Query' +type Orm_Query_Call struct { + *mock.Call +} + +// Query is a helper method to define mock.On call +func (_e *Orm_Expecter) Query() *Orm_Query_Call { + return &Orm_Query_Call{Call: _e.mock.On("Query")} +} + +func (_c *Orm_Query_Call) Run(run func()) *Orm_Query_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Orm_Query_Call) Return(_a0 orm.Query) *Orm_Query_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Orm_Query_Call) RunAndReturn(run func() orm.Query) *Orm_Query_Call { + _c.Call.Return(run) + return _c +} + // Transaction provides a mock function with given fields: txFunc func (_m *Orm) Transaction(txFunc func(orm.Transaction) error) error { ret := _m.Called(txFunc) + if len(ret) == 0 { + panic("no return value specified for Transaction") + } + var r0 error if rf, ok := ret.Get(0).(func(func(orm.Transaction) error) error); ok { r0 = rf(txFunc) @@ -109,10 +275,42 @@ func (_m *Orm) Transaction(txFunc func(orm.Transaction) error) error { return r0 } +// Orm_Transaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Transaction' +type Orm_Transaction_Call struct { + *mock.Call +} + +// Transaction is a helper method to define mock.On call +// - txFunc func(orm.Transaction) error +func (_e *Orm_Expecter) Transaction(txFunc interface{}) *Orm_Transaction_Call { + return &Orm_Transaction_Call{Call: _e.mock.On("Transaction", txFunc)} +} + +func (_c *Orm_Transaction_Call) Run(run func(txFunc func(orm.Transaction) error)) *Orm_Transaction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(func(orm.Transaction) error)) + }) + return _c +} + +func (_c *Orm_Transaction_Call) Return(_a0 error) *Orm_Transaction_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Orm_Transaction_Call) RunAndReturn(run func(func(orm.Transaction) error) error) *Orm_Transaction_Call { + _c.Call.Return(run) + return _c +} + // WithContext provides a mock function with given fields: ctx func (_m *Orm) WithContext(ctx context.Context) orm.Orm { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for WithContext") + } + var r0 orm.Orm if rf, ok := ret.Get(0).(func(context.Context) orm.Orm); ok { r0 = rf(ctx) @@ -125,6 +323,34 @@ func (_m *Orm) WithContext(ctx context.Context) orm.Orm { return r0 } +// Orm_WithContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithContext' +type Orm_WithContext_Call struct { + *mock.Call +} + +// WithContext is a helper method to define mock.On call +// - ctx context.Context +func (_e *Orm_Expecter) WithContext(ctx interface{}) *Orm_WithContext_Call { + return &Orm_WithContext_Call{Call: _e.mock.On("WithContext", ctx)} +} + +func (_c *Orm_WithContext_Call) Run(run func(ctx context.Context)) *Orm_WithContext_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Orm_WithContext_Call) Return(_a0 orm.Orm) *Orm_WithContext_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Orm_WithContext_Call) RunAndReturn(run func(context.Context) orm.Orm) *Orm_WithContext_Call { + _c.Call.Return(run) + return _c +} + // NewOrm creates a new instance of Orm. 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 NewOrm(t interface { diff --git a/mocks/database/orm/Query.go b/mocks/database/orm/Query.go index 39dfcee90..17334ced2 100644 --- a/mocks/database/orm/Query.go +++ b/mocks/database/orm/Query.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,10 +12,22 @@ type Query struct { mock.Mock } +type Query_Expecter struct { + mock *mock.Mock +} + +func (_m *Query) EXPECT() *Query_Expecter { + return &Query_Expecter{mock: &_m.Mock} +} + // Association provides a mock function with given fields: association func (_m *Query) Association(association string) orm.Association { ret := _m.Called(association) + if len(ret) == 0 { + panic("no return value specified for Association") + } + var r0 orm.Association if rf, ok := ret.Get(0).(func(string) orm.Association); ok { r0 = rf(association) @@ -28,10 +40,42 @@ func (_m *Query) Association(association string) orm.Association { return r0 } +// Query_Association_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Association' +type Query_Association_Call struct { + *mock.Call +} + +// Association is a helper method to define mock.On call +// - association string +func (_e *Query_Expecter) Association(association interface{}) *Query_Association_Call { + return &Query_Association_Call{Call: _e.mock.On("Association", association)} +} + +func (_c *Query_Association_Call) Run(run func(association string)) *Query_Association_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Query_Association_Call) Return(_a0 orm.Association) *Query_Association_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_Association_Call) RunAndReturn(run func(string) orm.Association) *Query_Association_Call { + _c.Call.Return(run) + return _c +} + // Begin provides a mock function with given fields: func (_m *Query) Begin() (orm.Transaction, error) { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Begin") + } + var r0 orm.Transaction var r1 error if rf, ok := ret.Get(0).(func() (orm.Transaction, error)); ok { @@ -54,10 +98,41 @@ func (_m *Query) Begin() (orm.Transaction, error) { return r0, r1 } +// Query_Begin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Begin' +type Query_Begin_Call struct { + *mock.Call +} + +// Begin is a helper method to define mock.On call +func (_e *Query_Expecter) Begin() *Query_Begin_Call { + return &Query_Begin_Call{Call: _e.mock.On("Begin")} +} + +func (_c *Query_Begin_Call) Run(run func()) *Query_Begin_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Query_Begin_Call) Return(_a0 orm.Transaction, _a1 error) *Query_Begin_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Query_Begin_Call) RunAndReturn(run func() (orm.Transaction, error)) *Query_Begin_Call { + _c.Call.Return(run) + return _c +} + // Count provides a mock function with given fields: count func (_m *Query) Count(count *int64) error { ret := _m.Called(count) + if len(ret) == 0 { + panic("no return value specified for Count") + } + var r0 error if rf, ok := ret.Get(0).(func(*int64) error); ok { r0 = rf(count) @@ -68,10 +143,42 @@ func (_m *Query) Count(count *int64) error { return r0 } +// Query_Count_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Count' +type Query_Count_Call struct { + *mock.Call +} + +// Count is a helper method to define mock.On call +// - count *int64 +func (_e *Query_Expecter) Count(count interface{}) *Query_Count_Call { + return &Query_Count_Call{Call: _e.mock.On("Count", count)} +} + +func (_c *Query_Count_Call) Run(run func(count *int64)) *Query_Count_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*int64)) + }) + return _c +} + +func (_c *Query_Count_Call) Return(_a0 error) *Query_Count_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_Count_Call) RunAndReturn(run func(*int64) error) *Query_Count_Call { + _c.Call.Return(run) + return _c +} + // Create provides a mock function with given fields: value func (_m *Query) Create(value interface{}) error { ret := _m.Called(value) + if len(ret) == 0 { + panic("no return value specified for Create") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}) error); ok { r0 = rf(value) @@ -82,10 +189,42 @@ func (_m *Query) Create(value interface{}) error { return r0 } +// Query_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type Query_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - value interface{} +func (_e *Query_Expecter) Create(value interface{}) *Query_Create_Call { + return &Query_Create_Call{Call: _e.mock.On("Create", value)} +} + +func (_c *Query_Create_Call) Run(run func(value interface{})) *Query_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Query_Create_Call) Return(_a0 error) *Query_Create_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_Create_Call) RunAndReturn(run func(interface{}) error) *Query_Create_Call { + _c.Call.Return(run) + return _c +} + // Cursor provides a mock function with given fields: func (_m *Query) Cursor() (chan orm.Cursor, error) { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Cursor") + } + var r0 chan orm.Cursor var r1 error if rf, ok := ret.Get(0).(func() (chan orm.Cursor, error)); ok { @@ -108,6 +247,33 @@ func (_m *Query) Cursor() (chan orm.Cursor, error) { return r0, r1 } +// Query_Cursor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Cursor' +type Query_Cursor_Call struct { + *mock.Call +} + +// Cursor is a helper method to define mock.On call +func (_e *Query_Expecter) Cursor() *Query_Cursor_Call { + return &Query_Cursor_Call{Call: _e.mock.On("Cursor")} +} + +func (_c *Query_Cursor_Call) Run(run func()) *Query_Cursor_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Query_Cursor_Call) Return(_a0 chan orm.Cursor, _a1 error) *Query_Cursor_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Query_Cursor_Call) RunAndReturn(run func() (chan orm.Cursor, error)) *Query_Cursor_Call { + _c.Call.Return(run) + return _c +} + // Delete provides a mock function with given fields: value, conds func (_m *Query) Delete(value interface{}, conds ...interface{}) (*orm.Result, error) { var _ca []interface{} @@ -115,6 +281,10 @@ func (_m *Query) Delete(value interface{}, conds ...interface{}) (*orm.Result, e _ca = append(_ca, conds...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Delete") + } + var r0 *orm.Result var r1 error if rf, ok := ret.Get(0).(func(interface{}, ...interface{}) (*orm.Result, error)); ok { @@ -137,12 +307,52 @@ func (_m *Query) Delete(value interface{}, conds ...interface{}) (*orm.Result, e return r0, r1 } +// Query_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type Query_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - value interface{} +// - conds ...interface{} +func (_e *Query_Expecter) Delete(value interface{}, conds ...interface{}) *Query_Delete_Call { + return &Query_Delete_Call{Call: _e.mock.On("Delete", + append([]interface{}{value}, conds...)...)} +} + +func (_c *Query_Delete_Call) Run(run func(value interface{}, conds ...interface{})) *Query_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(interface{}), variadicArgs...) + }) + return _c +} + +func (_c *Query_Delete_Call) Return(_a0 *orm.Result, _a1 error) *Query_Delete_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Query_Delete_Call) RunAndReturn(run func(interface{}, ...interface{}) (*orm.Result, error)) *Query_Delete_Call { + _c.Call.Return(run) + return _c +} + // Distinct provides a mock function with given fields: args func (_m *Query) Distinct(args ...interface{}) orm.Query { var _ca []interface{} _ca = append(_ca, args...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Distinct") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(...interface{}) orm.Query); ok { r0 = rf(args...) @@ -155,10 +365,49 @@ func (_m *Query) Distinct(args ...interface{}) orm.Query { return r0 } +// Query_Distinct_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Distinct' +type Query_Distinct_Call struct { + *mock.Call +} + +// Distinct is a helper method to define mock.On call +// - args ...interface{} +func (_e *Query_Expecter) Distinct(args ...interface{}) *Query_Distinct_Call { + return &Query_Distinct_Call{Call: _e.mock.On("Distinct", + append([]interface{}{}, args...)...)} +} + +func (_c *Query_Distinct_Call) Run(run func(args ...interface{})) *Query_Distinct_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Query_Distinct_Call) Return(_a0 orm.Query) *Query_Distinct_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_Distinct_Call) RunAndReturn(run func(...interface{}) orm.Query) *Query_Distinct_Call { + _c.Call.Return(run) + return _c +} + // Driver provides a mock function with given fields: func (_m *Query) Driver() orm.Driver { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Driver") + } + var r0 orm.Driver if rf, ok := ret.Get(0).(func() orm.Driver); ok { r0 = rf() @@ -169,6 +418,33 @@ func (_m *Query) Driver() orm.Driver { return r0 } +// Query_Driver_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Driver' +type Query_Driver_Call struct { + *mock.Call +} + +// Driver is a helper method to define mock.On call +func (_e *Query_Expecter) Driver() *Query_Driver_Call { + return &Query_Driver_Call{Call: _e.mock.On("Driver")} +} + +func (_c *Query_Driver_Call) Run(run func()) *Query_Driver_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Query_Driver_Call) Return(_a0 orm.Driver) *Query_Driver_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_Driver_Call) RunAndReturn(run func() orm.Driver) *Query_Driver_Call { + _c.Call.Return(run) + return _c +} + // Exec provides a mock function with given fields: sql, values func (_m *Query) Exec(sql string, values ...interface{}) (*orm.Result, error) { var _ca []interface{} @@ -176,6 +452,10 @@ func (_m *Query) Exec(sql string, values ...interface{}) (*orm.Result, error) { _ca = append(_ca, values...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Exec") + } + var r0 *orm.Result var r1 error if rf, ok := ret.Get(0).(func(string, ...interface{}) (*orm.Result, error)); ok { @@ -198,10 +478,50 @@ func (_m *Query) Exec(sql string, values ...interface{}) (*orm.Result, error) { return r0, r1 } +// Query_Exec_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Exec' +type Query_Exec_Call struct { + *mock.Call +} + +// Exec is a helper method to define mock.On call +// - sql string +// - values ...interface{} +func (_e *Query_Expecter) Exec(sql interface{}, values ...interface{}) *Query_Exec_Call { + return &Query_Exec_Call{Call: _e.mock.On("Exec", + append([]interface{}{sql}, values...)...)} +} + +func (_c *Query_Exec_Call) Run(run func(sql string, values ...interface{})) *Query_Exec_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Query_Exec_Call) Return(_a0 *orm.Result, _a1 error) *Query_Exec_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Query_Exec_Call) RunAndReturn(run func(string, ...interface{}) (*orm.Result, error)) *Query_Exec_Call { + _c.Call.Return(run) + return _c +} + // Exists provides a mock function with given fields: exists func (_m *Query) Exists(exists *bool) error { ret := _m.Called(exists) + if len(ret) == 0 { + panic("no return value specified for Exists") + } + var r0 error if rf, ok := ret.Get(0).(func(*bool) error); ok { r0 = rf(exists) @@ -212,6 +532,34 @@ func (_m *Query) Exists(exists *bool) error { return r0 } +// Query_Exists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Exists' +type Query_Exists_Call struct { + *mock.Call +} + +// Exists is a helper method to define mock.On call +// - exists *bool +func (_e *Query_Expecter) Exists(exists interface{}) *Query_Exists_Call { + return &Query_Exists_Call{Call: _e.mock.On("Exists", exists)} +} + +func (_c *Query_Exists_Call) Run(run func(exists *bool)) *Query_Exists_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bool)) + }) + return _c +} + +func (_c *Query_Exists_Call) Return(_a0 error) *Query_Exists_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_Exists_Call) RunAndReturn(run func(*bool) error) *Query_Exists_Call { + _c.Call.Return(run) + return _c +} + // Find provides a mock function with given fields: dest, conds func (_m *Query) Find(dest interface{}, conds ...interface{}) error { var _ca []interface{} @@ -219,6 +567,10 @@ func (_m *Query) Find(dest interface{}, conds ...interface{}) error { _ca = append(_ca, conds...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Find") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}, ...interface{}) error); ok { r0 = rf(dest, conds...) @@ -229,6 +581,42 @@ func (_m *Query) Find(dest interface{}, conds ...interface{}) error { return r0 } +// Query_Find_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Find' +type Query_Find_Call struct { + *mock.Call +} + +// Find is a helper method to define mock.On call +// - dest interface{} +// - conds ...interface{} +func (_e *Query_Expecter) Find(dest interface{}, conds ...interface{}) *Query_Find_Call { + return &Query_Find_Call{Call: _e.mock.On("Find", + append([]interface{}{dest}, conds...)...)} +} + +func (_c *Query_Find_Call) Run(run func(dest interface{}, conds ...interface{})) *Query_Find_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(interface{}), variadicArgs...) + }) + return _c +} + +func (_c *Query_Find_Call) Return(_a0 error) *Query_Find_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_Find_Call) RunAndReturn(run func(interface{}, ...interface{}) error) *Query_Find_Call { + _c.Call.Return(run) + return _c +} + // FindOrFail provides a mock function with given fields: dest, conds func (_m *Query) FindOrFail(dest interface{}, conds ...interface{}) error { var _ca []interface{} @@ -236,6 +624,10 @@ func (_m *Query) FindOrFail(dest interface{}, conds ...interface{}) error { _ca = append(_ca, conds...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for FindOrFail") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}, ...interface{}) error); ok { r0 = rf(dest, conds...) @@ -246,10 +638,50 @@ func (_m *Query) FindOrFail(dest interface{}, conds ...interface{}) error { return r0 } +// Query_FindOrFail_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindOrFail' +type Query_FindOrFail_Call struct { + *mock.Call +} + +// FindOrFail is a helper method to define mock.On call +// - dest interface{} +// - conds ...interface{} +func (_e *Query_Expecter) FindOrFail(dest interface{}, conds ...interface{}) *Query_FindOrFail_Call { + return &Query_FindOrFail_Call{Call: _e.mock.On("FindOrFail", + append([]interface{}{dest}, conds...)...)} +} + +func (_c *Query_FindOrFail_Call) Run(run func(dest interface{}, conds ...interface{})) *Query_FindOrFail_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(interface{}), variadicArgs...) + }) + return _c +} + +func (_c *Query_FindOrFail_Call) Return(_a0 error) *Query_FindOrFail_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_FindOrFail_Call) RunAndReturn(run func(interface{}, ...interface{}) error) *Query_FindOrFail_Call { + _c.Call.Return(run) + return _c +} + // First provides a mock function with given fields: dest func (_m *Query) First(dest interface{}) error { ret := _m.Called(dest) + if len(ret) == 0 { + panic("no return value specified for First") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}) error); ok { r0 = rf(dest) @@ -260,10 +692,42 @@ func (_m *Query) First(dest interface{}) error { return r0 } +// Query_First_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'First' +type Query_First_Call struct { + *mock.Call +} + +// First is a helper method to define mock.On call +// - dest interface{} +func (_e *Query_Expecter) First(dest interface{}) *Query_First_Call { + return &Query_First_Call{Call: _e.mock.On("First", dest)} +} + +func (_c *Query_First_Call) Run(run func(dest interface{})) *Query_First_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Query_First_Call) Return(_a0 error) *Query_First_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_First_Call) RunAndReturn(run func(interface{}) error) *Query_First_Call { + _c.Call.Return(run) + return _c +} + // FirstOr provides a mock function with given fields: dest, callback func (_m *Query) FirstOr(dest interface{}, callback func() error) error { ret := _m.Called(dest, callback) + if len(ret) == 0 { + panic("no return value specified for FirstOr") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}, func() error) error); ok { r0 = rf(dest, callback) @@ -274,6 +738,35 @@ func (_m *Query) FirstOr(dest interface{}, callback func() error) error { return r0 } +// Query_FirstOr_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FirstOr' +type Query_FirstOr_Call struct { + *mock.Call +} + +// FirstOr is a helper method to define mock.On call +// - dest interface{} +// - callback func() error +func (_e *Query_Expecter) FirstOr(dest interface{}, callback interface{}) *Query_FirstOr_Call { + return &Query_FirstOr_Call{Call: _e.mock.On("FirstOr", dest, callback)} +} + +func (_c *Query_FirstOr_Call) Run(run func(dest interface{}, callback func() error)) *Query_FirstOr_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{}), args[1].(func() error)) + }) + return _c +} + +func (_c *Query_FirstOr_Call) Return(_a0 error) *Query_FirstOr_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_FirstOr_Call) RunAndReturn(run func(interface{}, func() error) error) *Query_FirstOr_Call { + _c.Call.Return(run) + return _c +} + // FirstOrCreate provides a mock function with given fields: dest, conds func (_m *Query) FirstOrCreate(dest interface{}, conds ...interface{}) error { var _ca []interface{} @@ -281,6 +774,10 @@ func (_m *Query) FirstOrCreate(dest interface{}, conds ...interface{}) error { _ca = append(_ca, conds...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for FirstOrCreate") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}, ...interface{}) error); ok { r0 = rf(dest, conds...) @@ -291,10 +788,50 @@ func (_m *Query) FirstOrCreate(dest interface{}, conds ...interface{}) error { return r0 } +// Query_FirstOrCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FirstOrCreate' +type Query_FirstOrCreate_Call struct { + *mock.Call +} + +// FirstOrCreate is a helper method to define mock.On call +// - dest interface{} +// - conds ...interface{} +func (_e *Query_Expecter) FirstOrCreate(dest interface{}, conds ...interface{}) *Query_FirstOrCreate_Call { + return &Query_FirstOrCreate_Call{Call: _e.mock.On("FirstOrCreate", + append([]interface{}{dest}, conds...)...)} +} + +func (_c *Query_FirstOrCreate_Call) Run(run func(dest interface{}, conds ...interface{})) *Query_FirstOrCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(interface{}), variadicArgs...) + }) + return _c +} + +func (_c *Query_FirstOrCreate_Call) Return(_a0 error) *Query_FirstOrCreate_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_FirstOrCreate_Call) RunAndReturn(run func(interface{}, ...interface{}) error) *Query_FirstOrCreate_Call { + _c.Call.Return(run) + return _c +} + // FirstOrFail provides a mock function with given fields: dest func (_m *Query) FirstOrFail(dest interface{}) error { ret := _m.Called(dest) + if len(ret) == 0 { + panic("no return value specified for FirstOrFail") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}) error); ok { r0 = rf(dest) @@ -305,6 +842,34 @@ func (_m *Query) FirstOrFail(dest interface{}) error { return r0 } +// Query_FirstOrFail_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FirstOrFail' +type Query_FirstOrFail_Call struct { + *mock.Call +} + +// FirstOrFail is a helper method to define mock.On call +// - dest interface{} +func (_e *Query_Expecter) FirstOrFail(dest interface{}) *Query_FirstOrFail_Call { + return &Query_FirstOrFail_Call{Call: _e.mock.On("FirstOrFail", dest)} +} + +func (_c *Query_FirstOrFail_Call) Run(run func(dest interface{})) *Query_FirstOrFail_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Query_FirstOrFail_Call) Return(_a0 error) *Query_FirstOrFail_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_FirstOrFail_Call) RunAndReturn(run func(interface{}) error) *Query_FirstOrFail_Call { + _c.Call.Return(run) + return _c +} + // FirstOrNew provides a mock function with given fields: dest, attributes, values func (_m *Query) FirstOrNew(dest interface{}, attributes interface{}, values ...interface{}) error { var _ca []interface{} @@ -312,6 +877,10 @@ func (_m *Query) FirstOrNew(dest interface{}, attributes interface{}, values ... _ca = append(_ca, values...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for FirstOrNew") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}, interface{}, ...interface{}) error); ok { r0 = rf(dest, attributes, values...) @@ -322,6 +891,43 @@ func (_m *Query) FirstOrNew(dest interface{}, attributes interface{}, values ... return r0 } +// Query_FirstOrNew_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FirstOrNew' +type Query_FirstOrNew_Call struct { + *mock.Call +} + +// FirstOrNew is a helper method to define mock.On call +// - dest interface{} +// - attributes interface{} +// - values ...interface{} +func (_e *Query_Expecter) FirstOrNew(dest interface{}, attributes interface{}, values ...interface{}) *Query_FirstOrNew_Call { + return &Query_FirstOrNew_Call{Call: _e.mock.On("FirstOrNew", + append([]interface{}{dest, attributes}, values...)...)} +} + +func (_c *Query_FirstOrNew_Call) Run(run func(dest interface{}, attributes interface{}, values ...interface{})) *Query_FirstOrNew_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(interface{}), args[1].(interface{}), variadicArgs...) + }) + return _c +} + +func (_c *Query_FirstOrNew_Call) Return(_a0 error) *Query_FirstOrNew_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_FirstOrNew_Call) RunAndReturn(run func(interface{}, interface{}, ...interface{}) error) *Query_FirstOrNew_Call { + _c.Call.Return(run) + return _c +} + // ForceDelete provides a mock function with given fields: value, conds func (_m *Query) ForceDelete(value interface{}, conds ...interface{}) (*orm.Result, error) { var _ca []interface{} @@ -329,6 +935,10 @@ func (_m *Query) ForceDelete(value interface{}, conds ...interface{}) (*orm.Resu _ca = append(_ca, conds...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for ForceDelete") + } + var r0 *orm.Result var r1 error if rf, ok := ret.Get(0).(func(interface{}, ...interface{}) (*orm.Result, error)); ok { @@ -351,10 +961,50 @@ func (_m *Query) ForceDelete(value interface{}, conds ...interface{}) (*orm.Resu return r0, r1 } +// Query_ForceDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ForceDelete' +type Query_ForceDelete_Call struct { + *mock.Call +} + +// ForceDelete is a helper method to define mock.On call +// - value interface{} +// - conds ...interface{} +func (_e *Query_Expecter) ForceDelete(value interface{}, conds ...interface{}) *Query_ForceDelete_Call { + return &Query_ForceDelete_Call{Call: _e.mock.On("ForceDelete", + append([]interface{}{value}, conds...)...)} +} + +func (_c *Query_ForceDelete_Call) Run(run func(value interface{}, conds ...interface{})) *Query_ForceDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(interface{}), variadicArgs...) + }) + return _c +} + +func (_c *Query_ForceDelete_Call) Return(_a0 *orm.Result, _a1 error) *Query_ForceDelete_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Query_ForceDelete_Call) RunAndReturn(run func(interface{}, ...interface{}) (*orm.Result, error)) *Query_ForceDelete_Call { + _c.Call.Return(run) + return _c +} + // Get provides a mock function with given fields: dest func (_m *Query) Get(dest interface{}) error { ret := _m.Called(dest) + if len(ret) == 0 { + panic("no return value specified for Get") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}) error); ok { r0 = rf(dest) @@ -365,10 +1015,42 @@ func (_m *Query) Get(dest interface{}) error { return r0 } +// Query_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type Query_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - dest interface{} +func (_e *Query_Expecter) Get(dest interface{}) *Query_Get_Call { + return &Query_Get_Call{Call: _e.mock.On("Get", dest)} +} + +func (_c *Query_Get_Call) Run(run func(dest interface{})) *Query_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Query_Get_Call) Return(_a0 error) *Query_Get_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_Get_Call) RunAndReturn(run func(interface{}) error) *Query_Get_Call { + _c.Call.Return(run) + return _c +} + // Group provides a mock function with given fields: name func (_m *Query) Group(name string) orm.Query { ret := _m.Called(name) + if len(ret) == 0 { + panic("no return value specified for Group") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string) orm.Query); ok { r0 = rf(name) @@ -381,6 +1063,34 @@ func (_m *Query) Group(name string) orm.Query { return r0 } +// Query_Group_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Group' +type Query_Group_Call struct { + *mock.Call +} + +// Group is a helper method to define mock.On call +// - name string +func (_e *Query_Expecter) Group(name interface{}) *Query_Group_Call { + return &Query_Group_Call{Call: _e.mock.On("Group", name)} +} + +func (_c *Query_Group_Call) Run(run func(name string)) *Query_Group_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Query_Group_Call) Return(_a0 orm.Query) *Query_Group_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_Group_Call) RunAndReturn(run func(string) orm.Query) *Query_Group_Call { + _c.Call.Return(run) + return _c +} + // Having provides a mock function with given fields: query, args func (_m *Query) Having(query interface{}, args ...interface{}) orm.Query { var _ca []interface{} @@ -388,6 +1098,10 @@ func (_m *Query) Having(query interface{}, args ...interface{}) orm.Query { _ca = append(_ca, args...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Having") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(interface{}, ...interface{}) orm.Query); ok { r0 = rf(query, args...) @@ -400,10 +1114,50 @@ func (_m *Query) Having(query interface{}, args ...interface{}) orm.Query { return r0 } -// InRandomOrder provides a mock function with given fields: -func (_m *Query) InRandomOrder() orm.Query { +// Query_Having_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Having' +type Query_Having_Call struct { + *mock.Call +} + +// Having is a helper method to define mock.On call +// - query interface{} +// - args ...interface{} +func (_e *Query_Expecter) Having(query interface{}, args ...interface{}) *Query_Having_Call { + return &Query_Having_Call{Call: _e.mock.On("Having", + append([]interface{}{query}, args...)...)} +} + +func (_c *Query_Having_Call) Run(run func(query interface{}, args ...interface{})) *Query_Having_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(interface{}), variadicArgs...) + }) + return _c +} + +func (_c *Query_Having_Call) Return(_a0 orm.Query) *Query_Having_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_Having_Call) RunAndReturn(run func(interface{}, ...interface{}) orm.Query) *Query_Having_Call { + _c.Call.Return(run) + return _c +} + +// InRandomOrder provides a mock function with given fields: +func (_m *Query) InRandomOrder() orm.Query { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for InRandomOrder") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func() orm.Query); ok { r0 = rf() @@ -416,6 +1170,33 @@ func (_m *Query) InRandomOrder() orm.Query { return r0 } +// Query_InRandomOrder_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InRandomOrder' +type Query_InRandomOrder_Call struct { + *mock.Call +} + +// InRandomOrder is a helper method to define mock.On call +func (_e *Query_Expecter) InRandomOrder() *Query_InRandomOrder_Call { + return &Query_InRandomOrder_Call{Call: _e.mock.On("InRandomOrder")} +} + +func (_c *Query_InRandomOrder_Call) Run(run func()) *Query_InRandomOrder_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Query_InRandomOrder_Call) Return(_a0 orm.Query) *Query_InRandomOrder_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_InRandomOrder_Call) RunAndReturn(run func() orm.Query) *Query_InRandomOrder_Call { + _c.Call.Return(run) + return _c +} + // Join provides a mock function with given fields: query, args func (_m *Query) Join(query string, args ...interface{}) orm.Query { var _ca []interface{} @@ -423,6 +1204,10 @@ func (_m *Query) Join(query string, args ...interface{}) orm.Query { _ca = append(_ca, args...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Join") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string, ...interface{}) orm.Query); ok { r0 = rf(query, args...) @@ -435,10 +1220,50 @@ func (_m *Query) Join(query string, args ...interface{}) orm.Query { return r0 } +// Query_Join_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Join' +type Query_Join_Call struct { + *mock.Call +} + +// Join is a helper method to define mock.On call +// - query string +// - args ...interface{} +func (_e *Query_Expecter) Join(query interface{}, args ...interface{}) *Query_Join_Call { + return &Query_Join_Call{Call: _e.mock.On("Join", + append([]interface{}{query}, args...)...)} +} + +func (_c *Query_Join_Call) Run(run func(query string, args ...interface{})) *Query_Join_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Query_Join_Call) Return(_a0 orm.Query) *Query_Join_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_Join_Call) RunAndReturn(run func(string, ...interface{}) orm.Query) *Query_Join_Call { + _c.Call.Return(run) + return _c +} + // Limit provides a mock function with given fields: limit func (_m *Query) Limit(limit int) orm.Query { ret := _m.Called(limit) + if len(ret) == 0 { + panic("no return value specified for Limit") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(int) orm.Query); ok { r0 = rf(limit) @@ -451,6 +1276,34 @@ func (_m *Query) Limit(limit int) orm.Query { return r0 } +// Query_Limit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Limit' +type Query_Limit_Call struct { + *mock.Call +} + +// Limit is a helper method to define mock.On call +// - limit int +func (_e *Query_Expecter) Limit(limit interface{}) *Query_Limit_Call { + return &Query_Limit_Call{Call: _e.mock.On("Limit", limit)} +} + +func (_c *Query_Limit_Call) Run(run func(limit int)) *Query_Limit_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int)) + }) + return _c +} + +func (_c *Query_Limit_Call) Return(_a0 orm.Query) *Query_Limit_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_Limit_Call) RunAndReturn(run func(int) orm.Query) *Query_Limit_Call { + _c.Call.Return(run) + return _c +} + // Load provides a mock function with given fields: dest, relation, args func (_m *Query) Load(dest interface{}, relation string, args ...interface{}) error { var _ca []interface{} @@ -458,6 +1311,10 @@ func (_m *Query) Load(dest interface{}, relation string, args ...interface{}) er _ca = append(_ca, args...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Load") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}, string, ...interface{}) error); ok { r0 = rf(dest, relation, args...) @@ -468,6 +1325,43 @@ func (_m *Query) Load(dest interface{}, relation string, args ...interface{}) er return r0 } +// Query_Load_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Load' +type Query_Load_Call struct { + *mock.Call +} + +// Load is a helper method to define mock.On call +// - dest interface{} +// - relation string +// - args ...interface{} +func (_e *Query_Expecter) Load(dest interface{}, relation interface{}, args ...interface{}) *Query_Load_Call { + return &Query_Load_Call{Call: _e.mock.On("Load", + append([]interface{}{dest, relation}, args...)...)} +} + +func (_c *Query_Load_Call) Run(run func(dest interface{}, relation string, args ...interface{})) *Query_Load_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(interface{}), args[1].(string), variadicArgs...) + }) + return _c +} + +func (_c *Query_Load_Call) Return(_a0 error) *Query_Load_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_Load_Call) RunAndReturn(run func(interface{}, string, ...interface{}) error) *Query_Load_Call { + _c.Call.Return(run) + return _c +} + // LoadMissing provides a mock function with given fields: dest, relation, args func (_m *Query) LoadMissing(dest interface{}, relation string, args ...interface{}) error { var _ca []interface{} @@ -475,6 +1369,10 @@ func (_m *Query) LoadMissing(dest interface{}, relation string, args ...interfac _ca = append(_ca, args...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for LoadMissing") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}, string, ...interface{}) error); ok { r0 = rf(dest, relation, args...) @@ -485,10 +1383,51 @@ func (_m *Query) LoadMissing(dest interface{}, relation string, args ...interfac return r0 } +// Query_LoadMissing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadMissing' +type Query_LoadMissing_Call struct { + *mock.Call +} + +// LoadMissing is a helper method to define mock.On call +// - dest interface{} +// - relation string +// - args ...interface{} +func (_e *Query_Expecter) LoadMissing(dest interface{}, relation interface{}, args ...interface{}) *Query_LoadMissing_Call { + return &Query_LoadMissing_Call{Call: _e.mock.On("LoadMissing", + append([]interface{}{dest, relation}, args...)...)} +} + +func (_c *Query_LoadMissing_Call) Run(run func(dest interface{}, relation string, args ...interface{})) *Query_LoadMissing_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(interface{}), args[1].(string), variadicArgs...) + }) + return _c +} + +func (_c *Query_LoadMissing_Call) Return(_a0 error) *Query_LoadMissing_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_LoadMissing_Call) RunAndReturn(run func(interface{}, string, ...interface{}) error) *Query_LoadMissing_Call { + _c.Call.Return(run) + return _c +} + // LockForUpdate provides a mock function with given fields: func (_m *Query) LockForUpdate() orm.Query { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for LockForUpdate") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func() orm.Query); ok { r0 = rf() @@ -501,10 +1440,41 @@ func (_m *Query) LockForUpdate() orm.Query { return r0 } +// Query_LockForUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LockForUpdate' +type Query_LockForUpdate_Call struct { + *mock.Call +} + +// LockForUpdate is a helper method to define mock.On call +func (_e *Query_Expecter) LockForUpdate() *Query_LockForUpdate_Call { + return &Query_LockForUpdate_Call{Call: _e.mock.On("LockForUpdate")} +} + +func (_c *Query_LockForUpdate_Call) Run(run func()) *Query_LockForUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Query_LockForUpdate_Call) Return(_a0 orm.Query) *Query_LockForUpdate_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_LockForUpdate_Call) RunAndReturn(run func() orm.Query) *Query_LockForUpdate_Call { + _c.Call.Return(run) + return _c +} + // Model provides a mock function with given fields: value func (_m *Query) Model(value interface{}) orm.Query { ret := _m.Called(value) + if len(ret) == 0 { + panic("no return value specified for Model") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(interface{}) orm.Query); ok { r0 = rf(value) @@ -517,10 +1487,42 @@ func (_m *Query) Model(value interface{}) orm.Query { return r0 } +// Query_Model_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Model' +type Query_Model_Call struct { + *mock.Call +} + +// Model is a helper method to define mock.On call +// - value interface{} +func (_e *Query_Expecter) Model(value interface{}) *Query_Model_Call { + return &Query_Model_Call{Call: _e.mock.On("Model", value)} +} + +func (_c *Query_Model_Call) Run(run func(value interface{})) *Query_Model_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Query_Model_Call) Return(_a0 orm.Query) *Query_Model_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_Model_Call) RunAndReturn(run func(interface{}) orm.Query) *Query_Model_Call { + _c.Call.Return(run) + return _c +} + // Offset provides a mock function with given fields: offset func (_m *Query) Offset(offset int) orm.Query { ret := _m.Called(offset) + if len(ret) == 0 { + panic("no return value specified for Offset") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(int) orm.Query); ok { r0 = rf(offset) @@ -533,6 +1535,34 @@ func (_m *Query) Offset(offset int) orm.Query { return r0 } +// Query_Offset_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Offset' +type Query_Offset_Call struct { + *mock.Call +} + +// Offset is a helper method to define mock.On call +// - offset int +func (_e *Query_Expecter) Offset(offset interface{}) *Query_Offset_Call { + return &Query_Offset_Call{Call: _e.mock.On("Offset", offset)} +} + +func (_c *Query_Offset_Call) Run(run func(offset int)) *Query_Offset_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int)) + }) + return _c +} + +func (_c *Query_Offset_Call) Return(_a0 orm.Query) *Query_Offset_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_Offset_Call) RunAndReturn(run func(int) orm.Query) *Query_Offset_Call { + _c.Call.Return(run) + return _c +} + // Omit provides a mock function with given fields: columns func (_m *Query) Omit(columns ...string) orm.Query { _va := make([]interface{}, len(columns)) @@ -543,6 +1573,10 @@ func (_m *Query) Omit(columns ...string) orm.Query { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Omit") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(...string) orm.Query); ok { r0 = rf(columns...) @@ -555,6 +1589,41 @@ func (_m *Query) Omit(columns ...string) orm.Query { return r0 } +// Query_Omit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Omit' +type Query_Omit_Call struct { + *mock.Call +} + +// Omit is a helper method to define mock.On call +// - columns ...string +func (_e *Query_Expecter) Omit(columns ...interface{}) *Query_Omit_Call { + return &Query_Omit_Call{Call: _e.mock.On("Omit", + append([]interface{}{}, columns...)...)} +} + +func (_c *Query_Omit_Call) Run(run func(columns ...string)) *Query_Omit_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Query_Omit_Call) Return(_a0 orm.Query) *Query_Omit_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_Omit_Call) RunAndReturn(run func(...string) orm.Query) *Query_Omit_Call { + _c.Call.Return(run) + return _c +} + // OrWhere provides a mock function with given fields: query, args func (_m *Query) OrWhere(query interface{}, args ...interface{}) orm.Query { var _ca []interface{} @@ -562,6 +1631,10 @@ func (_m *Query) OrWhere(query interface{}, args ...interface{}) orm.Query { _ca = append(_ca, args...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for OrWhere") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(interface{}, ...interface{}) orm.Query); ok { r0 = rf(query, args...) @@ -574,10 +1647,50 @@ func (_m *Query) OrWhere(query interface{}, args ...interface{}) orm.Query { return r0 } +// Query_OrWhere_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrWhere' +type Query_OrWhere_Call struct { + *mock.Call +} + +// OrWhere is a helper method to define mock.On call +// - query interface{} +// - args ...interface{} +func (_e *Query_Expecter) OrWhere(query interface{}, args ...interface{}) *Query_OrWhere_Call { + return &Query_OrWhere_Call{Call: _e.mock.On("OrWhere", + append([]interface{}{query}, args...)...)} +} + +func (_c *Query_OrWhere_Call) Run(run func(query interface{}, args ...interface{})) *Query_OrWhere_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(interface{}), variadicArgs...) + }) + return _c +} + +func (_c *Query_OrWhere_Call) Return(_a0 orm.Query) *Query_OrWhere_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_OrWhere_Call) RunAndReturn(run func(interface{}, ...interface{}) orm.Query) *Query_OrWhere_Call { + _c.Call.Return(run) + return _c +} + // OrWhereBetween provides a mock function with given fields: column, x, y func (_m *Query) OrWhereBetween(column string, x interface{}, y interface{}) orm.Query { ret := _m.Called(column, x, y) + if len(ret) == 0 { + panic("no return value specified for OrWhereBetween") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string, interface{}, interface{}) orm.Query); ok { r0 = rf(column, x, y) @@ -590,10 +1703,44 @@ func (_m *Query) OrWhereBetween(column string, x interface{}, y interface{}) orm return r0 } +// Query_OrWhereBetween_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrWhereBetween' +type Query_OrWhereBetween_Call struct { + *mock.Call +} + +// OrWhereBetween is a helper method to define mock.On call +// - column string +// - x interface{} +// - y interface{} +func (_e *Query_Expecter) OrWhereBetween(column interface{}, x interface{}, y interface{}) *Query_OrWhereBetween_Call { + return &Query_OrWhereBetween_Call{Call: _e.mock.On("OrWhereBetween", column, x, y)} +} + +func (_c *Query_OrWhereBetween_Call) Run(run func(column string, x interface{}, y interface{})) *Query_OrWhereBetween_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(interface{}), args[2].(interface{})) + }) + return _c +} + +func (_c *Query_OrWhereBetween_Call) Return(_a0 orm.Query) *Query_OrWhereBetween_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_OrWhereBetween_Call) RunAndReturn(run func(string, interface{}, interface{}) orm.Query) *Query_OrWhereBetween_Call { + _c.Call.Return(run) + return _c +} + // OrWhereIn provides a mock function with given fields: column, values func (_m *Query) OrWhereIn(column string, values []interface{}) orm.Query { ret := _m.Called(column, values) + if len(ret) == 0 { + panic("no return value specified for OrWhereIn") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string, []interface{}) orm.Query); ok { r0 = rf(column, values) @@ -606,10 +1753,43 @@ func (_m *Query) OrWhereIn(column string, values []interface{}) orm.Query { return r0 } +// Query_OrWhereIn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrWhereIn' +type Query_OrWhereIn_Call struct { + *mock.Call +} + +// OrWhereIn is a helper method to define mock.On call +// - column string +// - values []interface{} +func (_e *Query_Expecter) OrWhereIn(column interface{}, values interface{}) *Query_OrWhereIn_Call { + return &Query_OrWhereIn_Call{Call: _e.mock.On("OrWhereIn", column, values)} +} + +func (_c *Query_OrWhereIn_Call) Run(run func(column string, values []interface{})) *Query_OrWhereIn_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].([]interface{})) + }) + return _c +} + +func (_c *Query_OrWhereIn_Call) Return(_a0 orm.Query) *Query_OrWhereIn_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_OrWhereIn_Call) RunAndReturn(run func(string, []interface{}) orm.Query) *Query_OrWhereIn_Call { + _c.Call.Return(run) + return _c +} + // OrWhereNotBetween provides a mock function with given fields: column, x, y func (_m *Query) OrWhereNotBetween(column string, x interface{}, y interface{}) orm.Query { ret := _m.Called(column, x, y) + if len(ret) == 0 { + panic("no return value specified for OrWhereNotBetween") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string, interface{}, interface{}) orm.Query); ok { r0 = rf(column, x, y) @@ -622,10 +1802,44 @@ func (_m *Query) OrWhereNotBetween(column string, x interface{}, y interface{}) return r0 } +// Query_OrWhereNotBetween_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrWhereNotBetween' +type Query_OrWhereNotBetween_Call struct { + *mock.Call +} + +// OrWhereNotBetween is a helper method to define mock.On call +// - column string +// - x interface{} +// - y interface{} +func (_e *Query_Expecter) OrWhereNotBetween(column interface{}, x interface{}, y interface{}) *Query_OrWhereNotBetween_Call { + return &Query_OrWhereNotBetween_Call{Call: _e.mock.On("OrWhereNotBetween", column, x, y)} +} + +func (_c *Query_OrWhereNotBetween_Call) Run(run func(column string, x interface{}, y interface{})) *Query_OrWhereNotBetween_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(interface{}), args[2].(interface{})) + }) + return _c +} + +func (_c *Query_OrWhereNotBetween_Call) Return(_a0 orm.Query) *Query_OrWhereNotBetween_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_OrWhereNotBetween_Call) RunAndReturn(run func(string, interface{}, interface{}) orm.Query) *Query_OrWhereNotBetween_Call { + _c.Call.Return(run) + return _c +} + // OrWhereNotIn provides a mock function with given fields: column, values func (_m *Query) OrWhereNotIn(column string, values []interface{}) orm.Query { ret := _m.Called(column, values) + if len(ret) == 0 { + panic("no return value specified for OrWhereNotIn") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string, []interface{}) orm.Query); ok { r0 = rf(column, values) @@ -638,10 +1852,43 @@ func (_m *Query) OrWhereNotIn(column string, values []interface{}) orm.Query { return r0 } +// Query_OrWhereNotIn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrWhereNotIn' +type Query_OrWhereNotIn_Call struct { + *mock.Call +} + +// OrWhereNotIn is a helper method to define mock.On call +// - column string +// - values []interface{} +func (_e *Query_Expecter) OrWhereNotIn(column interface{}, values interface{}) *Query_OrWhereNotIn_Call { + return &Query_OrWhereNotIn_Call{Call: _e.mock.On("OrWhereNotIn", column, values)} +} + +func (_c *Query_OrWhereNotIn_Call) Run(run func(column string, values []interface{})) *Query_OrWhereNotIn_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].([]interface{})) + }) + return _c +} + +func (_c *Query_OrWhereNotIn_Call) Return(_a0 orm.Query) *Query_OrWhereNotIn_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_OrWhereNotIn_Call) RunAndReturn(run func(string, []interface{}) orm.Query) *Query_OrWhereNotIn_Call { + _c.Call.Return(run) + return _c +} + // Order provides a mock function with given fields: value func (_m *Query) Order(value interface{}) orm.Query { ret := _m.Called(value) + if len(ret) == 0 { + panic("no return value specified for Order") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(interface{}) orm.Query); ok { r0 = rf(value) @@ -654,6 +1901,34 @@ func (_m *Query) Order(value interface{}) orm.Query { return r0 } +// Query_Order_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Order' +type Query_Order_Call struct { + *mock.Call +} + +// Order is a helper method to define mock.On call +// - value interface{} +func (_e *Query_Expecter) Order(value interface{}) *Query_Order_Call { + return &Query_Order_Call{Call: _e.mock.On("Order", value)} +} + +func (_c *Query_Order_Call) Run(run func(value interface{})) *Query_Order_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Query_Order_Call) Return(_a0 orm.Query) *Query_Order_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_Order_Call) RunAndReturn(run func(interface{}) orm.Query) *Query_Order_Call { + _c.Call.Return(run) + return _c +} + // OrderBy provides a mock function with given fields: column, direction func (_m *Query) OrderBy(column string, direction ...string) orm.Query { _va := make([]interface{}, len(direction)) @@ -665,6 +1940,10 @@ func (_m *Query) OrderBy(column string, direction ...string) orm.Query { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for OrderBy") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string, ...string) orm.Query); ok { r0 = rf(column, direction...) @@ -677,10 +1956,50 @@ func (_m *Query) OrderBy(column string, direction ...string) orm.Query { return r0 } +// Query_OrderBy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrderBy' +type Query_OrderBy_Call struct { + *mock.Call +} + +// OrderBy is a helper method to define mock.On call +// - column string +// - direction ...string +func (_e *Query_Expecter) OrderBy(column interface{}, direction ...interface{}) *Query_OrderBy_Call { + return &Query_OrderBy_Call{Call: _e.mock.On("OrderBy", + append([]interface{}{column}, direction...)...)} +} + +func (_c *Query_OrderBy_Call) Run(run func(column string, direction ...string)) *Query_OrderBy_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Query_OrderBy_Call) Return(_a0 orm.Query) *Query_OrderBy_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_OrderBy_Call) RunAndReturn(run func(string, ...string) orm.Query) *Query_OrderBy_Call { + _c.Call.Return(run) + return _c +} + // OrderByDesc provides a mock function with given fields: column func (_m *Query) OrderByDesc(column string) orm.Query { ret := _m.Called(column) + if len(ret) == 0 { + panic("no return value specified for OrderByDesc") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string) orm.Query); ok { r0 = rf(column) @@ -693,10 +2012,42 @@ func (_m *Query) OrderByDesc(column string) orm.Query { return r0 } +// Query_OrderByDesc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrderByDesc' +type Query_OrderByDesc_Call struct { + *mock.Call +} + +// OrderByDesc is a helper method to define mock.On call +// - column string +func (_e *Query_Expecter) OrderByDesc(column interface{}) *Query_OrderByDesc_Call { + return &Query_OrderByDesc_Call{Call: _e.mock.On("OrderByDesc", column)} +} + +func (_c *Query_OrderByDesc_Call) Run(run func(column string)) *Query_OrderByDesc_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Query_OrderByDesc_Call) Return(_a0 orm.Query) *Query_OrderByDesc_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_OrderByDesc_Call) RunAndReturn(run func(string) orm.Query) *Query_OrderByDesc_Call { + _c.Call.Return(run) + return _c +} + // Paginate provides a mock function with given fields: page, limit, dest, total func (_m *Query) Paginate(page int, limit int, dest interface{}, total *int64) error { ret := _m.Called(page, limit, dest, total) + if len(ret) == 0 { + panic("no return value specified for Paginate") + } + var r0 error if rf, ok := ret.Get(0).(func(int, int, interface{}, *int64) error); ok { r0 = rf(page, limit, dest, total) @@ -707,10 +2058,45 @@ func (_m *Query) Paginate(page int, limit int, dest interface{}, total *int64) e return r0 } +// Query_Paginate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Paginate' +type Query_Paginate_Call struct { + *mock.Call +} + +// Paginate is a helper method to define mock.On call +// - page int +// - limit int +// - dest interface{} +// - total *int64 +func (_e *Query_Expecter) Paginate(page interface{}, limit interface{}, dest interface{}, total interface{}) *Query_Paginate_Call { + return &Query_Paginate_Call{Call: _e.mock.On("Paginate", page, limit, dest, total)} +} + +func (_c *Query_Paginate_Call) Run(run func(page int, limit int, dest interface{}, total *int64)) *Query_Paginate_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int), args[1].(int), args[2].(interface{}), args[3].(*int64)) + }) + return _c +} + +func (_c *Query_Paginate_Call) Return(_a0 error) *Query_Paginate_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_Paginate_Call) RunAndReturn(run func(int, int, interface{}, *int64) error) *Query_Paginate_Call { + _c.Call.Return(run) + return _c +} + // Pluck provides a mock function with given fields: column, dest func (_m *Query) Pluck(column string, dest interface{}) error { ret := _m.Called(column, dest) + if len(ret) == 0 { + panic("no return value specified for Pluck") + } + var r0 error if rf, ok := ret.Get(0).(func(string, interface{}) error); ok { r0 = rf(column, dest) @@ -721,6 +2107,35 @@ func (_m *Query) Pluck(column string, dest interface{}) error { return r0 } +// Query_Pluck_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Pluck' +type Query_Pluck_Call struct { + *mock.Call +} + +// Pluck is a helper method to define mock.On call +// - column string +// - dest interface{} +func (_e *Query_Expecter) Pluck(column interface{}, dest interface{}) *Query_Pluck_Call { + return &Query_Pluck_Call{Call: _e.mock.On("Pluck", column, dest)} +} + +func (_c *Query_Pluck_Call) Run(run func(column string, dest interface{})) *Query_Pluck_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(interface{})) + }) + return _c +} + +func (_c *Query_Pluck_Call) Return(_a0 error) *Query_Pluck_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_Pluck_Call) RunAndReturn(run func(string, interface{}) error) *Query_Pluck_Call { + _c.Call.Return(run) + return _c +} + // Raw provides a mock function with given fields: sql, values func (_m *Query) Raw(sql string, values ...interface{}) orm.Query { var _ca []interface{} @@ -728,6 +2143,10 @@ func (_m *Query) Raw(sql string, values ...interface{}) orm.Query { _ca = append(_ca, values...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Raw") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string, ...interface{}) orm.Query); ok { r0 = rf(sql, values...) @@ -740,10 +2159,50 @@ func (_m *Query) Raw(sql string, values ...interface{}) orm.Query { return r0 } +// Query_Raw_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Raw' +type Query_Raw_Call struct { + *mock.Call +} + +// Raw is a helper method to define mock.On call +// - sql string +// - values ...interface{} +func (_e *Query_Expecter) Raw(sql interface{}, values ...interface{}) *Query_Raw_Call { + return &Query_Raw_Call{Call: _e.mock.On("Raw", + append([]interface{}{sql}, values...)...)} +} + +func (_c *Query_Raw_Call) Run(run func(sql string, values ...interface{})) *Query_Raw_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Query_Raw_Call) Return(_a0 orm.Query) *Query_Raw_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_Raw_Call) RunAndReturn(run func(string, ...interface{}) orm.Query) *Query_Raw_Call { + _c.Call.Return(run) + return _c +} + // Save provides a mock function with given fields: value func (_m *Query) Save(value interface{}) error { ret := _m.Called(value) + if len(ret) == 0 { + panic("no return value specified for Save") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}) error); ok { r0 = rf(value) @@ -754,10 +2213,42 @@ func (_m *Query) Save(value interface{}) error { return r0 } +// Query_Save_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Save' +type Query_Save_Call struct { + *mock.Call +} + +// Save is a helper method to define mock.On call +// - value interface{} +func (_e *Query_Expecter) Save(value interface{}) *Query_Save_Call { + return &Query_Save_Call{Call: _e.mock.On("Save", value)} +} + +func (_c *Query_Save_Call) Run(run func(value interface{})) *Query_Save_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Query_Save_Call) Return(_a0 error) *Query_Save_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_Save_Call) RunAndReturn(run func(interface{}) error) *Query_Save_Call { + _c.Call.Return(run) + return _c +} + // SaveQuietly provides a mock function with given fields: value func (_m *Query) SaveQuietly(value interface{}) error { ret := _m.Called(value) + if len(ret) == 0 { + panic("no return value specified for SaveQuietly") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}) error); ok { r0 = rf(value) @@ -768,10 +2259,42 @@ func (_m *Query) SaveQuietly(value interface{}) error { return r0 } +// Query_SaveQuietly_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveQuietly' +type Query_SaveQuietly_Call struct { + *mock.Call +} + +// SaveQuietly is a helper method to define mock.On call +// - value interface{} +func (_e *Query_Expecter) SaveQuietly(value interface{}) *Query_SaveQuietly_Call { + return &Query_SaveQuietly_Call{Call: _e.mock.On("SaveQuietly", value)} +} + +func (_c *Query_SaveQuietly_Call) Run(run func(value interface{})) *Query_SaveQuietly_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Query_SaveQuietly_Call) Return(_a0 error) *Query_SaveQuietly_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_SaveQuietly_Call) RunAndReturn(run func(interface{}) error) *Query_SaveQuietly_Call { + _c.Call.Return(run) + return _c +} + // Scan provides a mock function with given fields: dest func (_m *Query) Scan(dest interface{}) error { ret := _m.Called(dest) + if len(ret) == 0 { + panic("no return value specified for Scan") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}) error); ok { r0 = rf(dest) @@ -782,6 +2305,34 @@ func (_m *Query) Scan(dest interface{}) error { return r0 } +// Query_Scan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Scan' +type Query_Scan_Call struct { + *mock.Call +} + +// Scan is a helper method to define mock.On call +// - dest interface{} +func (_e *Query_Expecter) Scan(dest interface{}) *Query_Scan_Call { + return &Query_Scan_Call{Call: _e.mock.On("Scan", dest)} +} + +func (_c *Query_Scan_Call) Run(run func(dest interface{})) *Query_Scan_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Query_Scan_Call) Return(_a0 error) *Query_Scan_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_Scan_Call) RunAndReturn(run func(interface{}) error) *Query_Scan_Call { + _c.Call.Return(run) + return _c +} + // Scopes provides a mock function with given fields: funcs func (_m *Query) Scopes(funcs ...func(orm.Query) orm.Query) orm.Query { _va := make([]interface{}, len(funcs)) @@ -792,6 +2343,10 @@ func (_m *Query) Scopes(funcs ...func(orm.Query) orm.Query) orm.Query { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Scopes") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(...func(orm.Query) orm.Query) orm.Query); ok { r0 = rf(funcs...) @@ -804,6 +2359,41 @@ func (_m *Query) Scopes(funcs ...func(orm.Query) orm.Query) orm.Query { return r0 } +// Query_Scopes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Scopes' +type Query_Scopes_Call struct { + *mock.Call +} + +// Scopes is a helper method to define mock.On call +// - funcs ...func(orm.Query) orm.Query +func (_e *Query_Expecter) Scopes(funcs ...interface{}) *Query_Scopes_Call { + return &Query_Scopes_Call{Call: _e.mock.On("Scopes", + append([]interface{}{}, funcs...)...)} +} + +func (_c *Query_Scopes_Call) Run(run func(funcs ...func(orm.Query) orm.Query)) *Query_Scopes_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(orm.Query) orm.Query, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(func(orm.Query) orm.Query) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Query_Scopes_Call) Return(_a0 orm.Query) *Query_Scopes_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_Scopes_Call) RunAndReturn(run func(...func(orm.Query) orm.Query) orm.Query) *Query_Scopes_Call { + _c.Call.Return(run) + return _c +} + // Select provides a mock function with given fields: query, args func (_m *Query) Select(query interface{}, args ...interface{}) orm.Query { var _ca []interface{} @@ -811,6 +2401,10 @@ func (_m *Query) Select(query interface{}, args ...interface{}) orm.Query { _ca = append(_ca, args...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Select") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(interface{}, ...interface{}) orm.Query); ok { r0 = rf(query, args...) @@ -823,10 +2417,50 @@ func (_m *Query) Select(query interface{}, args ...interface{}) orm.Query { return r0 } +// Query_Select_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Select' +type Query_Select_Call struct { + *mock.Call +} + +// Select is a helper method to define mock.On call +// - query interface{} +// - args ...interface{} +func (_e *Query_Expecter) Select(query interface{}, args ...interface{}) *Query_Select_Call { + return &Query_Select_Call{Call: _e.mock.On("Select", + append([]interface{}{query}, args...)...)} +} + +func (_c *Query_Select_Call) Run(run func(query interface{}, args ...interface{})) *Query_Select_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(interface{}), variadicArgs...) + }) + return _c +} + +func (_c *Query_Select_Call) Return(_a0 orm.Query) *Query_Select_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_Select_Call) RunAndReturn(run func(interface{}, ...interface{}) orm.Query) *Query_Select_Call { + _c.Call.Return(run) + return _c +} + // SharedLock provides a mock function with given fields: func (_m *Query) SharedLock() orm.Query { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for SharedLock") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func() orm.Query); ok { r0 = rf() @@ -839,10 +2473,41 @@ func (_m *Query) SharedLock() orm.Query { return r0 } +// Query_SharedLock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SharedLock' +type Query_SharedLock_Call struct { + *mock.Call +} + +// SharedLock is a helper method to define mock.On call +func (_e *Query_Expecter) SharedLock() *Query_SharedLock_Call { + return &Query_SharedLock_Call{Call: _e.mock.On("SharedLock")} +} + +func (_c *Query_SharedLock_Call) Run(run func()) *Query_SharedLock_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Query_SharedLock_Call) Return(_a0 orm.Query) *Query_SharedLock_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_SharedLock_Call) RunAndReturn(run func() orm.Query) *Query_SharedLock_Call { + _c.Call.Return(run) + return _c +} + // Sum provides a mock function with given fields: column, dest func (_m *Query) Sum(column string, dest interface{}) error { ret := _m.Called(column, dest) + if len(ret) == 0 { + panic("no return value specified for Sum") + } + var r0 error if rf, ok := ret.Get(0).(func(string, interface{}) error); ok { r0 = rf(column, dest) @@ -853,6 +2518,35 @@ func (_m *Query) Sum(column string, dest interface{}) error { return r0 } +// Query_Sum_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sum' +type Query_Sum_Call struct { + *mock.Call +} + +// Sum is a helper method to define mock.On call +// - column string +// - dest interface{} +func (_e *Query_Expecter) Sum(column interface{}, dest interface{}) *Query_Sum_Call { + return &Query_Sum_Call{Call: _e.mock.On("Sum", column, dest)} +} + +func (_c *Query_Sum_Call) Run(run func(column string, dest interface{})) *Query_Sum_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(interface{})) + }) + return _c +} + +func (_c *Query_Sum_Call) Return(_a0 error) *Query_Sum_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_Sum_Call) RunAndReturn(run func(string, interface{}) error) *Query_Sum_Call { + _c.Call.Return(run) + return _c +} + // Table provides a mock function with given fields: name, args func (_m *Query) Table(name string, args ...interface{}) orm.Query { var _ca []interface{} @@ -860,6 +2554,10 @@ func (_m *Query) Table(name string, args ...interface{}) orm.Query { _ca = append(_ca, args...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Table") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string, ...interface{}) orm.Query); ok { r0 = rf(name, args...) @@ -872,6 +2570,42 @@ func (_m *Query) Table(name string, args ...interface{}) orm.Query { return r0 } +// Query_Table_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Table' +type Query_Table_Call struct { + *mock.Call +} + +// Table is a helper method to define mock.On call +// - name string +// - args ...interface{} +func (_e *Query_Expecter) Table(name interface{}, args ...interface{}) *Query_Table_Call { + return &Query_Table_Call{Call: _e.mock.On("Table", + append([]interface{}{name}, args...)...)} +} + +func (_c *Query_Table_Call) Run(run func(name string, args ...interface{})) *Query_Table_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Query_Table_Call) Return(_a0 orm.Query) *Query_Table_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_Table_Call) RunAndReturn(run func(string, ...interface{}) orm.Query) *Query_Table_Call { + _c.Call.Return(run) + return _c +} + // Update provides a mock function with given fields: column, value func (_m *Query) Update(column interface{}, value ...interface{}) (*orm.Result, error) { var _ca []interface{} @@ -879,6 +2613,10 @@ func (_m *Query) Update(column interface{}, value ...interface{}) (*orm.Result, _ca = append(_ca, value...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Update") + } + var r0 *orm.Result var r1 error if rf, ok := ret.Get(0).(func(interface{}, ...interface{}) (*orm.Result, error)); ok { @@ -901,10 +2639,50 @@ func (_m *Query) Update(column interface{}, value ...interface{}) (*orm.Result, return r0, r1 } +// Query_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type Query_Update_Call struct { + *mock.Call +} + +// Update is a helper method to define mock.On call +// - column interface{} +// - value ...interface{} +func (_e *Query_Expecter) Update(column interface{}, value ...interface{}) *Query_Update_Call { + return &Query_Update_Call{Call: _e.mock.On("Update", + append([]interface{}{column}, value...)...)} +} + +func (_c *Query_Update_Call) Run(run func(column interface{}, value ...interface{})) *Query_Update_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(interface{}), variadicArgs...) + }) + return _c +} + +func (_c *Query_Update_Call) Return(_a0 *orm.Result, _a1 error) *Query_Update_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Query_Update_Call) RunAndReturn(run func(interface{}, ...interface{}) (*orm.Result, error)) *Query_Update_Call { + _c.Call.Return(run) + return _c +} + // UpdateOrCreate provides a mock function with given fields: dest, attributes, values func (_m *Query) UpdateOrCreate(dest interface{}, attributes interface{}, values interface{}) error { ret := _m.Called(dest, attributes, values) + if len(ret) == 0 { + panic("no return value specified for UpdateOrCreate") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}, interface{}, interface{}) error); ok { r0 = rf(dest, attributes, values) @@ -915,6 +2693,36 @@ func (_m *Query) UpdateOrCreate(dest interface{}, attributes interface{}, values return r0 } +// Query_UpdateOrCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateOrCreate' +type Query_UpdateOrCreate_Call struct { + *mock.Call +} + +// UpdateOrCreate is a helper method to define mock.On call +// - dest interface{} +// - attributes interface{} +// - values interface{} +func (_e *Query_Expecter) UpdateOrCreate(dest interface{}, attributes interface{}, values interface{}) *Query_UpdateOrCreate_Call { + return &Query_UpdateOrCreate_Call{Call: _e.mock.On("UpdateOrCreate", dest, attributes, values)} +} + +func (_c *Query_UpdateOrCreate_Call) Run(run func(dest interface{}, attributes interface{}, values interface{})) *Query_UpdateOrCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{}), args[1].(interface{}), args[2].(interface{})) + }) + return _c +} + +func (_c *Query_UpdateOrCreate_Call) Return(_a0 error) *Query_UpdateOrCreate_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_UpdateOrCreate_Call) RunAndReturn(run func(interface{}, interface{}, interface{}) error) *Query_UpdateOrCreate_Call { + _c.Call.Return(run) + return _c +} + // Where provides a mock function with given fields: query, args func (_m *Query) Where(query interface{}, args ...interface{}) orm.Query { var _ca []interface{} @@ -922,6 +2730,10 @@ func (_m *Query) Where(query interface{}, args ...interface{}) orm.Query { _ca = append(_ca, args...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Where") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(interface{}, ...interface{}) orm.Query); ok { r0 = rf(query, args...) @@ -934,10 +2746,50 @@ func (_m *Query) Where(query interface{}, args ...interface{}) orm.Query { return r0 } +// Query_Where_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Where' +type Query_Where_Call struct { + *mock.Call +} + +// Where is a helper method to define mock.On call +// - query interface{} +// - args ...interface{} +func (_e *Query_Expecter) Where(query interface{}, args ...interface{}) *Query_Where_Call { + return &Query_Where_Call{Call: _e.mock.On("Where", + append([]interface{}{query}, args...)...)} +} + +func (_c *Query_Where_Call) Run(run func(query interface{}, args ...interface{})) *Query_Where_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(interface{}), variadicArgs...) + }) + return _c +} + +func (_c *Query_Where_Call) Return(_a0 orm.Query) *Query_Where_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_Where_Call) RunAndReturn(run func(interface{}, ...interface{}) orm.Query) *Query_Where_Call { + _c.Call.Return(run) + return _c +} + // WhereBetween provides a mock function with given fields: column, x, y func (_m *Query) WhereBetween(column string, x interface{}, y interface{}) orm.Query { ret := _m.Called(column, x, y) + if len(ret) == 0 { + panic("no return value specified for WhereBetween") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string, interface{}, interface{}) orm.Query); ok { r0 = rf(column, x, y) @@ -950,10 +2802,44 @@ func (_m *Query) WhereBetween(column string, x interface{}, y interface{}) orm.Q return r0 } +// Query_WhereBetween_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WhereBetween' +type Query_WhereBetween_Call struct { + *mock.Call +} + +// WhereBetween is a helper method to define mock.On call +// - column string +// - x interface{} +// - y interface{} +func (_e *Query_Expecter) WhereBetween(column interface{}, x interface{}, y interface{}) *Query_WhereBetween_Call { + return &Query_WhereBetween_Call{Call: _e.mock.On("WhereBetween", column, x, y)} +} + +func (_c *Query_WhereBetween_Call) Run(run func(column string, x interface{}, y interface{})) *Query_WhereBetween_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(interface{}), args[2].(interface{})) + }) + return _c +} + +func (_c *Query_WhereBetween_Call) Return(_a0 orm.Query) *Query_WhereBetween_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_WhereBetween_Call) RunAndReturn(run func(string, interface{}, interface{}) orm.Query) *Query_WhereBetween_Call { + _c.Call.Return(run) + return _c +} + // WhereIn provides a mock function with given fields: column, values func (_m *Query) WhereIn(column string, values []interface{}) orm.Query { ret := _m.Called(column, values) + if len(ret) == 0 { + panic("no return value specified for WhereIn") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string, []interface{}) orm.Query); ok { r0 = rf(column, values) @@ -966,10 +2852,43 @@ func (_m *Query) WhereIn(column string, values []interface{}) orm.Query { return r0 } +// Query_WhereIn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WhereIn' +type Query_WhereIn_Call struct { + *mock.Call +} + +// WhereIn is a helper method to define mock.On call +// - column string +// - values []interface{} +func (_e *Query_Expecter) WhereIn(column interface{}, values interface{}) *Query_WhereIn_Call { + return &Query_WhereIn_Call{Call: _e.mock.On("WhereIn", column, values)} +} + +func (_c *Query_WhereIn_Call) Run(run func(column string, values []interface{})) *Query_WhereIn_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].([]interface{})) + }) + return _c +} + +func (_c *Query_WhereIn_Call) Return(_a0 orm.Query) *Query_WhereIn_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_WhereIn_Call) RunAndReturn(run func(string, []interface{}) orm.Query) *Query_WhereIn_Call { + _c.Call.Return(run) + return _c +} + // WhereNotBetween provides a mock function with given fields: column, x, y func (_m *Query) WhereNotBetween(column string, x interface{}, y interface{}) orm.Query { ret := _m.Called(column, x, y) + if len(ret) == 0 { + panic("no return value specified for WhereNotBetween") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string, interface{}, interface{}) orm.Query); ok { r0 = rf(column, x, y) @@ -982,10 +2901,44 @@ func (_m *Query) WhereNotBetween(column string, x interface{}, y interface{}) or return r0 } +// Query_WhereNotBetween_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WhereNotBetween' +type Query_WhereNotBetween_Call struct { + *mock.Call +} + +// WhereNotBetween is a helper method to define mock.On call +// - column string +// - x interface{} +// - y interface{} +func (_e *Query_Expecter) WhereNotBetween(column interface{}, x interface{}, y interface{}) *Query_WhereNotBetween_Call { + return &Query_WhereNotBetween_Call{Call: _e.mock.On("WhereNotBetween", column, x, y)} +} + +func (_c *Query_WhereNotBetween_Call) Run(run func(column string, x interface{}, y interface{})) *Query_WhereNotBetween_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(interface{}), args[2].(interface{})) + }) + return _c +} + +func (_c *Query_WhereNotBetween_Call) Return(_a0 orm.Query) *Query_WhereNotBetween_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_WhereNotBetween_Call) RunAndReturn(run func(string, interface{}, interface{}) orm.Query) *Query_WhereNotBetween_Call { + _c.Call.Return(run) + return _c +} + // WhereNotIn provides a mock function with given fields: column, values func (_m *Query) WhereNotIn(column string, values []interface{}) orm.Query { ret := _m.Called(column, values) + if len(ret) == 0 { + panic("no return value specified for WhereNotIn") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string, []interface{}) orm.Query); ok { r0 = rf(column, values) @@ -998,10 +2951,43 @@ func (_m *Query) WhereNotIn(column string, values []interface{}) orm.Query { return r0 } +// Query_WhereNotIn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WhereNotIn' +type Query_WhereNotIn_Call struct { + *mock.Call +} + +// WhereNotIn is a helper method to define mock.On call +// - column string +// - values []interface{} +func (_e *Query_Expecter) WhereNotIn(column interface{}, values interface{}) *Query_WhereNotIn_Call { + return &Query_WhereNotIn_Call{Call: _e.mock.On("WhereNotIn", column, values)} +} + +func (_c *Query_WhereNotIn_Call) Run(run func(column string, values []interface{})) *Query_WhereNotIn_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].([]interface{})) + }) + return _c +} + +func (_c *Query_WhereNotIn_Call) Return(_a0 orm.Query) *Query_WhereNotIn_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_WhereNotIn_Call) RunAndReturn(run func(string, []interface{}) orm.Query) *Query_WhereNotIn_Call { + _c.Call.Return(run) + return _c +} + // WhereNotNull provides a mock function with given fields: column func (_m *Query) WhereNotNull(column string) orm.Query { ret := _m.Called(column) + if len(ret) == 0 { + panic("no return value specified for WhereNotNull") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string) orm.Query); ok { r0 = rf(column) @@ -1014,10 +3000,42 @@ func (_m *Query) WhereNotNull(column string) orm.Query { return r0 } +// Query_WhereNotNull_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WhereNotNull' +type Query_WhereNotNull_Call struct { + *mock.Call +} + +// WhereNotNull is a helper method to define mock.On call +// - column string +func (_e *Query_Expecter) WhereNotNull(column interface{}) *Query_WhereNotNull_Call { + return &Query_WhereNotNull_Call{Call: _e.mock.On("WhereNotNull", column)} +} + +func (_c *Query_WhereNotNull_Call) Run(run func(column string)) *Query_WhereNotNull_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Query_WhereNotNull_Call) Return(_a0 orm.Query) *Query_WhereNotNull_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_WhereNotNull_Call) RunAndReturn(run func(string) orm.Query) *Query_WhereNotNull_Call { + _c.Call.Return(run) + return _c +} + // WhereNull provides a mock function with given fields: column func (_m *Query) WhereNull(column string) orm.Query { ret := _m.Called(column) + if len(ret) == 0 { + panic("no return value specified for WhereNull") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string) orm.Query); ok { r0 = rf(column) @@ -1030,6 +3048,34 @@ func (_m *Query) WhereNull(column string) orm.Query { return r0 } +// Query_WhereNull_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WhereNull' +type Query_WhereNull_Call struct { + *mock.Call +} + +// WhereNull is a helper method to define mock.On call +// - column string +func (_e *Query_Expecter) WhereNull(column interface{}) *Query_WhereNull_Call { + return &Query_WhereNull_Call{Call: _e.mock.On("WhereNull", column)} +} + +func (_c *Query_WhereNull_Call) Run(run func(column string)) *Query_WhereNull_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Query_WhereNull_Call) Return(_a0 orm.Query) *Query_WhereNull_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_WhereNull_Call) RunAndReturn(run func(string) orm.Query) *Query_WhereNull_Call { + _c.Call.Return(run) + return _c +} + // With provides a mock function with given fields: query, args func (_m *Query) With(query string, args ...interface{}) orm.Query { var _ca []interface{} @@ -1037,6 +3083,10 @@ func (_m *Query) With(query string, args ...interface{}) orm.Query { _ca = append(_ca, args...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for With") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string, ...interface{}) orm.Query); ok { r0 = rf(query, args...) @@ -1049,10 +3099,50 @@ func (_m *Query) With(query string, args ...interface{}) orm.Query { return r0 } +// Query_With_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'With' +type Query_With_Call struct { + *mock.Call +} + +// With is a helper method to define mock.On call +// - query string +// - args ...interface{} +func (_e *Query_Expecter) With(query interface{}, args ...interface{}) *Query_With_Call { + return &Query_With_Call{Call: _e.mock.On("With", + append([]interface{}{query}, args...)...)} +} + +func (_c *Query_With_Call) Run(run func(query string, args ...interface{})) *Query_With_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Query_With_Call) Return(_a0 orm.Query) *Query_With_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_With_Call) RunAndReturn(run func(string, ...interface{}) orm.Query) *Query_With_Call { + _c.Call.Return(run) + return _c +} + // WithTrashed provides a mock function with given fields: func (_m *Query) WithTrashed() orm.Query { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for WithTrashed") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func() orm.Query); ok { r0 = rf() @@ -1065,10 +3155,41 @@ func (_m *Query) WithTrashed() orm.Query { return r0 } +// Query_WithTrashed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithTrashed' +type Query_WithTrashed_Call struct { + *mock.Call +} + +// WithTrashed is a helper method to define mock.On call +func (_e *Query_Expecter) WithTrashed() *Query_WithTrashed_Call { + return &Query_WithTrashed_Call{Call: _e.mock.On("WithTrashed")} +} + +func (_c *Query_WithTrashed_Call) Run(run func()) *Query_WithTrashed_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Query_WithTrashed_Call) Return(_a0 orm.Query) *Query_WithTrashed_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_WithTrashed_Call) RunAndReturn(run func() orm.Query) *Query_WithTrashed_Call { + _c.Call.Return(run) + return _c +} + // WithoutEvents provides a mock function with given fields: func (_m *Query) WithoutEvents() orm.Query { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for WithoutEvents") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func() orm.Query); ok { r0 = rf() @@ -1081,6 +3202,33 @@ func (_m *Query) WithoutEvents() orm.Query { return r0 } +// Query_WithoutEvents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithoutEvents' +type Query_WithoutEvents_Call struct { + *mock.Call +} + +// WithoutEvents is a helper method to define mock.On call +func (_e *Query_Expecter) WithoutEvents() *Query_WithoutEvents_Call { + return &Query_WithoutEvents_Call{Call: _e.mock.On("WithoutEvents")} +} + +func (_c *Query_WithoutEvents_Call) Run(run func()) *Query_WithoutEvents_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Query_WithoutEvents_Call) Return(_a0 orm.Query) *Query_WithoutEvents_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Query_WithoutEvents_Call) RunAndReturn(run func() orm.Query) *Query_WithoutEvents_Call { + _c.Call.Return(run) + return _c +} + // NewQuery creates a new instance of Query. 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 NewQuery(t interface { diff --git a/mocks/database/orm/Transaction.go b/mocks/database/orm/Transaction.go index 433792fe1..2b01bf2da 100644 --- a/mocks/database/orm/Transaction.go +++ b/mocks/database/orm/Transaction.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,10 +12,22 @@ type Transaction struct { mock.Mock } +type Transaction_Expecter struct { + mock *mock.Mock +} + +func (_m *Transaction) EXPECT() *Transaction_Expecter { + return &Transaction_Expecter{mock: &_m.Mock} +} + // Association provides a mock function with given fields: association func (_m *Transaction) Association(association string) orm.Association { ret := _m.Called(association) + if len(ret) == 0 { + panic("no return value specified for Association") + } + var r0 orm.Association if rf, ok := ret.Get(0).(func(string) orm.Association); ok { r0 = rf(association) @@ -28,10 +40,42 @@ func (_m *Transaction) Association(association string) orm.Association { return r0 } +// Transaction_Association_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Association' +type Transaction_Association_Call struct { + *mock.Call +} + +// Association is a helper method to define mock.On call +// - association string +func (_e *Transaction_Expecter) Association(association interface{}) *Transaction_Association_Call { + return &Transaction_Association_Call{Call: _e.mock.On("Association", association)} +} + +func (_c *Transaction_Association_Call) Run(run func(association string)) *Transaction_Association_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Transaction_Association_Call) Return(_a0 orm.Association) *Transaction_Association_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_Association_Call) RunAndReturn(run func(string) orm.Association) *Transaction_Association_Call { + _c.Call.Return(run) + return _c +} + // Begin provides a mock function with given fields: func (_m *Transaction) Begin() (orm.Transaction, error) { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Begin") + } + var r0 orm.Transaction var r1 error if rf, ok := ret.Get(0).(func() (orm.Transaction, error)); ok { @@ -54,10 +98,41 @@ func (_m *Transaction) Begin() (orm.Transaction, error) { return r0, r1 } +// Transaction_Begin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Begin' +type Transaction_Begin_Call struct { + *mock.Call +} + +// Begin is a helper method to define mock.On call +func (_e *Transaction_Expecter) Begin() *Transaction_Begin_Call { + return &Transaction_Begin_Call{Call: _e.mock.On("Begin")} +} + +func (_c *Transaction_Begin_Call) Run(run func()) *Transaction_Begin_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Transaction_Begin_Call) Return(_a0 orm.Transaction, _a1 error) *Transaction_Begin_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Transaction_Begin_Call) RunAndReturn(run func() (orm.Transaction, error)) *Transaction_Begin_Call { + _c.Call.Return(run) + return _c +} + // Commit provides a mock function with given fields: func (_m *Transaction) Commit() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Commit") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -68,10 +143,41 @@ func (_m *Transaction) Commit() error { return r0 } +// Transaction_Commit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Commit' +type Transaction_Commit_Call struct { + *mock.Call +} + +// Commit is a helper method to define mock.On call +func (_e *Transaction_Expecter) Commit() *Transaction_Commit_Call { + return &Transaction_Commit_Call{Call: _e.mock.On("Commit")} +} + +func (_c *Transaction_Commit_Call) Run(run func()) *Transaction_Commit_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Transaction_Commit_Call) Return(_a0 error) *Transaction_Commit_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_Commit_Call) RunAndReturn(run func() error) *Transaction_Commit_Call { + _c.Call.Return(run) + return _c +} + // Count provides a mock function with given fields: count func (_m *Transaction) Count(count *int64) error { ret := _m.Called(count) + if len(ret) == 0 { + panic("no return value specified for Count") + } + var r0 error if rf, ok := ret.Get(0).(func(*int64) error); ok { r0 = rf(count) @@ -82,10 +188,42 @@ func (_m *Transaction) Count(count *int64) error { return r0 } +// Transaction_Count_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Count' +type Transaction_Count_Call struct { + *mock.Call +} + +// Count is a helper method to define mock.On call +// - count *int64 +func (_e *Transaction_Expecter) Count(count interface{}) *Transaction_Count_Call { + return &Transaction_Count_Call{Call: _e.mock.On("Count", count)} +} + +func (_c *Transaction_Count_Call) Run(run func(count *int64)) *Transaction_Count_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*int64)) + }) + return _c +} + +func (_c *Transaction_Count_Call) Return(_a0 error) *Transaction_Count_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_Count_Call) RunAndReturn(run func(*int64) error) *Transaction_Count_Call { + _c.Call.Return(run) + return _c +} + // Create provides a mock function with given fields: value func (_m *Transaction) Create(value interface{}) error { ret := _m.Called(value) + if len(ret) == 0 { + panic("no return value specified for Create") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}) error); ok { r0 = rf(value) @@ -96,10 +234,42 @@ func (_m *Transaction) Create(value interface{}) error { return r0 } +// Transaction_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type Transaction_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - value interface{} +func (_e *Transaction_Expecter) Create(value interface{}) *Transaction_Create_Call { + return &Transaction_Create_Call{Call: _e.mock.On("Create", value)} +} + +func (_c *Transaction_Create_Call) Run(run func(value interface{})) *Transaction_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Transaction_Create_Call) Return(_a0 error) *Transaction_Create_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_Create_Call) RunAndReturn(run func(interface{}) error) *Transaction_Create_Call { + _c.Call.Return(run) + return _c +} + // Cursor provides a mock function with given fields: func (_m *Transaction) Cursor() (chan orm.Cursor, error) { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Cursor") + } + var r0 chan orm.Cursor var r1 error if rf, ok := ret.Get(0).(func() (chan orm.Cursor, error)); ok { @@ -122,6 +292,33 @@ func (_m *Transaction) Cursor() (chan orm.Cursor, error) { return r0, r1 } +// Transaction_Cursor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Cursor' +type Transaction_Cursor_Call struct { + *mock.Call +} + +// Cursor is a helper method to define mock.On call +func (_e *Transaction_Expecter) Cursor() *Transaction_Cursor_Call { + return &Transaction_Cursor_Call{Call: _e.mock.On("Cursor")} +} + +func (_c *Transaction_Cursor_Call) Run(run func()) *Transaction_Cursor_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Transaction_Cursor_Call) Return(_a0 chan orm.Cursor, _a1 error) *Transaction_Cursor_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Transaction_Cursor_Call) RunAndReturn(run func() (chan orm.Cursor, error)) *Transaction_Cursor_Call { + _c.Call.Return(run) + return _c +} + // Delete provides a mock function with given fields: value, conds func (_m *Transaction) Delete(value interface{}, conds ...interface{}) (*orm.Result, error) { var _ca []interface{} @@ -129,6 +326,10 @@ func (_m *Transaction) Delete(value interface{}, conds ...interface{}) (*orm.Res _ca = append(_ca, conds...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Delete") + } + var r0 *orm.Result var r1 error if rf, ok := ret.Get(0).(func(interface{}, ...interface{}) (*orm.Result, error)); ok { @@ -151,12 +352,52 @@ func (_m *Transaction) Delete(value interface{}, conds ...interface{}) (*orm.Res return r0, r1 } +// Transaction_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type Transaction_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - value interface{} +// - conds ...interface{} +func (_e *Transaction_Expecter) Delete(value interface{}, conds ...interface{}) *Transaction_Delete_Call { + return &Transaction_Delete_Call{Call: _e.mock.On("Delete", + append([]interface{}{value}, conds...)...)} +} + +func (_c *Transaction_Delete_Call) Run(run func(value interface{}, conds ...interface{})) *Transaction_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(interface{}), variadicArgs...) + }) + return _c +} + +func (_c *Transaction_Delete_Call) Return(_a0 *orm.Result, _a1 error) *Transaction_Delete_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Transaction_Delete_Call) RunAndReturn(run func(interface{}, ...interface{}) (*orm.Result, error)) *Transaction_Delete_Call { + _c.Call.Return(run) + return _c +} + // Distinct provides a mock function with given fields: args func (_m *Transaction) Distinct(args ...interface{}) orm.Query { var _ca []interface{} _ca = append(_ca, args...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Distinct") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(...interface{}) orm.Query); ok { r0 = rf(args...) @@ -169,10 +410,49 @@ func (_m *Transaction) Distinct(args ...interface{}) orm.Query { return r0 } +// Transaction_Distinct_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Distinct' +type Transaction_Distinct_Call struct { + *mock.Call +} + +// Distinct is a helper method to define mock.On call +// - args ...interface{} +func (_e *Transaction_Expecter) Distinct(args ...interface{}) *Transaction_Distinct_Call { + return &Transaction_Distinct_Call{Call: _e.mock.On("Distinct", + append([]interface{}{}, args...)...)} +} + +func (_c *Transaction_Distinct_Call) Run(run func(args ...interface{})) *Transaction_Distinct_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Transaction_Distinct_Call) Return(_a0 orm.Query) *Transaction_Distinct_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_Distinct_Call) RunAndReturn(run func(...interface{}) orm.Query) *Transaction_Distinct_Call { + _c.Call.Return(run) + return _c +} + // Driver provides a mock function with given fields: func (_m *Transaction) Driver() orm.Driver { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Driver") + } + var r0 orm.Driver if rf, ok := ret.Get(0).(func() orm.Driver); ok { r0 = rf() @@ -183,6 +463,33 @@ func (_m *Transaction) Driver() orm.Driver { return r0 } +// Transaction_Driver_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Driver' +type Transaction_Driver_Call struct { + *mock.Call +} + +// Driver is a helper method to define mock.On call +func (_e *Transaction_Expecter) Driver() *Transaction_Driver_Call { + return &Transaction_Driver_Call{Call: _e.mock.On("Driver")} +} + +func (_c *Transaction_Driver_Call) Run(run func()) *Transaction_Driver_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Transaction_Driver_Call) Return(_a0 orm.Driver) *Transaction_Driver_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_Driver_Call) RunAndReturn(run func() orm.Driver) *Transaction_Driver_Call { + _c.Call.Return(run) + return _c +} + // Exec provides a mock function with given fields: sql, values func (_m *Transaction) Exec(sql string, values ...interface{}) (*orm.Result, error) { var _ca []interface{} @@ -190,6 +497,10 @@ func (_m *Transaction) Exec(sql string, values ...interface{}) (*orm.Result, err _ca = append(_ca, values...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Exec") + } + var r0 *orm.Result var r1 error if rf, ok := ret.Get(0).(func(string, ...interface{}) (*orm.Result, error)); ok { @@ -212,10 +523,50 @@ func (_m *Transaction) Exec(sql string, values ...interface{}) (*orm.Result, err return r0, r1 } +// Transaction_Exec_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Exec' +type Transaction_Exec_Call struct { + *mock.Call +} + +// Exec is a helper method to define mock.On call +// - sql string +// - values ...interface{} +func (_e *Transaction_Expecter) Exec(sql interface{}, values ...interface{}) *Transaction_Exec_Call { + return &Transaction_Exec_Call{Call: _e.mock.On("Exec", + append([]interface{}{sql}, values...)...)} +} + +func (_c *Transaction_Exec_Call) Run(run func(sql string, values ...interface{})) *Transaction_Exec_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Transaction_Exec_Call) Return(_a0 *orm.Result, _a1 error) *Transaction_Exec_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Transaction_Exec_Call) RunAndReturn(run func(string, ...interface{}) (*orm.Result, error)) *Transaction_Exec_Call { + _c.Call.Return(run) + return _c +} + // Exists provides a mock function with given fields: exists func (_m *Transaction) Exists(exists *bool) error { ret := _m.Called(exists) + if len(ret) == 0 { + panic("no return value specified for Exists") + } + var r0 error if rf, ok := ret.Get(0).(func(*bool) error); ok { r0 = rf(exists) @@ -226,6 +577,34 @@ func (_m *Transaction) Exists(exists *bool) error { return r0 } +// Transaction_Exists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Exists' +type Transaction_Exists_Call struct { + *mock.Call +} + +// Exists is a helper method to define mock.On call +// - exists *bool +func (_e *Transaction_Expecter) Exists(exists interface{}) *Transaction_Exists_Call { + return &Transaction_Exists_Call{Call: _e.mock.On("Exists", exists)} +} + +func (_c *Transaction_Exists_Call) Run(run func(exists *bool)) *Transaction_Exists_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bool)) + }) + return _c +} + +func (_c *Transaction_Exists_Call) Return(_a0 error) *Transaction_Exists_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_Exists_Call) RunAndReturn(run func(*bool) error) *Transaction_Exists_Call { + _c.Call.Return(run) + return _c +} + // Find provides a mock function with given fields: dest, conds func (_m *Transaction) Find(dest interface{}, conds ...interface{}) error { var _ca []interface{} @@ -233,6 +612,10 @@ func (_m *Transaction) Find(dest interface{}, conds ...interface{}) error { _ca = append(_ca, conds...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Find") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}, ...interface{}) error); ok { r0 = rf(dest, conds...) @@ -243,6 +626,42 @@ func (_m *Transaction) Find(dest interface{}, conds ...interface{}) error { return r0 } +// Transaction_Find_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Find' +type Transaction_Find_Call struct { + *mock.Call +} + +// Find is a helper method to define mock.On call +// - dest interface{} +// - conds ...interface{} +func (_e *Transaction_Expecter) Find(dest interface{}, conds ...interface{}) *Transaction_Find_Call { + return &Transaction_Find_Call{Call: _e.mock.On("Find", + append([]interface{}{dest}, conds...)...)} +} + +func (_c *Transaction_Find_Call) Run(run func(dest interface{}, conds ...interface{})) *Transaction_Find_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(interface{}), variadicArgs...) + }) + return _c +} + +func (_c *Transaction_Find_Call) Return(_a0 error) *Transaction_Find_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_Find_Call) RunAndReturn(run func(interface{}, ...interface{}) error) *Transaction_Find_Call { + _c.Call.Return(run) + return _c +} + // FindOrFail provides a mock function with given fields: dest, conds func (_m *Transaction) FindOrFail(dest interface{}, conds ...interface{}) error { var _ca []interface{} @@ -250,6 +669,10 @@ func (_m *Transaction) FindOrFail(dest interface{}, conds ...interface{}) error _ca = append(_ca, conds...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for FindOrFail") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}, ...interface{}) error); ok { r0 = rf(dest, conds...) @@ -260,10 +683,50 @@ func (_m *Transaction) FindOrFail(dest interface{}, conds ...interface{}) error return r0 } +// Transaction_FindOrFail_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindOrFail' +type Transaction_FindOrFail_Call struct { + *mock.Call +} + +// FindOrFail is a helper method to define mock.On call +// - dest interface{} +// - conds ...interface{} +func (_e *Transaction_Expecter) FindOrFail(dest interface{}, conds ...interface{}) *Transaction_FindOrFail_Call { + return &Transaction_FindOrFail_Call{Call: _e.mock.On("FindOrFail", + append([]interface{}{dest}, conds...)...)} +} + +func (_c *Transaction_FindOrFail_Call) Run(run func(dest interface{}, conds ...interface{})) *Transaction_FindOrFail_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(interface{}), variadicArgs...) + }) + return _c +} + +func (_c *Transaction_FindOrFail_Call) Return(_a0 error) *Transaction_FindOrFail_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_FindOrFail_Call) RunAndReturn(run func(interface{}, ...interface{}) error) *Transaction_FindOrFail_Call { + _c.Call.Return(run) + return _c +} + // First provides a mock function with given fields: dest func (_m *Transaction) First(dest interface{}) error { ret := _m.Called(dest) + if len(ret) == 0 { + panic("no return value specified for First") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}) error); ok { r0 = rf(dest) @@ -274,10 +737,42 @@ func (_m *Transaction) First(dest interface{}) error { return r0 } +// Transaction_First_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'First' +type Transaction_First_Call struct { + *mock.Call +} + +// First is a helper method to define mock.On call +// - dest interface{} +func (_e *Transaction_Expecter) First(dest interface{}) *Transaction_First_Call { + return &Transaction_First_Call{Call: _e.mock.On("First", dest)} +} + +func (_c *Transaction_First_Call) Run(run func(dest interface{})) *Transaction_First_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Transaction_First_Call) Return(_a0 error) *Transaction_First_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_First_Call) RunAndReturn(run func(interface{}) error) *Transaction_First_Call { + _c.Call.Return(run) + return _c +} + // FirstOr provides a mock function with given fields: dest, callback func (_m *Transaction) FirstOr(dest interface{}, callback func() error) error { ret := _m.Called(dest, callback) + if len(ret) == 0 { + panic("no return value specified for FirstOr") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}, func() error) error); ok { r0 = rf(dest, callback) @@ -288,6 +783,35 @@ func (_m *Transaction) FirstOr(dest interface{}, callback func() error) error { return r0 } +// Transaction_FirstOr_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FirstOr' +type Transaction_FirstOr_Call struct { + *mock.Call +} + +// FirstOr is a helper method to define mock.On call +// - dest interface{} +// - callback func() error +func (_e *Transaction_Expecter) FirstOr(dest interface{}, callback interface{}) *Transaction_FirstOr_Call { + return &Transaction_FirstOr_Call{Call: _e.mock.On("FirstOr", dest, callback)} +} + +func (_c *Transaction_FirstOr_Call) Run(run func(dest interface{}, callback func() error)) *Transaction_FirstOr_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{}), args[1].(func() error)) + }) + return _c +} + +func (_c *Transaction_FirstOr_Call) Return(_a0 error) *Transaction_FirstOr_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_FirstOr_Call) RunAndReturn(run func(interface{}, func() error) error) *Transaction_FirstOr_Call { + _c.Call.Return(run) + return _c +} + // FirstOrCreate provides a mock function with given fields: dest, conds func (_m *Transaction) FirstOrCreate(dest interface{}, conds ...interface{}) error { var _ca []interface{} @@ -295,6 +819,10 @@ func (_m *Transaction) FirstOrCreate(dest interface{}, conds ...interface{}) err _ca = append(_ca, conds...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for FirstOrCreate") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}, ...interface{}) error); ok { r0 = rf(dest, conds...) @@ -305,10 +833,50 @@ func (_m *Transaction) FirstOrCreate(dest interface{}, conds ...interface{}) err return r0 } +// Transaction_FirstOrCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FirstOrCreate' +type Transaction_FirstOrCreate_Call struct { + *mock.Call +} + +// FirstOrCreate is a helper method to define mock.On call +// - dest interface{} +// - conds ...interface{} +func (_e *Transaction_Expecter) FirstOrCreate(dest interface{}, conds ...interface{}) *Transaction_FirstOrCreate_Call { + return &Transaction_FirstOrCreate_Call{Call: _e.mock.On("FirstOrCreate", + append([]interface{}{dest}, conds...)...)} +} + +func (_c *Transaction_FirstOrCreate_Call) Run(run func(dest interface{}, conds ...interface{})) *Transaction_FirstOrCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(interface{}), variadicArgs...) + }) + return _c +} + +func (_c *Transaction_FirstOrCreate_Call) Return(_a0 error) *Transaction_FirstOrCreate_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_FirstOrCreate_Call) RunAndReturn(run func(interface{}, ...interface{}) error) *Transaction_FirstOrCreate_Call { + _c.Call.Return(run) + return _c +} + // FirstOrFail provides a mock function with given fields: dest func (_m *Transaction) FirstOrFail(dest interface{}) error { ret := _m.Called(dest) + if len(ret) == 0 { + panic("no return value specified for FirstOrFail") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}) error); ok { r0 = rf(dest) @@ -319,6 +887,34 @@ func (_m *Transaction) FirstOrFail(dest interface{}) error { return r0 } +// Transaction_FirstOrFail_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FirstOrFail' +type Transaction_FirstOrFail_Call struct { + *mock.Call +} + +// FirstOrFail is a helper method to define mock.On call +// - dest interface{} +func (_e *Transaction_Expecter) FirstOrFail(dest interface{}) *Transaction_FirstOrFail_Call { + return &Transaction_FirstOrFail_Call{Call: _e.mock.On("FirstOrFail", dest)} +} + +func (_c *Transaction_FirstOrFail_Call) Run(run func(dest interface{})) *Transaction_FirstOrFail_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Transaction_FirstOrFail_Call) Return(_a0 error) *Transaction_FirstOrFail_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_FirstOrFail_Call) RunAndReturn(run func(interface{}) error) *Transaction_FirstOrFail_Call { + _c.Call.Return(run) + return _c +} + // FirstOrNew provides a mock function with given fields: dest, attributes, values func (_m *Transaction) FirstOrNew(dest interface{}, attributes interface{}, values ...interface{}) error { var _ca []interface{} @@ -326,6 +922,10 @@ func (_m *Transaction) FirstOrNew(dest interface{}, attributes interface{}, valu _ca = append(_ca, values...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for FirstOrNew") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}, interface{}, ...interface{}) error); ok { r0 = rf(dest, attributes, values...) @@ -336,6 +936,43 @@ func (_m *Transaction) FirstOrNew(dest interface{}, attributes interface{}, valu return r0 } +// Transaction_FirstOrNew_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FirstOrNew' +type Transaction_FirstOrNew_Call struct { + *mock.Call +} + +// FirstOrNew is a helper method to define mock.On call +// - dest interface{} +// - attributes interface{} +// - values ...interface{} +func (_e *Transaction_Expecter) FirstOrNew(dest interface{}, attributes interface{}, values ...interface{}) *Transaction_FirstOrNew_Call { + return &Transaction_FirstOrNew_Call{Call: _e.mock.On("FirstOrNew", + append([]interface{}{dest, attributes}, values...)...)} +} + +func (_c *Transaction_FirstOrNew_Call) Run(run func(dest interface{}, attributes interface{}, values ...interface{})) *Transaction_FirstOrNew_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(interface{}), args[1].(interface{}), variadicArgs...) + }) + return _c +} + +func (_c *Transaction_FirstOrNew_Call) Return(_a0 error) *Transaction_FirstOrNew_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_FirstOrNew_Call) RunAndReturn(run func(interface{}, interface{}, ...interface{}) error) *Transaction_FirstOrNew_Call { + _c.Call.Return(run) + return _c +} + // ForceDelete provides a mock function with given fields: value, conds func (_m *Transaction) ForceDelete(value interface{}, conds ...interface{}) (*orm.Result, error) { var _ca []interface{} @@ -343,6 +980,10 @@ func (_m *Transaction) ForceDelete(value interface{}, conds ...interface{}) (*or _ca = append(_ca, conds...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for ForceDelete") + } + var r0 *orm.Result var r1 error if rf, ok := ret.Get(0).(func(interface{}, ...interface{}) (*orm.Result, error)); ok { @@ -365,10 +1006,50 @@ func (_m *Transaction) ForceDelete(value interface{}, conds ...interface{}) (*or return r0, r1 } +// Transaction_ForceDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ForceDelete' +type Transaction_ForceDelete_Call struct { + *mock.Call +} + +// ForceDelete is a helper method to define mock.On call +// - value interface{} +// - conds ...interface{} +func (_e *Transaction_Expecter) ForceDelete(value interface{}, conds ...interface{}) *Transaction_ForceDelete_Call { + return &Transaction_ForceDelete_Call{Call: _e.mock.On("ForceDelete", + append([]interface{}{value}, conds...)...)} +} + +func (_c *Transaction_ForceDelete_Call) Run(run func(value interface{}, conds ...interface{})) *Transaction_ForceDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(interface{}), variadicArgs...) + }) + return _c +} + +func (_c *Transaction_ForceDelete_Call) Return(_a0 *orm.Result, _a1 error) *Transaction_ForceDelete_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Transaction_ForceDelete_Call) RunAndReturn(run func(interface{}, ...interface{}) (*orm.Result, error)) *Transaction_ForceDelete_Call { + _c.Call.Return(run) + return _c +} + // Get provides a mock function with given fields: dest func (_m *Transaction) Get(dest interface{}) error { ret := _m.Called(dest) + if len(ret) == 0 { + panic("no return value specified for Get") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}) error); ok { r0 = rf(dest) @@ -379,10 +1060,42 @@ func (_m *Transaction) Get(dest interface{}) error { return r0 } +// Transaction_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type Transaction_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - dest interface{} +func (_e *Transaction_Expecter) Get(dest interface{}) *Transaction_Get_Call { + return &Transaction_Get_Call{Call: _e.mock.On("Get", dest)} +} + +func (_c *Transaction_Get_Call) Run(run func(dest interface{})) *Transaction_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Transaction_Get_Call) Return(_a0 error) *Transaction_Get_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_Get_Call) RunAndReturn(run func(interface{}) error) *Transaction_Get_Call { + _c.Call.Return(run) + return _c +} + // Group provides a mock function with given fields: name func (_m *Transaction) Group(name string) orm.Query { ret := _m.Called(name) + if len(ret) == 0 { + panic("no return value specified for Group") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string) orm.Query); ok { r0 = rf(name) @@ -395,13 +1108,45 @@ func (_m *Transaction) Group(name string) orm.Query { return r0 } -// Having provides a mock function with given fields: query, args -func (_m *Transaction) Having(query interface{}, args ...interface{}) orm.Query { +// Transaction_Group_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Group' +type Transaction_Group_Call struct { + *mock.Call +} + +// Group is a helper method to define mock.On call +// - name string +func (_e *Transaction_Expecter) Group(name interface{}) *Transaction_Group_Call { + return &Transaction_Group_Call{Call: _e.mock.On("Group", name)} +} + +func (_c *Transaction_Group_Call) Run(run func(name string)) *Transaction_Group_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Transaction_Group_Call) Return(_a0 orm.Query) *Transaction_Group_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_Group_Call) RunAndReturn(run func(string) orm.Query) *Transaction_Group_Call { + _c.Call.Return(run) + return _c +} + +// Having provides a mock function with given fields: query, args +func (_m *Transaction) Having(query interface{}, args ...interface{}) orm.Query { var _ca []interface{} _ca = append(_ca, query) _ca = append(_ca, args...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Having") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(interface{}, ...interface{}) orm.Query); ok { r0 = rf(query, args...) @@ -414,10 +1159,50 @@ func (_m *Transaction) Having(query interface{}, args ...interface{}) orm.Query return r0 } +// Transaction_Having_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Having' +type Transaction_Having_Call struct { + *mock.Call +} + +// Having is a helper method to define mock.On call +// - query interface{} +// - args ...interface{} +func (_e *Transaction_Expecter) Having(query interface{}, args ...interface{}) *Transaction_Having_Call { + return &Transaction_Having_Call{Call: _e.mock.On("Having", + append([]interface{}{query}, args...)...)} +} + +func (_c *Transaction_Having_Call) Run(run func(query interface{}, args ...interface{})) *Transaction_Having_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(interface{}), variadicArgs...) + }) + return _c +} + +func (_c *Transaction_Having_Call) Return(_a0 orm.Query) *Transaction_Having_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_Having_Call) RunAndReturn(run func(interface{}, ...interface{}) orm.Query) *Transaction_Having_Call { + _c.Call.Return(run) + return _c +} + // InRandomOrder provides a mock function with given fields: func (_m *Transaction) InRandomOrder() orm.Query { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for InRandomOrder") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func() orm.Query); ok { r0 = rf() @@ -430,6 +1215,33 @@ func (_m *Transaction) InRandomOrder() orm.Query { return r0 } +// Transaction_InRandomOrder_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InRandomOrder' +type Transaction_InRandomOrder_Call struct { + *mock.Call +} + +// InRandomOrder is a helper method to define mock.On call +func (_e *Transaction_Expecter) InRandomOrder() *Transaction_InRandomOrder_Call { + return &Transaction_InRandomOrder_Call{Call: _e.mock.On("InRandomOrder")} +} + +func (_c *Transaction_InRandomOrder_Call) Run(run func()) *Transaction_InRandomOrder_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Transaction_InRandomOrder_Call) Return(_a0 orm.Query) *Transaction_InRandomOrder_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_InRandomOrder_Call) RunAndReturn(run func() orm.Query) *Transaction_InRandomOrder_Call { + _c.Call.Return(run) + return _c +} + // Join provides a mock function with given fields: query, args func (_m *Transaction) Join(query string, args ...interface{}) orm.Query { var _ca []interface{} @@ -437,6 +1249,10 @@ func (_m *Transaction) Join(query string, args ...interface{}) orm.Query { _ca = append(_ca, args...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Join") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string, ...interface{}) orm.Query); ok { r0 = rf(query, args...) @@ -449,10 +1265,50 @@ func (_m *Transaction) Join(query string, args ...interface{}) orm.Query { return r0 } +// Transaction_Join_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Join' +type Transaction_Join_Call struct { + *mock.Call +} + +// Join is a helper method to define mock.On call +// - query string +// - args ...interface{} +func (_e *Transaction_Expecter) Join(query interface{}, args ...interface{}) *Transaction_Join_Call { + return &Transaction_Join_Call{Call: _e.mock.On("Join", + append([]interface{}{query}, args...)...)} +} + +func (_c *Transaction_Join_Call) Run(run func(query string, args ...interface{})) *Transaction_Join_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Transaction_Join_Call) Return(_a0 orm.Query) *Transaction_Join_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_Join_Call) RunAndReturn(run func(string, ...interface{}) orm.Query) *Transaction_Join_Call { + _c.Call.Return(run) + return _c +} + // Limit provides a mock function with given fields: limit func (_m *Transaction) Limit(limit int) orm.Query { ret := _m.Called(limit) + if len(ret) == 0 { + panic("no return value specified for Limit") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(int) orm.Query); ok { r0 = rf(limit) @@ -465,6 +1321,34 @@ func (_m *Transaction) Limit(limit int) orm.Query { return r0 } +// Transaction_Limit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Limit' +type Transaction_Limit_Call struct { + *mock.Call +} + +// Limit is a helper method to define mock.On call +// - limit int +func (_e *Transaction_Expecter) Limit(limit interface{}) *Transaction_Limit_Call { + return &Transaction_Limit_Call{Call: _e.mock.On("Limit", limit)} +} + +func (_c *Transaction_Limit_Call) Run(run func(limit int)) *Transaction_Limit_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int)) + }) + return _c +} + +func (_c *Transaction_Limit_Call) Return(_a0 orm.Query) *Transaction_Limit_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_Limit_Call) RunAndReturn(run func(int) orm.Query) *Transaction_Limit_Call { + _c.Call.Return(run) + return _c +} + // Load provides a mock function with given fields: dest, relation, args func (_m *Transaction) Load(dest interface{}, relation string, args ...interface{}) error { var _ca []interface{} @@ -472,6 +1356,10 @@ func (_m *Transaction) Load(dest interface{}, relation string, args ...interface _ca = append(_ca, args...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Load") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}, string, ...interface{}) error); ok { r0 = rf(dest, relation, args...) @@ -482,6 +1370,43 @@ func (_m *Transaction) Load(dest interface{}, relation string, args ...interface return r0 } +// Transaction_Load_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Load' +type Transaction_Load_Call struct { + *mock.Call +} + +// Load is a helper method to define mock.On call +// - dest interface{} +// - relation string +// - args ...interface{} +func (_e *Transaction_Expecter) Load(dest interface{}, relation interface{}, args ...interface{}) *Transaction_Load_Call { + return &Transaction_Load_Call{Call: _e.mock.On("Load", + append([]interface{}{dest, relation}, args...)...)} +} + +func (_c *Transaction_Load_Call) Run(run func(dest interface{}, relation string, args ...interface{})) *Transaction_Load_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(interface{}), args[1].(string), variadicArgs...) + }) + return _c +} + +func (_c *Transaction_Load_Call) Return(_a0 error) *Transaction_Load_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_Load_Call) RunAndReturn(run func(interface{}, string, ...interface{}) error) *Transaction_Load_Call { + _c.Call.Return(run) + return _c +} + // LoadMissing provides a mock function with given fields: dest, relation, args func (_m *Transaction) LoadMissing(dest interface{}, relation string, args ...interface{}) error { var _ca []interface{} @@ -489,6 +1414,10 @@ func (_m *Transaction) LoadMissing(dest interface{}, relation string, args ...in _ca = append(_ca, args...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for LoadMissing") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}, string, ...interface{}) error); ok { r0 = rf(dest, relation, args...) @@ -499,10 +1428,51 @@ func (_m *Transaction) LoadMissing(dest interface{}, relation string, args ...in return r0 } +// Transaction_LoadMissing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadMissing' +type Transaction_LoadMissing_Call struct { + *mock.Call +} + +// LoadMissing is a helper method to define mock.On call +// - dest interface{} +// - relation string +// - args ...interface{} +func (_e *Transaction_Expecter) LoadMissing(dest interface{}, relation interface{}, args ...interface{}) *Transaction_LoadMissing_Call { + return &Transaction_LoadMissing_Call{Call: _e.mock.On("LoadMissing", + append([]interface{}{dest, relation}, args...)...)} +} + +func (_c *Transaction_LoadMissing_Call) Run(run func(dest interface{}, relation string, args ...interface{})) *Transaction_LoadMissing_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(interface{}), args[1].(string), variadicArgs...) + }) + return _c +} + +func (_c *Transaction_LoadMissing_Call) Return(_a0 error) *Transaction_LoadMissing_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_LoadMissing_Call) RunAndReturn(run func(interface{}, string, ...interface{}) error) *Transaction_LoadMissing_Call { + _c.Call.Return(run) + return _c +} + // LockForUpdate provides a mock function with given fields: func (_m *Transaction) LockForUpdate() orm.Query { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for LockForUpdate") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func() orm.Query); ok { r0 = rf() @@ -515,10 +1485,41 @@ func (_m *Transaction) LockForUpdate() orm.Query { return r0 } +// Transaction_LockForUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LockForUpdate' +type Transaction_LockForUpdate_Call struct { + *mock.Call +} + +// LockForUpdate is a helper method to define mock.On call +func (_e *Transaction_Expecter) LockForUpdate() *Transaction_LockForUpdate_Call { + return &Transaction_LockForUpdate_Call{Call: _e.mock.On("LockForUpdate")} +} + +func (_c *Transaction_LockForUpdate_Call) Run(run func()) *Transaction_LockForUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Transaction_LockForUpdate_Call) Return(_a0 orm.Query) *Transaction_LockForUpdate_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_LockForUpdate_Call) RunAndReturn(run func() orm.Query) *Transaction_LockForUpdate_Call { + _c.Call.Return(run) + return _c +} + // Model provides a mock function with given fields: value func (_m *Transaction) Model(value interface{}) orm.Query { ret := _m.Called(value) + if len(ret) == 0 { + panic("no return value specified for Model") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(interface{}) orm.Query); ok { r0 = rf(value) @@ -531,10 +1532,42 @@ func (_m *Transaction) Model(value interface{}) orm.Query { return r0 } +// Transaction_Model_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Model' +type Transaction_Model_Call struct { + *mock.Call +} + +// Model is a helper method to define mock.On call +// - value interface{} +func (_e *Transaction_Expecter) Model(value interface{}) *Transaction_Model_Call { + return &Transaction_Model_Call{Call: _e.mock.On("Model", value)} +} + +func (_c *Transaction_Model_Call) Run(run func(value interface{})) *Transaction_Model_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Transaction_Model_Call) Return(_a0 orm.Query) *Transaction_Model_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_Model_Call) RunAndReturn(run func(interface{}) orm.Query) *Transaction_Model_Call { + _c.Call.Return(run) + return _c +} + // Offset provides a mock function with given fields: offset func (_m *Transaction) Offset(offset int) orm.Query { ret := _m.Called(offset) + if len(ret) == 0 { + panic("no return value specified for Offset") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(int) orm.Query); ok { r0 = rf(offset) @@ -547,6 +1580,34 @@ func (_m *Transaction) Offset(offset int) orm.Query { return r0 } +// Transaction_Offset_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Offset' +type Transaction_Offset_Call struct { + *mock.Call +} + +// Offset is a helper method to define mock.On call +// - offset int +func (_e *Transaction_Expecter) Offset(offset interface{}) *Transaction_Offset_Call { + return &Transaction_Offset_Call{Call: _e.mock.On("Offset", offset)} +} + +func (_c *Transaction_Offset_Call) Run(run func(offset int)) *Transaction_Offset_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int)) + }) + return _c +} + +func (_c *Transaction_Offset_Call) Return(_a0 orm.Query) *Transaction_Offset_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_Offset_Call) RunAndReturn(run func(int) orm.Query) *Transaction_Offset_Call { + _c.Call.Return(run) + return _c +} + // Omit provides a mock function with given fields: columns func (_m *Transaction) Omit(columns ...string) orm.Query { _va := make([]interface{}, len(columns)) @@ -557,6 +1618,10 @@ func (_m *Transaction) Omit(columns ...string) orm.Query { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Omit") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(...string) orm.Query); ok { r0 = rf(columns...) @@ -569,6 +1634,41 @@ func (_m *Transaction) Omit(columns ...string) orm.Query { return r0 } +// Transaction_Omit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Omit' +type Transaction_Omit_Call struct { + *mock.Call +} + +// Omit is a helper method to define mock.On call +// - columns ...string +func (_e *Transaction_Expecter) Omit(columns ...interface{}) *Transaction_Omit_Call { + return &Transaction_Omit_Call{Call: _e.mock.On("Omit", + append([]interface{}{}, columns...)...)} +} + +func (_c *Transaction_Omit_Call) Run(run func(columns ...string)) *Transaction_Omit_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Transaction_Omit_Call) Return(_a0 orm.Query) *Transaction_Omit_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_Omit_Call) RunAndReturn(run func(...string) orm.Query) *Transaction_Omit_Call { + _c.Call.Return(run) + return _c +} + // OrWhere provides a mock function with given fields: query, args func (_m *Transaction) OrWhere(query interface{}, args ...interface{}) orm.Query { var _ca []interface{} @@ -576,6 +1676,10 @@ func (_m *Transaction) OrWhere(query interface{}, args ...interface{}) orm.Query _ca = append(_ca, args...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for OrWhere") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(interface{}, ...interface{}) orm.Query); ok { r0 = rf(query, args...) @@ -588,10 +1692,50 @@ func (_m *Transaction) OrWhere(query interface{}, args ...interface{}) orm.Query return r0 } +// Transaction_OrWhere_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrWhere' +type Transaction_OrWhere_Call struct { + *mock.Call +} + +// OrWhere is a helper method to define mock.On call +// - query interface{} +// - args ...interface{} +func (_e *Transaction_Expecter) OrWhere(query interface{}, args ...interface{}) *Transaction_OrWhere_Call { + return &Transaction_OrWhere_Call{Call: _e.mock.On("OrWhere", + append([]interface{}{query}, args...)...)} +} + +func (_c *Transaction_OrWhere_Call) Run(run func(query interface{}, args ...interface{})) *Transaction_OrWhere_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(interface{}), variadicArgs...) + }) + return _c +} + +func (_c *Transaction_OrWhere_Call) Return(_a0 orm.Query) *Transaction_OrWhere_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_OrWhere_Call) RunAndReturn(run func(interface{}, ...interface{}) orm.Query) *Transaction_OrWhere_Call { + _c.Call.Return(run) + return _c +} + // OrWhereBetween provides a mock function with given fields: column, x, y func (_m *Transaction) OrWhereBetween(column string, x interface{}, y interface{}) orm.Query { ret := _m.Called(column, x, y) + if len(ret) == 0 { + panic("no return value specified for OrWhereBetween") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string, interface{}, interface{}) orm.Query); ok { r0 = rf(column, x, y) @@ -604,10 +1748,44 @@ func (_m *Transaction) OrWhereBetween(column string, x interface{}, y interface{ return r0 } +// Transaction_OrWhereBetween_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrWhereBetween' +type Transaction_OrWhereBetween_Call struct { + *mock.Call +} + +// OrWhereBetween is a helper method to define mock.On call +// - column string +// - x interface{} +// - y interface{} +func (_e *Transaction_Expecter) OrWhereBetween(column interface{}, x interface{}, y interface{}) *Transaction_OrWhereBetween_Call { + return &Transaction_OrWhereBetween_Call{Call: _e.mock.On("OrWhereBetween", column, x, y)} +} + +func (_c *Transaction_OrWhereBetween_Call) Run(run func(column string, x interface{}, y interface{})) *Transaction_OrWhereBetween_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(interface{}), args[2].(interface{})) + }) + return _c +} + +func (_c *Transaction_OrWhereBetween_Call) Return(_a0 orm.Query) *Transaction_OrWhereBetween_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_OrWhereBetween_Call) RunAndReturn(run func(string, interface{}, interface{}) orm.Query) *Transaction_OrWhereBetween_Call { + _c.Call.Return(run) + return _c +} + // OrWhereIn provides a mock function with given fields: column, values func (_m *Transaction) OrWhereIn(column string, values []interface{}) orm.Query { ret := _m.Called(column, values) + if len(ret) == 0 { + panic("no return value specified for OrWhereIn") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string, []interface{}) orm.Query); ok { r0 = rf(column, values) @@ -620,10 +1798,43 @@ func (_m *Transaction) OrWhereIn(column string, values []interface{}) orm.Query return r0 } +// Transaction_OrWhereIn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrWhereIn' +type Transaction_OrWhereIn_Call struct { + *mock.Call +} + +// OrWhereIn is a helper method to define mock.On call +// - column string +// - values []interface{} +func (_e *Transaction_Expecter) OrWhereIn(column interface{}, values interface{}) *Transaction_OrWhereIn_Call { + return &Transaction_OrWhereIn_Call{Call: _e.mock.On("OrWhereIn", column, values)} +} + +func (_c *Transaction_OrWhereIn_Call) Run(run func(column string, values []interface{})) *Transaction_OrWhereIn_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].([]interface{})) + }) + return _c +} + +func (_c *Transaction_OrWhereIn_Call) Return(_a0 orm.Query) *Transaction_OrWhereIn_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_OrWhereIn_Call) RunAndReturn(run func(string, []interface{}) orm.Query) *Transaction_OrWhereIn_Call { + _c.Call.Return(run) + return _c +} + // OrWhereNotBetween provides a mock function with given fields: column, x, y func (_m *Transaction) OrWhereNotBetween(column string, x interface{}, y interface{}) orm.Query { ret := _m.Called(column, x, y) + if len(ret) == 0 { + panic("no return value specified for OrWhereNotBetween") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string, interface{}, interface{}) orm.Query); ok { r0 = rf(column, x, y) @@ -636,10 +1847,44 @@ func (_m *Transaction) OrWhereNotBetween(column string, x interface{}, y interfa return r0 } +// Transaction_OrWhereNotBetween_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrWhereNotBetween' +type Transaction_OrWhereNotBetween_Call struct { + *mock.Call +} + +// OrWhereNotBetween is a helper method to define mock.On call +// - column string +// - x interface{} +// - y interface{} +func (_e *Transaction_Expecter) OrWhereNotBetween(column interface{}, x interface{}, y interface{}) *Transaction_OrWhereNotBetween_Call { + return &Transaction_OrWhereNotBetween_Call{Call: _e.mock.On("OrWhereNotBetween", column, x, y)} +} + +func (_c *Transaction_OrWhereNotBetween_Call) Run(run func(column string, x interface{}, y interface{})) *Transaction_OrWhereNotBetween_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(interface{}), args[2].(interface{})) + }) + return _c +} + +func (_c *Transaction_OrWhereNotBetween_Call) Return(_a0 orm.Query) *Transaction_OrWhereNotBetween_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_OrWhereNotBetween_Call) RunAndReturn(run func(string, interface{}, interface{}) orm.Query) *Transaction_OrWhereNotBetween_Call { + _c.Call.Return(run) + return _c +} + // OrWhereNotIn provides a mock function with given fields: column, values func (_m *Transaction) OrWhereNotIn(column string, values []interface{}) orm.Query { ret := _m.Called(column, values) + if len(ret) == 0 { + panic("no return value specified for OrWhereNotIn") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string, []interface{}) orm.Query); ok { r0 = rf(column, values) @@ -652,10 +1897,43 @@ func (_m *Transaction) OrWhereNotIn(column string, values []interface{}) orm.Que return r0 } +// Transaction_OrWhereNotIn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrWhereNotIn' +type Transaction_OrWhereNotIn_Call struct { + *mock.Call +} + +// OrWhereNotIn is a helper method to define mock.On call +// - column string +// - values []interface{} +func (_e *Transaction_Expecter) OrWhereNotIn(column interface{}, values interface{}) *Transaction_OrWhereNotIn_Call { + return &Transaction_OrWhereNotIn_Call{Call: _e.mock.On("OrWhereNotIn", column, values)} +} + +func (_c *Transaction_OrWhereNotIn_Call) Run(run func(column string, values []interface{})) *Transaction_OrWhereNotIn_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].([]interface{})) + }) + return _c +} + +func (_c *Transaction_OrWhereNotIn_Call) Return(_a0 orm.Query) *Transaction_OrWhereNotIn_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_OrWhereNotIn_Call) RunAndReturn(run func(string, []interface{}) orm.Query) *Transaction_OrWhereNotIn_Call { + _c.Call.Return(run) + return _c +} + // Order provides a mock function with given fields: value func (_m *Transaction) Order(value interface{}) orm.Query { ret := _m.Called(value) + if len(ret) == 0 { + panic("no return value specified for Order") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(interface{}) orm.Query); ok { r0 = rf(value) @@ -668,6 +1946,34 @@ func (_m *Transaction) Order(value interface{}) orm.Query { return r0 } +// Transaction_Order_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Order' +type Transaction_Order_Call struct { + *mock.Call +} + +// Order is a helper method to define mock.On call +// - value interface{} +func (_e *Transaction_Expecter) Order(value interface{}) *Transaction_Order_Call { + return &Transaction_Order_Call{Call: _e.mock.On("Order", value)} +} + +func (_c *Transaction_Order_Call) Run(run func(value interface{})) *Transaction_Order_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Transaction_Order_Call) Return(_a0 orm.Query) *Transaction_Order_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_Order_Call) RunAndReturn(run func(interface{}) orm.Query) *Transaction_Order_Call { + _c.Call.Return(run) + return _c +} + // OrderBy provides a mock function with given fields: column, direction func (_m *Transaction) OrderBy(column string, direction ...string) orm.Query { _va := make([]interface{}, len(direction)) @@ -679,6 +1985,10 @@ func (_m *Transaction) OrderBy(column string, direction ...string) orm.Query { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for OrderBy") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string, ...string) orm.Query); ok { r0 = rf(column, direction...) @@ -691,10 +2001,50 @@ func (_m *Transaction) OrderBy(column string, direction ...string) orm.Query { return r0 } +// Transaction_OrderBy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrderBy' +type Transaction_OrderBy_Call struct { + *mock.Call +} + +// OrderBy is a helper method to define mock.On call +// - column string +// - direction ...string +func (_e *Transaction_Expecter) OrderBy(column interface{}, direction ...interface{}) *Transaction_OrderBy_Call { + return &Transaction_OrderBy_Call{Call: _e.mock.On("OrderBy", + append([]interface{}{column}, direction...)...)} +} + +func (_c *Transaction_OrderBy_Call) Run(run func(column string, direction ...string)) *Transaction_OrderBy_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Transaction_OrderBy_Call) Return(_a0 orm.Query) *Transaction_OrderBy_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_OrderBy_Call) RunAndReturn(run func(string, ...string) orm.Query) *Transaction_OrderBy_Call { + _c.Call.Return(run) + return _c +} + // OrderByDesc provides a mock function with given fields: column func (_m *Transaction) OrderByDesc(column string) orm.Query { ret := _m.Called(column) + if len(ret) == 0 { + panic("no return value specified for OrderByDesc") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string) orm.Query); ok { r0 = rf(column) @@ -707,10 +2057,42 @@ func (_m *Transaction) OrderByDesc(column string) orm.Query { return r0 } +// Transaction_OrderByDesc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrderByDesc' +type Transaction_OrderByDesc_Call struct { + *mock.Call +} + +// OrderByDesc is a helper method to define mock.On call +// - column string +func (_e *Transaction_Expecter) OrderByDesc(column interface{}) *Transaction_OrderByDesc_Call { + return &Transaction_OrderByDesc_Call{Call: _e.mock.On("OrderByDesc", column)} +} + +func (_c *Transaction_OrderByDesc_Call) Run(run func(column string)) *Transaction_OrderByDesc_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Transaction_OrderByDesc_Call) Return(_a0 orm.Query) *Transaction_OrderByDesc_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_OrderByDesc_Call) RunAndReturn(run func(string) orm.Query) *Transaction_OrderByDesc_Call { + _c.Call.Return(run) + return _c +} + // Paginate provides a mock function with given fields: page, limit, dest, total func (_m *Transaction) Paginate(page int, limit int, dest interface{}, total *int64) error { ret := _m.Called(page, limit, dest, total) + if len(ret) == 0 { + panic("no return value specified for Paginate") + } + var r0 error if rf, ok := ret.Get(0).(func(int, int, interface{}, *int64) error); ok { r0 = rf(page, limit, dest, total) @@ -721,10 +2103,45 @@ func (_m *Transaction) Paginate(page int, limit int, dest interface{}, total *in return r0 } +// Transaction_Paginate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Paginate' +type Transaction_Paginate_Call struct { + *mock.Call +} + +// Paginate is a helper method to define mock.On call +// - page int +// - limit int +// - dest interface{} +// - total *int64 +func (_e *Transaction_Expecter) Paginate(page interface{}, limit interface{}, dest interface{}, total interface{}) *Transaction_Paginate_Call { + return &Transaction_Paginate_Call{Call: _e.mock.On("Paginate", page, limit, dest, total)} +} + +func (_c *Transaction_Paginate_Call) Run(run func(page int, limit int, dest interface{}, total *int64)) *Transaction_Paginate_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int), args[1].(int), args[2].(interface{}), args[3].(*int64)) + }) + return _c +} + +func (_c *Transaction_Paginate_Call) Return(_a0 error) *Transaction_Paginate_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_Paginate_Call) RunAndReturn(run func(int, int, interface{}, *int64) error) *Transaction_Paginate_Call { + _c.Call.Return(run) + return _c +} + // Pluck provides a mock function with given fields: column, dest func (_m *Transaction) Pluck(column string, dest interface{}) error { ret := _m.Called(column, dest) + if len(ret) == 0 { + panic("no return value specified for Pluck") + } + var r0 error if rf, ok := ret.Get(0).(func(string, interface{}) error); ok { r0 = rf(column, dest) @@ -735,6 +2152,35 @@ func (_m *Transaction) Pluck(column string, dest interface{}) error { return r0 } +// Transaction_Pluck_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Pluck' +type Transaction_Pluck_Call struct { + *mock.Call +} + +// Pluck is a helper method to define mock.On call +// - column string +// - dest interface{} +func (_e *Transaction_Expecter) Pluck(column interface{}, dest interface{}) *Transaction_Pluck_Call { + return &Transaction_Pluck_Call{Call: _e.mock.On("Pluck", column, dest)} +} + +func (_c *Transaction_Pluck_Call) Run(run func(column string, dest interface{})) *Transaction_Pluck_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(interface{})) + }) + return _c +} + +func (_c *Transaction_Pluck_Call) Return(_a0 error) *Transaction_Pluck_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_Pluck_Call) RunAndReturn(run func(string, interface{}) error) *Transaction_Pluck_Call { + _c.Call.Return(run) + return _c +} + // Raw provides a mock function with given fields: sql, values func (_m *Transaction) Raw(sql string, values ...interface{}) orm.Query { var _ca []interface{} @@ -742,6 +2188,10 @@ func (_m *Transaction) Raw(sql string, values ...interface{}) orm.Query { _ca = append(_ca, values...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Raw") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string, ...interface{}) orm.Query); ok { r0 = rf(sql, values...) @@ -754,10 +2204,50 @@ func (_m *Transaction) Raw(sql string, values ...interface{}) orm.Query { return r0 } +// Transaction_Raw_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Raw' +type Transaction_Raw_Call struct { + *mock.Call +} + +// Raw is a helper method to define mock.On call +// - sql string +// - values ...interface{} +func (_e *Transaction_Expecter) Raw(sql interface{}, values ...interface{}) *Transaction_Raw_Call { + return &Transaction_Raw_Call{Call: _e.mock.On("Raw", + append([]interface{}{sql}, values...)...)} +} + +func (_c *Transaction_Raw_Call) Run(run func(sql string, values ...interface{})) *Transaction_Raw_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Transaction_Raw_Call) Return(_a0 orm.Query) *Transaction_Raw_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_Raw_Call) RunAndReturn(run func(string, ...interface{}) orm.Query) *Transaction_Raw_Call { + _c.Call.Return(run) + return _c +} + // Rollback provides a mock function with given fields: func (_m *Transaction) Rollback() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Rollback") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -768,10 +2258,41 @@ func (_m *Transaction) Rollback() error { return r0 } +// Transaction_Rollback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Rollback' +type Transaction_Rollback_Call struct { + *mock.Call +} + +// Rollback is a helper method to define mock.On call +func (_e *Transaction_Expecter) Rollback() *Transaction_Rollback_Call { + return &Transaction_Rollback_Call{Call: _e.mock.On("Rollback")} +} + +func (_c *Transaction_Rollback_Call) Run(run func()) *Transaction_Rollback_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Transaction_Rollback_Call) Return(_a0 error) *Transaction_Rollback_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_Rollback_Call) RunAndReturn(run func() error) *Transaction_Rollback_Call { + _c.Call.Return(run) + return _c +} + // Save provides a mock function with given fields: value func (_m *Transaction) Save(value interface{}) error { ret := _m.Called(value) + if len(ret) == 0 { + panic("no return value specified for Save") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}) error); ok { r0 = rf(value) @@ -782,10 +2303,42 @@ func (_m *Transaction) Save(value interface{}) error { return r0 } +// Transaction_Save_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Save' +type Transaction_Save_Call struct { + *mock.Call +} + +// Save is a helper method to define mock.On call +// - value interface{} +func (_e *Transaction_Expecter) Save(value interface{}) *Transaction_Save_Call { + return &Transaction_Save_Call{Call: _e.mock.On("Save", value)} +} + +func (_c *Transaction_Save_Call) Run(run func(value interface{})) *Transaction_Save_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Transaction_Save_Call) Return(_a0 error) *Transaction_Save_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_Save_Call) RunAndReturn(run func(interface{}) error) *Transaction_Save_Call { + _c.Call.Return(run) + return _c +} + // SaveQuietly provides a mock function with given fields: value func (_m *Transaction) SaveQuietly(value interface{}) error { ret := _m.Called(value) + if len(ret) == 0 { + panic("no return value specified for SaveQuietly") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}) error); ok { r0 = rf(value) @@ -796,10 +2349,42 @@ func (_m *Transaction) SaveQuietly(value interface{}) error { return r0 } +// Transaction_SaveQuietly_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveQuietly' +type Transaction_SaveQuietly_Call struct { + *mock.Call +} + +// SaveQuietly is a helper method to define mock.On call +// - value interface{} +func (_e *Transaction_Expecter) SaveQuietly(value interface{}) *Transaction_SaveQuietly_Call { + return &Transaction_SaveQuietly_Call{Call: _e.mock.On("SaveQuietly", value)} +} + +func (_c *Transaction_SaveQuietly_Call) Run(run func(value interface{})) *Transaction_SaveQuietly_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Transaction_SaveQuietly_Call) Return(_a0 error) *Transaction_SaveQuietly_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_SaveQuietly_Call) RunAndReturn(run func(interface{}) error) *Transaction_SaveQuietly_Call { + _c.Call.Return(run) + return _c +} + // Scan provides a mock function with given fields: dest func (_m *Transaction) Scan(dest interface{}) error { ret := _m.Called(dest) + if len(ret) == 0 { + panic("no return value specified for Scan") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}) error); ok { r0 = rf(dest) @@ -810,6 +2395,34 @@ func (_m *Transaction) Scan(dest interface{}) error { return r0 } +// Transaction_Scan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Scan' +type Transaction_Scan_Call struct { + *mock.Call +} + +// Scan is a helper method to define mock.On call +// - dest interface{} +func (_e *Transaction_Expecter) Scan(dest interface{}) *Transaction_Scan_Call { + return &Transaction_Scan_Call{Call: _e.mock.On("Scan", dest)} +} + +func (_c *Transaction_Scan_Call) Run(run func(dest interface{})) *Transaction_Scan_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Transaction_Scan_Call) Return(_a0 error) *Transaction_Scan_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_Scan_Call) RunAndReturn(run func(interface{}) error) *Transaction_Scan_Call { + _c.Call.Return(run) + return _c +} + // Scopes provides a mock function with given fields: funcs func (_m *Transaction) Scopes(funcs ...func(orm.Query) orm.Query) orm.Query { _va := make([]interface{}, len(funcs)) @@ -820,6 +2433,10 @@ func (_m *Transaction) Scopes(funcs ...func(orm.Query) orm.Query) orm.Query { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Scopes") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(...func(orm.Query) orm.Query) orm.Query); ok { r0 = rf(funcs...) @@ -832,6 +2449,41 @@ func (_m *Transaction) Scopes(funcs ...func(orm.Query) orm.Query) orm.Query { return r0 } +// Transaction_Scopes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Scopes' +type Transaction_Scopes_Call struct { + *mock.Call +} + +// Scopes is a helper method to define mock.On call +// - funcs ...func(orm.Query) orm.Query +func (_e *Transaction_Expecter) Scopes(funcs ...interface{}) *Transaction_Scopes_Call { + return &Transaction_Scopes_Call{Call: _e.mock.On("Scopes", + append([]interface{}{}, funcs...)...)} +} + +func (_c *Transaction_Scopes_Call) Run(run func(funcs ...func(orm.Query) orm.Query)) *Transaction_Scopes_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(orm.Query) orm.Query, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(func(orm.Query) orm.Query) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Transaction_Scopes_Call) Return(_a0 orm.Query) *Transaction_Scopes_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_Scopes_Call) RunAndReturn(run func(...func(orm.Query) orm.Query) orm.Query) *Transaction_Scopes_Call { + _c.Call.Return(run) + return _c +} + // Select provides a mock function with given fields: query, args func (_m *Transaction) Select(query interface{}, args ...interface{}) orm.Query { var _ca []interface{} @@ -839,6 +2491,10 @@ func (_m *Transaction) Select(query interface{}, args ...interface{}) orm.Query _ca = append(_ca, args...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Select") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(interface{}, ...interface{}) orm.Query); ok { r0 = rf(query, args...) @@ -851,10 +2507,50 @@ func (_m *Transaction) Select(query interface{}, args ...interface{}) orm.Query return r0 } +// Transaction_Select_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Select' +type Transaction_Select_Call struct { + *mock.Call +} + +// Select is a helper method to define mock.On call +// - query interface{} +// - args ...interface{} +func (_e *Transaction_Expecter) Select(query interface{}, args ...interface{}) *Transaction_Select_Call { + return &Transaction_Select_Call{Call: _e.mock.On("Select", + append([]interface{}{query}, args...)...)} +} + +func (_c *Transaction_Select_Call) Run(run func(query interface{}, args ...interface{})) *Transaction_Select_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(interface{}), variadicArgs...) + }) + return _c +} + +func (_c *Transaction_Select_Call) Return(_a0 orm.Query) *Transaction_Select_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_Select_Call) RunAndReturn(run func(interface{}, ...interface{}) orm.Query) *Transaction_Select_Call { + _c.Call.Return(run) + return _c +} + // SharedLock provides a mock function with given fields: func (_m *Transaction) SharedLock() orm.Query { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for SharedLock") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func() orm.Query); ok { r0 = rf() @@ -867,10 +2563,41 @@ func (_m *Transaction) SharedLock() orm.Query { return r0 } +// Transaction_SharedLock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SharedLock' +type Transaction_SharedLock_Call struct { + *mock.Call +} + +// SharedLock is a helper method to define mock.On call +func (_e *Transaction_Expecter) SharedLock() *Transaction_SharedLock_Call { + return &Transaction_SharedLock_Call{Call: _e.mock.On("SharedLock")} +} + +func (_c *Transaction_SharedLock_Call) Run(run func()) *Transaction_SharedLock_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Transaction_SharedLock_Call) Return(_a0 orm.Query) *Transaction_SharedLock_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_SharedLock_Call) RunAndReturn(run func() orm.Query) *Transaction_SharedLock_Call { + _c.Call.Return(run) + return _c +} + // Sum provides a mock function with given fields: column, dest func (_m *Transaction) Sum(column string, dest interface{}) error { ret := _m.Called(column, dest) + if len(ret) == 0 { + panic("no return value specified for Sum") + } + var r0 error if rf, ok := ret.Get(0).(func(string, interface{}) error); ok { r0 = rf(column, dest) @@ -881,6 +2608,35 @@ func (_m *Transaction) Sum(column string, dest interface{}) error { return r0 } +// Transaction_Sum_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sum' +type Transaction_Sum_Call struct { + *mock.Call +} + +// Sum is a helper method to define mock.On call +// - column string +// - dest interface{} +func (_e *Transaction_Expecter) Sum(column interface{}, dest interface{}) *Transaction_Sum_Call { + return &Transaction_Sum_Call{Call: _e.mock.On("Sum", column, dest)} +} + +func (_c *Transaction_Sum_Call) Run(run func(column string, dest interface{})) *Transaction_Sum_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(interface{})) + }) + return _c +} + +func (_c *Transaction_Sum_Call) Return(_a0 error) *Transaction_Sum_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_Sum_Call) RunAndReturn(run func(string, interface{}) error) *Transaction_Sum_Call { + _c.Call.Return(run) + return _c +} + // Table provides a mock function with given fields: name, args func (_m *Transaction) Table(name string, args ...interface{}) orm.Query { var _ca []interface{} @@ -888,6 +2644,10 @@ func (_m *Transaction) Table(name string, args ...interface{}) orm.Query { _ca = append(_ca, args...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Table") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string, ...interface{}) orm.Query); ok { r0 = rf(name, args...) @@ -900,6 +2660,42 @@ func (_m *Transaction) Table(name string, args ...interface{}) orm.Query { return r0 } +// Transaction_Table_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Table' +type Transaction_Table_Call struct { + *mock.Call +} + +// Table is a helper method to define mock.On call +// - name string +// - args ...interface{} +func (_e *Transaction_Expecter) Table(name interface{}, args ...interface{}) *Transaction_Table_Call { + return &Transaction_Table_Call{Call: _e.mock.On("Table", + append([]interface{}{name}, args...)...)} +} + +func (_c *Transaction_Table_Call) Run(run func(name string, args ...interface{})) *Transaction_Table_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Transaction_Table_Call) Return(_a0 orm.Query) *Transaction_Table_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_Table_Call) RunAndReturn(run func(string, ...interface{}) orm.Query) *Transaction_Table_Call { + _c.Call.Return(run) + return _c +} + // Update provides a mock function with given fields: column, value func (_m *Transaction) Update(column interface{}, value ...interface{}) (*orm.Result, error) { var _ca []interface{} @@ -907,6 +2703,10 @@ func (_m *Transaction) Update(column interface{}, value ...interface{}) (*orm.Re _ca = append(_ca, value...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Update") + } + var r0 *orm.Result var r1 error if rf, ok := ret.Get(0).(func(interface{}, ...interface{}) (*orm.Result, error)); ok { @@ -929,10 +2729,50 @@ func (_m *Transaction) Update(column interface{}, value ...interface{}) (*orm.Re return r0, r1 } +// Transaction_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type Transaction_Update_Call struct { + *mock.Call +} + +// Update is a helper method to define mock.On call +// - column interface{} +// - value ...interface{} +func (_e *Transaction_Expecter) Update(column interface{}, value ...interface{}) *Transaction_Update_Call { + return &Transaction_Update_Call{Call: _e.mock.On("Update", + append([]interface{}{column}, value...)...)} +} + +func (_c *Transaction_Update_Call) Run(run func(column interface{}, value ...interface{})) *Transaction_Update_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(interface{}), variadicArgs...) + }) + return _c +} + +func (_c *Transaction_Update_Call) Return(_a0 *orm.Result, _a1 error) *Transaction_Update_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Transaction_Update_Call) RunAndReturn(run func(interface{}, ...interface{}) (*orm.Result, error)) *Transaction_Update_Call { + _c.Call.Return(run) + return _c +} + // UpdateOrCreate provides a mock function with given fields: dest, attributes, values func (_m *Transaction) UpdateOrCreate(dest interface{}, attributes interface{}, values interface{}) error { ret := _m.Called(dest, attributes, values) + if len(ret) == 0 { + panic("no return value specified for UpdateOrCreate") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}, interface{}, interface{}) error); ok { r0 = rf(dest, attributes, values) @@ -943,6 +2783,36 @@ func (_m *Transaction) UpdateOrCreate(dest interface{}, attributes interface{}, return r0 } +// Transaction_UpdateOrCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateOrCreate' +type Transaction_UpdateOrCreate_Call struct { + *mock.Call +} + +// UpdateOrCreate is a helper method to define mock.On call +// - dest interface{} +// - attributes interface{} +// - values interface{} +func (_e *Transaction_Expecter) UpdateOrCreate(dest interface{}, attributes interface{}, values interface{}) *Transaction_UpdateOrCreate_Call { + return &Transaction_UpdateOrCreate_Call{Call: _e.mock.On("UpdateOrCreate", dest, attributes, values)} +} + +func (_c *Transaction_UpdateOrCreate_Call) Run(run func(dest interface{}, attributes interface{}, values interface{})) *Transaction_UpdateOrCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{}), args[1].(interface{}), args[2].(interface{})) + }) + return _c +} + +func (_c *Transaction_UpdateOrCreate_Call) Return(_a0 error) *Transaction_UpdateOrCreate_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_UpdateOrCreate_Call) RunAndReturn(run func(interface{}, interface{}, interface{}) error) *Transaction_UpdateOrCreate_Call { + _c.Call.Return(run) + return _c +} + // Where provides a mock function with given fields: query, args func (_m *Transaction) Where(query interface{}, args ...interface{}) orm.Query { var _ca []interface{} @@ -950,6 +2820,10 @@ func (_m *Transaction) Where(query interface{}, args ...interface{}) orm.Query { _ca = append(_ca, args...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Where") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(interface{}, ...interface{}) orm.Query); ok { r0 = rf(query, args...) @@ -962,10 +2836,50 @@ func (_m *Transaction) Where(query interface{}, args ...interface{}) orm.Query { return r0 } +// Transaction_Where_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Where' +type Transaction_Where_Call struct { + *mock.Call +} + +// Where is a helper method to define mock.On call +// - query interface{} +// - args ...interface{} +func (_e *Transaction_Expecter) Where(query interface{}, args ...interface{}) *Transaction_Where_Call { + return &Transaction_Where_Call{Call: _e.mock.On("Where", + append([]interface{}{query}, args...)...)} +} + +func (_c *Transaction_Where_Call) Run(run func(query interface{}, args ...interface{})) *Transaction_Where_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(interface{}), variadicArgs...) + }) + return _c +} + +func (_c *Transaction_Where_Call) Return(_a0 orm.Query) *Transaction_Where_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_Where_Call) RunAndReturn(run func(interface{}, ...interface{}) orm.Query) *Transaction_Where_Call { + _c.Call.Return(run) + return _c +} + // WhereBetween provides a mock function with given fields: column, x, y func (_m *Transaction) WhereBetween(column string, x interface{}, y interface{}) orm.Query { ret := _m.Called(column, x, y) + if len(ret) == 0 { + panic("no return value specified for WhereBetween") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string, interface{}, interface{}) orm.Query); ok { r0 = rf(column, x, y) @@ -978,10 +2892,44 @@ func (_m *Transaction) WhereBetween(column string, x interface{}, y interface{}) return r0 } +// Transaction_WhereBetween_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WhereBetween' +type Transaction_WhereBetween_Call struct { + *mock.Call +} + +// WhereBetween is a helper method to define mock.On call +// - column string +// - x interface{} +// - y interface{} +func (_e *Transaction_Expecter) WhereBetween(column interface{}, x interface{}, y interface{}) *Transaction_WhereBetween_Call { + return &Transaction_WhereBetween_Call{Call: _e.mock.On("WhereBetween", column, x, y)} +} + +func (_c *Transaction_WhereBetween_Call) Run(run func(column string, x interface{}, y interface{})) *Transaction_WhereBetween_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(interface{}), args[2].(interface{})) + }) + return _c +} + +func (_c *Transaction_WhereBetween_Call) Return(_a0 orm.Query) *Transaction_WhereBetween_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_WhereBetween_Call) RunAndReturn(run func(string, interface{}, interface{}) orm.Query) *Transaction_WhereBetween_Call { + _c.Call.Return(run) + return _c +} + // WhereIn provides a mock function with given fields: column, values func (_m *Transaction) WhereIn(column string, values []interface{}) orm.Query { ret := _m.Called(column, values) + if len(ret) == 0 { + panic("no return value specified for WhereIn") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string, []interface{}) orm.Query); ok { r0 = rf(column, values) @@ -994,10 +2942,43 @@ func (_m *Transaction) WhereIn(column string, values []interface{}) orm.Query { return r0 } +// Transaction_WhereIn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WhereIn' +type Transaction_WhereIn_Call struct { + *mock.Call +} + +// WhereIn is a helper method to define mock.On call +// - column string +// - values []interface{} +func (_e *Transaction_Expecter) WhereIn(column interface{}, values interface{}) *Transaction_WhereIn_Call { + return &Transaction_WhereIn_Call{Call: _e.mock.On("WhereIn", column, values)} +} + +func (_c *Transaction_WhereIn_Call) Run(run func(column string, values []interface{})) *Transaction_WhereIn_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].([]interface{})) + }) + return _c +} + +func (_c *Transaction_WhereIn_Call) Return(_a0 orm.Query) *Transaction_WhereIn_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_WhereIn_Call) RunAndReturn(run func(string, []interface{}) orm.Query) *Transaction_WhereIn_Call { + _c.Call.Return(run) + return _c +} + // WhereNotBetween provides a mock function with given fields: column, x, y func (_m *Transaction) WhereNotBetween(column string, x interface{}, y interface{}) orm.Query { ret := _m.Called(column, x, y) + if len(ret) == 0 { + panic("no return value specified for WhereNotBetween") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string, interface{}, interface{}) orm.Query); ok { r0 = rf(column, x, y) @@ -1010,10 +2991,44 @@ func (_m *Transaction) WhereNotBetween(column string, x interface{}, y interface return r0 } +// Transaction_WhereNotBetween_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WhereNotBetween' +type Transaction_WhereNotBetween_Call struct { + *mock.Call +} + +// WhereNotBetween is a helper method to define mock.On call +// - column string +// - x interface{} +// - y interface{} +func (_e *Transaction_Expecter) WhereNotBetween(column interface{}, x interface{}, y interface{}) *Transaction_WhereNotBetween_Call { + return &Transaction_WhereNotBetween_Call{Call: _e.mock.On("WhereNotBetween", column, x, y)} +} + +func (_c *Transaction_WhereNotBetween_Call) Run(run func(column string, x interface{}, y interface{})) *Transaction_WhereNotBetween_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(interface{}), args[2].(interface{})) + }) + return _c +} + +func (_c *Transaction_WhereNotBetween_Call) Return(_a0 orm.Query) *Transaction_WhereNotBetween_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_WhereNotBetween_Call) RunAndReturn(run func(string, interface{}, interface{}) orm.Query) *Transaction_WhereNotBetween_Call { + _c.Call.Return(run) + return _c +} + // WhereNotIn provides a mock function with given fields: column, values func (_m *Transaction) WhereNotIn(column string, values []interface{}) orm.Query { ret := _m.Called(column, values) + if len(ret) == 0 { + panic("no return value specified for WhereNotIn") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string, []interface{}) orm.Query); ok { r0 = rf(column, values) @@ -1026,10 +3041,43 @@ func (_m *Transaction) WhereNotIn(column string, values []interface{}) orm.Query return r0 } +// Transaction_WhereNotIn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WhereNotIn' +type Transaction_WhereNotIn_Call struct { + *mock.Call +} + +// WhereNotIn is a helper method to define mock.On call +// - column string +// - values []interface{} +func (_e *Transaction_Expecter) WhereNotIn(column interface{}, values interface{}) *Transaction_WhereNotIn_Call { + return &Transaction_WhereNotIn_Call{Call: _e.mock.On("WhereNotIn", column, values)} +} + +func (_c *Transaction_WhereNotIn_Call) Run(run func(column string, values []interface{})) *Transaction_WhereNotIn_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].([]interface{})) + }) + return _c +} + +func (_c *Transaction_WhereNotIn_Call) Return(_a0 orm.Query) *Transaction_WhereNotIn_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_WhereNotIn_Call) RunAndReturn(run func(string, []interface{}) orm.Query) *Transaction_WhereNotIn_Call { + _c.Call.Return(run) + return _c +} + // WhereNotNull provides a mock function with given fields: column func (_m *Transaction) WhereNotNull(column string) orm.Query { ret := _m.Called(column) + if len(ret) == 0 { + panic("no return value specified for WhereNotNull") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string) orm.Query); ok { r0 = rf(column) @@ -1042,10 +3090,42 @@ func (_m *Transaction) WhereNotNull(column string) orm.Query { return r0 } +// Transaction_WhereNotNull_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WhereNotNull' +type Transaction_WhereNotNull_Call struct { + *mock.Call +} + +// WhereNotNull is a helper method to define mock.On call +// - column string +func (_e *Transaction_Expecter) WhereNotNull(column interface{}) *Transaction_WhereNotNull_Call { + return &Transaction_WhereNotNull_Call{Call: _e.mock.On("WhereNotNull", column)} +} + +func (_c *Transaction_WhereNotNull_Call) Run(run func(column string)) *Transaction_WhereNotNull_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Transaction_WhereNotNull_Call) Return(_a0 orm.Query) *Transaction_WhereNotNull_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_WhereNotNull_Call) RunAndReturn(run func(string) orm.Query) *Transaction_WhereNotNull_Call { + _c.Call.Return(run) + return _c +} + // WhereNull provides a mock function with given fields: column func (_m *Transaction) WhereNull(column string) orm.Query { ret := _m.Called(column) + if len(ret) == 0 { + panic("no return value specified for WhereNull") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string) orm.Query); ok { r0 = rf(column) @@ -1058,6 +3138,34 @@ func (_m *Transaction) WhereNull(column string) orm.Query { return r0 } +// Transaction_WhereNull_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WhereNull' +type Transaction_WhereNull_Call struct { + *mock.Call +} + +// WhereNull is a helper method to define mock.On call +// - column string +func (_e *Transaction_Expecter) WhereNull(column interface{}) *Transaction_WhereNull_Call { + return &Transaction_WhereNull_Call{Call: _e.mock.On("WhereNull", column)} +} + +func (_c *Transaction_WhereNull_Call) Run(run func(column string)) *Transaction_WhereNull_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Transaction_WhereNull_Call) Return(_a0 orm.Query) *Transaction_WhereNull_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_WhereNull_Call) RunAndReturn(run func(string) orm.Query) *Transaction_WhereNull_Call { + _c.Call.Return(run) + return _c +} + // With provides a mock function with given fields: query, args func (_m *Transaction) With(query string, args ...interface{}) orm.Query { var _ca []interface{} @@ -1065,6 +3173,10 @@ func (_m *Transaction) With(query string, args ...interface{}) orm.Query { _ca = append(_ca, args...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for With") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func(string, ...interface{}) orm.Query); ok { r0 = rf(query, args...) @@ -1077,10 +3189,50 @@ func (_m *Transaction) With(query string, args ...interface{}) orm.Query { return r0 } +// Transaction_With_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'With' +type Transaction_With_Call struct { + *mock.Call +} + +// With is a helper method to define mock.On call +// - query string +// - args ...interface{} +func (_e *Transaction_Expecter) With(query interface{}, args ...interface{}) *Transaction_With_Call { + return &Transaction_With_Call{Call: _e.mock.On("With", + append([]interface{}{query}, args...)...)} +} + +func (_c *Transaction_With_Call) Run(run func(query string, args ...interface{})) *Transaction_With_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Transaction_With_Call) Return(_a0 orm.Query) *Transaction_With_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_With_Call) RunAndReturn(run func(string, ...interface{}) orm.Query) *Transaction_With_Call { + _c.Call.Return(run) + return _c +} + // WithTrashed provides a mock function with given fields: func (_m *Transaction) WithTrashed() orm.Query { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for WithTrashed") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func() orm.Query); ok { r0 = rf() @@ -1093,10 +3245,41 @@ func (_m *Transaction) WithTrashed() orm.Query { return r0 } +// Transaction_WithTrashed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithTrashed' +type Transaction_WithTrashed_Call struct { + *mock.Call +} + +// WithTrashed is a helper method to define mock.On call +func (_e *Transaction_Expecter) WithTrashed() *Transaction_WithTrashed_Call { + return &Transaction_WithTrashed_Call{Call: _e.mock.On("WithTrashed")} +} + +func (_c *Transaction_WithTrashed_Call) Run(run func()) *Transaction_WithTrashed_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Transaction_WithTrashed_Call) Return(_a0 orm.Query) *Transaction_WithTrashed_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_WithTrashed_Call) RunAndReturn(run func() orm.Query) *Transaction_WithTrashed_Call { + _c.Call.Return(run) + return _c +} + // WithoutEvents provides a mock function with given fields: func (_m *Transaction) WithoutEvents() orm.Query { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for WithoutEvents") + } + var r0 orm.Query if rf, ok := ret.Get(0).(func() orm.Query); ok { r0 = rf() @@ -1109,6 +3292,33 @@ func (_m *Transaction) WithoutEvents() orm.Query { return r0 } +// Transaction_WithoutEvents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithoutEvents' +type Transaction_WithoutEvents_Call struct { + *mock.Call +} + +// WithoutEvents is a helper method to define mock.On call +func (_e *Transaction_Expecter) WithoutEvents() *Transaction_WithoutEvents_Call { + return &Transaction_WithoutEvents_Call{Call: _e.mock.On("WithoutEvents")} +} + +func (_c *Transaction_WithoutEvents_Call) Run(run func()) *Transaction_WithoutEvents_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Transaction_WithoutEvents_Call) Return(_a0 orm.Query) *Transaction_WithoutEvents_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transaction_WithoutEvents_Call) RunAndReturn(run func() orm.Query) *Transaction_WithoutEvents_Call { + _c.Call.Return(run) + return _c +} + // NewTransaction creates a new instance of Transaction. 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 NewTransaction(t interface { diff --git a/mocks/database/schema/Blueprint.go b/mocks/database/schema/Blueprint.go new file mode 100644 index 000000000..0b277bd25 --- /dev/null +++ b/mocks/database/schema/Blueprint.go @@ -0,0 +1,2223 @@ +// Code generated by mockery v2.39.1. DO NOT EDIT. + +package mocks + +import ( + orm "github.com/goravel/framework/contracts/database/orm" + schema "github.com/goravel/framework/contracts/database/schema" + mock "github.com/stretchr/testify/mock" +) + +// Blueprint is an autogenerated mock type for the Blueprint type +type Blueprint struct { + mock.Mock +} + +type Blueprint_Expecter struct { + mock *mock.Mock +} + +func (_m *Blueprint) EXPECT() *Blueprint_Expecter { + return &Blueprint_Expecter{mock: &_m.Mock} +} + +// BigInteger provides a mock function with given fields: column +func (_m *Blueprint) BigInteger(column string) schema.ColumnDefinition { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for BigInteger") + } + + var r0 schema.ColumnDefinition + if rf, ok := ret.Get(0).(func(string) schema.ColumnDefinition); ok { + r0 = rf(column) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.ColumnDefinition) + } + } + + return r0 +} + +// Blueprint_BigInteger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BigInteger' +type Blueprint_BigInteger_Call struct { + *mock.Call +} + +// BigInteger is a helper method to define mock.On call +// - column string +func (_e *Blueprint_Expecter) BigInteger(column interface{}) *Blueprint_BigInteger_Call { + return &Blueprint_BigInteger_Call{Call: _e.mock.On("BigInteger", column)} +} + +func (_c *Blueprint_BigInteger_Call) Run(run func(column string)) *Blueprint_BigInteger_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Blueprint_BigInteger_Call) Return(_a0 schema.ColumnDefinition) *Blueprint_BigInteger_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_BigInteger_Call) RunAndReturn(run func(string) schema.ColumnDefinition) *Blueprint_BigInteger_Call { + _c.Call.Return(run) + return _c +} + +// Binary provides a mock function with given fields: column +func (_m *Blueprint) Binary(column string) schema.ColumnDefinition { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for Binary") + } + + var r0 schema.ColumnDefinition + if rf, ok := ret.Get(0).(func(string) schema.ColumnDefinition); ok { + r0 = rf(column) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.ColumnDefinition) + } + } + + return r0 +} + +// Blueprint_Binary_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Binary' +type Blueprint_Binary_Call struct { + *mock.Call +} + +// Binary is a helper method to define mock.On call +// - column string +func (_e *Blueprint_Expecter) Binary(column interface{}) *Blueprint_Binary_Call { + return &Blueprint_Binary_Call{Call: _e.mock.On("Binary", column)} +} + +func (_c *Blueprint_Binary_Call) Run(run func(column string)) *Blueprint_Binary_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Blueprint_Binary_Call) Return(_a0 schema.ColumnDefinition) *Blueprint_Binary_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_Binary_Call) RunAndReturn(run func(string) schema.ColumnDefinition) *Blueprint_Binary_Call { + _c.Call.Return(run) + return _c +} + +// Boolean provides a mock function with given fields: column +func (_m *Blueprint) Boolean(column string) schema.ColumnDefinition { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for Boolean") + } + + var r0 schema.ColumnDefinition + if rf, ok := ret.Get(0).(func(string) schema.ColumnDefinition); ok { + r0 = rf(column) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.ColumnDefinition) + } + } + + return r0 +} + +// Blueprint_Boolean_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Boolean' +type Blueprint_Boolean_Call struct { + *mock.Call +} + +// Boolean is a helper method to define mock.On call +// - column string +func (_e *Blueprint_Expecter) Boolean(column interface{}) *Blueprint_Boolean_Call { + return &Blueprint_Boolean_Call{Call: _e.mock.On("Boolean", column)} +} + +func (_c *Blueprint_Boolean_Call) Run(run func(column string)) *Blueprint_Boolean_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Blueprint_Boolean_Call) Return(_a0 schema.ColumnDefinition) *Blueprint_Boolean_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_Boolean_Call) RunAndReturn(run func(string) schema.ColumnDefinition) *Blueprint_Boolean_Call { + _c.Call.Return(run) + return _c +} + +// Build provides a mock function with given fields: query, grammar +func (_m *Blueprint) Build(query orm.Query, grammar schema.Grammar) error { + ret := _m.Called(query, grammar) + + if len(ret) == 0 { + panic("no return value specified for Build") + } + + var r0 error + if rf, ok := ret.Get(0).(func(orm.Query, schema.Grammar) error); ok { + r0 = rf(query, grammar) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Blueprint_Build_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Build' +type Blueprint_Build_Call struct { + *mock.Call +} + +// Build is a helper method to define mock.On call +// - query orm.Query +// - grammar schema.Grammar +func (_e *Blueprint_Expecter) Build(query interface{}, grammar interface{}) *Blueprint_Build_Call { + return &Blueprint_Build_Call{Call: _e.mock.On("Build", query, grammar)} +} + +func (_c *Blueprint_Build_Call) Run(run func(query orm.Query, grammar schema.Grammar)) *Blueprint_Build_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(orm.Query), args[1].(schema.Grammar)) + }) + return _c +} + +func (_c *Blueprint_Build_Call) Return(_a0 error) *Blueprint_Build_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_Build_Call) RunAndReturn(run func(orm.Query, schema.Grammar) error) *Blueprint_Build_Call { + _c.Call.Return(run) + return _c +} + +// Char provides a mock function with given fields: column, length +func (_m *Blueprint) Char(column string, length ...int) schema.ColumnDefinition { + _va := make([]interface{}, len(length)) + for _i := range length { + _va[_i] = length[_i] + } + var _ca []interface{} + _ca = append(_ca, column) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for Char") + } + + var r0 schema.ColumnDefinition + if rf, ok := ret.Get(0).(func(string, ...int) schema.ColumnDefinition); ok { + r0 = rf(column, length...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.ColumnDefinition) + } + } + + return r0 +} + +// Blueprint_Char_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Char' +type Blueprint_Char_Call struct { + *mock.Call +} + +// Char is a helper method to define mock.On call +// - column string +// - length ...int +func (_e *Blueprint_Expecter) Char(column interface{}, length ...interface{}) *Blueprint_Char_Call { + return &Blueprint_Char_Call{Call: _e.mock.On("Char", + append([]interface{}{column}, length...)...)} +} + +func (_c *Blueprint_Char_Call) Run(run func(column string, length ...int)) *Blueprint_Char_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]int, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(int) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Blueprint_Char_Call) Return(_a0 schema.ColumnDefinition) *Blueprint_Char_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_Char_Call) RunAndReturn(run func(string, ...int) schema.ColumnDefinition) *Blueprint_Char_Call { + _c.Call.Return(run) + return _c +} + +// Comment provides a mock function with given fields: comment +func (_m *Blueprint) Comment(comment string) error { + ret := _m.Called(comment) + + if len(ret) == 0 { + panic("no return value specified for Comment") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string) error); ok { + r0 = rf(comment) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Blueprint_Comment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Comment' +type Blueprint_Comment_Call struct { + *mock.Call +} + +// Comment is a helper method to define mock.On call +// - comment string +func (_e *Blueprint_Expecter) Comment(comment interface{}) *Blueprint_Comment_Call { + return &Blueprint_Comment_Call{Call: _e.mock.On("Comment", comment)} +} + +func (_c *Blueprint_Comment_Call) Run(run func(comment string)) *Blueprint_Comment_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Blueprint_Comment_Call) Return(_a0 error) *Blueprint_Comment_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_Comment_Call) RunAndReturn(run func(string) error) *Blueprint_Comment_Call { + _c.Call.Return(run) + return _c +} + +// Create provides a mock function with given fields: +func (_m *Blueprint) Create() { + _m.Called() +} + +// Blueprint_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type Blueprint_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +func (_e *Blueprint_Expecter) Create() *Blueprint_Create_Call { + return &Blueprint_Create_Call{Call: _e.mock.On("Create")} +} + +func (_c *Blueprint_Create_Call) Run(run func()) *Blueprint_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Blueprint_Create_Call) Return() *Blueprint_Create_Call { + _c.Call.Return() + return _c +} + +func (_c *Blueprint_Create_Call) RunAndReturn(run func()) *Blueprint_Create_Call { + _c.Call.Return(run) + return _c +} + +// Date provides a mock function with given fields: column +func (_m *Blueprint) Date(column string) schema.ColumnDefinition { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for Date") + } + + var r0 schema.ColumnDefinition + if rf, ok := ret.Get(0).(func(string) schema.ColumnDefinition); ok { + r0 = rf(column) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.ColumnDefinition) + } + } + + return r0 +} + +// Blueprint_Date_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Date' +type Blueprint_Date_Call struct { + *mock.Call +} + +// Date is a helper method to define mock.On call +// - column string +func (_e *Blueprint_Expecter) Date(column interface{}) *Blueprint_Date_Call { + return &Blueprint_Date_Call{Call: _e.mock.On("Date", column)} +} + +func (_c *Blueprint_Date_Call) Run(run func(column string)) *Blueprint_Date_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Blueprint_Date_Call) Return(_a0 schema.ColumnDefinition) *Blueprint_Date_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_Date_Call) RunAndReturn(run func(string) schema.ColumnDefinition) *Blueprint_Date_Call { + _c.Call.Return(run) + return _c +} + +// DateTime provides a mock function with given fields: column +func (_m *Blueprint) DateTime(column string) schema.ColumnDefinition { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for DateTime") + } + + var r0 schema.ColumnDefinition + if rf, ok := ret.Get(0).(func(string) schema.ColumnDefinition); ok { + r0 = rf(column) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.ColumnDefinition) + } + } + + return r0 +} + +// Blueprint_DateTime_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DateTime' +type Blueprint_DateTime_Call struct { + *mock.Call +} + +// DateTime is a helper method to define mock.On call +// - column string +func (_e *Blueprint_Expecter) DateTime(column interface{}) *Blueprint_DateTime_Call { + return &Blueprint_DateTime_Call{Call: _e.mock.On("DateTime", column)} +} + +func (_c *Blueprint_DateTime_Call) Run(run func(column string)) *Blueprint_DateTime_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Blueprint_DateTime_Call) Return(_a0 schema.ColumnDefinition) *Blueprint_DateTime_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_DateTime_Call) RunAndReturn(run func(string) schema.ColumnDefinition) *Blueprint_DateTime_Call { + _c.Call.Return(run) + return _c +} + +// DateTimeTz provides a mock function with given fields: column +func (_m *Blueprint) DateTimeTz(column string) schema.ColumnDefinition { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for DateTimeTz") + } + + var r0 schema.ColumnDefinition + if rf, ok := ret.Get(0).(func(string) schema.ColumnDefinition); ok { + r0 = rf(column) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.ColumnDefinition) + } + } + + return r0 +} + +// Blueprint_DateTimeTz_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DateTimeTz' +type Blueprint_DateTimeTz_Call struct { + *mock.Call +} + +// DateTimeTz is a helper method to define mock.On call +// - column string +func (_e *Blueprint_Expecter) DateTimeTz(column interface{}) *Blueprint_DateTimeTz_Call { + return &Blueprint_DateTimeTz_Call{Call: _e.mock.On("DateTimeTz", column)} +} + +func (_c *Blueprint_DateTimeTz_Call) Run(run func(column string)) *Blueprint_DateTimeTz_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Blueprint_DateTimeTz_Call) Return(_a0 schema.ColumnDefinition) *Blueprint_DateTimeTz_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_DateTimeTz_Call) RunAndReturn(run func(string) schema.ColumnDefinition) *Blueprint_DateTimeTz_Call { + _c.Call.Return(run) + return _c +} + +// Decimal provides a mock function with given fields: column +func (_m *Blueprint) Decimal(column string) schema.ColumnDefinition { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for Decimal") + } + + var r0 schema.ColumnDefinition + if rf, ok := ret.Get(0).(func(string) schema.ColumnDefinition); ok { + r0 = rf(column) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.ColumnDefinition) + } + } + + return r0 +} + +// Blueprint_Decimal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Decimal' +type Blueprint_Decimal_Call struct { + *mock.Call +} + +// Decimal is a helper method to define mock.On call +// - column string +func (_e *Blueprint_Expecter) Decimal(column interface{}) *Blueprint_Decimal_Call { + return &Blueprint_Decimal_Call{Call: _e.mock.On("Decimal", column)} +} + +func (_c *Blueprint_Decimal_Call) Run(run func(column string)) *Blueprint_Decimal_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Blueprint_Decimal_Call) Return(_a0 schema.ColumnDefinition) *Blueprint_Decimal_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_Decimal_Call) RunAndReturn(run func(string) schema.ColumnDefinition) *Blueprint_Decimal_Call { + _c.Call.Return(run) + return _c +} + +// Double provides a mock function with given fields: column +func (_m *Blueprint) Double(column string) schema.ColumnDefinition { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for Double") + } + + var r0 schema.ColumnDefinition + if rf, ok := ret.Get(0).(func(string) schema.ColumnDefinition); ok { + r0 = rf(column) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.ColumnDefinition) + } + } + + return r0 +} + +// Blueprint_Double_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Double' +type Blueprint_Double_Call struct { + *mock.Call +} + +// Double is a helper method to define mock.On call +// - column string +func (_e *Blueprint_Expecter) Double(column interface{}) *Blueprint_Double_Call { + return &Blueprint_Double_Call{Call: _e.mock.On("Double", column)} +} + +func (_c *Blueprint_Double_Call) Run(run func(column string)) *Blueprint_Double_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Blueprint_Double_Call) Return(_a0 schema.ColumnDefinition) *Blueprint_Double_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_Double_Call) RunAndReturn(run func(string) schema.ColumnDefinition) *Blueprint_Double_Call { + _c.Call.Return(run) + return _c +} + +// DropColumn provides a mock function with given fields: column +func (_m *Blueprint) DropColumn(column string) error { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for DropColumn") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string) error); ok { + r0 = rf(column) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Blueprint_DropColumn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DropColumn' +type Blueprint_DropColumn_Call struct { + *mock.Call +} + +// DropColumn is a helper method to define mock.On call +// - column string +func (_e *Blueprint_Expecter) DropColumn(column interface{}) *Blueprint_DropColumn_Call { + return &Blueprint_DropColumn_Call{Call: _e.mock.On("DropColumn", column)} +} + +func (_c *Blueprint_DropColumn_Call) Run(run func(column string)) *Blueprint_DropColumn_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Blueprint_DropColumn_Call) Return(_a0 error) *Blueprint_DropColumn_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_DropColumn_Call) RunAndReturn(run func(string) error) *Blueprint_DropColumn_Call { + _c.Call.Return(run) + return _c +} + +// DropForeign provides a mock function with given fields: index +func (_m *Blueprint) DropForeign(index string) error { + ret := _m.Called(index) + + if len(ret) == 0 { + panic("no return value specified for DropForeign") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string) error); ok { + r0 = rf(index) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Blueprint_DropForeign_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DropForeign' +type Blueprint_DropForeign_Call struct { + *mock.Call +} + +// DropForeign is a helper method to define mock.On call +// - index string +func (_e *Blueprint_Expecter) DropForeign(index interface{}) *Blueprint_DropForeign_Call { + return &Blueprint_DropForeign_Call{Call: _e.mock.On("DropForeign", index)} +} + +func (_c *Blueprint_DropForeign_Call) Run(run func(index string)) *Blueprint_DropForeign_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Blueprint_DropForeign_Call) Return(_a0 error) *Blueprint_DropForeign_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_DropForeign_Call) RunAndReturn(run func(string) error) *Blueprint_DropForeign_Call { + _c.Call.Return(run) + return _c +} + +// DropIndex provides a mock function with given fields: index +func (_m *Blueprint) DropIndex(index string) error { + ret := _m.Called(index) + + if len(ret) == 0 { + panic("no return value specified for DropIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string) error); ok { + r0 = rf(index) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Blueprint_DropIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DropIndex' +type Blueprint_DropIndex_Call struct { + *mock.Call +} + +// DropIndex is a helper method to define mock.On call +// - index string +func (_e *Blueprint_Expecter) DropIndex(index interface{}) *Blueprint_DropIndex_Call { + return &Blueprint_DropIndex_Call{Call: _e.mock.On("DropIndex", index)} +} + +func (_c *Blueprint_DropIndex_Call) Run(run func(index string)) *Blueprint_DropIndex_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Blueprint_DropIndex_Call) Return(_a0 error) *Blueprint_DropIndex_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_DropIndex_Call) RunAndReturn(run func(string) error) *Blueprint_DropIndex_Call { + _c.Call.Return(run) + return _c +} + +// DropSoftDeletes provides a mock function with given fields: +func (_m *Blueprint) DropSoftDeletes() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for DropSoftDeletes") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Blueprint_DropSoftDeletes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DropSoftDeletes' +type Blueprint_DropSoftDeletes_Call struct { + *mock.Call +} + +// DropSoftDeletes is a helper method to define mock.On call +func (_e *Blueprint_Expecter) DropSoftDeletes() *Blueprint_DropSoftDeletes_Call { + return &Blueprint_DropSoftDeletes_Call{Call: _e.mock.On("DropSoftDeletes")} +} + +func (_c *Blueprint_DropSoftDeletes_Call) Run(run func()) *Blueprint_DropSoftDeletes_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Blueprint_DropSoftDeletes_Call) Return(_a0 error) *Blueprint_DropSoftDeletes_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_DropSoftDeletes_Call) RunAndReturn(run func() error) *Blueprint_DropSoftDeletes_Call { + _c.Call.Return(run) + return _c +} + +// DropTimestamps provides a mock function with given fields: +func (_m *Blueprint) DropTimestamps() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for DropTimestamps") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Blueprint_DropTimestamps_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DropTimestamps' +type Blueprint_DropTimestamps_Call struct { + *mock.Call +} + +// DropTimestamps is a helper method to define mock.On call +func (_e *Blueprint_Expecter) DropTimestamps() *Blueprint_DropTimestamps_Call { + return &Blueprint_DropTimestamps_Call{Call: _e.mock.On("DropTimestamps")} +} + +func (_c *Blueprint_DropTimestamps_Call) Run(run func()) *Blueprint_DropTimestamps_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Blueprint_DropTimestamps_Call) Return(_a0 error) *Blueprint_DropTimestamps_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_DropTimestamps_Call) RunAndReturn(run func() error) *Blueprint_DropTimestamps_Call { + _c.Call.Return(run) + return _c +} + +// Enum provides a mock function with given fields: column, array +func (_m *Blueprint) Enum(column string, array []interface{}) schema.ColumnDefinition { + ret := _m.Called(column, array) + + if len(ret) == 0 { + panic("no return value specified for Enum") + } + + var r0 schema.ColumnDefinition + if rf, ok := ret.Get(0).(func(string, []interface{}) schema.ColumnDefinition); ok { + r0 = rf(column, array) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.ColumnDefinition) + } + } + + return r0 +} + +// Blueprint_Enum_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Enum' +type Blueprint_Enum_Call struct { + *mock.Call +} + +// Enum is a helper method to define mock.On call +// - column string +// - array []interface{} +func (_e *Blueprint_Expecter) Enum(column interface{}, array interface{}) *Blueprint_Enum_Call { + return &Blueprint_Enum_Call{Call: _e.mock.On("Enum", column, array)} +} + +func (_c *Blueprint_Enum_Call) Run(run func(column string, array []interface{})) *Blueprint_Enum_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].([]interface{})) + }) + return _c +} + +func (_c *Blueprint_Enum_Call) Return(_a0 schema.ColumnDefinition) *Blueprint_Enum_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_Enum_Call) RunAndReturn(run func(string, []interface{}) schema.ColumnDefinition) *Blueprint_Enum_Call { + _c.Call.Return(run) + return _c +} + +// Float provides a mock function with given fields: column +func (_m *Blueprint) Float(column string) schema.ColumnDefinition { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for Float") + } + + var r0 schema.ColumnDefinition + if rf, ok := ret.Get(0).(func(string) schema.ColumnDefinition); ok { + r0 = rf(column) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.ColumnDefinition) + } + } + + return r0 +} + +// Blueprint_Float_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Float' +type Blueprint_Float_Call struct { + *mock.Call +} + +// Float is a helper method to define mock.On call +// - column string +func (_e *Blueprint_Expecter) Float(column interface{}) *Blueprint_Float_Call { + return &Blueprint_Float_Call{Call: _e.mock.On("Float", column)} +} + +func (_c *Blueprint_Float_Call) Run(run func(column string)) *Blueprint_Float_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Blueprint_Float_Call) Return(_a0 schema.ColumnDefinition) *Blueprint_Float_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_Float_Call) RunAndReturn(run func(string) schema.ColumnDefinition) *Blueprint_Float_Call { + _c.Call.Return(run) + return _c +} + +// Foreign provides a mock function with given fields: columns, name +func (_m *Blueprint) Foreign(columns []string, name ...string) error { + _va := make([]interface{}, len(name)) + for _i := range name { + _va[_i] = name[_i] + } + var _ca []interface{} + _ca = append(_ca, columns) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for Foreign") + } + + var r0 error + if rf, ok := ret.Get(0).(func([]string, ...string) error); ok { + r0 = rf(columns, name...) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Blueprint_Foreign_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Foreign' +type Blueprint_Foreign_Call struct { + *mock.Call +} + +// Foreign is a helper method to define mock.On call +// - columns []string +// - name ...string +func (_e *Blueprint_Expecter) Foreign(columns interface{}, name ...interface{}) *Blueprint_Foreign_Call { + return &Blueprint_Foreign_Call{Call: _e.mock.On("Foreign", + append([]interface{}{columns}, name...)...)} +} + +func (_c *Blueprint_Foreign_Call) Run(run func(columns []string, name ...string)) *Blueprint_Foreign_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(args[0].([]string), variadicArgs...) + }) + return _c +} + +func (_c *Blueprint_Foreign_Call) Return(_a0 error) *Blueprint_Foreign_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_Foreign_Call) RunAndReturn(run func([]string, ...string) error) *Blueprint_Foreign_Call { + _c.Call.Return(run) + return _c +} + +// GetAddedColumns provides a mock function with given fields: +func (_m *Blueprint) GetAddedColumns() []schema.ColumnDefinition { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetAddedColumns") + } + + var r0 []schema.ColumnDefinition + if rf, ok := ret.Get(0).(func() []schema.ColumnDefinition); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]schema.ColumnDefinition) + } + } + + return r0 +} + +// Blueprint_GetAddedColumns_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAddedColumns' +type Blueprint_GetAddedColumns_Call struct { + *mock.Call +} + +// GetAddedColumns is a helper method to define mock.On call +func (_e *Blueprint_Expecter) GetAddedColumns() *Blueprint_GetAddedColumns_Call { + return &Blueprint_GetAddedColumns_Call{Call: _e.mock.On("GetAddedColumns")} +} + +func (_c *Blueprint_GetAddedColumns_Call) Run(run func()) *Blueprint_GetAddedColumns_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Blueprint_GetAddedColumns_Call) Return(_a0 []schema.ColumnDefinition) *Blueprint_GetAddedColumns_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_GetAddedColumns_Call) RunAndReturn(run func() []schema.ColumnDefinition) *Blueprint_GetAddedColumns_Call { + _c.Call.Return(run) + return _c +} + +// GetChangedColumns provides a mock function with given fields: +func (_m *Blueprint) GetChangedColumns() []schema.ColumnDefinition { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetChangedColumns") + } + + var r0 []schema.ColumnDefinition + if rf, ok := ret.Get(0).(func() []schema.ColumnDefinition); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]schema.ColumnDefinition) + } + } + + return r0 +} + +// Blueprint_GetChangedColumns_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetChangedColumns' +type Blueprint_GetChangedColumns_Call struct { + *mock.Call +} + +// GetChangedColumns is a helper method to define mock.On call +func (_e *Blueprint_Expecter) GetChangedColumns() *Blueprint_GetChangedColumns_Call { + return &Blueprint_GetChangedColumns_Call{Call: _e.mock.On("GetChangedColumns")} +} + +func (_c *Blueprint_GetChangedColumns_Call) Run(run func()) *Blueprint_GetChangedColumns_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Blueprint_GetChangedColumns_Call) Return(_a0 []schema.ColumnDefinition) *Blueprint_GetChangedColumns_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_GetChangedColumns_Call) RunAndReturn(run func() []schema.ColumnDefinition) *Blueprint_GetChangedColumns_Call { + _c.Call.Return(run) + return _c +} + +// GetTableName provides a mock function with given fields: +func (_m *Blueprint) GetTableName() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetTableName") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Blueprint_GetTableName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTableName' +type Blueprint_GetTableName_Call struct { + *mock.Call +} + +// GetTableName is a helper method to define mock.On call +func (_e *Blueprint_Expecter) GetTableName() *Blueprint_GetTableName_Call { + return &Blueprint_GetTableName_Call{Call: _e.mock.On("GetTableName")} +} + +func (_c *Blueprint_GetTableName_Call) Run(run func()) *Blueprint_GetTableName_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Blueprint_GetTableName_Call) Return(_a0 string) *Blueprint_GetTableName_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_GetTableName_Call) RunAndReturn(run func() string) *Blueprint_GetTableName_Call { + _c.Call.Return(run) + return _c +} + +// ID provides a mock function with given fields: +func (_m *Blueprint) ID() schema.ColumnDefinition { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for ID") + } + + var r0 schema.ColumnDefinition + if rf, ok := ret.Get(0).(func() schema.ColumnDefinition); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.ColumnDefinition) + } + } + + return r0 +} + +// Blueprint_ID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ID' +type Blueprint_ID_Call struct { + *mock.Call +} + +// ID is a helper method to define mock.On call +func (_e *Blueprint_Expecter) ID() *Blueprint_ID_Call { + return &Blueprint_ID_Call{Call: _e.mock.On("ID")} +} + +func (_c *Blueprint_ID_Call) Run(run func()) *Blueprint_ID_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Blueprint_ID_Call) Return(_a0 schema.ColumnDefinition) *Blueprint_ID_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_ID_Call) RunAndReturn(run func() schema.ColumnDefinition) *Blueprint_ID_Call { + _c.Call.Return(run) + return _c +} + +// Index provides a mock function with given fields: columns, name +func (_m *Blueprint) Index(columns []string, name string) error { + ret := _m.Called(columns, name) + + if len(ret) == 0 { + panic("no return value specified for Index") + } + + var r0 error + if rf, ok := ret.Get(0).(func([]string, string) error); ok { + r0 = rf(columns, name) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Blueprint_Index_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Index' +type Blueprint_Index_Call struct { + *mock.Call +} + +// Index is a helper method to define mock.On call +// - columns []string +// - name string +func (_e *Blueprint_Expecter) Index(columns interface{}, name interface{}) *Blueprint_Index_Call { + return &Blueprint_Index_Call{Call: _e.mock.On("Index", columns, name)} +} + +func (_c *Blueprint_Index_Call) Run(run func(columns []string, name string)) *Blueprint_Index_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]string), args[1].(string)) + }) + return _c +} + +func (_c *Blueprint_Index_Call) Return(_a0 error) *Blueprint_Index_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_Index_Call) RunAndReturn(run func([]string, string) error) *Blueprint_Index_Call { + _c.Call.Return(run) + return _c +} + +// Integer provides a mock function with given fields: column +func (_m *Blueprint) Integer(column string) schema.ColumnDefinition { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for Integer") + } + + var r0 schema.ColumnDefinition + if rf, ok := ret.Get(0).(func(string) schema.ColumnDefinition); ok { + r0 = rf(column) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.ColumnDefinition) + } + } + + return r0 +} + +// Blueprint_Integer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Integer' +type Blueprint_Integer_Call struct { + *mock.Call +} + +// Integer is a helper method to define mock.On call +// - column string +func (_e *Blueprint_Expecter) Integer(column interface{}) *Blueprint_Integer_Call { + return &Blueprint_Integer_Call{Call: _e.mock.On("Integer", column)} +} + +func (_c *Blueprint_Integer_Call) Run(run func(column string)) *Blueprint_Integer_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Blueprint_Integer_Call) Return(_a0 schema.ColumnDefinition) *Blueprint_Integer_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_Integer_Call) RunAndReturn(run func(string) schema.ColumnDefinition) *Blueprint_Integer_Call { + _c.Call.Return(run) + return _c +} + +// Json provides a mock function with given fields: column +func (_m *Blueprint) Json(column string) schema.ColumnDefinition { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for Json") + } + + var r0 schema.ColumnDefinition + if rf, ok := ret.Get(0).(func(string) schema.ColumnDefinition); ok { + r0 = rf(column) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.ColumnDefinition) + } + } + + return r0 +} + +// Blueprint_Json_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Json' +type Blueprint_Json_Call struct { + *mock.Call +} + +// Json is a helper method to define mock.On call +// - column string +func (_e *Blueprint_Expecter) Json(column interface{}) *Blueprint_Json_Call { + return &Blueprint_Json_Call{Call: _e.mock.On("Json", column)} +} + +func (_c *Blueprint_Json_Call) Run(run func(column string)) *Blueprint_Json_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Blueprint_Json_Call) Return(_a0 schema.ColumnDefinition) *Blueprint_Json_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_Json_Call) RunAndReturn(run func(string) schema.ColumnDefinition) *Blueprint_Json_Call { + _c.Call.Return(run) + return _c +} + +// Jsonb provides a mock function with given fields: column +func (_m *Blueprint) Jsonb(column string) schema.ColumnDefinition { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for Jsonb") + } + + var r0 schema.ColumnDefinition + if rf, ok := ret.Get(0).(func(string) schema.ColumnDefinition); ok { + r0 = rf(column) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.ColumnDefinition) + } + } + + return r0 +} + +// Blueprint_Jsonb_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Jsonb' +type Blueprint_Jsonb_Call struct { + *mock.Call +} + +// Jsonb is a helper method to define mock.On call +// - column string +func (_e *Blueprint_Expecter) Jsonb(column interface{}) *Blueprint_Jsonb_Call { + return &Blueprint_Jsonb_Call{Call: _e.mock.On("Jsonb", column)} +} + +func (_c *Blueprint_Jsonb_Call) Run(run func(column string)) *Blueprint_Jsonb_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Blueprint_Jsonb_Call) Return(_a0 schema.ColumnDefinition) *Blueprint_Jsonb_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_Jsonb_Call) RunAndReturn(run func(string) schema.ColumnDefinition) *Blueprint_Jsonb_Call { + _c.Call.Return(run) + return _c +} + +// Primary provides a mock function with given fields: columns, name +func (_m *Blueprint) Primary(columns []string, name string) error { + ret := _m.Called(columns, name) + + if len(ret) == 0 { + panic("no return value specified for Primary") + } + + var r0 error + if rf, ok := ret.Get(0).(func([]string, string) error); ok { + r0 = rf(columns, name) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Blueprint_Primary_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Primary' +type Blueprint_Primary_Call struct { + *mock.Call +} + +// Primary is a helper method to define mock.On call +// - columns []string +// - name string +func (_e *Blueprint_Expecter) Primary(columns interface{}, name interface{}) *Blueprint_Primary_Call { + return &Blueprint_Primary_Call{Call: _e.mock.On("Primary", columns, name)} +} + +func (_c *Blueprint_Primary_Call) Run(run func(columns []string, name string)) *Blueprint_Primary_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]string), args[1].(string)) + }) + return _c +} + +func (_c *Blueprint_Primary_Call) Return(_a0 error) *Blueprint_Primary_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_Primary_Call) RunAndReturn(run func([]string, string) error) *Blueprint_Primary_Call { + _c.Call.Return(run) + return _c +} + +// RenameColumn provides a mock function with given fields: from, to +func (_m *Blueprint) RenameColumn(from string, to string) error { + ret := _m.Called(from, to) + + if len(ret) == 0 { + panic("no return value specified for RenameColumn") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string, string) error); ok { + r0 = rf(from, to) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Blueprint_RenameColumn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RenameColumn' +type Blueprint_RenameColumn_Call struct { + *mock.Call +} + +// RenameColumn is a helper method to define mock.On call +// - from string +// - to string +func (_e *Blueprint_Expecter) RenameColumn(from interface{}, to interface{}) *Blueprint_RenameColumn_Call { + return &Blueprint_RenameColumn_Call{Call: _e.mock.On("RenameColumn", from, to)} +} + +func (_c *Blueprint_RenameColumn_Call) Run(run func(from string, to string)) *Blueprint_RenameColumn_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Blueprint_RenameColumn_Call) Return(_a0 error) *Blueprint_RenameColumn_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_RenameColumn_Call) RunAndReturn(run func(string, string) error) *Blueprint_RenameColumn_Call { + _c.Call.Return(run) + return _c +} + +// RenameIndex provides a mock function with given fields: from, to +func (_m *Blueprint) RenameIndex(from string, to string) error { + ret := _m.Called(from, to) + + if len(ret) == 0 { + panic("no return value specified for RenameIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string, string) error); ok { + r0 = rf(from, to) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Blueprint_RenameIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RenameIndex' +type Blueprint_RenameIndex_Call struct { + *mock.Call +} + +// RenameIndex is a helper method to define mock.On call +// - from string +// - to string +func (_e *Blueprint_Expecter) RenameIndex(from interface{}, to interface{}) *Blueprint_RenameIndex_Call { + return &Blueprint_RenameIndex_Call{Call: _e.mock.On("RenameIndex", from, to)} +} + +func (_c *Blueprint_RenameIndex_Call) Run(run func(from string, to string)) *Blueprint_RenameIndex_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Blueprint_RenameIndex_Call) Return(_a0 error) *Blueprint_RenameIndex_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_RenameIndex_Call) RunAndReturn(run func(string, string) error) *Blueprint_RenameIndex_Call { + _c.Call.Return(run) + return _c +} + +// SoftDeletes provides a mock function with given fields: column +func (_m *Blueprint) SoftDeletes(column ...string) schema.ColumnDefinition { + _va := make([]interface{}, len(column)) + for _i := range column { + _va[_i] = column[_i] + } + var _ca []interface{} + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for SoftDeletes") + } + + var r0 schema.ColumnDefinition + if rf, ok := ret.Get(0).(func(...string) schema.ColumnDefinition); ok { + r0 = rf(column...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.ColumnDefinition) + } + } + + return r0 +} + +// Blueprint_SoftDeletes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SoftDeletes' +type Blueprint_SoftDeletes_Call struct { + *mock.Call +} + +// SoftDeletes is a helper method to define mock.On call +// - column ...string +func (_e *Blueprint_Expecter) SoftDeletes(column ...interface{}) *Blueprint_SoftDeletes_Call { + return &Blueprint_SoftDeletes_Call{Call: _e.mock.On("SoftDeletes", + append([]interface{}{}, column...)...)} +} + +func (_c *Blueprint_SoftDeletes_Call) Run(run func(column ...string)) *Blueprint_SoftDeletes_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Blueprint_SoftDeletes_Call) Return(_a0 schema.ColumnDefinition) *Blueprint_SoftDeletes_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_SoftDeletes_Call) RunAndReturn(run func(...string) schema.ColumnDefinition) *Blueprint_SoftDeletes_Call { + _c.Call.Return(run) + return _c +} + +// SoftDeletesTz provides a mock function with given fields: column +func (_m *Blueprint) SoftDeletesTz(column ...string) schema.ColumnDefinition { + _va := make([]interface{}, len(column)) + for _i := range column { + _va[_i] = column[_i] + } + var _ca []interface{} + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for SoftDeletesTz") + } + + var r0 schema.ColumnDefinition + if rf, ok := ret.Get(0).(func(...string) schema.ColumnDefinition); ok { + r0 = rf(column...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.ColumnDefinition) + } + } + + return r0 +} + +// Blueprint_SoftDeletesTz_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SoftDeletesTz' +type Blueprint_SoftDeletesTz_Call struct { + *mock.Call +} + +// SoftDeletesTz is a helper method to define mock.On call +// - column ...string +func (_e *Blueprint_Expecter) SoftDeletesTz(column ...interface{}) *Blueprint_SoftDeletesTz_Call { + return &Blueprint_SoftDeletesTz_Call{Call: _e.mock.On("SoftDeletesTz", + append([]interface{}{}, column...)...)} +} + +func (_c *Blueprint_SoftDeletesTz_Call) Run(run func(column ...string)) *Blueprint_SoftDeletesTz_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Blueprint_SoftDeletesTz_Call) Return(_a0 schema.ColumnDefinition) *Blueprint_SoftDeletesTz_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_SoftDeletesTz_Call) RunAndReturn(run func(...string) schema.ColumnDefinition) *Blueprint_SoftDeletesTz_Call { + _c.Call.Return(run) + return _c +} + +// String provides a mock function with given fields: column, length +func (_m *Blueprint) String(column string, length ...int) schema.ColumnDefinition { + _va := make([]interface{}, len(length)) + for _i := range length { + _va[_i] = length[_i] + } + var _ca []interface{} + _ca = append(_ca, column) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for String") + } + + var r0 schema.ColumnDefinition + if rf, ok := ret.Get(0).(func(string, ...int) schema.ColumnDefinition); ok { + r0 = rf(column, length...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.ColumnDefinition) + } + } + + return r0 +} + +// Blueprint_String_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'String' +type Blueprint_String_Call struct { + *mock.Call +} + +// String is a helper method to define mock.On call +// - column string +// - length ...int +func (_e *Blueprint_Expecter) String(column interface{}, length ...interface{}) *Blueprint_String_Call { + return &Blueprint_String_Call{Call: _e.mock.On("String", + append([]interface{}{column}, length...)...)} +} + +func (_c *Blueprint_String_Call) Run(run func(column string, length ...int)) *Blueprint_String_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]int, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(int) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Blueprint_String_Call) Return(_a0 schema.ColumnDefinition) *Blueprint_String_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_String_Call) RunAndReturn(run func(string, ...int) schema.ColumnDefinition) *Blueprint_String_Call { + _c.Call.Return(run) + return _c +} + +// Text provides a mock function with given fields: column +func (_m *Blueprint) Text(column string) schema.ColumnDefinition { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for Text") + } + + var r0 schema.ColumnDefinition + if rf, ok := ret.Get(0).(func(string) schema.ColumnDefinition); ok { + r0 = rf(column) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.ColumnDefinition) + } + } + + return r0 +} + +// Blueprint_Text_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Text' +type Blueprint_Text_Call struct { + *mock.Call +} + +// Text is a helper method to define mock.On call +// - column string +func (_e *Blueprint_Expecter) Text(column interface{}) *Blueprint_Text_Call { + return &Blueprint_Text_Call{Call: _e.mock.On("Text", column)} +} + +func (_c *Blueprint_Text_Call) Run(run func(column string)) *Blueprint_Text_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Blueprint_Text_Call) Return(_a0 schema.ColumnDefinition) *Blueprint_Text_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_Text_Call) RunAndReturn(run func(string) schema.ColumnDefinition) *Blueprint_Text_Call { + _c.Call.Return(run) + return _c +} + +// Time provides a mock function with given fields: column +func (_m *Blueprint) Time(column string) schema.ColumnDefinition { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for Time") + } + + var r0 schema.ColumnDefinition + if rf, ok := ret.Get(0).(func(string) schema.ColumnDefinition); ok { + r0 = rf(column) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.ColumnDefinition) + } + } + + return r0 +} + +// Blueprint_Time_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Time' +type Blueprint_Time_Call struct { + *mock.Call +} + +// Time is a helper method to define mock.On call +// - column string +func (_e *Blueprint_Expecter) Time(column interface{}) *Blueprint_Time_Call { + return &Blueprint_Time_Call{Call: _e.mock.On("Time", column)} +} + +func (_c *Blueprint_Time_Call) Run(run func(column string)) *Blueprint_Time_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Blueprint_Time_Call) Return(_a0 schema.ColumnDefinition) *Blueprint_Time_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_Time_Call) RunAndReturn(run func(string) schema.ColumnDefinition) *Blueprint_Time_Call { + _c.Call.Return(run) + return _c +} + +// TimeTz provides a mock function with given fields: column +func (_m *Blueprint) TimeTz(column string) schema.ColumnDefinition { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for TimeTz") + } + + var r0 schema.ColumnDefinition + if rf, ok := ret.Get(0).(func(string) schema.ColumnDefinition); ok { + r0 = rf(column) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.ColumnDefinition) + } + } + + return r0 +} + +// Blueprint_TimeTz_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TimeTz' +type Blueprint_TimeTz_Call struct { + *mock.Call +} + +// TimeTz is a helper method to define mock.On call +// - column string +func (_e *Blueprint_Expecter) TimeTz(column interface{}) *Blueprint_TimeTz_Call { + return &Blueprint_TimeTz_Call{Call: _e.mock.On("TimeTz", column)} +} + +func (_c *Blueprint_TimeTz_Call) Run(run func(column string)) *Blueprint_TimeTz_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Blueprint_TimeTz_Call) Return(_a0 schema.ColumnDefinition) *Blueprint_TimeTz_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_TimeTz_Call) RunAndReturn(run func(string) schema.ColumnDefinition) *Blueprint_TimeTz_Call { + _c.Call.Return(run) + return _c +} + +// Timestamp provides a mock function with given fields: column +func (_m *Blueprint) Timestamp(column string) schema.ColumnDefinition { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for Timestamp") + } + + var r0 schema.ColumnDefinition + if rf, ok := ret.Get(0).(func(string) schema.ColumnDefinition); ok { + r0 = rf(column) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.ColumnDefinition) + } + } + + return r0 +} + +// Blueprint_Timestamp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Timestamp' +type Blueprint_Timestamp_Call struct { + *mock.Call +} + +// Timestamp is a helper method to define mock.On call +// - column string +func (_e *Blueprint_Expecter) Timestamp(column interface{}) *Blueprint_Timestamp_Call { + return &Blueprint_Timestamp_Call{Call: _e.mock.On("Timestamp", column)} +} + +func (_c *Blueprint_Timestamp_Call) Run(run func(column string)) *Blueprint_Timestamp_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Blueprint_Timestamp_Call) Return(_a0 schema.ColumnDefinition) *Blueprint_Timestamp_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_Timestamp_Call) RunAndReturn(run func(string) schema.ColumnDefinition) *Blueprint_Timestamp_Call { + _c.Call.Return(run) + return _c +} + +// TimestampTz provides a mock function with given fields: column +func (_m *Blueprint) TimestampTz(column string) schema.ColumnDefinition { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for TimestampTz") + } + + var r0 schema.ColumnDefinition + if rf, ok := ret.Get(0).(func(string) schema.ColumnDefinition); ok { + r0 = rf(column) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.ColumnDefinition) + } + } + + return r0 +} + +// Blueprint_TimestampTz_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TimestampTz' +type Blueprint_TimestampTz_Call struct { + *mock.Call +} + +// TimestampTz is a helper method to define mock.On call +// - column string +func (_e *Blueprint_Expecter) TimestampTz(column interface{}) *Blueprint_TimestampTz_Call { + return &Blueprint_TimestampTz_Call{Call: _e.mock.On("TimestampTz", column)} +} + +func (_c *Blueprint_TimestampTz_Call) Run(run func(column string)) *Blueprint_TimestampTz_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Blueprint_TimestampTz_Call) Return(_a0 schema.ColumnDefinition) *Blueprint_TimestampTz_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_TimestampTz_Call) RunAndReturn(run func(string) schema.ColumnDefinition) *Blueprint_TimestampTz_Call { + _c.Call.Return(run) + return _c +} + +// Timestamps provides a mock function with given fields: +func (_m *Blueprint) Timestamps() schema.ColumnDefinition { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Timestamps") + } + + var r0 schema.ColumnDefinition + if rf, ok := ret.Get(0).(func() schema.ColumnDefinition); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.ColumnDefinition) + } + } + + return r0 +} + +// Blueprint_Timestamps_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Timestamps' +type Blueprint_Timestamps_Call struct { + *mock.Call +} + +// Timestamps is a helper method to define mock.On call +func (_e *Blueprint_Expecter) Timestamps() *Blueprint_Timestamps_Call { + return &Blueprint_Timestamps_Call{Call: _e.mock.On("Timestamps")} +} + +func (_c *Blueprint_Timestamps_Call) Run(run func()) *Blueprint_Timestamps_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Blueprint_Timestamps_Call) Return(_a0 schema.ColumnDefinition) *Blueprint_Timestamps_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_Timestamps_Call) RunAndReturn(run func() schema.ColumnDefinition) *Blueprint_Timestamps_Call { + _c.Call.Return(run) + return _c +} + +// TimestampsTz provides a mock function with given fields: +func (_m *Blueprint) TimestampsTz() schema.ColumnDefinition { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for TimestampsTz") + } + + var r0 schema.ColumnDefinition + if rf, ok := ret.Get(0).(func() schema.ColumnDefinition); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.ColumnDefinition) + } + } + + return r0 +} + +// Blueprint_TimestampsTz_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TimestampsTz' +type Blueprint_TimestampsTz_Call struct { + *mock.Call +} + +// TimestampsTz is a helper method to define mock.On call +func (_e *Blueprint_Expecter) TimestampsTz() *Blueprint_TimestampsTz_Call { + return &Blueprint_TimestampsTz_Call{Call: _e.mock.On("TimestampsTz")} +} + +func (_c *Blueprint_TimestampsTz_Call) Run(run func()) *Blueprint_TimestampsTz_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Blueprint_TimestampsTz_Call) Return(_a0 schema.ColumnDefinition) *Blueprint_TimestampsTz_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_TimestampsTz_Call) RunAndReturn(run func() schema.ColumnDefinition) *Blueprint_TimestampsTz_Call { + _c.Call.Return(run) + return _c +} + +// ToSql provides a mock function with given fields: query, grammar +func (_m *Blueprint) ToSql(query orm.Query, grammar schema.Grammar) []string { + ret := _m.Called(query, grammar) + + if len(ret) == 0 { + panic("no return value specified for ToSql") + } + + var r0 []string + if rf, ok := ret.Get(0).(func(orm.Query, schema.Grammar) []string); ok { + r0 = rf(query, grammar) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + + return r0 +} + +// Blueprint_ToSql_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ToSql' +type Blueprint_ToSql_Call struct { + *mock.Call +} + +// ToSql is a helper method to define mock.On call +// - query orm.Query +// - grammar schema.Grammar +func (_e *Blueprint_Expecter) ToSql(query interface{}, grammar interface{}) *Blueprint_ToSql_Call { + return &Blueprint_ToSql_Call{Call: _e.mock.On("ToSql", query, grammar)} +} + +func (_c *Blueprint_ToSql_Call) Run(run func(query orm.Query, grammar schema.Grammar)) *Blueprint_ToSql_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(orm.Query), args[1].(schema.Grammar)) + }) + return _c +} + +func (_c *Blueprint_ToSql_Call) Return(_a0 []string) *Blueprint_ToSql_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_ToSql_Call) RunAndReturn(run func(orm.Query, schema.Grammar) []string) *Blueprint_ToSql_Call { + _c.Call.Return(run) + return _c +} + +// Unique provides a mock function with given fields: columns, name +func (_m *Blueprint) Unique(columns []string, name string) error { + ret := _m.Called(columns, name) + + if len(ret) == 0 { + panic("no return value specified for Unique") + } + + var r0 error + if rf, ok := ret.Get(0).(func([]string, string) error); ok { + r0 = rf(columns, name) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Blueprint_Unique_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unique' +type Blueprint_Unique_Call struct { + *mock.Call +} + +// Unique is a helper method to define mock.On call +// - columns []string +// - name string +func (_e *Blueprint_Expecter) Unique(columns interface{}, name interface{}) *Blueprint_Unique_Call { + return &Blueprint_Unique_Call{Call: _e.mock.On("Unique", columns, name)} +} + +func (_c *Blueprint_Unique_Call) Run(run func(columns []string, name string)) *Blueprint_Unique_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]string), args[1].(string)) + }) + return _c +} + +func (_c *Blueprint_Unique_Call) Return(_a0 error) *Blueprint_Unique_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_Unique_Call) RunAndReturn(run func([]string, string) error) *Blueprint_Unique_Call { + _c.Call.Return(run) + return _c +} + +// UnsignedBigInteger provides a mock function with given fields: column +func (_m *Blueprint) UnsignedBigInteger(column string) schema.ColumnDefinition { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for UnsignedBigInteger") + } + + var r0 schema.ColumnDefinition + if rf, ok := ret.Get(0).(func(string) schema.ColumnDefinition); ok { + r0 = rf(column) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.ColumnDefinition) + } + } + + return r0 +} + +// Blueprint_UnsignedBigInteger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnsignedBigInteger' +type Blueprint_UnsignedBigInteger_Call struct { + *mock.Call +} + +// UnsignedBigInteger is a helper method to define mock.On call +// - column string +func (_e *Blueprint_Expecter) UnsignedBigInteger(column interface{}) *Blueprint_UnsignedBigInteger_Call { + return &Blueprint_UnsignedBigInteger_Call{Call: _e.mock.On("UnsignedBigInteger", column)} +} + +func (_c *Blueprint_UnsignedBigInteger_Call) Run(run func(column string)) *Blueprint_UnsignedBigInteger_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Blueprint_UnsignedBigInteger_Call) Return(_a0 schema.ColumnDefinition) *Blueprint_UnsignedBigInteger_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_UnsignedBigInteger_Call) RunAndReturn(run func(string) schema.ColumnDefinition) *Blueprint_UnsignedBigInteger_Call { + _c.Call.Return(run) + return _c +} + +// UnsignedInteger provides a mock function with given fields: column +func (_m *Blueprint) UnsignedInteger(column string) schema.ColumnDefinition { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for UnsignedInteger") + } + + var r0 schema.ColumnDefinition + if rf, ok := ret.Get(0).(func(string) schema.ColumnDefinition); ok { + r0 = rf(column) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.ColumnDefinition) + } + } + + return r0 +} + +// Blueprint_UnsignedInteger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnsignedInteger' +type Blueprint_UnsignedInteger_Call struct { + *mock.Call +} + +// UnsignedInteger is a helper method to define mock.On call +// - column string +func (_e *Blueprint_Expecter) UnsignedInteger(column interface{}) *Blueprint_UnsignedInteger_Call { + return &Blueprint_UnsignedInteger_Call{Call: _e.mock.On("UnsignedInteger", column)} +} + +func (_c *Blueprint_UnsignedInteger_Call) Run(run func(column string)) *Blueprint_UnsignedInteger_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Blueprint_UnsignedInteger_Call) Return(_a0 schema.ColumnDefinition) *Blueprint_UnsignedInteger_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Blueprint_UnsignedInteger_Call) RunAndReturn(run func(string) schema.ColumnDefinition) *Blueprint_UnsignedInteger_Call { + _c.Call.Return(run) + return _c +} + +// NewBlueprint creates a new instance of Blueprint. 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 NewBlueprint(t interface { + mock.TestingT + Cleanup(func()) +}) *Blueprint { + mock := &Blueprint{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/database/schema/Column.go b/mocks/database/schema/Column.go new file mode 100644 index 000000000..7a241e799 --- /dev/null +++ b/mocks/database/schema/Column.go @@ -0,0 +1,426 @@ +// Code generated by mockery v2.39.1. DO NOT EDIT. + +package mocks + +import mock "github.com/stretchr/testify/mock" + +// Column is an autogenerated mock type for the Column type +type Column struct { + mock.Mock +} + +type Column_Expecter struct { + mock *mock.Mock +} + +func (_m *Column) EXPECT() *Column_Expecter { + return &Column_Expecter{mock: &_m.Mock} +} + +// Change provides a mock function with given fields: +func (_m *Column) Change() { + _m.Called() +} + +// Column_Change_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Change' +type Column_Change_Call struct { + *mock.Call +} + +// Change is a helper method to define mock.On call +func (_e *Column_Expecter) Change() *Column_Change_Call { + return &Column_Change_Call{Call: _e.mock.On("Change")} +} + +func (_c *Column_Change_Call) Run(run func()) *Column_Change_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Column_Change_Call) Return() *Column_Change_Call { + _c.Call.Return() + return _c +} + +func (_c *Column_Change_Call) RunAndReturn(run func()) *Column_Change_Call { + _c.Call.Return(run) + return _c +} + +// GetAllowed provides a mock function with given fields: +func (_m *Column) GetAllowed() []string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetAllowed") + } + + var r0 []string + if rf, ok := ret.Get(0).(func() []string); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + + return r0 +} + +// Column_GetAllowed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllowed' +type Column_GetAllowed_Call struct { + *mock.Call +} + +// GetAllowed is a helper method to define mock.On call +func (_e *Column_Expecter) GetAllowed() *Column_GetAllowed_Call { + return &Column_GetAllowed_Call{Call: _e.mock.On("GetAllowed")} +} + +func (_c *Column_GetAllowed_Call) Run(run func()) *Column_GetAllowed_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Column_GetAllowed_Call) Return(_a0 []string) *Column_GetAllowed_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Column_GetAllowed_Call) RunAndReturn(run func() []string) *Column_GetAllowed_Call { + _c.Call.Return(run) + return _c +} + +// GetAutoIncrement provides a mock function with given fields: +func (_m *Column) GetAutoIncrement() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetAutoIncrement") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// Column_GetAutoIncrement_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAutoIncrement' +type Column_GetAutoIncrement_Call struct { + *mock.Call +} + +// GetAutoIncrement is a helper method to define mock.On call +func (_e *Column_Expecter) GetAutoIncrement() *Column_GetAutoIncrement_Call { + return &Column_GetAutoIncrement_Call{Call: _e.mock.On("GetAutoIncrement")} +} + +func (_c *Column_GetAutoIncrement_Call) Run(run func()) *Column_GetAutoIncrement_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Column_GetAutoIncrement_Call) Return(_a0 bool) *Column_GetAutoIncrement_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Column_GetAutoIncrement_Call) RunAndReturn(run func() bool) *Column_GetAutoIncrement_Call { + _c.Call.Return(run) + return _c +} + +// GetLength provides a mock function with given fields: +func (_m *Column) GetLength() int { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetLength") + } + + var r0 int + if rf, ok := ret.Get(0).(func() int); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(int) + } + + return r0 +} + +// Column_GetLength_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLength' +type Column_GetLength_Call struct { + *mock.Call +} + +// GetLength is a helper method to define mock.On call +func (_e *Column_Expecter) GetLength() *Column_GetLength_Call { + return &Column_GetLength_Call{Call: _e.mock.On("GetLength")} +} + +func (_c *Column_GetLength_Call) Run(run func()) *Column_GetLength_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Column_GetLength_Call) Return(_a0 int) *Column_GetLength_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Column_GetLength_Call) RunAndReturn(run func() int) *Column_GetLength_Call { + _c.Call.Return(run) + return _c +} + +// GetName provides a mock function with given fields: +func (_m *Column) GetName() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetName") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Column_GetName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetName' +type Column_GetName_Call struct { + *mock.Call +} + +// GetName is a helper method to define mock.On call +func (_e *Column_Expecter) GetName() *Column_GetName_Call { + return &Column_GetName_Call{Call: _e.mock.On("GetName")} +} + +func (_c *Column_GetName_Call) Run(run func()) *Column_GetName_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Column_GetName_Call) Return(_a0 string) *Column_GetName_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Column_GetName_Call) RunAndReturn(run func() string) *Column_GetName_Call { + _c.Call.Return(run) + return _c +} + +// GetPlaces provides a mock function with given fields: +func (_m *Column) GetPlaces() int { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetPlaces") + } + + var r0 int + if rf, ok := ret.Get(0).(func() int); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(int) + } + + return r0 +} + +// Column_GetPlaces_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPlaces' +type Column_GetPlaces_Call struct { + *mock.Call +} + +// GetPlaces is a helper method to define mock.On call +func (_e *Column_Expecter) GetPlaces() *Column_GetPlaces_Call { + return &Column_GetPlaces_Call{Call: _e.mock.On("GetPlaces")} +} + +func (_c *Column_GetPlaces_Call) Run(run func()) *Column_GetPlaces_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Column_GetPlaces_Call) Return(_a0 int) *Column_GetPlaces_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Column_GetPlaces_Call) RunAndReturn(run func() int) *Column_GetPlaces_Call { + _c.Call.Return(run) + return _c +} + +// GetPrecision provides a mock function with given fields: +func (_m *Column) GetPrecision() int { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetPrecision") + } + + var r0 int + if rf, ok := ret.Get(0).(func() int); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(int) + } + + return r0 +} + +// Column_GetPrecision_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPrecision' +type Column_GetPrecision_Call struct { + *mock.Call +} + +// GetPrecision is a helper method to define mock.On call +func (_e *Column_Expecter) GetPrecision() *Column_GetPrecision_Call { + return &Column_GetPrecision_Call{Call: _e.mock.On("GetPrecision")} +} + +func (_c *Column_GetPrecision_Call) Run(run func()) *Column_GetPrecision_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Column_GetPrecision_Call) Return(_a0 int) *Column_GetPrecision_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Column_GetPrecision_Call) RunAndReturn(run func() int) *Column_GetPrecision_Call { + _c.Call.Return(run) + return _c +} + +// GetTotal provides a mock function with given fields: +func (_m *Column) GetTotal() int { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetTotal") + } + + var r0 int + if rf, ok := ret.Get(0).(func() int); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(int) + } + + return r0 +} + +// Column_GetTotal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTotal' +type Column_GetTotal_Call struct { + *mock.Call +} + +// GetTotal is a helper method to define mock.On call +func (_e *Column_Expecter) GetTotal() *Column_GetTotal_Call { + return &Column_GetTotal_Call{Call: _e.mock.On("GetTotal")} +} + +func (_c *Column_GetTotal_Call) Run(run func()) *Column_GetTotal_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Column_GetTotal_Call) Return(_a0 int) *Column_GetTotal_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Column_GetTotal_Call) RunAndReturn(run func() int) *Column_GetTotal_Call { + _c.Call.Return(run) + return _c +} + +// GetType provides a mock function with given fields: +func (_m *Column) GetType() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetType") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Column_GetType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetType' +type Column_GetType_Call struct { + *mock.Call +} + +// GetType is a helper method to define mock.On call +func (_e *Column_Expecter) GetType() *Column_GetType_Call { + return &Column_GetType_Call{Call: _e.mock.On("GetType")} +} + +func (_c *Column_GetType_Call) Run(run func()) *Column_GetType_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Column_GetType_Call) Return(_a0 string) *Column_GetType_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Column_GetType_Call) RunAndReturn(run func() string) *Column_GetType_Call { + _c.Call.Return(run) + return _c +} + +// NewColumn creates a new instance of Column. 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 NewColumn(t interface { + mock.TestingT + Cleanup(func()) +}) *Column { + mock := &Column{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/database/schema/Grammar.go b/mocks/database/schema/Grammar.go new file mode 100644 index 000000000..67cea6f87 --- /dev/null +++ b/mocks/database/schema/Grammar.go @@ -0,0 +1,2273 @@ +// Code generated by mockery v2.39.1. DO NOT EDIT. + +package mocks + +import ( + orm "github.com/goravel/framework/contracts/database/orm" + schema "github.com/goravel/framework/contracts/database/schema" + mock "github.com/stretchr/testify/mock" +) + +// Grammar is an autogenerated mock type for the Grammar type +type Grammar struct { + mock.Mock +} + +type Grammar_Expecter struct { + mock *mock.Mock +} + +func (_m *Grammar) EXPECT() *Grammar_Expecter { + return &Grammar_Expecter{mock: &_m.Mock} +} + +// CompileAdd provides a mock function with given fields: blueprint, command +func (_m *Grammar) CompileAdd(blueprint schema.Blueprint, command string) string { + ret := _m.Called(blueprint, command) + + if len(ret) == 0 { + panic("no return value specified for CompileAdd") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.Blueprint, string) string); ok { + r0 = rf(blueprint, command) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_CompileAdd_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompileAdd' +type Grammar_CompileAdd_Call struct { + *mock.Call +} + +// CompileAdd is a helper method to define mock.On call +// - blueprint schema.Blueprint +// - command string +func (_e *Grammar_Expecter) CompileAdd(blueprint interface{}, command interface{}) *Grammar_CompileAdd_Call { + return &Grammar_CompileAdd_Call{Call: _e.mock.On("CompileAdd", blueprint, command)} +} + +func (_c *Grammar_CompileAdd_Call) Run(run func(blueprint schema.Blueprint, command string)) *Grammar_CompileAdd_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.Blueprint), args[1].(string)) + }) + return _c +} + +func (_c *Grammar_CompileAdd_Call) Return(_a0 string) *Grammar_CompileAdd_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_CompileAdd_Call) RunAndReturn(run func(schema.Blueprint, string) string) *Grammar_CompileAdd_Call { + _c.Call.Return(run) + return _c +} + +// CompileAutoIncrementStartingValues provides a mock function with given fields: blueprint, command +func (_m *Grammar) CompileAutoIncrementStartingValues(blueprint schema.Blueprint, command string) string { + ret := _m.Called(blueprint, command) + + if len(ret) == 0 { + panic("no return value specified for CompileAutoIncrementStartingValues") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.Blueprint, string) string); ok { + r0 = rf(blueprint, command) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_CompileAutoIncrementStartingValues_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompileAutoIncrementStartingValues' +type Grammar_CompileAutoIncrementStartingValues_Call struct { + *mock.Call +} + +// CompileAutoIncrementStartingValues is a helper method to define mock.On call +// - blueprint schema.Blueprint +// - command string +func (_e *Grammar_Expecter) CompileAutoIncrementStartingValues(blueprint interface{}, command interface{}) *Grammar_CompileAutoIncrementStartingValues_Call { + return &Grammar_CompileAutoIncrementStartingValues_Call{Call: _e.mock.On("CompileAutoIncrementStartingValues", blueprint, command)} +} + +func (_c *Grammar_CompileAutoIncrementStartingValues_Call) Run(run func(blueprint schema.Blueprint, command string)) *Grammar_CompileAutoIncrementStartingValues_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.Blueprint), args[1].(string)) + }) + return _c +} + +func (_c *Grammar_CompileAutoIncrementStartingValues_Call) Return(_a0 string) *Grammar_CompileAutoIncrementStartingValues_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_CompileAutoIncrementStartingValues_Call) RunAndReturn(run func(schema.Blueprint, string) string) *Grammar_CompileAutoIncrementStartingValues_Call { + _c.Call.Return(run) + return _c +} + +// CompileChange provides a mock function with given fields: blueprint, command, connection +func (_m *Grammar) CompileChange(blueprint schema.Blueprint, command string, connection string) string { + ret := _m.Called(blueprint, command, connection) + + if len(ret) == 0 { + panic("no return value specified for CompileChange") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.Blueprint, string, string) string); ok { + r0 = rf(blueprint, command, connection) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_CompileChange_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompileChange' +type Grammar_CompileChange_Call struct { + *mock.Call +} + +// CompileChange is a helper method to define mock.On call +// - blueprint schema.Blueprint +// - command string +// - connection string +func (_e *Grammar_Expecter) CompileChange(blueprint interface{}, command interface{}, connection interface{}) *Grammar_CompileChange_Call { + return &Grammar_CompileChange_Call{Call: _e.mock.On("CompileChange", blueprint, command, connection)} +} + +func (_c *Grammar_CompileChange_Call) Run(run func(blueprint schema.Blueprint, command string, connection string)) *Grammar_CompileChange_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.Blueprint), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *Grammar_CompileChange_Call) Return(_a0 string) *Grammar_CompileChange_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_CompileChange_Call) RunAndReturn(run func(schema.Blueprint, string, string) string) *Grammar_CompileChange_Call { + _c.Call.Return(run) + return _c +} + +// CompileColumns provides a mock function with given fields: database, table +func (_m *Grammar) CompileColumns(database string, table string) string { + ret := _m.Called(database, table) + + if len(ret) == 0 { + panic("no return value specified for CompileColumns") + } + + var r0 string + if rf, ok := ret.Get(0).(func(string, string) string); ok { + r0 = rf(database, table) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_CompileColumns_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompileColumns' +type Grammar_CompileColumns_Call struct { + *mock.Call +} + +// CompileColumns is a helper method to define mock.On call +// - database string +// - table string +func (_e *Grammar_Expecter) CompileColumns(database interface{}, table interface{}) *Grammar_CompileColumns_Call { + return &Grammar_CompileColumns_Call{Call: _e.mock.On("CompileColumns", database, table)} +} + +func (_c *Grammar_CompileColumns_Call) Run(run func(database string, table string)) *Grammar_CompileColumns_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Grammar_CompileColumns_Call) Return(_a0 string) *Grammar_CompileColumns_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_CompileColumns_Call) RunAndReturn(run func(string, string) string) *Grammar_CompileColumns_Call { + _c.Call.Return(run) + return _c +} + +// CompileCreate provides a mock function with given fields: blueprint, query +func (_m *Grammar) CompileCreate(blueprint schema.Blueprint, query orm.Query) string { + ret := _m.Called(blueprint, query) + + if len(ret) == 0 { + panic("no return value specified for CompileCreate") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.Blueprint, orm.Query) string); ok { + r0 = rf(blueprint, query) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_CompileCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompileCreate' +type Grammar_CompileCreate_Call struct { + *mock.Call +} + +// CompileCreate is a helper method to define mock.On call +// - blueprint schema.Blueprint +// - query orm.Query +func (_e *Grammar_Expecter) CompileCreate(blueprint interface{}, query interface{}) *Grammar_CompileCreate_Call { + return &Grammar_CompileCreate_Call{Call: _e.mock.On("CompileCreate", blueprint, query)} +} + +func (_c *Grammar_CompileCreate_Call) Run(run func(blueprint schema.Blueprint, query orm.Query)) *Grammar_CompileCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.Blueprint), args[1].(orm.Query)) + }) + return _c +} + +func (_c *Grammar_CompileCreate_Call) Return(_a0 string) *Grammar_CompileCreate_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_CompileCreate_Call) RunAndReturn(run func(schema.Blueprint, orm.Query) string) *Grammar_CompileCreate_Call { + _c.Call.Return(run) + return _c +} + +// CompileCreateEncoding provides a mock function with given fields: sql, connection, blueprint +func (_m *Grammar) CompileCreateEncoding(sql string, connection string, blueprint schema.Blueprint) string { + ret := _m.Called(sql, connection, blueprint) + + if len(ret) == 0 { + panic("no return value specified for CompileCreateEncoding") + } + + var r0 string + if rf, ok := ret.Get(0).(func(string, string, schema.Blueprint) string); ok { + r0 = rf(sql, connection, blueprint) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_CompileCreateEncoding_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompileCreateEncoding' +type Grammar_CompileCreateEncoding_Call struct { + *mock.Call +} + +// CompileCreateEncoding is a helper method to define mock.On call +// - sql string +// - connection string +// - blueprint schema.Blueprint +func (_e *Grammar_Expecter) CompileCreateEncoding(sql interface{}, connection interface{}, blueprint interface{}) *Grammar_CompileCreateEncoding_Call { + return &Grammar_CompileCreateEncoding_Call{Call: _e.mock.On("CompileCreateEncoding", sql, connection, blueprint)} +} + +func (_c *Grammar_CompileCreateEncoding_Call) Run(run func(sql string, connection string, blueprint schema.Blueprint)) *Grammar_CompileCreateEncoding_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string), args[2].(schema.Blueprint)) + }) + return _c +} + +func (_c *Grammar_CompileCreateEncoding_Call) Return(_a0 string) *Grammar_CompileCreateEncoding_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_CompileCreateEncoding_Call) RunAndReturn(run func(string, string, schema.Blueprint) string) *Grammar_CompileCreateEncoding_Call { + _c.Call.Return(run) + return _c +} + +// CompileCreateEngine provides a mock function with given fields: sql, connection, blueprint +func (_m *Grammar) CompileCreateEngine(sql string, connection string, blueprint schema.Blueprint) string { + ret := _m.Called(sql, connection, blueprint) + + if len(ret) == 0 { + panic("no return value specified for CompileCreateEngine") + } + + var r0 string + if rf, ok := ret.Get(0).(func(string, string, schema.Blueprint) string); ok { + r0 = rf(sql, connection, blueprint) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_CompileCreateEngine_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompileCreateEngine' +type Grammar_CompileCreateEngine_Call struct { + *mock.Call +} + +// CompileCreateEngine is a helper method to define mock.On call +// - sql string +// - connection string +// - blueprint schema.Blueprint +func (_e *Grammar_Expecter) CompileCreateEngine(sql interface{}, connection interface{}, blueprint interface{}) *Grammar_CompileCreateEngine_Call { + return &Grammar_CompileCreateEngine_Call{Call: _e.mock.On("CompileCreateEngine", sql, connection, blueprint)} +} + +func (_c *Grammar_CompileCreateEngine_Call) Run(run func(sql string, connection string, blueprint schema.Blueprint)) *Grammar_CompileCreateEngine_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string), args[2].(schema.Blueprint)) + }) + return _c +} + +func (_c *Grammar_CompileCreateEngine_Call) Return(_a0 string) *Grammar_CompileCreateEngine_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_CompileCreateEngine_Call) RunAndReturn(run func(string, string, schema.Blueprint) string) *Grammar_CompileCreateEngine_Call { + _c.Call.Return(run) + return _c +} + +// CompileCreateTable provides a mock function with given fields: blueprint, command, connection +func (_m *Grammar) CompileCreateTable(blueprint schema.Blueprint, command string, connection string) string { + ret := _m.Called(blueprint, command, connection) + + if len(ret) == 0 { + panic("no return value specified for CompileCreateTable") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.Blueprint, string, string) string); ok { + r0 = rf(blueprint, command, connection) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_CompileCreateTable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompileCreateTable' +type Grammar_CompileCreateTable_Call struct { + *mock.Call +} + +// CompileCreateTable is a helper method to define mock.On call +// - blueprint schema.Blueprint +// - command string +// - connection string +func (_e *Grammar_Expecter) CompileCreateTable(blueprint interface{}, command interface{}, connection interface{}) *Grammar_CompileCreateTable_Call { + return &Grammar_CompileCreateTable_Call{Call: _e.mock.On("CompileCreateTable", blueprint, command, connection)} +} + +func (_c *Grammar_CompileCreateTable_Call) Run(run func(blueprint schema.Blueprint, command string, connection string)) *Grammar_CompileCreateTable_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.Blueprint), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *Grammar_CompileCreateTable_Call) Return(_a0 string) *Grammar_CompileCreateTable_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_CompileCreateTable_Call) RunAndReturn(run func(schema.Blueprint, string, string) string) *Grammar_CompileCreateTable_Call { + _c.Call.Return(run) + return _c +} + +// CompileDrop provides a mock function with given fields: blueprint, command +func (_m *Grammar) CompileDrop(blueprint schema.Blueprint, command string) string { + ret := _m.Called(blueprint, command) + + if len(ret) == 0 { + panic("no return value specified for CompileDrop") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.Blueprint, string) string); ok { + r0 = rf(blueprint, command) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_CompileDrop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompileDrop' +type Grammar_CompileDrop_Call struct { + *mock.Call +} + +// CompileDrop is a helper method to define mock.On call +// - blueprint schema.Blueprint +// - command string +func (_e *Grammar_Expecter) CompileDrop(blueprint interface{}, command interface{}) *Grammar_CompileDrop_Call { + return &Grammar_CompileDrop_Call{Call: _e.mock.On("CompileDrop", blueprint, command)} +} + +func (_c *Grammar_CompileDrop_Call) Run(run func(blueprint schema.Blueprint, command string)) *Grammar_CompileDrop_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.Blueprint), args[1].(string)) + }) + return _c +} + +func (_c *Grammar_CompileDrop_Call) Return(_a0 string) *Grammar_CompileDrop_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_CompileDrop_Call) RunAndReturn(run func(schema.Blueprint, string) string) *Grammar_CompileDrop_Call { + _c.Call.Return(run) + return _c +} + +// CompileDropAllTables provides a mock function with given fields: tables +func (_m *Grammar) CompileDropAllTables(tables []string) string { + ret := _m.Called(tables) + + if len(ret) == 0 { + panic("no return value specified for CompileDropAllTables") + } + + var r0 string + if rf, ok := ret.Get(0).(func([]string) string); ok { + r0 = rf(tables) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_CompileDropAllTables_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompileDropAllTables' +type Grammar_CompileDropAllTables_Call struct { + *mock.Call +} + +// CompileDropAllTables is a helper method to define mock.On call +// - tables []string +func (_e *Grammar_Expecter) CompileDropAllTables(tables interface{}) *Grammar_CompileDropAllTables_Call { + return &Grammar_CompileDropAllTables_Call{Call: _e.mock.On("CompileDropAllTables", tables)} +} + +func (_c *Grammar_CompileDropAllTables_Call) Run(run func(tables []string)) *Grammar_CompileDropAllTables_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]string)) + }) + return _c +} + +func (_c *Grammar_CompileDropAllTables_Call) Return(_a0 string) *Grammar_CompileDropAllTables_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_CompileDropAllTables_Call) RunAndReturn(run func([]string) string) *Grammar_CompileDropAllTables_Call { + _c.Call.Return(run) + return _c +} + +// CompileDropAllViews provides a mock function with given fields: views +func (_m *Grammar) CompileDropAllViews(views []string) string { + ret := _m.Called(views) + + if len(ret) == 0 { + panic("no return value specified for CompileDropAllViews") + } + + var r0 string + if rf, ok := ret.Get(0).(func([]string) string); ok { + r0 = rf(views) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_CompileDropAllViews_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompileDropAllViews' +type Grammar_CompileDropAllViews_Call struct { + *mock.Call +} + +// CompileDropAllViews is a helper method to define mock.On call +// - views []string +func (_e *Grammar_Expecter) CompileDropAllViews(views interface{}) *Grammar_CompileDropAllViews_Call { + return &Grammar_CompileDropAllViews_Call{Call: _e.mock.On("CompileDropAllViews", views)} +} + +func (_c *Grammar_CompileDropAllViews_Call) Run(run func(views []string)) *Grammar_CompileDropAllViews_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]string)) + }) + return _c +} + +func (_c *Grammar_CompileDropAllViews_Call) Return(_a0 string) *Grammar_CompileDropAllViews_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_CompileDropAllViews_Call) RunAndReturn(run func([]string) string) *Grammar_CompileDropAllViews_Call { + _c.Call.Return(run) + return _c +} + +// CompileDropColumn provides a mock function with given fields: blueprint, command +func (_m *Grammar) CompileDropColumn(blueprint schema.Blueprint, command string) string { + ret := _m.Called(blueprint, command) + + if len(ret) == 0 { + panic("no return value specified for CompileDropColumn") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.Blueprint, string) string); ok { + r0 = rf(blueprint, command) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_CompileDropColumn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompileDropColumn' +type Grammar_CompileDropColumn_Call struct { + *mock.Call +} + +// CompileDropColumn is a helper method to define mock.On call +// - blueprint schema.Blueprint +// - command string +func (_e *Grammar_Expecter) CompileDropColumn(blueprint interface{}, command interface{}) *Grammar_CompileDropColumn_Call { + return &Grammar_CompileDropColumn_Call{Call: _e.mock.On("CompileDropColumn", blueprint, command)} +} + +func (_c *Grammar_CompileDropColumn_Call) Run(run func(blueprint schema.Blueprint, command string)) *Grammar_CompileDropColumn_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.Blueprint), args[1].(string)) + }) + return _c +} + +func (_c *Grammar_CompileDropColumn_Call) Return(_a0 string) *Grammar_CompileDropColumn_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_CompileDropColumn_Call) RunAndReturn(run func(schema.Blueprint, string) string) *Grammar_CompileDropColumn_Call { + _c.Call.Return(run) + return _c +} + +// CompileDropIfExists provides a mock function with given fields: blueprint, command +func (_m *Grammar) CompileDropIfExists(blueprint schema.Blueprint, command string) string { + ret := _m.Called(blueprint, command) + + if len(ret) == 0 { + panic("no return value specified for CompileDropIfExists") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.Blueprint, string) string); ok { + r0 = rf(blueprint, command) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_CompileDropIfExists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompileDropIfExists' +type Grammar_CompileDropIfExists_Call struct { + *mock.Call +} + +// CompileDropIfExists is a helper method to define mock.On call +// - blueprint schema.Blueprint +// - command string +func (_e *Grammar_Expecter) CompileDropIfExists(blueprint interface{}, command interface{}) *Grammar_CompileDropIfExists_Call { + return &Grammar_CompileDropIfExists_Call{Call: _e.mock.On("CompileDropIfExists", blueprint, command)} +} + +func (_c *Grammar_CompileDropIfExists_Call) Run(run func(blueprint schema.Blueprint, command string)) *Grammar_CompileDropIfExists_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.Blueprint), args[1].(string)) + }) + return _c +} + +func (_c *Grammar_CompileDropIfExists_Call) Return(_a0 string) *Grammar_CompileDropIfExists_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_CompileDropIfExists_Call) RunAndReturn(run func(schema.Blueprint, string) string) *Grammar_CompileDropIfExists_Call { + _c.Call.Return(run) + return _c +} + +// CompileDropIndex provides a mock function with given fields: blueprint, command +func (_m *Grammar) CompileDropIndex(blueprint schema.Blueprint, command string) string { + ret := _m.Called(blueprint, command) + + if len(ret) == 0 { + panic("no return value specified for CompileDropIndex") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.Blueprint, string) string); ok { + r0 = rf(blueprint, command) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_CompileDropIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompileDropIndex' +type Grammar_CompileDropIndex_Call struct { + *mock.Call +} + +// CompileDropIndex is a helper method to define mock.On call +// - blueprint schema.Blueprint +// - command string +func (_e *Grammar_Expecter) CompileDropIndex(blueprint interface{}, command interface{}) *Grammar_CompileDropIndex_Call { + return &Grammar_CompileDropIndex_Call{Call: _e.mock.On("CompileDropIndex", blueprint, command)} +} + +func (_c *Grammar_CompileDropIndex_Call) Run(run func(blueprint schema.Blueprint, command string)) *Grammar_CompileDropIndex_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.Blueprint), args[1].(string)) + }) + return _c +} + +func (_c *Grammar_CompileDropIndex_Call) Return(_a0 string) *Grammar_CompileDropIndex_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_CompileDropIndex_Call) RunAndReturn(run func(schema.Blueprint, string) string) *Grammar_CompileDropIndex_Call { + _c.Call.Return(run) + return _c +} + +// CompileDropPrimary provides a mock function with given fields: blueprint, command +func (_m *Grammar) CompileDropPrimary(blueprint schema.Blueprint, command string) string { + ret := _m.Called(blueprint, command) + + if len(ret) == 0 { + panic("no return value specified for CompileDropPrimary") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.Blueprint, string) string); ok { + r0 = rf(blueprint, command) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_CompileDropPrimary_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompileDropPrimary' +type Grammar_CompileDropPrimary_Call struct { + *mock.Call +} + +// CompileDropPrimary is a helper method to define mock.On call +// - blueprint schema.Blueprint +// - command string +func (_e *Grammar_Expecter) CompileDropPrimary(blueprint interface{}, command interface{}) *Grammar_CompileDropPrimary_Call { + return &Grammar_CompileDropPrimary_Call{Call: _e.mock.On("CompileDropPrimary", blueprint, command)} +} + +func (_c *Grammar_CompileDropPrimary_Call) Run(run func(blueprint schema.Blueprint, command string)) *Grammar_CompileDropPrimary_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.Blueprint), args[1].(string)) + }) + return _c +} + +func (_c *Grammar_CompileDropPrimary_Call) Return(_a0 string) *Grammar_CompileDropPrimary_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_CompileDropPrimary_Call) RunAndReturn(run func(schema.Blueprint, string) string) *Grammar_CompileDropPrimary_Call { + _c.Call.Return(run) + return _c +} + +// CompileDropUnique provides a mock function with given fields: blueprint, command +func (_m *Grammar) CompileDropUnique(blueprint schema.Blueprint, command string) string { + ret := _m.Called(blueprint, command) + + if len(ret) == 0 { + panic("no return value specified for CompileDropUnique") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.Blueprint, string) string); ok { + r0 = rf(blueprint, command) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_CompileDropUnique_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompileDropUnique' +type Grammar_CompileDropUnique_Call struct { + *mock.Call +} + +// CompileDropUnique is a helper method to define mock.On call +// - blueprint schema.Blueprint +// - command string +func (_e *Grammar_Expecter) CompileDropUnique(blueprint interface{}, command interface{}) *Grammar_CompileDropUnique_Call { + return &Grammar_CompileDropUnique_Call{Call: _e.mock.On("CompileDropUnique", blueprint, command)} +} + +func (_c *Grammar_CompileDropUnique_Call) Run(run func(blueprint schema.Blueprint, command string)) *Grammar_CompileDropUnique_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.Blueprint), args[1].(string)) + }) + return _c +} + +func (_c *Grammar_CompileDropUnique_Call) Return(_a0 string) *Grammar_CompileDropUnique_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_CompileDropUnique_Call) RunAndReturn(run func(schema.Blueprint, string) string) *Grammar_CompileDropUnique_Call { + _c.Call.Return(run) + return _c +} + +// CompileIndex provides a mock function with given fields: blueprint, command +func (_m *Grammar) CompileIndex(blueprint schema.Blueprint, command string) string { + ret := _m.Called(blueprint, command) + + if len(ret) == 0 { + panic("no return value specified for CompileIndex") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.Blueprint, string) string); ok { + r0 = rf(blueprint, command) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_CompileIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompileIndex' +type Grammar_CompileIndex_Call struct { + *mock.Call +} + +// CompileIndex is a helper method to define mock.On call +// - blueprint schema.Blueprint +// - command string +func (_e *Grammar_Expecter) CompileIndex(blueprint interface{}, command interface{}) *Grammar_CompileIndex_Call { + return &Grammar_CompileIndex_Call{Call: _e.mock.On("CompileIndex", blueprint, command)} +} + +func (_c *Grammar_CompileIndex_Call) Run(run func(blueprint schema.Blueprint, command string)) *Grammar_CompileIndex_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.Blueprint), args[1].(string)) + }) + return _c +} + +func (_c *Grammar_CompileIndex_Call) Return(_a0 string) *Grammar_CompileIndex_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_CompileIndex_Call) RunAndReturn(run func(schema.Blueprint, string) string) *Grammar_CompileIndex_Call { + _c.Call.Return(run) + return _c +} + +// CompileIndexes provides a mock function with given fields: database, table +func (_m *Grammar) CompileIndexes(database string, table string) string { + ret := _m.Called(database, table) + + if len(ret) == 0 { + panic("no return value specified for CompileIndexes") + } + + var r0 string + if rf, ok := ret.Get(0).(func(string, string) string); ok { + r0 = rf(database, table) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_CompileIndexes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompileIndexes' +type Grammar_CompileIndexes_Call struct { + *mock.Call +} + +// CompileIndexes is a helper method to define mock.On call +// - database string +// - table string +func (_e *Grammar_Expecter) CompileIndexes(database interface{}, table interface{}) *Grammar_CompileIndexes_Call { + return &Grammar_CompileIndexes_Call{Call: _e.mock.On("CompileIndexes", database, table)} +} + +func (_c *Grammar_CompileIndexes_Call) Run(run func(database string, table string)) *Grammar_CompileIndexes_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Grammar_CompileIndexes_Call) Return(_a0 string) *Grammar_CompileIndexes_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_CompileIndexes_Call) RunAndReturn(run func(string, string) string) *Grammar_CompileIndexes_Call { + _c.Call.Return(run) + return _c +} + +// CompilePrimary provides a mock function with given fields: blueprint, command +func (_m *Grammar) CompilePrimary(blueprint schema.Blueprint, command string) string { + ret := _m.Called(blueprint, command) + + if len(ret) == 0 { + panic("no return value specified for CompilePrimary") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.Blueprint, string) string); ok { + r0 = rf(blueprint, command) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_CompilePrimary_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompilePrimary' +type Grammar_CompilePrimary_Call struct { + *mock.Call +} + +// CompilePrimary is a helper method to define mock.On call +// - blueprint schema.Blueprint +// - command string +func (_e *Grammar_Expecter) CompilePrimary(blueprint interface{}, command interface{}) *Grammar_CompilePrimary_Call { + return &Grammar_CompilePrimary_Call{Call: _e.mock.On("CompilePrimary", blueprint, command)} +} + +func (_c *Grammar_CompilePrimary_Call) Run(run func(blueprint schema.Blueprint, command string)) *Grammar_CompilePrimary_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.Blueprint), args[1].(string)) + }) + return _c +} + +func (_c *Grammar_CompilePrimary_Call) Return(_a0 string) *Grammar_CompilePrimary_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_CompilePrimary_Call) RunAndReturn(run func(schema.Blueprint, string) string) *Grammar_CompilePrimary_Call { + _c.Call.Return(run) + return _c +} + +// CompileRename provides a mock function with given fields: blueprint, command +func (_m *Grammar) CompileRename(blueprint schema.Blueprint, command string) string { + ret := _m.Called(blueprint, command) + + if len(ret) == 0 { + panic("no return value specified for CompileRename") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.Blueprint, string) string); ok { + r0 = rf(blueprint, command) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_CompileRename_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompileRename' +type Grammar_CompileRename_Call struct { + *mock.Call +} + +// CompileRename is a helper method to define mock.On call +// - blueprint schema.Blueprint +// - command string +func (_e *Grammar_Expecter) CompileRename(blueprint interface{}, command interface{}) *Grammar_CompileRename_Call { + return &Grammar_CompileRename_Call{Call: _e.mock.On("CompileRename", blueprint, command)} +} + +func (_c *Grammar_CompileRename_Call) Run(run func(blueprint schema.Blueprint, command string)) *Grammar_CompileRename_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.Blueprint), args[1].(string)) + }) + return _c +} + +func (_c *Grammar_CompileRename_Call) Return(_a0 string) *Grammar_CompileRename_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_CompileRename_Call) RunAndReturn(run func(schema.Blueprint, string) string) *Grammar_CompileRename_Call { + _c.Call.Return(run) + return _c +} + +// CompileRenameColumn provides a mock function with given fields: blueprint, command, connection +func (_m *Grammar) CompileRenameColumn(blueprint schema.Blueprint, command string, connection string) string { + ret := _m.Called(blueprint, command, connection) + + if len(ret) == 0 { + panic("no return value specified for CompileRenameColumn") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.Blueprint, string, string) string); ok { + r0 = rf(blueprint, command, connection) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_CompileRenameColumn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompileRenameColumn' +type Grammar_CompileRenameColumn_Call struct { + *mock.Call +} + +// CompileRenameColumn is a helper method to define mock.On call +// - blueprint schema.Blueprint +// - command string +// - connection string +func (_e *Grammar_Expecter) CompileRenameColumn(blueprint interface{}, command interface{}, connection interface{}) *Grammar_CompileRenameColumn_Call { + return &Grammar_CompileRenameColumn_Call{Call: _e.mock.On("CompileRenameColumn", blueprint, command, connection)} +} + +func (_c *Grammar_CompileRenameColumn_Call) Run(run func(blueprint schema.Blueprint, command string, connection string)) *Grammar_CompileRenameColumn_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.Blueprint), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *Grammar_CompileRenameColumn_Call) Return(_a0 string) *Grammar_CompileRenameColumn_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_CompileRenameColumn_Call) RunAndReturn(run func(schema.Blueprint, string, string) string) *Grammar_CompileRenameColumn_Call { + _c.Call.Return(run) + return _c +} + +// CompileRenameIndex provides a mock function with given fields: blueprint, command +func (_m *Grammar) CompileRenameIndex(blueprint schema.Blueprint, command string) string { + ret := _m.Called(blueprint, command) + + if len(ret) == 0 { + panic("no return value specified for CompileRenameIndex") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.Blueprint, string) string); ok { + r0 = rf(blueprint, command) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_CompileRenameIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompileRenameIndex' +type Grammar_CompileRenameIndex_Call struct { + *mock.Call +} + +// CompileRenameIndex is a helper method to define mock.On call +// - blueprint schema.Blueprint +// - command string +func (_e *Grammar_Expecter) CompileRenameIndex(blueprint interface{}, command interface{}) *Grammar_CompileRenameIndex_Call { + return &Grammar_CompileRenameIndex_Call{Call: _e.mock.On("CompileRenameIndex", blueprint, command)} +} + +func (_c *Grammar_CompileRenameIndex_Call) Run(run func(blueprint schema.Blueprint, command string)) *Grammar_CompileRenameIndex_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.Blueprint), args[1].(string)) + }) + return _c +} + +func (_c *Grammar_CompileRenameIndex_Call) Return(_a0 string) *Grammar_CompileRenameIndex_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_CompileRenameIndex_Call) RunAndReturn(run func(schema.Blueprint, string) string) *Grammar_CompileRenameIndex_Call { + _c.Call.Return(run) + return _c +} + +// CompileTableComment provides a mock function with given fields: blueprint, command +func (_m *Grammar) CompileTableComment(blueprint schema.Blueprint, command string) string { + ret := _m.Called(blueprint, command) + + if len(ret) == 0 { + panic("no return value specified for CompileTableComment") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.Blueprint, string) string); ok { + r0 = rf(blueprint, command) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_CompileTableComment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompileTableComment' +type Grammar_CompileTableComment_Call struct { + *mock.Call +} + +// CompileTableComment is a helper method to define mock.On call +// - blueprint schema.Blueprint +// - command string +func (_e *Grammar_Expecter) CompileTableComment(blueprint interface{}, command interface{}) *Grammar_CompileTableComment_Call { + return &Grammar_CompileTableComment_Call{Call: _e.mock.On("CompileTableComment", blueprint, command)} +} + +func (_c *Grammar_CompileTableComment_Call) Run(run func(blueprint schema.Blueprint, command string)) *Grammar_CompileTableComment_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.Blueprint), args[1].(string)) + }) + return _c +} + +func (_c *Grammar_CompileTableComment_Call) Return(_a0 string) *Grammar_CompileTableComment_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_CompileTableComment_Call) RunAndReturn(run func(schema.Blueprint, string) string) *Grammar_CompileTableComment_Call { + _c.Call.Return(run) + return _c +} + +// CompileTables provides a mock function with given fields: database +func (_m *Grammar) CompileTables(database string) string { + ret := _m.Called(database) + + if len(ret) == 0 { + panic("no return value specified for CompileTables") + } + + var r0 string + if rf, ok := ret.Get(0).(func(string) string); ok { + r0 = rf(database) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_CompileTables_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompileTables' +type Grammar_CompileTables_Call struct { + *mock.Call +} + +// CompileTables is a helper method to define mock.On call +// - database string +func (_e *Grammar_Expecter) CompileTables(database interface{}) *Grammar_CompileTables_Call { + return &Grammar_CompileTables_Call{Call: _e.mock.On("CompileTables", database)} +} + +func (_c *Grammar_CompileTables_Call) Run(run func(database string)) *Grammar_CompileTables_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Grammar_CompileTables_Call) Return(_a0 string) *Grammar_CompileTables_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_CompileTables_Call) RunAndReturn(run func(string) string) *Grammar_CompileTables_Call { + _c.Call.Return(run) + return _c +} + +// CompileUnique provides a mock function with given fields: blueprint, command +func (_m *Grammar) CompileUnique(blueprint schema.Blueprint, command string) string { + ret := _m.Called(blueprint, command) + + if len(ret) == 0 { + panic("no return value specified for CompileUnique") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.Blueprint, string) string); ok { + r0 = rf(blueprint, command) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_CompileUnique_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompileUnique' +type Grammar_CompileUnique_Call struct { + *mock.Call +} + +// CompileUnique is a helper method to define mock.On call +// - blueprint schema.Blueprint +// - command string +func (_e *Grammar_Expecter) CompileUnique(blueprint interface{}, command interface{}) *Grammar_CompileUnique_Call { + return &Grammar_CompileUnique_Call{Call: _e.mock.On("CompileUnique", blueprint, command)} +} + +func (_c *Grammar_CompileUnique_Call) Run(run func(blueprint schema.Blueprint, command string)) *Grammar_CompileUnique_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.Blueprint), args[1].(string)) + }) + return _c +} + +func (_c *Grammar_CompileUnique_Call) Return(_a0 string) *Grammar_CompileUnique_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_CompileUnique_Call) RunAndReturn(run func(schema.Blueprint, string) string) *Grammar_CompileUnique_Call { + _c.Call.Return(run) + return _c +} + +// CompileViews provides a mock function with given fields: database +func (_m *Grammar) CompileViews(database string) string { + ret := _m.Called(database) + + if len(ret) == 0 { + panic("no return value specified for CompileViews") + } + + var r0 string + if rf, ok := ret.Get(0).(func(string) string); ok { + r0 = rf(database) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_CompileViews_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompileViews' +type Grammar_CompileViews_Call struct { + *mock.Call +} + +// CompileViews is a helper method to define mock.On call +// - database string +func (_e *Grammar_Expecter) CompileViews(database interface{}) *Grammar_CompileViews_Call { + return &Grammar_CompileViews_Call{Call: _e.mock.On("CompileViews", database)} +} + +func (_c *Grammar_CompileViews_Call) Run(run func(database string)) *Grammar_CompileViews_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Grammar_CompileViews_Call) Return(_a0 string) *Grammar_CompileViews_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_CompileViews_Call) RunAndReturn(run func(string) string) *Grammar_CompileViews_Call { + _c.Call.Return(run) + return _c +} + +// ModifyDefault provides a mock function with given fields: blueprint, column +func (_m *Grammar) ModifyDefault(blueprint schema.Blueprint, column string) string { + ret := _m.Called(blueprint, column) + + if len(ret) == 0 { + panic("no return value specified for ModifyDefault") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.Blueprint, string) string); ok { + r0 = rf(blueprint, column) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_ModifyDefault_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ModifyDefault' +type Grammar_ModifyDefault_Call struct { + *mock.Call +} + +// ModifyDefault is a helper method to define mock.On call +// - blueprint schema.Blueprint +// - column string +func (_e *Grammar_Expecter) ModifyDefault(blueprint interface{}, column interface{}) *Grammar_ModifyDefault_Call { + return &Grammar_ModifyDefault_Call{Call: _e.mock.On("ModifyDefault", blueprint, column)} +} + +func (_c *Grammar_ModifyDefault_Call) Run(run func(blueprint schema.Blueprint, column string)) *Grammar_ModifyDefault_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.Blueprint), args[1].(string)) + }) + return _c +} + +func (_c *Grammar_ModifyDefault_Call) Return(_a0 string) *Grammar_ModifyDefault_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_ModifyDefault_Call) RunAndReturn(run func(schema.Blueprint, string) string) *Grammar_ModifyDefault_Call { + _c.Call.Return(run) + return _c +} + +// ModifyNullable provides a mock function with given fields: blueprint, column +func (_m *Grammar) ModifyNullable(blueprint schema.Blueprint, column string) string { + ret := _m.Called(blueprint, column) + + if len(ret) == 0 { + panic("no return value specified for ModifyNullable") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.Blueprint, string) string); ok { + r0 = rf(blueprint, column) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_ModifyNullable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ModifyNullable' +type Grammar_ModifyNullable_Call struct { + *mock.Call +} + +// ModifyNullable is a helper method to define mock.On call +// - blueprint schema.Blueprint +// - column string +func (_e *Grammar_Expecter) ModifyNullable(blueprint interface{}, column interface{}) *Grammar_ModifyNullable_Call { + return &Grammar_ModifyNullable_Call{Call: _e.mock.On("ModifyNullable", blueprint, column)} +} + +func (_c *Grammar_ModifyNullable_Call) Run(run func(blueprint schema.Blueprint, column string)) *Grammar_ModifyNullable_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.Blueprint), args[1].(string)) + }) + return _c +} + +func (_c *Grammar_ModifyNullable_Call) Return(_a0 string) *Grammar_ModifyNullable_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_ModifyNullable_Call) RunAndReturn(run func(schema.Blueprint, string) string) *Grammar_ModifyNullable_Call { + _c.Call.Return(run) + return _c +} + +// TypeBigInteger provides a mock function with given fields: column +func (_m *Grammar) TypeBigInteger(column schema.ColumnDefinition) string { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for TypeBigInteger") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.ColumnDefinition) string); ok { + r0 = rf(column) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_TypeBigInteger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeBigInteger' +type Grammar_TypeBigInteger_Call struct { + *mock.Call +} + +// TypeBigInteger is a helper method to define mock.On call +// - column schema.ColumnDefinition +func (_e *Grammar_Expecter) TypeBigInteger(column interface{}) *Grammar_TypeBigInteger_Call { + return &Grammar_TypeBigInteger_Call{Call: _e.mock.On("TypeBigInteger", column)} +} + +func (_c *Grammar_TypeBigInteger_Call) Run(run func(column schema.ColumnDefinition)) *Grammar_TypeBigInteger_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.ColumnDefinition)) + }) + return _c +} + +func (_c *Grammar_TypeBigInteger_Call) Return(_a0 string) *Grammar_TypeBigInteger_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_TypeBigInteger_Call) RunAndReturn(run func(schema.ColumnDefinition) string) *Grammar_TypeBigInteger_Call { + _c.Call.Return(run) + return _c +} + +// TypeBinary provides a mock function with given fields: column +func (_m *Grammar) TypeBinary(column schema.ColumnDefinition) string { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for TypeBinary") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.ColumnDefinition) string); ok { + r0 = rf(column) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_TypeBinary_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeBinary' +type Grammar_TypeBinary_Call struct { + *mock.Call +} + +// TypeBinary is a helper method to define mock.On call +// - column schema.ColumnDefinition +func (_e *Grammar_Expecter) TypeBinary(column interface{}) *Grammar_TypeBinary_Call { + return &Grammar_TypeBinary_Call{Call: _e.mock.On("TypeBinary", column)} +} + +func (_c *Grammar_TypeBinary_Call) Run(run func(column schema.ColumnDefinition)) *Grammar_TypeBinary_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.ColumnDefinition)) + }) + return _c +} + +func (_c *Grammar_TypeBinary_Call) Return(_a0 string) *Grammar_TypeBinary_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_TypeBinary_Call) RunAndReturn(run func(schema.ColumnDefinition) string) *Grammar_TypeBinary_Call { + _c.Call.Return(run) + return _c +} + +// TypeBoolean provides a mock function with given fields: column +func (_m *Grammar) TypeBoolean(column schema.ColumnDefinition) string { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for TypeBoolean") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.ColumnDefinition) string); ok { + r0 = rf(column) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_TypeBoolean_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeBoolean' +type Grammar_TypeBoolean_Call struct { + *mock.Call +} + +// TypeBoolean is a helper method to define mock.On call +// - column schema.ColumnDefinition +func (_e *Grammar_Expecter) TypeBoolean(column interface{}) *Grammar_TypeBoolean_Call { + return &Grammar_TypeBoolean_Call{Call: _e.mock.On("TypeBoolean", column)} +} + +func (_c *Grammar_TypeBoolean_Call) Run(run func(column schema.ColumnDefinition)) *Grammar_TypeBoolean_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.ColumnDefinition)) + }) + return _c +} + +func (_c *Grammar_TypeBoolean_Call) Return(_a0 string) *Grammar_TypeBoolean_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_TypeBoolean_Call) RunAndReturn(run func(schema.ColumnDefinition) string) *Grammar_TypeBoolean_Call { + _c.Call.Return(run) + return _c +} + +// TypeChar provides a mock function with given fields: column +func (_m *Grammar) TypeChar(column schema.ColumnDefinition) string { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for TypeChar") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.ColumnDefinition) string); ok { + r0 = rf(column) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_TypeChar_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeChar' +type Grammar_TypeChar_Call struct { + *mock.Call +} + +// TypeChar is a helper method to define mock.On call +// - column schema.ColumnDefinition +func (_e *Grammar_Expecter) TypeChar(column interface{}) *Grammar_TypeChar_Call { + return &Grammar_TypeChar_Call{Call: _e.mock.On("TypeChar", column)} +} + +func (_c *Grammar_TypeChar_Call) Run(run func(column schema.ColumnDefinition)) *Grammar_TypeChar_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.ColumnDefinition)) + }) + return _c +} + +func (_c *Grammar_TypeChar_Call) Return(_a0 string) *Grammar_TypeChar_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_TypeChar_Call) RunAndReturn(run func(schema.ColumnDefinition) string) *Grammar_TypeChar_Call { + _c.Call.Return(run) + return _c +} + +// TypeDate provides a mock function with given fields: column +func (_m *Grammar) TypeDate(column schema.ColumnDefinition) string { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for TypeDate") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.ColumnDefinition) string); ok { + r0 = rf(column) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_TypeDate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeDate' +type Grammar_TypeDate_Call struct { + *mock.Call +} + +// TypeDate is a helper method to define mock.On call +// - column schema.ColumnDefinition +func (_e *Grammar_Expecter) TypeDate(column interface{}) *Grammar_TypeDate_Call { + return &Grammar_TypeDate_Call{Call: _e.mock.On("TypeDate", column)} +} + +func (_c *Grammar_TypeDate_Call) Run(run func(column schema.ColumnDefinition)) *Grammar_TypeDate_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.ColumnDefinition)) + }) + return _c +} + +func (_c *Grammar_TypeDate_Call) Return(_a0 string) *Grammar_TypeDate_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_TypeDate_Call) RunAndReturn(run func(schema.ColumnDefinition) string) *Grammar_TypeDate_Call { + _c.Call.Return(run) + return _c +} + +// TypeDateTime provides a mock function with given fields: column +func (_m *Grammar) TypeDateTime(column schema.ColumnDefinition) string { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for TypeDateTime") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.ColumnDefinition) string); ok { + r0 = rf(column) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_TypeDateTime_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeDateTime' +type Grammar_TypeDateTime_Call struct { + *mock.Call +} + +// TypeDateTime is a helper method to define mock.On call +// - column schema.ColumnDefinition +func (_e *Grammar_Expecter) TypeDateTime(column interface{}) *Grammar_TypeDateTime_Call { + return &Grammar_TypeDateTime_Call{Call: _e.mock.On("TypeDateTime", column)} +} + +func (_c *Grammar_TypeDateTime_Call) Run(run func(column schema.ColumnDefinition)) *Grammar_TypeDateTime_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.ColumnDefinition)) + }) + return _c +} + +func (_c *Grammar_TypeDateTime_Call) Return(_a0 string) *Grammar_TypeDateTime_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_TypeDateTime_Call) RunAndReturn(run func(schema.ColumnDefinition) string) *Grammar_TypeDateTime_Call { + _c.Call.Return(run) + return _c +} + +// TypeDateTimeTz provides a mock function with given fields: column +func (_m *Grammar) TypeDateTimeTz(column schema.ColumnDefinition) string { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for TypeDateTimeTz") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.ColumnDefinition) string); ok { + r0 = rf(column) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_TypeDateTimeTz_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeDateTimeTz' +type Grammar_TypeDateTimeTz_Call struct { + *mock.Call +} + +// TypeDateTimeTz is a helper method to define mock.On call +// - column schema.ColumnDefinition +func (_e *Grammar_Expecter) TypeDateTimeTz(column interface{}) *Grammar_TypeDateTimeTz_Call { + return &Grammar_TypeDateTimeTz_Call{Call: _e.mock.On("TypeDateTimeTz", column)} +} + +func (_c *Grammar_TypeDateTimeTz_Call) Run(run func(column schema.ColumnDefinition)) *Grammar_TypeDateTimeTz_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.ColumnDefinition)) + }) + return _c +} + +func (_c *Grammar_TypeDateTimeTz_Call) Return(_a0 string) *Grammar_TypeDateTimeTz_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_TypeDateTimeTz_Call) RunAndReturn(run func(schema.ColumnDefinition) string) *Grammar_TypeDateTimeTz_Call { + _c.Call.Return(run) + return _c +} + +// TypeDecimal provides a mock function with given fields: column +func (_m *Grammar) TypeDecimal(column schema.ColumnDefinition) string { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for TypeDecimal") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.ColumnDefinition) string); ok { + r0 = rf(column) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_TypeDecimal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeDecimal' +type Grammar_TypeDecimal_Call struct { + *mock.Call +} + +// TypeDecimal is a helper method to define mock.On call +// - column schema.ColumnDefinition +func (_e *Grammar_Expecter) TypeDecimal(column interface{}) *Grammar_TypeDecimal_Call { + return &Grammar_TypeDecimal_Call{Call: _e.mock.On("TypeDecimal", column)} +} + +func (_c *Grammar_TypeDecimal_Call) Run(run func(column schema.ColumnDefinition)) *Grammar_TypeDecimal_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.ColumnDefinition)) + }) + return _c +} + +func (_c *Grammar_TypeDecimal_Call) Return(_a0 string) *Grammar_TypeDecimal_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_TypeDecimal_Call) RunAndReturn(run func(schema.ColumnDefinition) string) *Grammar_TypeDecimal_Call { + _c.Call.Return(run) + return _c +} + +// TypeDouble provides a mock function with given fields: column +func (_m *Grammar) TypeDouble(column schema.ColumnDefinition) string { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for TypeDouble") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.ColumnDefinition) string); ok { + r0 = rf(column) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_TypeDouble_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeDouble' +type Grammar_TypeDouble_Call struct { + *mock.Call +} + +// TypeDouble is a helper method to define mock.On call +// - column schema.ColumnDefinition +func (_e *Grammar_Expecter) TypeDouble(column interface{}) *Grammar_TypeDouble_Call { + return &Grammar_TypeDouble_Call{Call: _e.mock.On("TypeDouble", column)} +} + +func (_c *Grammar_TypeDouble_Call) Run(run func(column schema.ColumnDefinition)) *Grammar_TypeDouble_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.ColumnDefinition)) + }) + return _c +} + +func (_c *Grammar_TypeDouble_Call) Return(_a0 string) *Grammar_TypeDouble_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_TypeDouble_Call) RunAndReturn(run func(schema.ColumnDefinition) string) *Grammar_TypeDouble_Call { + _c.Call.Return(run) + return _c +} + +// TypeEnum provides a mock function with given fields: column +func (_m *Grammar) TypeEnum(column schema.ColumnDefinition) string { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for TypeEnum") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.ColumnDefinition) string); ok { + r0 = rf(column) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_TypeEnum_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeEnum' +type Grammar_TypeEnum_Call struct { + *mock.Call +} + +// TypeEnum is a helper method to define mock.On call +// - column schema.ColumnDefinition +func (_e *Grammar_Expecter) TypeEnum(column interface{}) *Grammar_TypeEnum_Call { + return &Grammar_TypeEnum_Call{Call: _e.mock.On("TypeEnum", column)} +} + +func (_c *Grammar_TypeEnum_Call) Run(run func(column schema.ColumnDefinition)) *Grammar_TypeEnum_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.ColumnDefinition)) + }) + return _c +} + +func (_c *Grammar_TypeEnum_Call) Return(_a0 string) *Grammar_TypeEnum_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_TypeEnum_Call) RunAndReturn(run func(schema.ColumnDefinition) string) *Grammar_TypeEnum_Call { + _c.Call.Return(run) + return _c +} + +// TypeFloat provides a mock function with given fields: column +func (_m *Grammar) TypeFloat(column schema.ColumnDefinition) string { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for TypeFloat") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.ColumnDefinition) string); ok { + r0 = rf(column) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_TypeFloat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeFloat' +type Grammar_TypeFloat_Call struct { + *mock.Call +} + +// TypeFloat is a helper method to define mock.On call +// - column schema.ColumnDefinition +func (_e *Grammar_Expecter) TypeFloat(column interface{}) *Grammar_TypeFloat_Call { + return &Grammar_TypeFloat_Call{Call: _e.mock.On("TypeFloat", column)} +} + +func (_c *Grammar_TypeFloat_Call) Run(run func(column schema.ColumnDefinition)) *Grammar_TypeFloat_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.ColumnDefinition)) + }) + return _c +} + +func (_c *Grammar_TypeFloat_Call) Return(_a0 string) *Grammar_TypeFloat_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_TypeFloat_Call) RunAndReturn(run func(schema.ColumnDefinition) string) *Grammar_TypeFloat_Call { + _c.Call.Return(run) + return _c +} + +// TypeInteger provides a mock function with given fields: column +func (_m *Grammar) TypeInteger(column schema.ColumnDefinition) string { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for TypeInteger") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.ColumnDefinition) string); ok { + r0 = rf(column) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_TypeInteger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeInteger' +type Grammar_TypeInteger_Call struct { + *mock.Call +} + +// TypeInteger is a helper method to define mock.On call +// - column schema.ColumnDefinition +func (_e *Grammar_Expecter) TypeInteger(column interface{}) *Grammar_TypeInteger_Call { + return &Grammar_TypeInteger_Call{Call: _e.mock.On("TypeInteger", column)} +} + +func (_c *Grammar_TypeInteger_Call) Run(run func(column schema.ColumnDefinition)) *Grammar_TypeInteger_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.ColumnDefinition)) + }) + return _c +} + +func (_c *Grammar_TypeInteger_Call) Return(_a0 string) *Grammar_TypeInteger_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_TypeInteger_Call) RunAndReturn(run func(schema.ColumnDefinition) string) *Grammar_TypeInteger_Call { + _c.Call.Return(run) + return _c +} + +// TypeJson provides a mock function with given fields: column +func (_m *Grammar) TypeJson(column schema.ColumnDefinition) string { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for TypeJson") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.ColumnDefinition) string); ok { + r0 = rf(column) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_TypeJson_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeJson' +type Grammar_TypeJson_Call struct { + *mock.Call +} + +// TypeJson is a helper method to define mock.On call +// - column schema.ColumnDefinition +func (_e *Grammar_Expecter) TypeJson(column interface{}) *Grammar_TypeJson_Call { + return &Grammar_TypeJson_Call{Call: _e.mock.On("TypeJson", column)} +} + +func (_c *Grammar_TypeJson_Call) Run(run func(column schema.ColumnDefinition)) *Grammar_TypeJson_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.ColumnDefinition)) + }) + return _c +} + +func (_c *Grammar_TypeJson_Call) Return(_a0 string) *Grammar_TypeJson_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_TypeJson_Call) RunAndReturn(run func(schema.ColumnDefinition) string) *Grammar_TypeJson_Call { + _c.Call.Return(run) + return _c +} + +// TypeJsonb provides a mock function with given fields: column +func (_m *Grammar) TypeJsonb(column schema.ColumnDefinition) string { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for TypeJsonb") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.ColumnDefinition) string); ok { + r0 = rf(column) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_TypeJsonb_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeJsonb' +type Grammar_TypeJsonb_Call struct { + *mock.Call +} + +// TypeJsonb is a helper method to define mock.On call +// - column schema.ColumnDefinition +func (_e *Grammar_Expecter) TypeJsonb(column interface{}) *Grammar_TypeJsonb_Call { + return &Grammar_TypeJsonb_Call{Call: _e.mock.On("TypeJsonb", column)} +} + +func (_c *Grammar_TypeJsonb_Call) Run(run func(column schema.ColumnDefinition)) *Grammar_TypeJsonb_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.ColumnDefinition)) + }) + return _c +} + +func (_c *Grammar_TypeJsonb_Call) Return(_a0 string) *Grammar_TypeJsonb_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_TypeJsonb_Call) RunAndReturn(run func(schema.ColumnDefinition) string) *Grammar_TypeJsonb_Call { + _c.Call.Return(run) + return _c +} + +// TypeString provides a mock function with given fields: column +func (_m *Grammar) TypeString(column schema.ColumnDefinition) string { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for TypeString") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.ColumnDefinition) string); ok { + r0 = rf(column) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_TypeString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeString' +type Grammar_TypeString_Call struct { + *mock.Call +} + +// TypeString is a helper method to define mock.On call +// - column schema.ColumnDefinition +func (_e *Grammar_Expecter) TypeString(column interface{}) *Grammar_TypeString_Call { + return &Grammar_TypeString_Call{Call: _e.mock.On("TypeString", column)} +} + +func (_c *Grammar_TypeString_Call) Run(run func(column schema.ColumnDefinition)) *Grammar_TypeString_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.ColumnDefinition)) + }) + return _c +} + +func (_c *Grammar_TypeString_Call) Return(_a0 string) *Grammar_TypeString_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_TypeString_Call) RunAndReturn(run func(schema.ColumnDefinition) string) *Grammar_TypeString_Call { + _c.Call.Return(run) + return _c +} + +// TypeText provides a mock function with given fields: column +func (_m *Grammar) TypeText(column schema.ColumnDefinition) string { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for TypeText") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.ColumnDefinition) string); ok { + r0 = rf(column) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_TypeText_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeText' +type Grammar_TypeText_Call struct { + *mock.Call +} + +// TypeText is a helper method to define mock.On call +// - column schema.ColumnDefinition +func (_e *Grammar_Expecter) TypeText(column interface{}) *Grammar_TypeText_Call { + return &Grammar_TypeText_Call{Call: _e.mock.On("TypeText", column)} +} + +func (_c *Grammar_TypeText_Call) Run(run func(column schema.ColumnDefinition)) *Grammar_TypeText_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.ColumnDefinition)) + }) + return _c +} + +func (_c *Grammar_TypeText_Call) Return(_a0 string) *Grammar_TypeText_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_TypeText_Call) RunAndReturn(run func(schema.ColumnDefinition) string) *Grammar_TypeText_Call { + _c.Call.Return(run) + return _c +} + +// TypeTime provides a mock function with given fields: column +func (_m *Grammar) TypeTime(column schema.ColumnDefinition) string { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for TypeTime") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.ColumnDefinition) string); ok { + r0 = rf(column) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_TypeTime_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeTime' +type Grammar_TypeTime_Call struct { + *mock.Call +} + +// TypeTime is a helper method to define mock.On call +// - column schema.ColumnDefinition +func (_e *Grammar_Expecter) TypeTime(column interface{}) *Grammar_TypeTime_Call { + return &Grammar_TypeTime_Call{Call: _e.mock.On("TypeTime", column)} +} + +func (_c *Grammar_TypeTime_Call) Run(run func(column schema.ColumnDefinition)) *Grammar_TypeTime_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.ColumnDefinition)) + }) + return _c +} + +func (_c *Grammar_TypeTime_Call) Return(_a0 string) *Grammar_TypeTime_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_TypeTime_Call) RunAndReturn(run func(schema.ColumnDefinition) string) *Grammar_TypeTime_Call { + _c.Call.Return(run) + return _c +} + +// TypeTimeTz provides a mock function with given fields: column +func (_m *Grammar) TypeTimeTz(column schema.ColumnDefinition) string { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for TypeTimeTz") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.ColumnDefinition) string); ok { + r0 = rf(column) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_TypeTimeTz_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeTimeTz' +type Grammar_TypeTimeTz_Call struct { + *mock.Call +} + +// TypeTimeTz is a helper method to define mock.On call +// - column schema.ColumnDefinition +func (_e *Grammar_Expecter) TypeTimeTz(column interface{}) *Grammar_TypeTimeTz_Call { + return &Grammar_TypeTimeTz_Call{Call: _e.mock.On("TypeTimeTz", column)} +} + +func (_c *Grammar_TypeTimeTz_Call) Run(run func(column schema.ColumnDefinition)) *Grammar_TypeTimeTz_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.ColumnDefinition)) + }) + return _c +} + +func (_c *Grammar_TypeTimeTz_Call) Return(_a0 string) *Grammar_TypeTimeTz_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_TypeTimeTz_Call) RunAndReturn(run func(schema.ColumnDefinition) string) *Grammar_TypeTimeTz_Call { + _c.Call.Return(run) + return _c +} + +// TypeTimestamp provides a mock function with given fields: column +func (_m *Grammar) TypeTimestamp(column schema.ColumnDefinition) string { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for TypeTimestamp") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.ColumnDefinition) string); ok { + r0 = rf(column) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_TypeTimestamp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeTimestamp' +type Grammar_TypeTimestamp_Call struct { + *mock.Call +} + +// TypeTimestamp is a helper method to define mock.On call +// - column schema.ColumnDefinition +func (_e *Grammar_Expecter) TypeTimestamp(column interface{}) *Grammar_TypeTimestamp_Call { + return &Grammar_TypeTimestamp_Call{Call: _e.mock.On("TypeTimestamp", column)} +} + +func (_c *Grammar_TypeTimestamp_Call) Run(run func(column schema.ColumnDefinition)) *Grammar_TypeTimestamp_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.ColumnDefinition)) + }) + return _c +} + +func (_c *Grammar_TypeTimestamp_Call) Return(_a0 string) *Grammar_TypeTimestamp_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_TypeTimestamp_Call) RunAndReturn(run func(schema.ColumnDefinition) string) *Grammar_TypeTimestamp_Call { + _c.Call.Return(run) + return _c +} + +// TypeTimestampTz provides a mock function with given fields: column +func (_m *Grammar) TypeTimestampTz(column schema.ColumnDefinition) string { + ret := _m.Called(column) + + if len(ret) == 0 { + panic("no return value specified for TypeTimestampTz") + } + + var r0 string + if rf, ok := ret.Get(0).(func(schema.ColumnDefinition) string); ok { + r0 = rf(column) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Grammar_TypeTimestampTz_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeTimestampTz' +type Grammar_TypeTimestampTz_Call struct { + *mock.Call +} + +// TypeTimestampTz is a helper method to define mock.On call +// - column schema.ColumnDefinition +func (_e *Grammar_Expecter) TypeTimestampTz(column interface{}) *Grammar_TypeTimestampTz_Call { + return &Grammar_TypeTimestampTz_Call{Call: _e.mock.On("TypeTimestampTz", column)} +} + +func (_c *Grammar_TypeTimestampTz_Call) Run(run func(column schema.ColumnDefinition)) *Grammar_TypeTimestampTz_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.ColumnDefinition)) + }) + return _c +} + +func (_c *Grammar_TypeTimestampTz_Call) Return(_a0 string) *Grammar_TypeTimestampTz_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grammar_TypeTimestampTz_Call) RunAndReturn(run func(schema.ColumnDefinition) string) *Grammar_TypeTimestampTz_Call { + _c.Call.Return(run) + return _c +} + +// NewGrammar creates a new instance of Grammar. 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 NewGrammar(t interface { + mock.TestingT + Cleanup(func()) +}) *Grammar { + mock := &Grammar{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/database/schema/Migration.go b/mocks/database/schema/Migration.go new file mode 100644 index 000000000..9d18c20ec --- /dev/null +++ b/mocks/database/schema/Migration.go @@ -0,0 +1,167 @@ +// Code generated by mockery v2.39.1. DO NOT EDIT. + +package mocks + +import mock "github.com/stretchr/testify/mock" + +// Migration is an autogenerated mock type for the Migration type +type Migration struct { + mock.Mock +} + +type Migration_Expecter struct { + mock *mock.Mock +} + +func (_m *Migration) EXPECT() *Migration_Expecter { + return &Migration_Expecter{mock: &_m.Mock} +} + +// Down provides a mock function with given fields: +func (_m *Migration) Down() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Down") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Migration_Down_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Down' +type Migration_Down_Call struct { + *mock.Call +} + +// Down is a helper method to define mock.On call +func (_e *Migration_Expecter) Down() *Migration_Down_Call { + return &Migration_Down_Call{Call: _e.mock.On("Down")} +} + +func (_c *Migration_Down_Call) Run(run func()) *Migration_Down_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Migration_Down_Call) Return(_a0 error) *Migration_Down_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Migration_Down_Call) RunAndReturn(run func() error) *Migration_Down_Call { + _c.Call.Return(run) + return _c +} + +// Signature provides a mock function with given fields: +func (_m *Migration) Signature() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Signature") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Migration_Signature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Signature' +type Migration_Signature_Call struct { + *mock.Call +} + +// Signature is a helper method to define mock.On call +func (_e *Migration_Expecter) Signature() *Migration_Signature_Call { + return &Migration_Signature_Call{Call: _e.mock.On("Signature")} +} + +func (_c *Migration_Signature_Call) Run(run func()) *Migration_Signature_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Migration_Signature_Call) Return(_a0 string) *Migration_Signature_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Migration_Signature_Call) RunAndReturn(run func() string) *Migration_Signature_Call { + _c.Call.Return(run) + return _c +} + +// Up provides a mock function with given fields: +func (_m *Migration) Up() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Up") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Migration_Up_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Up' +type Migration_Up_Call struct { + *mock.Call +} + +// Up is a helper method to define mock.On call +func (_e *Migration_Expecter) Up() *Migration_Up_Call { + return &Migration_Up_Call{Call: _e.mock.On("Up")} +} + +func (_c *Migration_Up_Call) Run(run func()) *Migration_Up_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Migration_Up_Call) Return(_a0 error) *Migration_Up_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Migration_Up_Call) RunAndReturn(run func() error) *Migration_Up_Call { + _c.Call.Return(run) + return _c +} + +// NewMigration creates a new instance of Migration. 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 NewMigration(t interface { + mock.TestingT + Cleanup(func()) +}) *Migration { + mock := &Migration{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/database/schema/Schema.go b/mocks/database/schema/Schema.go new file mode 100644 index 000000000..143719dc0 --- /dev/null +++ b/mocks/database/schema/Schema.go @@ -0,0 +1,1036 @@ +// Code generated by mockery v2.39.1. DO NOT EDIT. + +package mocks + +import ( + schema "github.com/goravel/framework/contracts/database/schema" + mock "github.com/stretchr/testify/mock" +) + +// Schema is an autogenerated mock type for the Schema type +type Schema struct { + mock.Mock +} + +type Schema_Expecter struct { + mock *mock.Mock +} + +func (_m *Schema) EXPECT() *Schema_Expecter { + return &Schema_Expecter{mock: &_m.Mock} +} + +// Connection provides a mock function with given fields: name +func (_m *Schema) Connection(name string) schema.Schema { + ret := _m.Called(name) + + if len(ret) == 0 { + panic("no return value specified for Connection") + } + + var r0 schema.Schema + if rf, ok := ret.Get(0).(func(string) schema.Schema); ok { + r0 = rf(name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.Schema) + } + } + + return r0 +} + +// Schema_Connection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Connection' +type Schema_Connection_Call struct { + *mock.Call +} + +// Connection is a helper method to define mock.On call +// - name string +func (_e *Schema_Expecter) Connection(name interface{}) *Schema_Connection_Call { + return &Schema_Connection_Call{Call: _e.mock.On("Connection", name)} +} + +func (_c *Schema_Connection_Call) Run(run func(name string)) *Schema_Connection_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Schema_Connection_Call) Return(_a0 schema.Schema) *Schema_Connection_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Schema_Connection_Call) RunAndReturn(run func(string) schema.Schema) *Schema_Connection_Call { + _c.Call.Return(run) + return _c +} + +// Create provides a mock function with given fields: table, callback +func (_m *Schema) Create(table string, callback func(schema.Blueprint)) error { + ret := _m.Called(table, callback) + + if len(ret) == 0 { + panic("no return value specified for Create") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string, func(schema.Blueprint)) error); ok { + r0 = rf(table, callback) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Schema_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type Schema_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - table string +// - callback func(schema.Blueprint) +func (_e *Schema_Expecter) Create(table interface{}, callback interface{}) *Schema_Create_Call { + return &Schema_Create_Call{Call: _e.mock.On("Create", table, callback)} +} + +func (_c *Schema_Create_Call) Run(run func(table string, callback func(schema.Blueprint))) *Schema_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(func(schema.Blueprint))) + }) + return _c +} + +func (_c *Schema_Create_Call) Return(_a0 error) *Schema_Create_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Schema_Create_Call) RunAndReturn(run func(string, func(schema.Blueprint)) error) *Schema_Create_Call { + _c.Call.Return(run) + return _c +} + +// Drop provides a mock function with given fields: table +func (_m *Schema) Drop(table string) error { + ret := _m.Called(table) + + if len(ret) == 0 { + panic("no return value specified for Drop") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string) error); ok { + r0 = rf(table) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Schema_Drop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Drop' +type Schema_Drop_Call struct { + *mock.Call +} + +// Drop is a helper method to define mock.On call +// - table string +func (_e *Schema_Expecter) Drop(table interface{}) *Schema_Drop_Call { + return &Schema_Drop_Call{Call: _e.mock.On("Drop", table)} +} + +func (_c *Schema_Drop_Call) Run(run func(table string)) *Schema_Drop_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Schema_Drop_Call) Return(_a0 error) *Schema_Drop_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Schema_Drop_Call) RunAndReturn(run func(string) error) *Schema_Drop_Call { + _c.Call.Return(run) + return _c +} + +// DropAllTables provides a mock function with given fields: +func (_m *Schema) DropAllTables() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for DropAllTables") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Schema_DropAllTables_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DropAllTables' +type Schema_DropAllTables_Call struct { + *mock.Call +} + +// DropAllTables is a helper method to define mock.On call +func (_e *Schema_Expecter) DropAllTables() *Schema_DropAllTables_Call { + return &Schema_DropAllTables_Call{Call: _e.mock.On("DropAllTables")} +} + +func (_c *Schema_DropAllTables_Call) Run(run func()) *Schema_DropAllTables_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Schema_DropAllTables_Call) Return(_a0 error) *Schema_DropAllTables_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Schema_DropAllTables_Call) RunAndReturn(run func() error) *Schema_DropAllTables_Call { + _c.Call.Return(run) + return _c +} + +// DropAllViews provides a mock function with given fields: +func (_m *Schema) DropAllViews() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for DropAllViews") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Schema_DropAllViews_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DropAllViews' +type Schema_DropAllViews_Call struct { + *mock.Call +} + +// DropAllViews is a helper method to define mock.On call +func (_e *Schema_Expecter) DropAllViews() *Schema_DropAllViews_Call { + return &Schema_DropAllViews_Call{Call: _e.mock.On("DropAllViews")} +} + +func (_c *Schema_DropAllViews_Call) Run(run func()) *Schema_DropAllViews_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Schema_DropAllViews_Call) Return(_a0 error) *Schema_DropAllViews_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Schema_DropAllViews_Call) RunAndReturn(run func() error) *Schema_DropAllViews_Call { + _c.Call.Return(run) + return _c +} + +// DropColumns provides a mock function with given fields: table, columns +func (_m *Schema) DropColumns(table string, columns []string) error { + ret := _m.Called(table, columns) + + if len(ret) == 0 { + panic("no return value specified for DropColumns") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string, []string) error); ok { + r0 = rf(table, columns) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Schema_DropColumns_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DropColumns' +type Schema_DropColumns_Call struct { + *mock.Call +} + +// DropColumns is a helper method to define mock.On call +// - table string +// - columns []string +func (_e *Schema_Expecter) DropColumns(table interface{}, columns interface{}) *Schema_DropColumns_Call { + return &Schema_DropColumns_Call{Call: _e.mock.On("DropColumns", table, columns)} +} + +func (_c *Schema_DropColumns_Call) Run(run func(table string, columns []string)) *Schema_DropColumns_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].([]string)) + }) + return _c +} + +func (_c *Schema_DropColumns_Call) Return(_a0 error) *Schema_DropColumns_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Schema_DropColumns_Call) RunAndReturn(run func(string, []string) error) *Schema_DropColumns_Call { + _c.Call.Return(run) + return _c +} + +// DropIfExists provides a mock function with given fields: table +func (_m *Schema) DropIfExists(table string) error { + ret := _m.Called(table) + + if len(ret) == 0 { + panic("no return value specified for DropIfExists") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string) error); ok { + r0 = rf(table) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Schema_DropIfExists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DropIfExists' +type Schema_DropIfExists_Call struct { + *mock.Call +} + +// DropIfExists is a helper method to define mock.On call +// - table string +func (_e *Schema_Expecter) DropIfExists(table interface{}) *Schema_DropIfExists_Call { + return &Schema_DropIfExists_Call{Call: _e.mock.On("DropIfExists", table)} +} + +func (_c *Schema_DropIfExists_Call) Run(run func(table string)) *Schema_DropIfExists_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Schema_DropIfExists_Call) Return(_a0 error) *Schema_DropIfExists_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Schema_DropIfExists_Call) RunAndReturn(run func(string) error) *Schema_DropIfExists_Call { + _c.Call.Return(run) + return _c +} + +// GetColumnListing provides a mock function with given fields: table +func (_m *Schema) GetColumnListing(table string) []string { + ret := _m.Called(table) + + if len(ret) == 0 { + panic("no return value specified for GetColumnListing") + } + + var r0 []string + if rf, ok := ret.Get(0).(func(string) []string); ok { + r0 = rf(table) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + + return r0 +} + +// Schema_GetColumnListing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetColumnListing' +type Schema_GetColumnListing_Call struct { + *mock.Call +} + +// GetColumnListing is a helper method to define mock.On call +// - table string +func (_e *Schema_Expecter) GetColumnListing(table interface{}) *Schema_GetColumnListing_Call { + return &Schema_GetColumnListing_Call{Call: _e.mock.On("GetColumnListing", table)} +} + +func (_c *Schema_GetColumnListing_Call) Run(run func(table string)) *Schema_GetColumnListing_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Schema_GetColumnListing_Call) Return(_a0 []string) *Schema_GetColumnListing_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Schema_GetColumnListing_Call) RunAndReturn(run func(string) []string) *Schema_GetColumnListing_Call { + _c.Call.Return(run) + return _c +} + +// GetColumns provides a mock function with given fields: table +func (_m *Schema) GetColumns(table string) []schema.ColumnDefinition { + ret := _m.Called(table) + + if len(ret) == 0 { + panic("no return value specified for GetColumns") + } + + var r0 []schema.ColumnDefinition + if rf, ok := ret.Get(0).(func(string) []schema.ColumnDefinition); ok { + r0 = rf(table) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]schema.ColumnDefinition) + } + } + + return r0 +} + +// Schema_GetColumns_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetColumns' +type Schema_GetColumns_Call struct { + *mock.Call +} + +// GetColumns is a helper method to define mock.On call +// - table string +func (_e *Schema_Expecter) GetColumns(table interface{}) *Schema_GetColumns_Call { + return &Schema_GetColumns_Call{Call: _e.mock.On("GetColumns", table)} +} + +func (_c *Schema_GetColumns_Call) Run(run func(table string)) *Schema_GetColumns_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Schema_GetColumns_Call) Return(_a0 []schema.ColumnDefinition) *Schema_GetColumns_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Schema_GetColumns_Call) RunAndReturn(run func(string) []schema.ColumnDefinition) *Schema_GetColumns_Call { + _c.Call.Return(run) + return _c +} + +// GetIndexListing provides a mock function with given fields: table +func (_m *Schema) GetIndexListing(table string) []string { + ret := _m.Called(table) + + if len(ret) == 0 { + panic("no return value specified for GetIndexListing") + } + + var r0 []string + if rf, ok := ret.Get(0).(func(string) []string); ok { + r0 = rf(table) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + + return r0 +} + +// Schema_GetIndexListing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetIndexListing' +type Schema_GetIndexListing_Call struct { + *mock.Call +} + +// GetIndexListing is a helper method to define mock.On call +// - table string +func (_e *Schema_Expecter) GetIndexListing(table interface{}) *Schema_GetIndexListing_Call { + return &Schema_GetIndexListing_Call{Call: _e.mock.On("GetIndexListing", table)} +} + +func (_c *Schema_GetIndexListing_Call) Run(run func(table string)) *Schema_GetIndexListing_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Schema_GetIndexListing_Call) Return(_a0 []string) *Schema_GetIndexListing_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Schema_GetIndexListing_Call) RunAndReturn(run func(string) []string) *Schema_GetIndexListing_Call { + _c.Call.Return(run) + return _c +} + +// GetIndexes provides a mock function with given fields: table +func (_m *Schema) GetIndexes(table string) []schema.Index { + ret := _m.Called(table) + + if len(ret) == 0 { + panic("no return value specified for GetIndexes") + } + + var r0 []schema.Index + if rf, ok := ret.Get(0).(func(string) []schema.Index); ok { + r0 = rf(table) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]schema.Index) + } + } + + return r0 +} + +// Schema_GetIndexes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetIndexes' +type Schema_GetIndexes_Call struct { + *mock.Call +} + +// GetIndexes is a helper method to define mock.On call +// - table string +func (_e *Schema_Expecter) GetIndexes(table interface{}) *Schema_GetIndexes_Call { + return &Schema_GetIndexes_Call{Call: _e.mock.On("GetIndexes", table)} +} + +func (_c *Schema_GetIndexes_Call) Run(run func(table string)) *Schema_GetIndexes_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Schema_GetIndexes_Call) Return(_a0 []schema.Index) *Schema_GetIndexes_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Schema_GetIndexes_Call) RunAndReturn(run func(string) []schema.Index) *Schema_GetIndexes_Call { + _c.Call.Return(run) + return _c +} + +// GetTableListing provides a mock function with given fields: +func (_m *Schema) GetTableListing() []string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetTableListing") + } + + var r0 []string + if rf, ok := ret.Get(0).(func() []string); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + + return r0 +} + +// Schema_GetTableListing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTableListing' +type Schema_GetTableListing_Call struct { + *mock.Call +} + +// GetTableListing is a helper method to define mock.On call +func (_e *Schema_Expecter) GetTableListing() *Schema_GetTableListing_Call { + return &Schema_GetTableListing_Call{Call: _e.mock.On("GetTableListing")} +} + +func (_c *Schema_GetTableListing_Call) Run(run func()) *Schema_GetTableListing_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Schema_GetTableListing_Call) Return(_a0 []string) *Schema_GetTableListing_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Schema_GetTableListing_Call) RunAndReturn(run func() []string) *Schema_GetTableListing_Call { + _c.Call.Return(run) + return _c +} + +// GetTables provides a mock function with given fields: +func (_m *Schema) GetTables() ([]schema.Table, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetTables") + } + + var r0 []schema.Table + var r1 error + if rf, ok := ret.Get(0).(func() ([]schema.Table, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() []schema.Table); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]schema.Table) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Schema_GetTables_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTables' +type Schema_GetTables_Call struct { + *mock.Call +} + +// GetTables is a helper method to define mock.On call +func (_e *Schema_Expecter) GetTables() *Schema_GetTables_Call { + return &Schema_GetTables_Call{Call: _e.mock.On("GetTables")} +} + +func (_c *Schema_GetTables_Call) Run(run func()) *Schema_GetTables_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Schema_GetTables_Call) Return(_a0 []schema.Table, _a1 error) *Schema_GetTables_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Schema_GetTables_Call) RunAndReturn(run func() ([]schema.Table, error)) *Schema_GetTables_Call { + _c.Call.Return(run) + return _c +} + +// GetViews provides a mock function with given fields: +func (_m *Schema) GetViews() []schema.View { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetViews") + } + + var r0 []schema.View + if rf, ok := ret.Get(0).(func() []schema.View); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]schema.View) + } + } + + return r0 +} + +// Schema_GetViews_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetViews' +type Schema_GetViews_Call struct { + *mock.Call +} + +// GetViews is a helper method to define mock.On call +func (_e *Schema_Expecter) GetViews() *Schema_GetViews_Call { + return &Schema_GetViews_Call{Call: _e.mock.On("GetViews")} +} + +func (_c *Schema_GetViews_Call) Run(run func()) *Schema_GetViews_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Schema_GetViews_Call) Return(_a0 []schema.View) *Schema_GetViews_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Schema_GetViews_Call) RunAndReturn(run func() []schema.View) *Schema_GetViews_Call { + _c.Call.Return(run) + return _c +} + +// HasColumn provides a mock function with given fields: table, column +func (_m *Schema) HasColumn(table string, column string) bool { + ret := _m.Called(table, column) + + if len(ret) == 0 { + panic("no return value specified for HasColumn") + } + + var r0 bool + if rf, ok := ret.Get(0).(func(string, string) bool); ok { + r0 = rf(table, column) + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// Schema_HasColumn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasColumn' +type Schema_HasColumn_Call struct { + *mock.Call +} + +// HasColumn is a helper method to define mock.On call +// - table string +// - column string +func (_e *Schema_Expecter) HasColumn(table interface{}, column interface{}) *Schema_HasColumn_Call { + return &Schema_HasColumn_Call{Call: _e.mock.On("HasColumn", table, column)} +} + +func (_c *Schema_HasColumn_Call) Run(run func(table string, column string)) *Schema_HasColumn_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Schema_HasColumn_Call) Return(_a0 bool) *Schema_HasColumn_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Schema_HasColumn_Call) RunAndReturn(run func(string, string) bool) *Schema_HasColumn_Call { + _c.Call.Return(run) + return _c +} + +// HasColumns provides a mock function with given fields: table, columns +func (_m *Schema) HasColumns(table string, columns []string) bool { + ret := _m.Called(table, columns) + + if len(ret) == 0 { + panic("no return value specified for HasColumns") + } + + var r0 bool + if rf, ok := ret.Get(0).(func(string, []string) bool); ok { + r0 = rf(table, columns) + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// Schema_HasColumns_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasColumns' +type Schema_HasColumns_Call struct { + *mock.Call +} + +// HasColumns is a helper method to define mock.On call +// - table string +// - columns []string +func (_e *Schema_Expecter) HasColumns(table interface{}, columns interface{}) *Schema_HasColumns_Call { + return &Schema_HasColumns_Call{Call: _e.mock.On("HasColumns", table, columns)} +} + +func (_c *Schema_HasColumns_Call) Run(run func(table string, columns []string)) *Schema_HasColumns_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].([]string)) + }) + return _c +} + +func (_c *Schema_HasColumns_Call) Return(_a0 bool) *Schema_HasColumns_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Schema_HasColumns_Call) RunAndReturn(run func(string, []string) bool) *Schema_HasColumns_Call { + _c.Call.Return(run) + return _c +} + +// HasIndex provides a mock function with given fields: table, index +func (_m *Schema) HasIndex(table string, index string) { + _m.Called(table, index) +} + +// Schema_HasIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasIndex' +type Schema_HasIndex_Call struct { + *mock.Call +} + +// HasIndex is a helper method to define mock.On call +// - table string +// - index string +func (_e *Schema_Expecter) HasIndex(table interface{}, index interface{}) *Schema_HasIndex_Call { + return &Schema_HasIndex_Call{Call: _e.mock.On("HasIndex", table, index)} +} + +func (_c *Schema_HasIndex_Call) Run(run func(table string, index string)) *Schema_HasIndex_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Schema_HasIndex_Call) Return() *Schema_HasIndex_Call { + _c.Call.Return() + return _c +} + +func (_c *Schema_HasIndex_Call) RunAndReturn(run func(string, string)) *Schema_HasIndex_Call { + _c.Call.Return(run) + return _c +} + +// HasTable provides a mock function with given fields: table +func (_m *Schema) HasTable(table string) bool { + ret := _m.Called(table) + + if len(ret) == 0 { + panic("no return value specified for HasTable") + } + + var r0 bool + if rf, ok := ret.Get(0).(func(string) bool); ok { + r0 = rf(table) + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// Schema_HasTable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasTable' +type Schema_HasTable_Call struct { + *mock.Call +} + +// HasTable is a helper method to define mock.On call +// - table string +func (_e *Schema_Expecter) HasTable(table interface{}) *Schema_HasTable_Call { + return &Schema_HasTable_Call{Call: _e.mock.On("HasTable", table)} +} + +func (_c *Schema_HasTable_Call) Run(run func(table string)) *Schema_HasTable_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Schema_HasTable_Call) Return(_a0 bool) *Schema_HasTable_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Schema_HasTable_Call) RunAndReturn(run func(string) bool) *Schema_HasTable_Call { + _c.Call.Return(run) + return _c +} + +// HasView provides a mock function with given fields: view +func (_m *Schema) HasView(view string) bool { + ret := _m.Called(view) + + if len(ret) == 0 { + panic("no return value specified for HasView") + } + + var r0 bool + if rf, ok := ret.Get(0).(func(string) bool); ok { + r0 = rf(view) + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// Schema_HasView_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasView' +type Schema_HasView_Call struct { + *mock.Call +} + +// HasView is a helper method to define mock.On call +// - view string +func (_e *Schema_Expecter) HasView(view interface{}) *Schema_HasView_Call { + return &Schema_HasView_Call{Call: _e.mock.On("HasView", view)} +} + +func (_c *Schema_HasView_Call) Run(run func(view string)) *Schema_HasView_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Schema_HasView_Call) Return(_a0 bool) *Schema_HasView_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Schema_HasView_Call) RunAndReturn(run func(string) bool) *Schema_HasView_Call { + _c.Call.Return(run) + return _c +} + +// Register provides a mock function with given fields: _a0 +func (_m *Schema) Register(_a0 []schema.Migration) { + _m.Called(_a0) +} + +// Schema_Register_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Register' +type Schema_Register_Call struct { + *mock.Call +} + +// Register is a helper method to define mock.On call +// - _a0 []schema.Migration +func (_e *Schema_Expecter) Register(_a0 interface{}) *Schema_Register_Call { + return &Schema_Register_Call{Call: _e.mock.On("Register", _a0)} +} + +func (_c *Schema_Register_Call) Run(run func(_a0 []schema.Migration)) *Schema_Register_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]schema.Migration)) + }) + return _c +} + +func (_c *Schema_Register_Call) Return() *Schema_Register_Call { + _c.Call.Return() + return _c +} + +func (_c *Schema_Register_Call) RunAndReturn(run func([]schema.Migration)) *Schema_Register_Call { + _c.Call.Return(run) + return _c +} + +// Rename provides a mock function with given fields: from, to +func (_m *Schema) Rename(from string, to string) { + _m.Called(from, to) +} + +// Schema_Rename_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Rename' +type Schema_Rename_Call struct { + *mock.Call +} + +// Rename is a helper method to define mock.On call +// - from string +// - to string +func (_e *Schema_Expecter) Rename(from interface{}, to interface{}) *Schema_Rename_Call { + return &Schema_Rename_Call{Call: _e.mock.On("Rename", from, to)} +} + +func (_c *Schema_Rename_Call) Run(run func(from string, to string)) *Schema_Rename_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Schema_Rename_Call) Return() *Schema_Rename_Call { + _c.Call.Return() + return _c +} + +func (_c *Schema_Rename_Call) RunAndReturn(run func(string, string)) *Schema_Rename_Call { + _c.Call.Return(run) + return _c +} + +// Table provides a mock function with given fields: table, callback +func (_m *Schema) Table(table string, callback func(schema.Blueprint)) error { + ret := _m.Called(table, callback) + + if len(ret) == 0 { + panic("no return value specified for Table") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string, func(schema.Blueprint)) error); ok { + r0 = rf(table, callback) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Schema_Table_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Table' +type Schema_Table_Call struct { + *mock.Call +} + +// Table is a helper method to define mock.On call +// - table string +// - callback func(schema.Blueprint) +func (_e *Schema_Expecter) Table(table interface{}, callback interface{}) *Schema_Table_Call { + return &Schema_Table_Call{Call: _e.mock.On("Table", table, callback)} +} + +func (_c *Schema_Table_Call) Run(run func(table string, callback func(schema.Blueprint))) *Schema_Table_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(func(schema.Blueprint))) + }) + return _c +} + +func (_c *Schema_Table_Call) Return(_a0 error) *Schema_Table_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Schema_Table_Call) RunAndReturn(run func(string, func(schema.Blueprint)) error) *Schema_Table_Call { + _c.Call.Return(run) + return _c +} + +// NewSchema creates a new instance of Schema. 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 NewSchema(t interface { + mock.TestingT + Cleanup(func()) +}) *Schema { + mock := &Schema{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/database/seeder/Facade.go b/mocks/database/seeder/Facade.go index 870143464..c88487cb1 100644 --- a/mocks/database/seeder/Facade.go +++ b/mocks/database/seeder/Facade.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,10 +12,22 @@ type Facade struct { mock.Mock } +type Facade_Expecter struct { + mock *mock.Mock +} + +func (_m *Facade) EXPECT() *Facade_Expecter { + return &Facade_Expecter{mock: &_m.Mock} +} + // Call provides a mock function with given fields: seeders func (_m *Facade) Call(seeders []seeder.Seeder) error { ret := _m.Called(seeders) + if len(ret) == 0 { + panic("no return value specified for Call") + } + var r0 error if rf, ok := ret.Get(0).(func([]seeder.Seeder) error); ok { r0 = rf(seeders) @@ -26,10 +38,42 @@ func (_m *Facade) Call(seeders []seeder.Seeder) error { return r0 } +// Facade_Call_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Call' +type Facade_Call_Call struct { + *mock.Call +} + +// Call is a helper method to define mock.On call +// - seeders []seeder.Seeder +func (_e *Facade_Expecter) Call(seeders interface{}) *Facade_Call_Call { + return &Facade_Call_Call{Call: _e.mock.On("Call", seeders)} +} + +func (_c *Facade_Call_Call) Run(run func(seeders []seeder.Seeder)) *Facade_Call_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]seeder.Seeder)) + }) + return _c +} + +func (_c *Facade_Call_Call) Return(_a0 error) *Facade_Call_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Facade_Call_Call) RunAndReturn(run func([]seeder.Seeder) error) *Facade_Call_Call { + _c.Call.Return(run) + return _c +} + // CallOnce provides a mock function with given fields: seeders func (_m *Facade) CallOnce(seeders []seeder.Seeder) error { ret := _m.Called(seeders) + if len(ret) == 0 { + panic("no return value specified for CallOnce") + } + var r0 error if rf, ok := ret.Get(0).(func([]seeder.Seeder) error); ok { r0 = rf(seeders) @@ -40,10 +84,42 @@ func (_m *Facade) CallOnce(seeders []seeder.Seeder) error { return r0 } +// Facade_CallOnce_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CallOnce' +type Facade_CallOnce_Call struct { + *mock.Call +} + +// CallOnce is a helper method to define mock.On call +// - seeders []seeder.Seeder +func (_e *Facade_Expecter) CallOnce(seeders interface{}) *Facade_CallOnce_Call { + return &Facade_CallOnce_Call{Call: _e.mock.On("CallOnce", seeders)} +} + +func (_c *Facade_CallOnce_Call) Run(run func(seeders []seeder.Seeder)) *Facade_CallOnce_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]seeder.Seeder)) + }) + return _c +} + +func (_c *Facade_CallOnce_Call) Return(_a0 error) *Facade_CallOnce_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Facade_CallOnce_Call) RunAndReturn(run func([]seeder.Seeder) error) *Facade_CallOnce_Call { + _c.Call.Return(run) + return _c +} + // GetSeeder provides a mock function with given fields: name func (_m *Facade) GetSeeder(name string) seeder.Seeder { ret := _m.Called(name) + if len(ret) == 0 { + panic("no return value specified for GetSeeder") + } + var r0 seeder.Seeder if rf, ok := ret.Get(0).(func(string) seeder.Seeder); ok { r0 = rf(name) @@ -56,10 +132,42 @@ func (_m *Facade) GetSeeder(name string) seeder.Seeder { return r0 } +// Facade_GetSeeder_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSeeder' +type Facade_GetSeeder_Call struct { + *mock.Call +} + +// GetSeeder is a helper method to define mock.On call +// - name string +func (_e *Facade_Expecter) GetSeeder(name interface{}) *Facade_GetSeeder_Call { + return &Facade_GetSeeder_Call{Call: _e.mock.On("GetSeeder", name)} +} + +func (_c *Facade_GetSeeder_Call) Run(run func(name string)) *Facade_GetSeeder_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Facade_GetSeeder_Call) Return(_a0 seeder.Seeder) *Facade_GetSeeder_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Facade_GetSeeder_Call) RunAndReturn(run func(string) seeder.Seeder) *Facade_GetSeeder_Call { + _c.Call.Return(run) + return _c +} + // GetSeeders provides a mock function with given fields: func (_m *Facade) GetSeeders() []seeder.Seeder { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for GetSeeders") + } + var r0 []seeder.Seeder if rf, ok := ret.Get(0).(func() []seeder.Seeder); ok { r0 = rf() @@ -72,11 +180,66 @@ func (_m *Facade) GetSeeders() []seeder.Seeder { return r0 } +// Facade_GetSeeders_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSeeders' +type Facade_GetSeeders_Call struct { + *mock.Call +} + +// GetSeeders is a helper method to define mock.On call +func (_e *Facade_Expecter) GetSeeders() *Facade_GetSeeders_Call { + return &Facade_GetSeeders_Call{Call: _e.mock.On("GetSeeders")} +} + +func (_c *Facade_GetSeeders_Call) Run(run func()) *Facade_GetSeeders_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Facade_GetSeeders_Call) Return(_a0 []seeder.Seeder) *Facade_GetSeeders_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Facade_GetSeeders_Call) RunAndReturn(run func() []seeder.Seeder) *Facade_GetSeeders_Call { + _c.Call.Return(run) + return _c +} + // Register provides a mock function with given fields: seeders func (_m *Facade) Register(seeders []seeder.Seeder) { _m.Called(seeders) } +// Facade_Register_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Register' +type Facade_Register_Call struct { + *mock.Call +} + +// Register is a helper method to define mock.On call +// - seeders []seeder.Seeder +func (_e *Facade_Expecter) Register(seeders interface{}) *Facade_Register_Call { + return &Facade_Register_Call{Call: _e.mock.On("Register", seeders)} +} + +func (_c *Facade_Register_Call) Run(run func(seeders []seeder.Seeder)) *Facade_Register_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]seeder.Seeder)) + }) + return _c +} + +func (_c *Facade_Register_Call) Return() *Facade_Register_Call { + _c.Call.Return() + return _c +} + +func (_c *Facade_Register_Call) RunAndReturn(run func([]seeder.Seeder)) *Facade_Register_Call { + _c.Call.Return(run) + return _c +} + // NewFacade creates a new instance of Facade. 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 NewFacade(t interface { diff --git a/mocks/database/seeder/Seeder.go b/mocks/database/seeder/Seeder.go index 717aad41e..0ccef02ef 100644 --- a/mocks/database/seeder/Seeder.go +++ b/mocks/database/seeder/Seeder.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -9,10 +9,22 @@ type Seeder struct { mock.Mock } +type Seeder_Expecter struct { + mock *mock.Mock +} + +func (_m *Seeder) EXPECT() *Seeder_Expecter { + return &Seeder_Expecter{mock: &_m.Mock} +} + // Run provides a mock function with given fields: func (_m *Seeder) Run() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Run") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -23,10 +35,41 @@ func (_m *Seeder) Run() error { return r0 } +// Seeder_Run_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Run' +type Seeder_Run_Call struct { + *mock.Call +} + +// Run is a helper method to define mock.On call +func (_e *Seeder_Expecter) Run() *Seeder_Run_Call { + return &Seeder_Run_Call{Call: _e.mock.On("Run")} +} + +func (_c *Seeder_Run_Call) Run(run func()) *Seeder_Run_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Seeder_Run_Call) Return(_a0 error) *Seeder_Run_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Seeder_Run_Call) RunAndReturn(run func() error) *Seeder_Run_Call { + _c.Call.Return(run) + return _c +} + // Signature provides a mock function with given fields: func (_m *Seeder) Signature() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Signature") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -37,6 +80,33 @@ func (_m *Seeder) Signature() string { return r0 } +// Seeder_Signature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Signature' +type Seeder_Signature_Call struct { + *mock.Call +} + +// Signature is a helper method to define mock.On call +func (_e *Seeder_Expecter) Signature() *Seeder_Signature_Call { + return &Seeder_Signature_Call{Call: _e.mock.On("Signature")} +} + +func (_c *Seeder_Signature_Call) Run(run func()) *Seeder_Signature_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Seeder_Signature_Call) Return(_a0 string) *Seeder_Signature_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Seeder_Signature_Call) RunAndReturn(run func() string) *Seeder_Signature_Call { + _c.Call.Return(run) + return _c +} + // NewSeeder creates a new instance of Seeder. 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 NewSeeder(t interface { diff --git a/mocks/event/Event.go b/mocks/event/Event.go index 6e365d28d..88d7c58e2 100644 --- a/mocks/event/Event.go +++ b/mocks/event/Event.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,10 +12,22 @@ type Event struct { mock.Mock } +type Event_Expecter struct { + mock *mock.Mock +} + +func (_m *Event) EXPECT() *Event_Expecter { + return &Event_Expecter{mock: &_m.Mock} +} + // Handle provides a mock function with given fields: args func (_m *Event) Handle(args []event.Arg) ([]event.Arg, error) { ret := _m.Called(args) + if len(ret) == 0 { + panic("no return value specified for Handle") + } + var r0 []event.Arg var r1 error if rf, ok := ret.Get(0).(func([]event.Arg) ([]event.Arg, error)); ok { @@ -38,6 +50,34 @@ func (_m *Event) Handle(args []event.Arg) ([]event.Arg, error) { return r0, r1 } +// Event_Handle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Handle' +type Event_Handle_Call struct { + *mock.Call +} + +// Handle is a helper method to define mock.On call +// - args []event.Arg +func (_e *Event_Expecter) Handle(args interface{}) *Event_Handle_Call { + return &Event_Handle_Call{Call: _e.mock.On("Handle", args)} +} + +func (_c *Event_Handle_Call) Run(run func(args []event.Arg)) *Event_Handle_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]event.Arg)) + }) + return _c +} + +func (_c *Event_Handle_Call) Return(_a0 []event.Arg, _a1 error) *Event_Handle_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Event_Handle_Call) RunAndReturn(run func([]event.Arg) ([]event.Arg, error)) *Event_Handle_Call { + _c.Call.Return(run) + return _c +} + // NewEvent creates a new instance of Event. 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 NewEvent(t interface { diff --git a/mocks/event/Instance.go b/mocks/event/Instance.go index 7bcef81c8..901365318 100644 --- a/mocks/event/Instance.go +++ b/mocks/event/Instance.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,10 +12,22 @@ type Instance struct { mock.Mock } +type Instance_Expecter struct { + mock *mock.Mock +} + +func (_m *Instance) EXPECT() *Instance_Expecter { + return &Instance_Expecter{mock: &_m.Mock} +} + // GetEvents provides a mock function with given fields: func (_m *Instance) GetEvents() map[event.Event][]event.Listener { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for GetEvents") + } + var r0 map[event.Event][]event.Listener if rf, ok := ret.Get(0).(func() map[event.Event][]event.Listener); ok { r0 = rf() @@ -28,10 +40,41 @@ func (_m *Instance) GetEvents() map[event.Event][]event.Listener { return r0 } +// Instance_GetEvents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEvents' +type Instance_GetEvents_Call struct { + *mock.Call +} + +// GetEvents is a helper method to define mock.On call +func (_e *Instance_Expecter) GetEvents() *Instance_GetEvents_Call { + return &Instance_GetEvents_Call{Call: _e.mock.On("GetEvents")} +} + +func (_c *Instance_GetEvents_Call) Run(run func()) *Instance_GetEvents_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Instance_GetEvents_Call) Return(_a0 map[event.Event][]event.Listener) *Instance_GetEvents_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Instance_GetEvents_Call) RunAndReturn(run func() map[event.Event][]event.Listener) *Instance_GetEvents_Call { + _c.Call.Return(run) + return _c +} + // Job provides a mock function with given fields: _a0, args func (_m *Instance) Job(_a0 event.Event, args []event.Arg) event.Task { ret := _m.Called(_a0, args) + if len(ret) == 0 { + panic("no return value specified for Job") + } + var r0 event.Task if rf, ok := ret.Get(0).(func(event.Event, []event.Arg) event.Task); ok { r0 = rf(_a0, args) @@ -44,11 +87,68 @@ func (_m *Instance) Job(_a0 event.Event, args []event.Arg) event.Task { return r0 } +// Instance_Job_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Job' +type Instance_Job_Call struct { + *mock.Call +} + +// Job is a helper method to define mock.On call +// - _a0 event.Event +// - args []event.Arg +func (_e *Instance_Expecter) Job(_a0 interface{}, args interface{}) *Instance_Job_Call { + return &Instance_Job_Call{Call: _e.mock.On("Job", _a0, args)} +} + +func (_c *Instance_Job_Call) Run(run func(_a0 event.Event, args []event.Arg)) *Instance_Job_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(event.Event), args[1].([]event.Arg)) + }) + return _c +} + +func (_c *Instance_Job_Call) Return(_a0 event.Task) *Instance_Job_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Instance_Job_Call) RunAndReturn(run func(event.Event, []event.Arg) event.Task) *Instance_Job_Call { + _c.Call.Return(run) + return _c +} + // Register provides a mock function with given fields: _a0 func (_m *Instance) Register(_a0 map[event.Event][]event.Listener) { _m.Called(_a0) } +// Instance_Register_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Register' +type Instance_Register_Call struct { + *mock.Call +} + +// Register is a helper method to define mock.On call +// - _a0 map[event.Event][]event.Listener +func (_e *Instance_Expecter) Register(_a0 interface{}) *Instance_Register_Call { + return &Instance_Register_Call{Call: _e.mock.On("Register", _a0)} +} + +func (_c *Instance_Register_Call) Run(run func(_a0 map[event.Event][]event.Listener)) *Instance_Register_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(map[event.Event][]event.Listener)) + }) + return _c +} + +func (_c *Instance_Register_Call) Return() *Instance_Register_Call { + _c.Call.Return() + return _c +} + +func (_c *Instance_Register_Call) RunAndReturn(run func(map[event.Event][]event.Listener)) *Instance_Register_Call { + _c.Call.Return(run) + return _c +} + // NewInstance creates a new instance of Instance. 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 NewInstance(t interface { diff --git a/mocks/event/Listener.go b/mocks/event/Listener.go index 4f3a94157..64efb010c 100644 --- a/mocks/event/Listener.go +++ b/mocks/event/Listener.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,12 +12,24 @@ type Listener struct { mock.Mock } +type Listener_Expecter struct { + mock *mock.Mock +} + +func (_m *Listener) EXPECT() *Listener_Expecter { + return &Listener_Expecter{mock: &_m.Mock} +} + // Handle provides a mock function with given fields: args func (_m *Listener) Handle(args ...interface{}) error { var _ca []interface{} _ca = append(_ca, args...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Handle") + } + var r0 error if rf, ok := ret.Get(0).(func(...interface{}) error); ok { r0 = rf(args...) @@ -28,12 +40,51 @@ func (_m *Listener) Handle(args ...interface{}) error { return r0 } +// Listener_Handle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Handle' +type Listener_Handle_Call struct { + *mock.Call +} + +// Handle is a helper method to define mock.On call +// - args ...interface{} +func (_e *Listener_Expecter) Handle(args ...interface{}) *Listener_Handle_Call { + return &Listener_Handle_Call{Call: _e.mock.On("Handle", + append([]interface{}{}, args...)...)} +} + +func (_c *Listener_Handle_Call) Run(run func(args ...interface{})) *Listener_Handle_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Listener_Handle_Call) Return(_a0 error) *Listener_Handle_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Listener_Handle_Call) RunAndReturn(run func(...interface{}) error) *Listener_Handle_Call { + _c.Call.Return(run) + return _c +} + // Queue provides a mock function with given fields: args func (_m *Listener) Queue(args ...interface{}) event.Queue { var _ca []interface{} _ca = append(_ca, args...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Queue") + } + var r0 event.Queue if rf, ok := ret.Get(0).(func(...interface{}) event.Queue); ok { r0 = rf(args...) @@ -44,10 +95,49 @@ func (_m *Listener) Queue(args ...interface{}) event.Queue { return r0 } +// Listener_Queue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Queue' +type Listener_Queue_Call struct { + *mock.Call +} + +// Queue is a helper method to define mock.On call +// - args ...interface{} +func (_e *Listener_Expecter) Queue(args ...interface{}) *Listener_Queue_Call { + return &Listener_Queue_Call{Call: _e.mock.On("Queue", + append([]interface{}{}, args...)...)} +} + +func (_c *Listener_Queue_Call) Run(run func(args ...interface{})) *Listener_Queue_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Listener_Queue_Call) Return(_a0 event.Queue) *Listener_Queue_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Listener_Queue_Call) RunAndReturn(run func(...interface{}) event.Queue) *Listener_Queue_Call { + _c.Call.Return(run) + return _c +} + // Signature provides a mock function with given fields: func (_m *Listener) Signature() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Signature") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -58,6 +148,33 @@ func (_m *Listener) Signature() string { return r0 } +// Listener_Signature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Signature' +type Listener_Signature_Call struct { + *mock.Call +} + +// Signature is a helper method to define mock.On call +func (_e *Listener_Expecter) Signature() *Listener_Signature_Call { + return &Listener_Signature_Call{Call: _e.mock.On("Signature")} +} + +func (_c *Listener_Signature_Call) Run(run func()) *Listener_Signature_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Listener_Signature_Call) Return(_a0 string) *Listener_Signature_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Listener_Signature_Call) RunAndReturn(run func() string) *Listener_Signature_Call { + _c.Call.Return(run) + return _c +} + // NewListener creates a new instance of Listener. 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 NewListener(t interface { diff --git a/mocks/event/Task.go b/mocks/event/Task.go index 884f94fa5..859c8021b 100644 --- a/mocks/event/Task.go +++ b/mocks/event/Task.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -9,10 +9,22 @@ type Task struct { mock.Mock } +type Task_Expecter struct { + mock *mock.Mock +} + +func (_m *Task) EXPECT() *Task_Expecter { + return &Task_Expecter{mock: &_m.Mock} +} + // Dispatch provides a mock function with given fields: func (_m *Task) Dispatch() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Dispatch") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -23,6 +35,33 @@ func (_m *Task) Dispatch() error { return r0 } +// Task_Dispatch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Dispatch' +type Task_Dispatch_Call struct { + *mock.Call +} + +// Dispatch is a helper method to define mock.On call +func (_e *Task_Expecter) Dispatch() *Task_Dispatch_Call { + return &Task_Dispatch_Call{Call: _e.mock.On("Dispatch")} +} + +func (_c *Task_Dispatch_Call) Run(run func()) *Task_Dispatch_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Task_Dispatch_Call) Return(_a0 error) *Task_Dispatch_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Task_Dispatch_Call) RunAndReturn(run func() error) *Task_Dispatch_Call { + _c.Call.Return(run) + return _c +} + // NewTask creates a new instance of Task. 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 NewTask(t interface { diff --git a/mocks/filesystem/Driver.go b/mocks/filesystem/Driver.go index 04f9c70be..cef36cd59 100644 --- a/mocks/filesystem/Driver.go +++ b/mocks/filesystem/Driver.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -16,10 +16,22 @@ type Driver struct { mock.Mock } +type Driver_Expecter struct { + mock *mock.Mock +} + +func (_m *Driver) EXPECT() *Driver_Expecter { + return &Driver_Expecter{mock: &_m.Mock} +} + // AllDirectories provides a mock function with given fields: path func (_m *Driver) AllDirectories(path string) ([]string, error) { ret := _m.Called(path) + if len(ret) == 0 { + panic("no return value specified for AllDirectories") + } + var r0 []string var r1 error if rf, ok := ret.Get(0).(func(string) ([]string, error)); ok { @@ -42,10 +54,42 @@ func (_m *Driver) AllDirectories(path string) ([]string, error) { return r0, r1 } +// Driver_AllDirectories_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AllDirectories' +type Driver_AllDirectories_Call struct { + *mock.Call +} + +// AllDirectories is a helper method to define mock.On call +// - path string +func (_e *Driver_Expecter) AllDirectories(path interface{}) *Driver_AllDirectories_Call { + return &Driver_AllDirectories_Call{Call: _e.mock.On("AllDirectories", path)} +} + +func (_c *Driver_AllDirectories_Call) Run(run func(path string)) *Driver_AllDirectories_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Driver_AllDirectories_Call) Return(_a0 []string, _a1 error) *Driver_AllDirectories_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Driver_AllDirectories_Call) RunAndReturn(run func(string) ([]string, error)) *Driver_AllDirectories_Call { + _c.Call.Return(run) + return _c +} + // AllFiles provides a mock function with given fields: path func (_m *Driver) AllFiles(path string) ([]string, error) { ret := _m.Called(path) + if len(ret) == 0 { + panic("no return value specified for AllFiles") + } + var r0 []string var r1 error if rf, ok := ret.Get(0).(func(string) ([]string, error)); ok { @@ -68,10 +112,42 @@ func (_m *Driver) AllFiles(path string) ([]string, error) { return r0, r1 } +// Driver_AllFiles_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AllFiles' +type Driver_AllFiles_Call struct { + *mock.Call +} + +// AllFiles is a helper method to define mock.On call +// - path string +func (_e *Driver_Expecter) AllFiles(path interface{}) *Driver_AllFiles_Call { + return &Driver_AllFiles_Call{Call: _e.mock.On("AllFiles", path)} +} + +func (_c *Driver_AllFiles_Call) Run(run func(path string)) *Driver_AllFiles_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Driver_AllFiles_Call) Return(_a0 []string, _a1 error) *Driver_AllFiles_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Driver_AllFiles_Call) RunAndReturn(run func(string) ([]string, error)) *Driver_AllFiles_Call { + _c.Call.Return(run) + return _c +} + // Copy provides a mock function with given fields: oldFile, newFile func (_m *Driver) Copy(oldFile string, newFile string) error { ret := _m.Called(oldFile, newFile) + if len(ret) == 0 { + panic("no return value specified for Copy") + } + var r0 error if rf, ok := ret.Get(0).(func(string, string) error); ok { r0 = rf(oldFile, newFile) @@ -82,6 +158,35 @@ func (_m *Driver) Copy(oldFile string, newFile string) error { return r0 } +// Driver_Copy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Copy' +type Driver_Copy_Call struct { + *mock.Call +} + +// Copy is a helper method to define mock.On call +// - oldFile string +// - newFile string +func (_e *Driver_Expecter) Copy(oldFile interface{}, newFile interface{}) *Driver_Copy_Call { + return &Driver_Copy_Call{Call: _e.mock.On("Copy", oldFile, newFile)} +} + +func (_c *Driver_Copy_Call) Run(run func(oldFile string, newFile string)) *Driver_Copy_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Driver_Copy_Call) Return(_a0 error) *Driver_Copy_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_Copy_Call) RunAndReturn(run func(string, string) error) *Driver_Copy_Call { + _c.Call.Return(run) + return _c +} + // Delete provides a mock function with given fields: file func (_m *Driver) Delete(file ...string) error { _va := make([]interface{}, len(file)) @@ -92,6 +197,10 @@ func (_m *Driver) Delete(file ...string) error { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + 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(file...) @@ -102,10 +211,49 @@ func (_m *Driver) Delete(file ...string) error { return r0 } +// Driver_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type Driver_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - file ...string +func (_e *Driver_Expecter) Delete(file ...interface{}) *Driver_Delete_Call { + return &Driver_Delete_Call{Call: _e.mock.On("Delete", + append([]interface{}{}, file...)...)} +} + +func (_c *Driver_Delete_Call) Run(run func(file ...string)) *Driver_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Driver_Delete_Call) Return(_a0 error) *Driver_Delete_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_Delete_Call) RunAndReturn(run func(...string) error) *Driver_Delete_Call { + _c.Call.Return(run) + return _c +} + // DeleteDirectory provides a mock function with given fields: directory func (_m *Driver) DeleteDirectory(directory string) error { ret := _m.Called(directory) + if len(ret) == 0 { + panic("no return value specified for DeleteDirectory") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(directory) @@ -116,10 +264,42 @@ func (_m *Driver) DeleteDirectory(directory string) error { return r0 } +// Driver_DeleteDirectory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteDirectory' +type Driver_DeleteDirectory_Call struct { + *mock.Call +} + +// DeleteDirectory is a helper method to define mock.On call +// - directory string +func (_e *Driver_Expecter) DeleteDirectory(directory interface{}) *Driver_DeleteDirectory_Call { + return &Driver_DeleteDirectory_Call{Call: _e.mock.On("DeleteDirectory", directory)} +} + +func (_c *Driver_DeleteDirectory_Call) Run(run func(directory string)) *Driver_DeleteDirectory_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Driver_DeleteDirectory_Call) Return(_a0 error) *Driver_DeleteDirectory_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_DeleteDirectory_Call) RunAndReturn(run func(string) error) *Driver_DeleteDirectory_Call { + _c.Call.Return(run) + return _c +} + // Directories provides a mock function with given fields: path func (_m *Driver) Directories(path string) ([]string, error) { ret := _m.Called(path) + if len(ret) == 0 { + panic("no return value specified for Directories") + } + var r0 []string var r1 error if rf, ok := ret.Get(0).(func(string) ([]string, error)); ok { @@ -142,10 +322,42 @@ func (_m *Driver) Directories(path string) ([]string, error) { return r0, r1 } +// Driver_Directories_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Directories' +type Driver_Directories_Call struct { + *mock.Call +} + +// Directories is a helper method to define mock.On call +// - path string +func (_e *Driver_Expecter) Directories(path interface{}) *Driver_Directories_Call { + return &Driver_Directories_Call{Call: _e.mock.On("Directories", path)} +} + +func (_c *Driver_Directories_Call) Run(run func(path string)) *Driver_Directories_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Driver_Directories_Call) Return(_a0 []string, _a1 error) *Driver_Directories_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Driver_Directories_Call) RunAndReturn(run func(string) ([]string, error)) *Driver_Directories_Call { + _c.Call.Return(run) + return _c +} + // Exists provides a mock function with given fields: file func (_m *Driver) Exists(file string) bool { ret := _m.Called(file) + if len(ret) == 0 { + panic("no return value specified for Exists") + } + var r0 bool if rf, ok := ret.Get(0).(func(string) bool); ok { r0 = rf(file) @@ -156,10 +368,42 @@ func (_m *Driver) Exists(file string) bool { return r0 } +// Driver_Exists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Exists' +type Driver_Exists_Call struct { + *mock.Call +} + +// Exists is a helper method to define mock.On call +// - file string +func (_e *Driver_Expecter) Exists(file interface{}) *Driver_Exists_Call { + return &Driver_Exists_Call{Call: _e.mock.On("Exists", file)} +} + +func (_c *Driver_Exists_Call) Run(run func(file string)) *Driver_Exists_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Driver_Exists_Call) Return(_a0 bool) *Driver_Exists_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_Exists_Call) RunAndReturn(run func(string) bool) *Driver_Exists_Call { + _c.Call.Return(run) + return _c +} + // Files provides a mock function with given fields: path func (_m *Driver) Files(path string) ([]string, error) { ret := _m.Called(path) + if len(ret) == 0 { + panic("no return value specified for Files") + } + var r0 []string var r1 error if rf, ok := ret.Get(0).(func(string) ([]string, error)); ok { @@ -182,10 +426,42 @@ func (_m *Driver) Files(path string) ([]string, error) { return r0, r1 } +// Driver_Files_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Files' +type Driver_Files_Call struct { + *mock.Call +} + +// Files is a helper method to define mock.On call +// - path string +func (_e *Driver_Expecter) Files(path interface{}) *Driver_Files_Call { + return &Driver_Files_Call{Call: _e.mock.On("Files", path)} +} + +func (_c *Driver_Files_Call) Run(run func(path string)) *Driver_Files_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Driver_Files_Call) Return(_a0 []string, _a1 error) *Driver_Files_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Driver_Files_Call) RunAndReturn(run func(string) ([]string, error)) *Driver_Files_Call { + _c.Call.Return(run) + return _c +} + // Get provides a mock function with given fields: file func (_m *Driver) Get(file string) (string, error) { ret := _m.Called(file) + if len(ret) == 0 { + panic("no return value specified for Get") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func(string) (string, error)); ok { @@ -206,10 +482,42 @@ func (_m *Driver) Get(file string) (string, error) { return r0, r1 } +// Driver_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type Driver_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - file string +func (_e *Driver_Expecter) Get(file interface{}) *Driver_Get_Call { + return &Driver_Get_Call{Call: _e.mock.On("Get", file)} +} + +func (_c *Driver_Get_Call) Run(run func(file string)) *Driver_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Driver_Get_Call) Return(_a0 string, _a1 error) *Driver_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Driver_Get_Call) RunAndReturn(run func(string) (string, error)) *Driver_Get_Call { + _c.Call.Return(run) + return _c +} + // GetBytes provides a mock function with given fields: file func (_m *Driver) GetBytes(file string) ([]byte, error) { ret := _m.Called(file) + if len(ret) == 0 { + panic("no return value specified for GetBytes") + } + var r0 []byte var r1 error if rf, ok := ret.Get(0).(func(string) ([]byte, error)); ok { @@ -232,10 +540,42 @@ func (_m *Driver) GetBytes(file string) ([]byte, error) { return r0, r1 } +// Driver_GetBytes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBytes' +type Driver_GetBytes_Call struct { + *mock.Call +} + +// GetBytes is a helper method to define mock.On call +// - file string +func (_e *Driver_Expecter) GetBytes(file interface{}) *Driver_GetBytes_Call { + return &Driver_GetBytes_Call{Call: _e.mock.On("GetBytes", file)} +} + +func (_c *Driver_GetBytes_Call) Run(run func(file string)) *Driver_GetBytes_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Driver_GetBytes_Call) Return(_a0 []byte, _a1 error) *Driver_GetBytes_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Driver_GetBytes_Call) RunAndReturn(run func(string) ([]byte, error)) *Driver_GetBytes_Call { + _c.Call.Return(run) + return _c +} + // LastModified provides a mock function with given fields: file func (_m *Driver) LastModified(file string) (time.Time, error) { ret := _m.Called(file) + if len(ret) == 0 { + panic("no return value specified for LastModified") + } + var r0 time.Time var r1 error if rf, ok := ret.Get(0).(func(string) (time.Time, error)); ok { @@ -256,10 +596,42 @@ func (_m *Driver) LastModified(file string) (time.Time, error) { return r0, r1 } +// Driver_LastModified_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LastModified' +type Driver_LastModified_Call struct { + *mock.Call +} + +// LastModified is a helper method to define mock.On call +// - file string +func (_e *Driver_Expecter) LastModified(file interface{}) *Driver_LastModified_Call { + return &Driver_LastModified_Call{Call: _e.mock.On("LastModified", file)} +} + +func (_c *Driver_LastModified_Call) Run(run func(file string)) *Driver_LastModified_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Driver_LastModified_Call) Return(_a0 time.Time, _a1 error) *Driver_LastModified_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Driver_LastModified_Call) RunAndReturn(run func(string) (time.Time, error)) *Driver_LastModified_Call { + _c.Call.Return(run) + return _c +} + // MakeDirectory provides a mock function with given fields: directory func (_m *Driver) MakeDirectory(directory string) error { ret := _m.Called(directory) + if len(ret) == 0 { + panic("no return value specified for MakeDirectory") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(directory) @@ -270,10 +642,42 @@ func (_m *Driver) MakeDirectory(directory string) error { return r0 } +// Driver_MakeDirectory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeDirectory' +type Driver_MakeDirectory_Call struct { + *mock.Call +} + +// MakeDirectory is a helper method to define mock.On call +// - directory string +func (_e *Driver_Expecter) MakeDirectory(directory interface{}) *Driver_MakeDirectory_Call { + return &Driver_MakeDirectory_Call{Call: _e.mock.On("MakeDirectory", directory)} +} + +func (_c *Driver_MakeDirectory_Call) Run(run func(directory string)) *Driver_MakeDirectory_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Driver_MakeDirectory_Call) Return(_a0 error) *Driver_MakeDirectory_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_MakeDirectory_Call) RunAndReturn(run func(string) error) *Driver_MakeDirectory_Call { + _c.Call.Return(run) + return _c +} + // MimeType provides a mock function with given fields: file func (_m *Driver) MimeType(file string) (string, error) { ret := _m.Called(file) + if len(ret) == 0 { + panic("no return value specified for MimeType") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func(string) (string, error)); ok { @@ -294,10 +698,42 @@ func (_m *Driver) MimeType(file string) (string, error) { return r0, r1 } +// Driver_MimeType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MimeType' +type Driver_MimeType_Call struct { + *mock.Call +} + +// MimeType is a helper method to define mock.On call +// - file string +func (_e *Driver_Expecter) MimeType(file interface{}) *Driver_MimeType_Call { + return &Driver_MimeType_Call{Call: _e.mock.On("MimeType", file)} +} + +func (_c *Driver_MimeType_Call) Run(run func(file string)) *Driver_MimeType_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Driver_MimeType_Call) Return(_a0 string, _a1 error) *Driver_MimeType_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Driver_MimeType_Call) RunAndReturn(run func(string) (string, error)) *Driver_MimeType_Call { + _c.Call.Return(run) + return _c +} + // Missing provides a mock function with given fields: file func (_m *Driver) Missing(file string) bool { ret := _m.Called(file) + if len(ret) == 0 { + panic("no return value specified for Missing") + } + var r0 bool if rf, ok := ret.Get(0).(func(string) bool); ok { r0 = rf(file) @@ -308,10 +744,42 @@ func (_m *Driver) Missing(file string) bool { return r0 } +// Driver_Missing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Missing' +type Driver_Missing_Call struct { + *mock.Call +} + +// Missing is a helper method to define mock.On call +// - file string +func (_e *Driver_Expecter) Missing(file interface{}) *Driver_Missing_Call { + return &Driver_Missing_Call{Call: _e.mock.On("Missing", file)} +} + +func (_c *Driver_Missing_Call) Run(run func(file string)) *Driver_Missing_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Driver_Missing_Call) Return(_a0 bool) *Driver_Missing_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_Missing_Call) RunAndReturn(run func(string) bool) *Driver_Missing_Call { + _c.Call.Return(run) + return _c +} + // Move provides a mock function with given fields: oldFile, newFile func (_m *Driver) Move(oldFile string, newFile string) error { ret := _m.Called(oldFile, newFile) + if len(ret) == 0 { + panic("no return value specified for Move") + } + var r0 error if rf, ok := ret.Get(0).(func(string, string) error); ok { r0 = rf(oldFile, newFile) @@ -322,10 +790,43 @@ func (_m *Driver) Move(oldFile string, newFile string) error { return r0 } +// Driver_Move_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Move' +type Driver_Move_Call struct { + *mock.Call +} + +// Move is a helper method to define mock.On call +// - oldFile string +// - newFile string +func (_e *Driver_Expecter) Move(oldFile interface{}, newFile interface{}) *Driver_Move_Call { + return &Driver_Move_Call{Call: _e.mock.On("Move", oldFile, newFile)} +} + +func (_c *Driver_Move_Call) Run(run func(oldFile string, newFile string)) *Driver_Move_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Driver_Move_Call) Return(_a0 error) *Driver_Move_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_Move_Call) RunAndReturn(run func(string, string) error) *Driver_Move_Call { + _c.Call.Return(run) + return _c +} + // Path provides a mock function with given fields: file func (_m *Driver) Path(file string) string { ret := _m.Called(file) + if len(ret) == 0 { + panic("no return value specified for Path") + } + var r0 string if rf, ok := ret.Get(0).(func(string) string); ok { r0 = rf(file) @@ -336,10 +837,42 @@ func (_m *Driver) Path(file string) string { return r0 } +// Driver_Path_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Path' +type Driver_Path_Call struct { + *mock.Call +} + +// Path is a helper method to define mock.On call +// - file string +func (_e *Driver_Expecter) Path(file interface{}) *Driver_Path_Call { + return &Driver_Path_Call{Call: _e.mock.On("Path", file)} +} + +func (_c *Driver_Path_Call) Run(run func(file string)) *Driver_Path_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Driver_Path_Call) Return(_a0 string) *Driver_Path_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_Path_Call) RunAndReturn(run func(string) string) *Driver_Path_Call { + _c.Call.Return(run) + return _c +} + // Put provides a mock function with given fields: file, content func (_m *Driver) Put(file string, content string) error { ret := _m.Called(file, content) + if len(ret) == 0 { + panic("no return value specified for Put") + } + var r0 error if rf, ok := ret.Get(0).(func(string, string) error); ok { r0 = rf(file, content) @@ -350,10 +883,43 @@ func (_m *Driver) Put(file string, content string) error { return r0 } +// Driver_Put_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Put' +type Driver_Put_Call struct { + *mock.Call +} + +// Put is a helper method to define mock.On call +// - file string +// - content string +func (_e *Driver_Expecter) Put(file interface{}, content interface{}) *Driver_Put_Call { + return &Driver_Put_Call{Call: _e.mock.On("Put", file, content)} +} + +func (_c *Driver_Put_Call) Run(run func(file string, content string)) *Driver_Put_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Driver_Put_Call) Return(_a0 error) *Driver_Put_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_Put_Call) RunAndReturn(run func(string, string) error) *Driver_Put_Call { + _c.Call.Return(run) + return _c +} + // PutFile provides a mock function with given fields: path, source func (_m *Driver) PutFile(path string, source filesystem.File) (string, error) { ret := _m.Called(path, source) + if len(ret) == 0 { + panic("no return value specified for PutFile") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func(string, filesystem.File) (string, error)); ok { @@ -374,10 +940,43 @@ func (_m *Driver) PutFile(path string, source filesystem.File) (string, error) { return r0, r1 } +// Driver_PutFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PutFile' +type Driver_PutFile_Call struct { + *mock.Call +} + +// PutFile is a helper method to define mock.On call +// - path string +// - source filesystem.File +func (_e *Driver_Expecter) PutFile(path interface{}, source interface{}) *Driver_PutFile_Call { + return &Driver_PutFile_Call{Call: _e.mock.On("PutFile", path, source)} +} + +func (_c *Driver_PutFile_Call) Run(run func(path string, source filesystem.File)) *Driver_PutFile_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(filesystem.File)) + }) + return _c +} + +func (_c *Driver_PutFile_Call) Return(_a0 string, _a1 error) *Driver_PutFile_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Driver_PutFile_Call) RunAndReturn(run func(string, filesystem.File) (string, error)) *Driver_PutFile_Call { + _c.Call.Return(run) + return _c +} + // PutFileAs provides a mock function with given fields: path, source, name func (_m *Driver) PutFileAs(path string, source filesystem.File, name string) (string, error) { ret := _m.Called(path, source, name) + if len(ret) == 0 { + panic("no return value specified for PutFileAs") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func(string, filesystem.File, string) (string, error)); ok { @@ -398,10 +997,44 @@ func (_m *Driver) PutFileAs(path string, source filesystem.File, name string) (s return r0, r1 } +// Driver_PutFileAs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PutFileAs' +type Driver_PutFileAs_Call struct { + *mock.Call +} + +// PutFileAs is a helper method to define mock.On call +// - path string +// - source filesystem.File +// - name string +func (_e *Driver_Expecter) PutFileAs(path interface{}, source interface{}, name interface{}) *Driver_PutFileAs_Call { + return &Driver_PutFileAs_Call{Call: _e.mock.On("PutFileAs", path, source, name)} +} + +func (_c *Driver_PutFileAs_Call) Run(run func(path string, source filesystem.File, name string)) *Driver_PutFileAs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(filesystem.File), args[2].(string)) + }) + return _c +} + +func (_c *Driver_PutFileAs_Call) Return(_a0 string, _a1 error) *Driver_PutFileAs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Driver_PutFileAs_Call) RunAndReturn(run func(string, filesystem.File, string) (string, error)) *Driver_PutFileAs_Call { + _c.Call.Return(run) + return _c +} + // Size provides a mock function with given fields: file func (_m *Driver) Size(file string) (int64, error) { ret := _m.Called(file) + if len(ret) == 0 { + panic("no return value specified for Size") + } + var r0 int64 var r1 error if rf, ok := ret.Get(0).(func(string) (int64, error)); ok { @@ -422,10 +1055,42 @@ func (_m *Driver) Size(file string) (int64, error) { return r0, r1 } +// Driver_Size_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Size' +type Driver_Size_Call struct { + *mock.Call +} + +// Size is a helper method to define mock.On call +// - file string +func (_e *Driver_Expecter) Size(file interface{}) *Driver_Size_Call { + return &Driver_Size_Call{Call: _e.mock.On("Size", file)} +} + +func (_c *Driver_Size_Call) Run(run func(file string)) *Driver_Size_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Driver_Size_Call) Return(_a0 int64, _a1 error) *Driver_Size_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Driver_Size_Call) RunAndReturn(run func(string) (int64, error)) *Driver_Size_Call { + _c.Call.Return(run) + return _c +} + // TemporaryUrl provides a mock function with given fields: file, _a1 func (_m *Driver) TemporaryUrl(file string, _a1 time.Time) (string, error) { ret := _m.Called(file, _a1) + if len(ret) == 0 { + panic("no return value specified for TemporaryUrl") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func(string, time.Time) (string, error)); ok { @@ -446,10 +1111,43 @@ func (_m *Driver) TemporaryUrl(file string, _a1 time.Time) (string, error) { return r0, r1 } +// Driver_TemporaryUrl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TemporaryUrl' +type Driver_TemporaryUrl_Call struct { + *mock.Call +} + +// TemporaryUrl is a helper method to define mock.On call +// - file string +// - _a1 time.Time +func (_e *Driver_Expecter) TemporaryUrl(file interface{}, _a1 interface{}) *Driver_TemporaryUrl_Call { + return &Driver_TemporaryUrl_Call{Call: _e.mock.On("TemporaryUrl", file, _a1)} +} + +func (_c *Driver_TemporaryUrl_Call) Run(run func(file string, _a1 time.Time)) *Driver_TemporaryUrl_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(time.Time)) + }) + return _c +} + +func (_c *Driver_TemporaryUrl_Call) Return(_a0 string, _a1 error) *Driver_TemporaryUrl_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Driver_TemporaryUrl_Call) RunAndReturn(run func(string, time.Time) (string, error)) *Driver_TemporaryUrl_Call { + _c.Call.Return(run) + return _c +} + // Url provides a mock function with given fields: file func (_m *Driver) Url(file string) string { ret := _m.Called(file) + if len(ret) == 0 { + panic("no return value specified for Url") + } + var r0 string if rf, ok := ret.Get(0).(func(string) string); ok { r0 = rf(file) @@ -460,10 +1158,42 @@ func (_m *Driver) Url(file string) string { return r0 } +// Driver_Url_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Url' +type Driver_Url_Call struct { + *mock.Call +} + +// Url is a helper method to define mock.On call +// - file string +func (_e *Driver_Expecter) Url(file interface{}) *Driver_Url_Call { + return &Driver_Url_Call{Call: _e.mock.On("Url", file)} +} + +func (_c *Driver_Url_Call) Run(run func(file string)) *Driver_Url_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Driver_Url_Call) Return(_a0 string) *Driver_Url_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_Url_Call) RunAndReturn(run func(string) string) *Driver_Url_Call { + _c.Call.Return(run) + return _c +} + // WithContext provides a mock function with given fields: ctx func (_m *Driver) WithContext(ctx context.Context) filesystem.Driver { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for WithContext") + } + var r0 filesystem.Driver if rf, ok := ret.Get(0).(func(context.Context) filesystem.Driver); ok { r0 = rf(ctx) @@ -476,6 +1206,34 @@ func (_m *Driver) WithContext(ctx context.Context) filesystem.Driver { return r0 } +// Driver_WithContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithContext' +type Driver_WithContext_Call struct { + *mock.Call +} + +// WithContext is a helper method to define mock.On call +// - ctx context.Context +func (_e *Driver_Expecter) WithContext(ctx interface{}) *Driver_WithContext_Call { + return &Driver_WithContext_Call{Call: _e.mock.On("WithContext", ctx)} +} + +func (_c *Driver_WithContext_Call) Run(run func(ctx context.Context)) *Driver_WithContext_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Driver_WithContext_Call) Return(_a0 filesystem.Driver) *Driver_WithContext_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_WithContext_Call) RunAndReturn(run func(context.Context) filesystem.Driver) *Driver_WithContext_Call { + _c.Call.Return(run) + return _c +} + // NewDriver creates a new instance of Driver. 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 NewDriver(t interface { diff --git a/mocks/filesystem/File.go b/mocks/filesystem/File.go index 1006644cc..f08842242 100644 --- a/mocks/filesystem/File.go +++ b/mocks/filesystem/File.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -14,10 +14,22 @@ type File struct { mock.Mock } +type File_Expecter struct { + mock *mock.Mock +} + +func (_m *File) EXPECT() *File_Expecter { + return &File_Expecter{mock: &_m.Mock} +} + // Disk provides a mock function with given fields: disk func (_m *File) Disk(disk string) filesystem.File { ret := _m.Called(disk) + if len(ret) == 0 { + panic("no return value specified for Disk") + } + var r0 filesystem.File if rf, ok := ret.Get(0).(func(string) filesystem.File); ok { r0 = rf(disk) @@ -30,10 +42,42 @@ func (_m *File) Disk(disk string) filesystem.File { return r0 } +// File_Disk_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Disk' +type File_Disk_Call struct { + *mock.Call +} + +// Disk is a helper method to define mock.On call +// - disk string +func (_e *File_Expecter) Disk(disk interface{}) *File_Disk_Call { + return &File_Disk_Call{Call: _e.mock.On("Disk", disk)} +} + +func (_c *File_Disk_Call) Run(run func(disk string)) *File_Disk_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *File_Disk_Call) Return(_a0 filesystem.File) *File_Disk_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *File_Disk_Call) RunAndReturn(run func(string) filesystem.File) *File_Disk_Call { + _c.Call.Return(run) + return _c +} + // Extension provides a mock function with given fields: func (_m *File) Extension() (string, error) { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Extension") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func() (string, error)); ok { @@ -54,10 +98,41 @@ func (_m *File) Extension() (string, error) { return r0, r1 } +// File_Extension_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Extension' +type File_Extension_Call struct { + *mock.Call +} + +// Extension is a helper method to define mock.On call +func (_e *File_Expecter) Extension() *File_Extension_Call { + return &File_Extension_Call{Call: _e.mock.On("Extension")} +} + +func (_c *File_Extension_Call) Run(run func()) *File_Extension_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *File_Extension_Call) Return(_a0 string, _a1 error) *File_Extension_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *File_Extension_Call) RunAndReturn(run func() (string, error)) *File_Extension_Call { + _c.Call.Return(run) + return _c +} + // File provides a mock function with given fields: func (_m *File) File() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for File") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -68,10 +143,41 @@ func (_m *File) File() string { return r0 } +// File_File_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'File' +type File_File_Call struct { + *mock.Call +} + +// File is a helper method to define mock.On call +func (_e *File_Expecter) File() *File_File_Call { + return &File_File_Call{Call: _e.mock.On("File")} +} + +func (_c *File_File_Call) Run(run func()) *File_File_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *File_File_Call) Return(_a0 string) *File_File_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *File_File_Call) RunAndReturn(run func() string) *File_File_Call { + _c.Call.Return(run) + return _c +} + // GetClientOriginalExtension provides a mock function with given fields: func (_m *File) GetClientOriginalExtension() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for GetClientOriginalExtension") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -82,10 +188,41 @@ func (_m *File) GetClientOriginalExtension() string { return r0 } +// File_GetClientOriginalExtension_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetClientOriginalExtension' +type File_GetClientOriginalExtension_Call struct { + *mock.Call +} + +// GetClientOriginalExtension is a helper method to define mock.On call +func (_e *File_Expecter) GetClientOriginalExtension() *File_GetClientOriginalExtension_Call { + return &File_GetClientOriginalExtension_Call{Call: _e.mock.On("GetClientOriginalExtension")} +} + +func (_c *File_GetClientOriginalExtension_Call) Run(run func()) *File_GetClientOriginalExtension_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *File_GetClientOriginalExtension_Call) Return(_a0 string) *File_GetClientOriginalExtension_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *File_GetClientOriginalExtension_Call) RunAndReturn(run func() string) *File_GetClientOriginalExtension_Call { + _c.Call.Return(run) + return _c +} + // GetClientOriginalName provides a mock function with given fields: func (_m *File) GetClientOriginalName() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for GetClientOriginalName") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -96,6 +233,33 @@ func (_m *File) GetClientOriginalName() string { return r0 } +// File_GetClientOriginalName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetClientOriginalName' +type File_GetClientOriginalName_Call struct { + *mock.Call +} + +// GetClientOriginalName is a helper method to define mock.On call +func (_e *File_Expecter) GetClientOriginalName() *File_GetClientOriginalName_Call { + return &File_GetClientOriginalName_Call{Call: _e.mock.On("GetClientOriginalName")} +} + +func (_c *File_GetClientOriginalName_Call) Run(run func()) *File_GetClientOriginalName_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *File_GetClientOriginalName_Call) Return(_a0 string) *File_GetClientOriginalName_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *File_GetClientOriginalName_Call) RunAndReturn(run func() string) *File_GetClientOriginalName_Call { + _c.Call.Return(run) + return _c +} + // HashName provides a mock function with given fields: path func (_m *File) HashName(path ...string) string { _va := make([]interface{}, len(path)) @@ -106,6 +270,10 @@ func (_m *File) HashName(path ...string) string { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for HashName") + } + var r0 string if rf, ok := ret.Get(0).(func(...string) string); ok { r0 = rf(path...) @@ -116,10 +284,49 @@ func (_m *File) HashName(path ...string) string { return r0 } +// File_HashName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HashName' +type File_HashName_Call struct { + *mock.Call +} + +// HashName is a helper method to define mock.On call +// - path ...string +func (_e *File_Expecter) HashName(path ...interface{}) *File_HashName_Call { + return &File_HashName_Call{Call: _e.mock.On("HashName", + append([]interface{}{}, path...)...)} +} + +func (_c *File_HashName_Call) Run(run func(path ...string)) *File_HashName_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *File_HashName_Call) Return(_a0 string) *File_HashName_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *File_HashName_Call) RunAndReturn(run func(...string) string) *File_HashName_Call { + _c.Call.Return(run) + return _c +} + // LastModified provides a mock function with given fields: func (_m *File) LastModified() (time.Time, error) { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for LastModified") + } + var r0 time.Time var r1 error if rf, ok := ret.Get(0).(func() (time.Time, error)); ok { @@ -140,10 +347,41 @@ func (_m *File) LastModified() (time.Time, error) { return r0, r1 } +// File_LastModified_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LastModified' +type File_LastModified_Call struct { + *mock.Call +} + +// LastModified is a helper method to define mock.On call +func (_e *File_Expecter) LastModified() *File_LastModified_Call { + return &File_LastModified_Call{Call: _e.mock.On("LastModified")} +} + +func (_c *File_LastModified_Call) Run(run func()) *File_LastModified_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *File_LastModified_Call) Return(_a0 time.Time, _a1 error) *File_LastModified_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *File_LastModified_Call) RunAndReturn(run func() (time.Time, error)) *File_LastModified_Call { + _c.Call.Return(run) + return _c +} + // MimeType provides a mock function with given fields: func (_m *File) MimeType() (string, error) { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MimeType") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func() (string, error)); ok { @@ -164,10 +402,41 @@ func (_m *File) MimeType() (string, error) { return r0, r1 } +// File_MimeType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MimeType' +type File_MimeType_Call struct { + *mock.Call +} + +// MimeType is a helper method to define mock.On call +func (_e *File_Expecter) MimeType() *File_MimeType_Call { + return &File_MimeType_Call{Call: _e.mock.On("MimeType")} +} + +func (_c *File_MimeType_Call) Run(run func()) *File_MimeType_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *File_MimeType_Call) Return(_a0 string, _a1 error) *File_MimeType_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *File_MimeType_Call) RunAndReturn(run func() (string, error)) *File_MimeType_Call { + _c.Call.Return(run) + return _c +} + // Size provides a mock function with given fields: func (_m *File) Size() (int64, error) { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Size") + } + var r0 int64 var r1 error if rf, ok := ret.Get(0).(func() (int64, error)); ok { @@ -188,10 +457,41 @@ func (_m *File) Size() (int64, error) { return r0, r1 } +// File_Size_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Size' +type File_Size_Call struct { + *mock.Call +} + +// Size is a helper method to define mock.On call +func (_e *File_Expecter) Size() *File_Size_Call { + return &File_Size_Call{Call: _e.mock.On("Size")} +} + +func (_c *File_Size_Call) Run(run func()) *File_Size_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *File_Size_Call) Return(_a0 int64, _a1 error) *File_Size_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *File_Size_Call) RunAndReturn(run func() (int64, error)) *File_Size_Call { + _c.Call.Return(run) + return _c +} + // Store provides a mock function with given fields: path func (_m *File) Store(path string) (string, error) { ret := _m.Called(path) + if len(ret) == 0 { + panic("no return value specified for Store") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func(string) (string, error)); ok { @@ -212,10 +512,42 @@ func (_m *File) Store(path string) (string, error) { return r0, r1 } +// File_Store_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Store' +type File_Store_Call struct { + *mock.Call +} + +// Store is a helper method to define mock.On call +// - path string +func (_e *File_Expecter) Store(path interface{}) *File_Store_Call { + return &File_Store_Call{Call: _e.mock.On("Store", path)} +} + +func (_c *File_Store_Call) Run(run func(path string)) *File_Store_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *File_Store_Call) Return(_a0 string, _a1 error) *File_Store_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *File_Store_Call) RunAndReturn(run func(string) (string, error)) *File_Store_Call { + _c.Call.Return(run) + return _c +} + // StoreAs provides a mock function with given fields: path, name func (_m *File) StoreAs(path string, name string) (string, error) { ret := _m.Called(path, name) + if len(ret) == 0 { + panic("no return value specified for StoreAs") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func(string, string) (string, error)); ok { @@ -236,6 +568,35 @@ func (_m *File) StoreAs(path string, name string) (string, error) { return r0, r1 } +// File_StoreAs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StoreAs' +type File_StoreAs_Call struct { + *mock.Call +} + +// StoreAs is a helper method to define mock.On call +// - path string +// - name string +func (_e *File_Expecter) StoreAs(path interface{}, name interface{}) *File_StoreAs_Call { + return &File_StoreAs_Call{Call: _e.mock.On("StoreAs", path, name)} +} + +func (_c *File_StoreAs_Call) Run(run func(path string, name string)) *File_StoreAs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *File_StoreAs_Call) Return(_a0 string, _a1 error) *File_StoreAs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *File_StoreAs_Call) RunAndReturn(run func(string, string) (string, error)) *File_StoreAs_Call { + _c.Call.Return(run) + return _c +} + // NewFile creates a new instance of File. 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 NewFile(t interface { diff --git a/mocks/filesystem/Storage.go b/mocks/filesystem/Storage.go index b31b7f8c3..6372d77fa 100644 --- a/mocks/filesystem/Storage.go +++ b/mocks/filesystem/Storage.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -16,10 +16,22 @@ type Storage struct { mock.Mock } +type Storage_Expecter struct { + mock *mock.Mock +} + +func (_m *Storage) EXPECT() *Storage_Expecter { + return &Storage_Expecter{mock: &_m.Mock} +} + // AllDirectories provides a mock function with given fields: path func (_m *Storage) AllDirectories(path string) ([]string, error) { ret := _m.Called(path) + if len(ret) == 0 { + panic("no return value specified for AllDirectories") + } + var r0 []string var r1 error if rf, ok := ret.Get(0).(func(string) ([]string, error)); ok { @@ -42,10 +54,42 @@ func (_m *Storage) AllDirectories(path string) ([]string, error) { return r0, r1 } +// Storage_AllDirectories_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AllDirectories' +type Storage_AllDirectories_Call struct { + *mock.Call +} + +// AllDirectories is a helper method to define mock.On call +// - path string +func (_e *Storage_Expecter) AllDirectories(path interface{}) *Storage_AllDirectories_Call { + return &Storage_AllDirectories_Call{Call: _e.mock.On("AllDirectories", path)} +} + +func (_c *Storage_AllDirectories_Call) Run(run func(path string)) *Storage_AllDirectories_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Storage_AllDirectories_Call) Return(_a0 []string, _a1 error) *Storage_AllDirectories_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Storage_AllDirectories_Call) RunAndReturn(run func(string) ([]string, error)) *Storage_AllDirectories_Call { + _c.Call.Return(run) + return _c +} + // AllFiles provides a mock function with given fields: path func (_m *Storage) AllFiles(path string) ([]string, error) { ret := _m.Called(path) + if len(ret) == 0 { + panic("no return value specified for AllFiles") + } + var r0 []string var r1 error if rf, ok := ret.Get(0).(func(string) ([]string, error)); ok { @@ -68,10 +112,42 @@ func (_m *Storage) AllFiles(path string) ([]string, error) { return r0, r1 } +// Storage_AllFiles_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AllFiles' +type Storage_AllFiles_Call struct { + *mock.Call +} + +// AllFiles is a helper method to define mock.On call +// - path string +func (_e *Storage_Expecter) AllFiles(path interface{}) *Storage_AllFiles_Call { + return &Storage_AllFiles_Call{Call: _e.mock.On("AllFiles", path)} +} + +func (_c *Storage_AllFiles_Call) Run(run func(path string)) *Storage_AllFiles_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Storage_AllFiles_Call) Return(_a0 []string, _a1 error) *Storage_AllFiles_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Storage_AllFiles_Call) RunAndReturn(run func(string) ([]string, error)) *Storage_AllFiles_Call { + _c.Call.Return(run) + return _c +} + // Copy provides a mock function with given fields: oldFile, newFile func (_m *Storage) Copy(oldFile string, newFile string) error { ret := _m.Called(oldFile, newFile) + if len(ret) == 0 { + panic("no return value specified for Copy") + } + var r0 error if rf, ok := ret.Get(0).(func(string, string) error); ok { r0 = rf(oldFile, newFile) @@ -82,6 +158,35 @@ func (_m *Storage) Copy(oldFile string, newFile string) error { return r0 } +// Storage_Copy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Copy' +type Storage_Copy_Call struct { + *mock.Call +} + +// Copy is a helper method to define mock.On call +// - oldFile string +// - newFile string +func (_e *Storage_Expecter) Copy(oldFile interface{}, newFile interface{}) *Storage_Copy_Call { + return &Storage_Copy_Call{Call: _e.mock.On("Copy", oldFile, newFile)} +} + +func (_c *Storage_Copy_Call) Run(run func(oldFile string, newFile string)) *Storage_Copy_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Storage_Copy_Call) Return(_a0 error) *Storage_Copy_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Storage_Copy_Call) RunAndReturn(run func(string, string) error) *Storage_Copy_Call { + _c.Call.Return(run) + return _c +} + // Delete provides a mock function with given fields: file func (_m *Storage) Delete(file ...string) error { _va := make([]interface{}, len(file)) @@ -92,6 +197,10 @@ func (_m *Storage) Delete(file ...string) error { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + 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(file...) @@ -102,10 +211,49 @@ func (_m *Storage) Delete(file ...string) error { return r0 } +// Storage_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type Storage_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - file ...string +func (_e *Storage_Expecter) Delete(file ...interface{}) *Storage_Delete_Call { + return &Storage_Delete_Call{Call: _e.mock.On("Delete", + append([]interface{}{}, file...)...)} +} + +func (_c *Storage_Delete_Call) Run(run func(file ...string)) *Storage_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Storage_Delete_Call) Return(_a0 error) *Storage_Delete_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Storage_Delete_Call) RunAndReturn(run func(...string) error) *Storage_Delete_Call { + _c.Call.Return(run) + return _c +} + // DeleteDirectory provides a mock function with given fields: directory func (_m *Storage) DeleteDirectory(directory string) error { ret := _m.Called(directory) + if len(ret) == 0 { + panic("no return value specified for DeleteDirectory") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(directory) @@ -116,10 +264,42 @@ func (_m *Storage) DeleteDirectory(directory string) error { return r0 } +// Storage_DeleteDirectory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteDirectory' +type Storage_DeleteDirectory_Call struct { + *mock.Call +} + +// DeleteDirectory is a helper method to define mock.On call +// - directory string +func (_e *Storage_Expecter) DeleteDirectory(directory interface{}) *Storage_DeleteDirectory_Call { + return &Storage_DeleteDirectory_Call{Call: _e.mock.On("DeleteDirectory", directory)} +} + +func (_c *Storage_DeleteDirectory_Call) Run(run func(directory string)) *Storage_DeleteDirectory_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Storage_DeleteDirectory_Call) Return(_a0 error) *Storage_DeleteDirectory_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Storage_DeleteDirectory_Call) RunAndReturn(run func(string) error) *Storage_DeleteDirectory_Call { + _c.Call.Return(run) + return _c +} + // Directories provides a mock function with given fields: path func (_m *Storage) Directories(path string) ([]string, error) { ret := _m.Called(path) + if len(ret) == 0 { + panic("no return value specified for Directories") + } + var r0 []string var r1 error if rf, ok := ret.Get(0).(func(string) ([]string, error)); ok { @@ -142,10 +322,42 @@ func (_m *Storage) Directories(path string) ([]string, error) { return r0, r1 } +// Storage_Directories_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Directories' +type Storage_Directories_Call struct { + *mock.Call +} + +// Directories is a helper method to define mock.On call +// - path string +func (_e *Storage_Expecter) Directories(path interface{}) *Storage_Directories_Call { + return &Storage_Directories_Call{Call: _e.mock.On("Directories", path)} +} + +func (_c *Storage_Directories_Call) Run(run func(path string)) *Storage_Directories_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Storage_Directories_Call) Return(_a0 []string, _a1 error) *Storage_Directories_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Storage_Directories_Call) RunAndReturn(run func(string) ([]string, error)) *Storage_Directories_Call { + _c.Call.Return(run) + return _c +} + // Disk provides a mock function with given fields: disk func (_m *Storage) Disk(disk string) filesystem.Driver { ret := _m.Called(disk) + if len(ret) == 0 { + panic("no return value specified for Disk") + } + var r0 filesystem.Driver if rf, ok := ret.Get(0).(func(string) filesystem.Driver); ok { r0 = rf(disk) @@ -158,10 +370,42 @@ func (_m *Storage) Disk(disk string) filesystem.Driver { return r0 } +// Storage_Disk_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Disk' +type Storage_Disk_Call struct { + *mock.Call +} + +// Disk is a helper method to define mock.On call +// - disk string +func (_e *Storage_Expecter) Disk(disk interface{}) *Storage_Disk_Call { + return &Storage_Disk_Call{Call: _e.mock.On("Disk", disk)} +} + +func (_c *Storage_Disk_Call) Run(run func(disk string)) *Storage_Disk_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Storage_Disk_Call) Return(_a0 filesystem.Driver) *Storage_Disk_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Storage_Disk_Call) RunAndReturn(run func(string) filesystem.Driver) *Storage_Disk_Call { + _c.Call.Return(run) + return _c +} + // Exists provides a mock function with given fields: file func (_m *Storage) Exists(file string) bool { ret := _m.Called(file) + if len(ret) == 0 { + panic("no return value specified for Exists") + } + var r0 bool if rf, ok := ret.Get(0).(func(string) bool); ok { r0 = rf(file) @@ -172,10 +416,42 @@ func (_m *Storage) Exists(file string) bool { return r0 } +// Storage_Exists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Exists' +type Storage_Exists_Call struct { + *mock.Call +} + +// Exists is a helper method to define mock.On call +// - file string +func (_e *Storage_Expecter) Exists(file interface{}) *Storage_Exists_Call { + return &Storage_Exists_Call{Call: _e.mock.On("Exists", file)} +} + +func (_c *Storage_Exists_Call) Run(run func(file string)) *Storage_Exists_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Storage_Exists_Call) Return(_a0 bool) *Storage_Exists_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Storage_Exists_Call) RunAndReturn(run func(string) bool) *Storage_Exists_Call { + _c.Call.Return(run) + return _c +} + // Files provides a mock function with given fields: path func (_m *Storage) Files(path string) ([]string, error) { ret := _m.Called(path) + if len(ret) == 0 { + panic("no return value specified for Files") + } + var r0 []string var r1 error if rf, ok := ret.Get(0).(func(string) ([]string, error)); ok { @@ -198,10 +474,42 @@ func (_m *Storage) Files(path string) ([]string, error) { return r0, r1 } +// Storage_Files_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Files' +type Storage_Files_Call struct { + *mock.Call +} + +// Files is a helper method to define mock.On call +// - path string +func (_e *Storage_Expecter) Files(path interface{}) *Storage_Files_Call { + return &Storage_Files_Call{Call: _e.mock.On("Files", path)} +} + +func (_c *Storage_Files_Call) Run(run func(path string)) *Storage_Files_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Storage_Files_Call) Return(_a0 []string, _a1 error) *Storage_Files_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Storage_Files_Call) RunAndReturn(run func(string) ([]string, error)) *Storage_Files_Call { + _c.Call.Return(run) + return _c +} + // Get provides a mock function with given fields: file func (_m *Storage) Get(file string) (string, error) { ret := _m.Called(file) + if len(ret) == 0 { + panic("no return value specified for Get") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func(string) (string, error)); ok { @@ -222,10 +530,42 @@ func (_m *Storage) Get(file string) (string, error) { return r0, r1 } +// Storage_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type Storage_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - file string +func (_e *Storage_Expecter) Get(file interface{}) *Storage_Get_Call { + return &Storage_Get_Call{Call: _e.mock.On("Get", file)} +} + +func (_c *Storage_Get_Call) Run(run func(file string)) *Storage_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Storage_Get_Call) Return(_a0 string, _a1 error) *Storage_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Storage_Get_Call) RunAndReturn(run func(string) (string, error)) *Storage_Get_Call { + _c.Call.Return(run) + return _c +} + // GetBytes provides a mock function with given fields: file func (_m *Storage) GetBytes(file string) ([]byte, error) { ret := _m.Called(file) + if len(ret) == 0 { + panic("no return value specified for GetBytes") + } + var r0 []byte var r1 error if rf, ok := ret.Get(0).(func(string) ([]byte, error)); ok { @@ -248,10 +588,42 @@ func (_m *Storage) GetBytes(file string) ([]byte, error) { return r0, r1 } +// Storage_GetBytes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBytes' +type Storage_GetBytes_Call struct { + *mock.Call +} + +// GetBytes is a helper method to define mock.On call +// - file string +func (_e *Storage_Expecter) GetBytes(file interface{}) *Storage_GetBytes_Call { + return &Storage_GetBytes_Call{Call: _e.mock.On("GetBytes", file)} +} + +func (_c *Storage_GetBytes_Call) Run(run func(file string)) *Storage_GetBytes_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Storage_GetBytes_Call) Return(_a0 []byte, _a1 error) *Storage_GetBytes_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Storage_GetBytes_Call) RunAndReturn(run func(string) ([]byte, error)) *Storage_GetBytes_Call { + _c.Call.Return(run) + return _c +} + // LastModified provides a mock function with given fields: file func (_m *Storage) LastModified(file string) (time.Time, error) { ret := _m.Called(file) + if len(ret) == 0 { + panic("no return value specified for LastModified") + } + var r0 time.Time var r1 error if rf, ok := ret.Get(0).(func(string) (time.Time, error)); ok { @@ -272,10 +644,42 @@ func (_m *Storage) LastModified(file string) (time.Time, error) { return r0, r1 } +// Storage_LastModified_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LastModified' +type Storage_LastModified_Call struct { + *mock.Call +} + +// LastModified is a helper method to define mock.On call +// - file string +func (_e *Storage_Expecter) LastModified(file interface{}) *Storage_LastModified_Call { + return &Storage_LastModified_Call{Call: _e.mock.On("LastModified", file)} +} + +func (_c *Storage_LastModified_Call) Run(run func(file string)) *Storage_LastModified_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Storage_LastModified_Call) Return(_a0 time.Time, _a1 error) *Storage_LastModified_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Storage_LastModified_Call) RunAndReturn(run func(string) (time.Time, error)) *Storage_LastModified_Call { + _c.Call.Return(run) + return _c +} + // MakeDirectory provides a mock function with given fields: directory func (_m *Storage) MakeDirectory(directory string) error { ret := _m.Called(directory) + if len(ret) == 0 { + panic("no return value specified for MakeDirectory") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(directory) @@ -286,10 +690,42 @@ func (_m *Storage) MakeDirectory(directory string) error { return r0 } +// Storage_MakeDirectory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeDirectory' +type Storage_MakeDirectory_Call struct { + *mock.Call +} + +// MakeDirectory is a helper method to define mock.On call +// - directory string +func (_e *Storage_Expecter) MakeDirectory(directory interface{}) *Storage_MakeDirectory_Call { + return &Storage_MakeDirectory_Call{Call: _e.mock.On("MakeDirectory", directory)} +} + +func (_c *Storage_MakeDirectory_Call) Run(run func(directory string)) *Storage_MakeDirectory_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Storage_MakeDirectory_Call) Return(_a0 error) *Storage_MakeDirectory_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Storage_MakeDirectory_Call) RunAndReturn(run func(string) error) *Storage_MakeDirectory_Call { + _c.Call.Return(run) + return _c +} + // MimeType provides a mock function with given fields: file func (_m *Storage) MimeType(file string) (string, error) { ret := _m.Called(file) + if len(ret) == 0 { + panic("no return value specified for MimeType") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func(string) (string, error)); ok { @@ -310,10 +746,42 @@ func (_m *Storage) MimeType(file string) (string, error) { return r0, r1 } +// Storage_MimeType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MimeType' +type Storage_MimeType_Call struct { + *mock.Call +} + +// MimeType is a helper method to define mock.On call +// - file string +func (_e *Storage_Expecter) MimeType(file interface{}) *Storage_MimeType_Call { + return &Storage_MimeType_Call{Call: _e.mock.On("MimeType", file)} +} + +func (_c *Storage_MimeType_Call) Run(run func(file string)) *Storage_MimeType_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Storage_MimeType_Call) Return(_a0 string, _a1 error) *Storage_MimeType_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Storage_MimeType_Call) RunAndReturn(run func(string) (string, error)) *Storage_MimeType_Call { + _c.Call.Return(run) + return _c +} + // Missing provides a mock function with given fields: file func (_m *Storage) Missing(file string) bool { ret := _m.Called(file) + if len(ret) == 0 { + panic("no return value specified for Missing") + } + var r0 bool if rf, ok := ret.Get(0).(func(string) bool); ok { r0 = rf(file) @@ -324,10 +792,42 @@ func (_m *Storage) Missing(file string) bool { return r0 } +// Storage_Missing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Missing' +type Storage_Missing_Call struct { + *mock.Call +} + +// Missing is a helper method to define mock.On call +// - file string +func (_e *Storage_Expecter) Missing(file interface{}) *Storage_Missing_Call { + return &Storage_Missing_Call{Call: _e.mock.On("Missing", file)} +} + +func (_c *Storage_Missing_Call) Run(run func(file string)) *Storage_Missing_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Storage_Missing_Call) Return(_a0 bool) *Storage_Missing_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Storage_Missing_Call) RunAndReturn(run func(string) bool) *Storage_Missing_Call { + _c.Call.Return(run) + return _c +} + // Move provides a mock function with given fields: oldFile, newFile func (_m *Storage) Move(oldFile string, newFile string) error { ret := _m.Called(oldFile, newFile) + if len(ret) == 0 { + panic("no return value specified for Move") + } + var r0 error if rf, ok := ret.Get(0).(func(string, string) error); ok { r0 = rf(oldFile, newFile) @@ -338,10 +838,43 @@ func (_m *Storage) Move(oldFile string, newFile string) error { return r0 } +// Storage_Move_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Move' +type Storage_Move_Call struct { + *mock.Call +} + +// Move is a helper method to define mock.On call +// - oldFile string +// - newFile string +func (_e *Storage_Expecter) Move(oldFile interface{}, newFile interface{}) *Storage_Move_Call { + return &Storage_Move_Call{Call: _e.mock.On("Move", oldFile, newFile)} +} + +func (_c *Storage_Move_Call) Run(run func(oldFile string, newFile string)) *Storage_Move_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Storage_Move_Call) Return(_a0 error) *Storage_Move_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Storage_Move_Call) RunAndReturn(run func(string, string) error) *Storage_Move_Call { + _c.Call.Return(run) + return _c +} + // Path provides a mock function with given fields: file func (_m *Storage) Path(file string) string { ret := _m.Called(file) + if len(ret) == 0 { + panic("no return value specified for Path") + } + var r0 string if rf, ok := ret.Get(0).(func(string) string); ok { r0 = rf(file) @@ -352,10 +885,42 @@ func (_m *Storage) Path(file string) string { return r0 } +// Storage_Path_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Path' +type Storage_Path_Call struct { + *mock.Call +} + +// Path is a helper method to define mock.On call +// - file string +func (_e *Storage_Expecter) Path(file interface{}) *Storage_Path_Call { + return &Storage_Path_Call{Call: _e.mock.On("Path", file)} +} + +func (_c *Storage_Path_Call) Run(run func(file string)) *Storage_Path_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Storage_Path_Call) Return(_a0 string) *Storage_Path_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Storage_Path_Call) RunAndReturn(run func(string) string) *Storage_Path_Call { + _c.Call.Return(run) + return _c +} + // Put provides a mock function with given fields: file, content func (_m *Storage) Put(file string, content string) error { ret := _m.Called(file, content) + if len(ret) == 0 { + panic("no return value specified for Put") + } + var r0 error if rf, ok := ret.Get(0).(func(string, string) error); ok { r0 = rf(file, content) @@ -366,10 +931,43 @@ func (_m *Storage) Put(file string, content string) error { return r0 } +// Storage_Put_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Put' +type Storage_Put_Call struct { + *mock.Call +} + +// Put is a helper method to define mock.On call +// - file string +// - content string +func (_e *Storage_Expecter) Put(file interface{}, content interface{}) *Storage_Put_Call { + return &Storage_Put_Call{Call: _e.mock.On("Put", file, content)} +} + +func (_c *Storage_Put_Call) Run(run func(file string, content string)) *Storage_Put_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Storage_Put_Call) Return(_a0 error) *Storage_Put_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Storage_Put_Call) RunAndReturn(run func(string, string) error) *Storage_Put_Call { + _c.Call.Return(run) + return _c +} + // PutFile provides a mock function with given fields: path, source func (_m *Storage) PutFile(path string, source filesystem.File) (string, error) { ret := _m.Called(path, source) + if len(ret) == 0 { + panic("no return value specified for PutFile") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func(string, filesystem.File) (string, error)); ok { @@ -390,10 +988,43 @@ func (_m *Storage) PutFile(path string, source filesystem.File) (string, error) return r0, r1 } +// Storage_PutFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PutFile' +type Storage_PutFile_Call struct { + *mock.Call +} + +// PutFile is a helper method to define mock.On call +// - path string +// - source filesystem.File +func (_e *Storage_Expecter) PutFile(path interface{}, source interface{}) *Storage_PutFile_Call { + return &Storage_PutFile_Call{Call: _e.mock.On("PutFile", path, source)} +} + +func (_c *Storage_PutFile_Call) Run(run func(path string, source filesystem.File)) *Storage_PutFile_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(filesystem.File)) + }) + return _c +} + +func (_c *Storage_PutFile_Call) Return(_a0 string, _a1 error) *Storage_PutFile_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Storage_PutFile_Call) RunAndReturn(run func(string, filesystem.File) (string, error)) *Storage_PutFile_Call { + _c.Call.Return(run) + return _c +} + // PutFileAs provides a mock function with given fields: path, source, name func (_m *Storage) PutFileAs(path string, source filesystem.File, name string) (string, error) { ret := _m.Called(path, source, name) + if len(ret) == 0 { + panic("no return value specified for PutFileAs") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func(string, filesystem.File, string) (string, error)); ok { @@ -414,10 +1045,44 @@ func (_m *Storage) PutFileAs(path string, source filesystem.File, name string) ( return r0, r1 } +// Storage_PutFileAs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PutFileAs' +type Storage_PutFileAs_Call struct { + *mock.Call +} + +// PutFileAs is a helper method to define mock.On call +// - path string +// - source filesystem.File +// - name string +func (_e *Storage_Expecter) PutFileAs(path interface{}, source interface{}, name interface{}) *Storage_PutFileAs_Call { + return &Storage_PutFileAs_Call{Call: _e.mock.On("PutFileAs", path, source, name)} +} + +func (_c *Storage_PutFileAs_Call) Run(run func(path string, source filesystem.File, name string)) *Storage_PutFileAs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(filesystem.File), args[2].(string)) + }) + return _c +} + +func (_c *Storage_PutFileAs_Call) Return(_a0 string, _a1 error) *Storage_PutFileAs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Storage_PutFileAs_Call) RunAndReturn(run func(string, filesystem.File, string) (string, error)) *Storage_PutFileAs_Call { + _c.Call.Return(run) + return _c +} + // Size provides a mock function with given fields: file func (_m *Storage) Size(file string) (int64, error) { ret := _m.Called(file) + if len(ret) == 0 { + panic("no return value specified for Size") + } + var r0 int64 var r1 error if rf, ok := ret.Get(0).(func(string) (int64, error)); ok { @@ -438,10 +1103,42 @@ func (_m *Storage) Size(file string) (int64, error) { return r0, r1 } +// Storage_Size_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Size' +type Storage_Size_Call struct { + *mock.Call +} + +// Size is a helper method to define mock.On call +// - file string +func (_e *Storage_Expecter) Size(file interface{}) *Storage_Size_Call { + return &Storage_Size_Call{Call: _e.mock.On("Size", file)} +} + +func (_c *Storage_Size_Call) Run(run func(file string)) *Storage_Size_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Storage_Size_Call) Return(_a0 int64, _a1 error) *Storage_Size_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Storage_Size_Call) RunAndReturn(run func(string) (int64, error)) *Storage_Size_Call { + _c.Call.Return(run) + return _c +} + // TemporaryUrl provides a mock function with given fields: file, _a1 func (_m *Storage) TemporaryUrl(file string, _a1 time.Time) (string, error) { ret := _m.Called(file, _a1) + if len(ret) == 0 { + panic("no return value specified for TemporaryUrl") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func(string, time.Time) (string, error)); ok { @@ -462,10 +1159,43 @@ func (_m *Storage) TemporaryUrl(file string, _a1 time.Time) (string, error) { return r0, r1 } +// Storage_TemporaryUrl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TemporaryUrl' +type Storage_TemporaryUrl_Call struct { + *mock.Call +} + +// TemporaryUrl is a helper method to define mock.On call +// - file string +// - _a1 time.Time +func (_e *Storage_Expecter) TemporaryUrl(file interface{}, _a1 interface{}) *Storage_TemporaryUrl_Call { + return &Storage_TemporaryUrl_Call{Call: _e.mock.On("TemporaryUrl", file, _a1)} +} + +func (_c *Storage_TemporaryUrl_Call) Run(run func(file string, _a1 time.Time)) *Storage_TemporaryUrl_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(time.Time)) + }) + return _c +} + +func (_c *Storage_TemporaryUrl_Call) Return(_a0 string, _a1 error) *Storage_TemporaryUrl_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Storage_TemporaryUrl_Call) RunAndReturn(run func(string, time.Time) (string, error)) *Storage_TemporaryUrl_Call { + _c.Call.Return(run) + return _c +} + // Url provides a mock function with given fields: file func (_m *Storage) Url(file string) string { ret := _m.Called(file) + if len(ret) == 0 { + panic("no return value specified for Url") + } + var r0 string if rf, ok := ret.Get(0).(func(string) string); ok { r0 = rf(file) @@ -476,10 +1206,42 @@ func (_m *Storage) Url(file string) string { return r0 } +// Storage_Url_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Url' +type Storage_Url_Call struct { + *mock.Call +} + +// Url is a helper method to define mock.On call +// - file string +func (_e *Storage_Expecter) Url(file interface{}) *Storage_Url_Call { + return &Storage_Url_Call{Call: _e.mock.On("Url", file)} +} + +func (_c *Storage_Url_Call) Run(run func(file string)) *Storage_Url_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Storage_Url_Call) Return(_a0 string) *Storage_Url_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Storage_Url_Call) RunAndReturn(run func(string) string) *Storage_Url_Call { + _c.Call.Return(run) + return _c +} + // WithContext provides a mock function with given fields: ctx func (_m *Storage) WithContext(ctx context.Context) filesystem.Driver { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for WithContext") + } + var r0 filesystem.Driver if rf, ok := ret.Get(0).(func(context.Context) filesystem.Driver); ok { r0 = rf(ctx) @@ -492,6 +1254,34 @@ func (_m *Storage) WithContext(ctx context.Context) filesystem.Driver { return r0 } +// Storage_WithContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithContext' +type Storage_WithContext_Call struct { + *mock.Call +} + +// WithContext is a helper method to define mock.On call +// - ctx context.Context +func (_e *Storage_Expecter) WithContext(ctx interface{}) *Storage_WithContext_Call { + return &Storage_WithContext_Call{Call: _e.mock.On("WithContext", ctx)} +} + +func (_c *Storage_WithContext_Call) Run(run func(ctx context.Context)) *Storage_WithContext_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Storage_WithContext_Call) Return(_a0 filesystem.Driver) *Storage_WithContext_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Storage_WithContext_Call) RunAndReturn(run func(context.Context) filesystem.Driver) *Storage_WithContext_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 { diff --git a/mocks/foundation/Application.go b/mocks/foundation/Application.go index c02fc50de..ac51f706c 100644 --- a/mocks/foundation/Application.go +++ b/mocks/foundation/Application.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -42,6 +42,8 @@ import ( schedule "github.com/goravel/framework/contracts/schedule" + schema "github.com/goravel/framework/contracts/database/schema" + seeder "github.com/goravel/framework/contracts/database/seeder" session "github.com/goravel/framework/contracts/session" @@ -58,10 +60,22 @@ type Application struct { mock.Mock } +type Application_Expecter struct { + mock *mock.Mock +} + +func (_m *Application) EXPECT() *Application_Expecter { + return &Application_Expecter{mock: &_m.Mock} +} + // BasePath provides a mock function with given fields: path func (_m *Application) BasePath(path string) string { ret := _m.Called(path) + if len(ret) == 0 { + panic("no return value specified for BasePath") + } + var r0 string if rf, ok := ret.Get(0).(func(string) string); ok { r0 = rf(path) @@ -72,30 +86,175 @@ func (_m *Application) BasePath(path string) string { return r0 } +// Application_BasePath_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BasePath' +type Application_BasePath_Call struct { + *mock.Call +} + +// BasePath is a helper method to define mock.On call +// - path string +func (_e *Application_Expecter) BasePath(path interface{}) *Application_BasePath_Call { + return &Application_BasePath_Call{Call: _e.mock.On("BasePath", path)} +} + +func (_c *Application_BasePath_Call) Run(run func(path string)) *Application_BasePath_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Application_BasePath_Call) Return(_a0 string) *Application_BasePath_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_BasePath_Call) RunAndReturn(run func(string) string) *Application_BasePath_Call { + _c.Call.Return(run) + return _c +} + // Bind provides a mock function with given fields: key, callback func (_m *Application) Bind(key interface{}, callback func(foundation.Application) (interface{}, error)) { _m.Called(key, callback) } +// Application_Bind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bind' +type Application_Bind_Call struct { + *mock.Call +} + +// Bind is a helper method to define mock.On call +// - key interface{} +// - callback func(foundation.Application)(interface{} , error) +func (_e *Application_Expecter) Bind(key interface{}, callback interface{}) *Application_Bind_Call { + return &Application_Bind_Call{Call: _e.mock.On("Bind", key, callback)} +} + +func (_c *Application_Bind_Call) Run(run func(key interface{}, callback func(foundation.Application) (interface{}, error))) *Application_Bind_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{}), args[1].(func(foundation.Application) (interface{}, error))) + }) + return _c +} + +func (_c *Application_Bind_Call) Return() *Application_Bind_Call { + _c.Call.Return() + return _c +} + +func (_c *Application_Bind_Call) RunAndReturn(run func(interface{}, func(foundation.Application) (interface{}, error))) *Application_Bind_Call { + _c.Call.Return(run) + return _c +} + // BindWith provides a mock function with given fields: key, callback func (_m *Application) BindWith(key interface{}, callback func(foundation.Application, map[string]interface{}) (interface{}, error)) { _m.Called(key, callback) } +// Application_BindWith_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BindWith' +type Application_BindWith_Call struct { + *mock.Call +} + +// BindWith is a helper method to define mock.On call +// - key interface{} +// - callback func(foundation.Application , map[string]interface{})(interface{} , error) +func (_e *Application_Expecter) BindWith(key interface{}, callback interface{}) *Application_BindWith_Call { + return &Application_BindWith_Call{Call: _e.mock.On("BindWith", key, callback)} +} + +func (_c *Application_BindWith_Call) Run(run func(key interface{}, callback func(foundation.Application, map[string]interface{}) (interface{}, error))) *Application_BindWith_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{}), args[1].(func(foundation.Application, map[string]interface{}) (interface{}, error))) + }) + return _c +} + +func (_c *Application_BindWith_Call) Return() *Application_BindWith_Call { + _c.Call.Return() + return _c +} + +func (_c *Application_BindWith_Call) RunAndReturn(run func(interface{}, func(foundation.Application, map[string]interface{}) (interface{}, error))) *Application_BindWith_Call { + _c.Call.Return(run) + return _c +} + // Boot provides a mock function with given fields: func (_m *Application) Boot() { _m.Called() } +// Application_Boot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Boot' +type Application_Boot_Call struct { + *mock.Call +} + +// Boot is a helper method to define mock.On call +func (_e *Application_Expecter) Boot() *Application_Boot_Call { + return &Application_Boot_Call{Call: _e.mock.On("Boot")} +} + +func (_c *Application_Boot_Call) Run(run func()) *Application_Boot_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_Boot_Call) Return() *Application_Boot_Call { + _c.Call.Return() + return _c +} + +func (_c *Application_Boot_Call) RunAndReturn(run func()) *Application_Boot_Call { + _c.Call.Return(run) + return _c +} + // Commands provides a mock function with given fields: _a0 func (_m *Application) Commands(_a0 []console.Command) { _m.Called(_a0) } +// Application_Commands_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Commands' +type Application_Commands_Call struct { + *mock.Call +} + +// Commands is a helper method to define mock.On call +// - _a0 []console.Command +func (_e *Application_Expecter) Commands(_a0 interface{}) *Application_Commands_Call { + return &Application_Commands_Call{Call: _e.mock.On("Commands", _a0)} +} + +func (_c *Application_Commands_Call) Run(run func(_a0 []console.Command)) *Application_Commands_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]console.Command)) + }) + return _c +} + +func (_c *Application_Commands_Call) Return() *Application_Commands_Call { + _c.Call.Return() + return _c +} + +func (_c *Application_Commands_Call) RunAndReturn(run func([]console.Command)) *Application_Commands_Call { + _c.Call.Return(run) + return _c +} + // ConfigPath provides a mock function with given fields: path func (_m *Application) ConfigPath(path string) string { ret := _m.Called(path) + if len(ret) == 0 { + panic("no return value specified for ConfigPath") + } + var r0 string if rf, ok := ret.Get(0).(func(string) string); ok { r0 = rf(path) @@ -106,10 +265,42 @@ func (_m *Application) ConfigPath(path string) string { return r0 } +// Application_ConfigPath_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConfigPath' +type Application_ConfigPath_Call struct { + *mock.Call +} + +// ConfigPath is a helper method to define mock.On call +// - path string +func (_e *Application_Expecter) ConfigPath(path interface{}) *Application_ConfigPath_Call { + return &Application_ConfigPath_Call{Call: _e.mock.On("ConfigPath", path)} +} + +func (_c *Application_ConfigPath_Call) Run(run func(path string)) *Application_ConfigPath_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Application_ConfigPath_Call) Return(_a0 string) *Application_ConfigPath_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_ConfigPath_Call) RunAndReturn(run func(string) string) *Application_ConfigPath_Call { + _c.Call.Return(run) + return _c +} + // DatabasePath provides a mock function with given fields: path func (_m *Application) DatabasePath(path string) string { ret := _m.Called(path) + if len(ret) == 0 { + panic("no return value specified for DatabasePath") + } + var r0 string if rf, ok := ret.Get(0).(func(string) string); ok { r0 = rf(path) @@ -120,10 +311,42 @@ func (_m *Application) DatabasePath(path string) string { return r0 } +// Application_DatabasePath_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DatabasePath' +type Application_DatabasePath_Call struct { + *mock.Call +} + +// DatabasePath is a helper method to define mock.On call +// - path string +func (_e *Application_Expecter) DatabasePath(path interface{}) *Application_DatabasePath_Call { + return &Application_DatabasePath_Call{Call: _e.mock.On("DatabasePath", path)} +} + +func (_c *Application_DatabasePath_Call) Run(run func(path string)) *Application_DatabasePath_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Application_DatabasePath_Call) Return(_a0 string) *Application_DatabasePath_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_DatabasePath_Call) RunAndReturn(run func(string) string) *Application_DatabasePath_Call { + _c.Call.Return(run) + return _c +} + // GetLocale provides a mock function with given fields: ctx func (_m *Application) GetLocale(ctx context.Context) string { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for GetLocale") + } + var r0 string if rf, ok := ret.Get(0).(func(context.Context) string); ok { r0 = rf(ctx) @@ -134,15 +357,76 @@ func (_m *Application) GetLocale(ctx context.Context) string { return r0 } +// Application_GetLocale_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLocale' +type Application_GetLocale_Call struct { + *mock.Call +} + +// GetLocale is a helper method to define mock.On call +// - ctx context.Context +func (_e *Application_Expecter) GetLocale(ctx interface{}) *Application_GetLocale_Call { + return &Application_GetLocale_Call{Call: _e.mock.On("GetLocale", ctx)} +} + +func (_c *Application_GetLocale_Call) Run(run func(ctx context.Context)) *Application_GetLocale_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Application_GetLocale_Call) Return(_a0 string) *Application_GetLocale_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_GetLocale_Call) RunAndReturn(run func(context.Context) string) *Application_GetLocale_Call { + _c.Call.Return(run) + return _c +} + // Instance provides a mock function with given fields: key, instance func (_m *Application) Instance(key interface{}, instance interface{}) { _m.Called(key, instance) } +// Application_Instance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Instance' +type Application_Instance_Call struct { + *mock.Call +} + +// Instance is a helper method to define mock.On call +// - key interface{} +// - instance interface{} +func (_e *Application_Expecter) Instance(key interface{}, instance interface{}) *Application_Instance_Call { + return &Application_Instance_Call{Call: _e.mock.On("Instance", key, instance)} +} + +func (_c *Application_Instance_Call) Run(run func(key interface{}, instance interface{})) *Application_Instance_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{}), args[1].(interface{})) + }) + return _c +} + +func (_c *Application_Instance_Call) Return() *Application_Instance_Call { + _c.Call.Return() + return _c +} + +func (_c *Application_Instance_Call) RunAndReturn(run func(interface{}, interface{})) *Application_Instance_Call { + _c.Call.Return(run) + return _c +} + // IsLocale provides a mock function with given fields: ctx, locale func (_m *Application) IsLocale(ctx context.Context, locale string) bool { ret := _m.Called(ctx, locale) + if len(ret) == 0 { + panic("no return value specified for IsLocale") + } + var r0 bool if rf, ok := ret.Get(0).(func(context.Context, string) bool); ok { r0 = rf(ctx, locale) @@ -153,10 +437,43 @@ func (_m *Application) IsLocale(ctx context.Context, locale string) bool { return r0 } +// Application_IsLocale_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsLocale' +type Application_IsLocale_Call struct { + *mock.Call +} + +// IsLocale is a helper method to define mock.On call +// - ctx context.Context +// - locale string +func (_e *Application_Expecter) IsLocale(ctx interface{}, locale interface{}) *Application_IsLocale_Call { + return &Application_IsLocale_Call{Call: _e.mock.On("IsLocale", ctx, locale)} +} + +func (_c *Application_IsLocale_Call) Run(run func(ctx context.Context, locale string)) *Application_IsLocale_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Application_IsLocale_Call) Return(_a0 bool) *Application_IsLocale_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_IsLocale_Call) RunAndReturn(run func(context.Context, string) bool) *Application_IsLocale_Call { + _c.Call.Return(run) + return _c +} + // LangPath provides a mock function with given fields: path func (_m *Application) LangPath(path string) string { ret := _m.Called(path) + if len(ret) == 0 { + panic("no return value specified for LangPath") + } + var r0 string if rf, ok := ret.Get(0).(func(string) string); ok { r0 = rf(path) @@ -167,10 +484,42 @@ func (_m *Application) LangPath(path string) string { return r0 } +// Application_LangPath_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LangPath' +type Application_LangPath_Call struct { + *mock.Call +} + +// LangPath is a helper method to define mock.On call +// - path string +func (_e *Application_Expecter) LangPath(path interface{}) *Application_LangPath_Call { + return &Application_LangPath_Call{Call: _e.mock.On("LangPath", path)} +} + +func (_c *Application_LangPath_Call) Run(run func(path string)) *Application_LangPath_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Application_LangPath_Call) Return(_a0 string) *Application_LangPath_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_LangPath_Call) RunAndReturn(run func(string) string) *Application_LangPath_Call { + _c.Call.Return(run) + return _c +} + // Make provides a mock function with given fields: key func (_m *Application) Make(key interface{}) (interface{}, error) { ret := _m.Called(key) + if len(ret) == 0 { + panic("no return value specified for Make") + } + var r0 interface{} var r1 error if rf, ok := ret.Get(0).(func(interface{}) (interface{}, error)); ok { @@ -193,10 +542,42 @@ func (_m *Application) Make(key interface{}) (interface{}, error) { return r0, r1 } +// Application_Make_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Make' +type Application_Make_Call struct { + *mock.Call +} + +// Make is a helper method to define mock.On call +// - key interface{} +func (_e *Application_Expecter) Make(key interface{}) *Application_Make_Call { + return &Application_Make_Call{Call: _e.mock.On("Make", key)} +} + +func (_c *Application_Make_Call) Run(run func(key interface{})) *Application_Make_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Application_Make_Call) Return(_a0 interface{}, _a1 error) *Application_Make_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Application_Make_Call) RunAndReturn(run func(interface{}) (interface{}, error)) *Application_Make_Call { + _c.Call.Return(run) + return _c +} + // MakeArtisan provides a mock function with given fields: func (_m *Application) MakeArtisan() console.Artisan { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeArtisan") + } + var r0 console.Artisan if rf, ok := ret.Get(0).(func() console.Artisan); ok { r0 = rf() @@ -209,10 +590,41 @@ func (_m *Application) MakeArtisan() console.Artisan { return r0 } +// Application_MakeArtisan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeArtisan' +type Application_MakeArtisan_Call struct { + *mock.Call +} + +// MakeArtisan is a helper method to define mock.On call +func (_e *Application_Expecter) MakeArtisan() *Application_MakeArtisan_Call { + return &Application_MakeArtisan_Call{Call: _e.mock.On("MakeArtisan")} +} + +func (_c *Application_MakeArtisan_Call) Run(run func()) *Application_MakeArtisan_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_MakeArtisan_Call) Return(_a0 console.Artisan) *Application_MakeArtisan_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_MakeArtisan_Call) RunAndReturn(run func() console.Artisan) *Application_MakeArtisan_Call { + _c.Call.Return(run) + return _c +} + // MakeAuth provides a mock function with given fields: ctx func (_m *Application) MakeAuth(ctx http.Context) auth.Auth { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for MakeAuth") + } + var r0 auth.Auth if rf, ok := ret.Get(0).(func(http.Context) auth.Auth); ok { r0 = rf(ctx) @@ -225,10 +637,42 @@ func (_m *Application) MakeAuth(ctx http.Context) auth.Auth { return r0 } +// Application_MakeAuth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeAuth' +type Application_MakeAuth_Call struct { + *mock.Call +} + +// MakeAuth is a helper method to define mock.On call +// - ctx http.Context +func (_e *Application_Expecter) MakeAuth(ctx interface{}) *Application_MakeAuth_Call { + return &Application_MakeAuth_Call{Call: _e.mock.On("MakeAuth", ctx)} +} + +func (_c *Application_MakeAuth_Call) Run(run func(ctx http.Context)) *Application_MakeAuth_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(http.Context)) + }) + return _c +} + +func (_c *Application_MakeAuth_Call) Return(_a0 auth.Auth) *Application_MakeAuth_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_MakeAuth_Call) RunAndReturn(run func(http.Context) auth.Auth) *Application_MakeAuth_Call { + _c.Call.Return(run) + return _c +} + // MakeCache provides a mock function with given fields: func (_m *Application) MakeCache() cache.Cache { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeCache") + } + var r0 cache.Cache if rf, ok := ret.Get(0).(func() cache.Cache); ok { r0 = rf() @@ -241,10 +685,41 @@ func (_m *Application) MakeCache() cache.Cache { return r0 } +// Application_MakeCache_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeCache' +type Application_MakeCache_Call struct { + *mock.Call +} + +// MakeCache is a helper method to define mock.On call +func (_e *Application_Expecter) MakeCache() *Application_MakeCache_Call { + return &Application_MakeCache_Call{Call: _e.mock.On("MakeCache")} +} + +func (_c *Application_MakeCache_Call) Run(run func()) *Application_MakeCache_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_MakeCache_Call) Return(_a0 cache.Cache) *Application_MakeCache_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_MakeCache_Call) RunAndReturn(run func() cache.Cache) *Application_MakeCache_Call { + _c.Call.Return(run) + return _c +} + // MakeConfig provides a mock function with given fields: func (_m *Application) MakeConfig() config.Config { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeConfig") + } + var r0 config.Config if rf, ok := ret.Get(0).(func() config.Config); ok { r0 = rf() @@ -257,10 +732,41 @@ func (_m *Application) MakeConfig() config.Config { return r0 } +// Application_MakeConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeConfig' +type Application_MakeConfig_Call struct { + *mock.Call +} + +// MakeConfig is a helper method to define mock.On call +func (_e *Application_Expecter) MakeConfig() *Application_MakeConfig_Call { + return &Application_MakeConfig_Call{Call: _e.mock.On("MakeConfig")} +} + +func (_c *Application_MakeConfig_Call) Run(run func()) *Application_MakeConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_MakeConfig_Call) Return(_a0 config.Config) *Application_MakeConfig_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_MakeConfig_Call) RunAndReturn(run func() config.Config) *Application_MakeConfig_Call { + _c.Call.Return(run) + return _c +} + // MakeCrypt provides a mock function with given fields: func (_m *Application) MakeCrypt() crypt.Crypt { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeCrypt") + } + var r0 crypt.Crypt if rf, ok := ret.Get(0).(func() crypt.Crypt); ok { r0 = rf() @@ -273,10 +779,41 @@ func (_m *Application) MakeCrypt() crypt.Crypt { return r0 } +// Application_MakeCrypt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeCrypt' +type Application_MakeCrypt_Call struct { + *mock.Call +} + +// MakeCrypt is a helper method to define mock.On call +func (_e *Application_Expecter) MakeCrypt() *Application_MakeCrypt_Call { + return &Application_MakeCrypt_Call{Call: _e.mock.On("MakeCrypt")} +} + +func (_c *Application_MakeCrypt_Call) Run(run func()) *Application_MakeCrypt_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_MakeCrypt_Call) Return(_a0 crypt.Crypt) *Application_MakeCrypt_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_MakeCrypt_Call) RunAndReturn(run func() crypt.Crypt) *Application_MakeCrypt_Call { + _c.Call.Return(run) + return _c +} + // MakeEvent provides a mock function with given fields: func (_m *Application) MakeEvent() event.Instance { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeEvent") + } + var r0 event.Instance if rf, ok := ret.Get(0).(func() event.Instance); ok { r0 = rf() @@ -289,10 +826,41 @@ func (_m *Application) MakeEvent() event.Instance { return r0 } +// Application_MakeEvent_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeEvent' +type Application_MakeEvent_Call struct { + *mock.Call +} + +// MakeEvent is a helper method to define mock.On call +func (_e *Application_Expecter) MakeEvent() *Application_MakeEvent_Call { + return &Application_MakeEvent_Call{Call: _e.mock.On("MakeEvent")} +} + +func (_c *Application_MakeEvent_Call) Run(run func()) *Application_MakeEvent_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_MakeEvent_Call) Return(_a0 event.Instance) *Application_MakeEvent_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_MakeEvent_Call) RunAndReturn(run func() event.Instance) *Application_MakeEvent_Call { + _c.Call.Return(run) + return _c +} + // MakeGate provides a mock function with given fields: func (_m *Application) MakeGate() access.Gate { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeGate") + } + var r0 access.Gate if rf, ok := ret.Get(0).(func() access.Gate); ok { r0 = rf() @@ -305,10 +873,41 @@ func (_m *Application) MakeGate() access.Gate { return r0 } +// Application_MakeGate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeGate' +type Application_MakeGate_Call struct { + *mock.Call +} + +// MakeGate is a helper method to define mock.On call +func (_e *Application_Expecter) MakeGate() *Application_MakeGate_Call { + return &Application_MakeGate_Call{Call: _e.mock.On("MakeGate")} +} + +func (_c *Application_MakeGate_Call) Run(run func()) *Application_MakeGate_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_MakeGate_Call) Return(_a0 access.Gate) *Application_MakeGate_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_MakeGate_Call) RunAndReturn(run func() access.Gate) *Application_MakeGate_Call { + _c.Call.Return(run) + return _c +} + // MakeGrpc provides a mock function with given fields: func (_m *Application) MakeGrpc() grpc.Grpc { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeGrpc") + } + var r0 grpc.Grpc if rf, ok := ret.Get(0).(func() grpc.Grpc); ok { r0 = rf() @@ -321,10 +920,41 @@ func (_m *Application) MakeGrpc() grpc.Grpc { return r0 } +// Application_MakeGrpc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeGrpc' +type Application_MakeGrpc_Call struct { + *mock.Call +} + +// MakeGrpc is a helper method to define mock.On call +func (_e *Application_Expecter) MakeGrpc() *Application_MakeGrpc_Call { + return &Application_MakeGrpc_Call{Call: _e.mock.On("MakeGrpc")} +} + +func (_c *Application_MakeGrpc_Call) Run(run func()) *Application_MakeGrpc_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_MakeGrpc_Call) Return(_a0 grpc.Grpc) *Application_MakeGrpc_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_MakeGrpc_Call) RunAndReturn(run func() grpc.Grpc) *Application_MakeGrpc_Call { + _c.Call.Return(run) + return _c +} + // MakeHash provides a mock function with given fields: func (_m *Application) MakeHash() hash.Hash { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeHash") + } + var r0 hash.Hash if rf, ok := ret.Get(0).(func() hash.Hash); ok { r0 = rf() @@ -337,10 +967,41 @@ func (_m *Application) MakeHash() hash.Hash { return r0 } +// Application_MakeHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeHash' +type Application_MakeHash_Call struct { + *mock.Call +} + +// MakeHash is a helper method to define mock.On call +func (_e *Application_Expecter) MakeHash() *Application_MakeHash_Call { + return &Application_MakeHash_Call{Call: _e.mock.On("MakeHash")} +} + +func (_c *Application_MakeHash_Call) Run(run func()) *Application_MakeHash_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_MakeHash_Call) Return(_a0 hash.Hash) *Application_MakeHash_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_MakeHash_Call) RunAndReturn(run func() hash.Hash) *Application_MakeHash_Call { + _c.Call.Return(run) + return _c +} + // MakeLang provides a mock function with given fields: ctx func (_m *Application) MakeLang(ctx context.Context) translation.Translator { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for MakeLang") + } + var r0 translation.Translator if rf, ok := ret.Get(0).(func(context.Context) translation.Translator); ok { r0 = rf(ctx) @@ -353,13 +1014,45 @@ func (_m *Application) MakeLang(ctx context.Context) translation.Translator { return r0 } -// MakeLog provides a mock function with given fields: -func (_m *Application) MakeLog() log.Log { - ret := _m.Called() +// Application_MakeLang_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeLang' +type Application_MakeLang_Call struct { + *mock.Call +} - var r0 log.Log - if rf, ok := ret.Get(0).(func() log.Log); ok { - r0 = rf() +// MakeLang is a helper method to define mock.On call +// - ctx context.Context +func (_e *Application_Expecter) MakeLang(ctx interface{}) *Application_MakeLang_Call { + return &Application_MakeLang_Call{Call: _e.mock.On("MakeLang", ctx)} +} + +func (_c *Application_MakeLang_Call) Run(run func(ctx context.Context)) *Application_MakeLang_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Application_MakeLang_Call) Return(_a0 translation.Translator) *Application_MakeLang_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_MakeLang_Call) RunAndReturn(run func(context.Context) translation.Translator) *Application_MakeLang_Call { + _c.Call.Return(run) + return _c +} + +// MakeLog provides a mock function with given fields: +func (_m *Application) MakeLog() log.Log { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for MakeLog") + } + + var r0 log.Log + if rf, ok := ret.Get(0).(func() log.Log); ok { + r0 = rf() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(log.Log) @@ -369,10 +1062,41 @@ func (_m *Application) MakeLog() log.Log { return r0 } +// Application_MakeLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeLog' +type Application_MakeLog_Call struct { + *mock.Call +} + +// MakeLog is a helper method to define mock.On call +func (_e *Application_Expecter) MakeLog() *Application_MakeLog_Call { + return &Application_MakeLog_Call{Call: _e.mock.On("MakeLog")} +} + +func (_c *Application_MakeLog_Call) Run(run func()) *Application_MakeLog_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_MakeLog_Call) Return(_a0 log.Log) *Application_MakeLog_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_MakeLog_Call) RunAndReturn(run func() log.Log) *Application_MakeLog_Call { + _c.Call.Return(run) + return _c +} + // MakeMail provides a mock function with given fields: func (_m *Application) MakeMail() mail.Mail { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeMail") + } + var r0 mail.Mail if rf, ok := ret.Get(0).(func() mail.Mail); ok { r0 = rf() @@ -385,10 +1109,41 @@ func (_m *Application) MakeMail() mail.Mail { return r0 } +// Application_MakeMail_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeMail' +type Application_MakeMail_Call struct { + *mock.Call +} + +// MakeMail is a helper method to define mock.On call +func (_e *Application_Expecter) MakeMail() *Application_MakeMail_Call { + return &Application_MakeMail_Call{Call: _e.mock.On("MakeMail")} +} + +func (_c *Application_MakeMail_Call) Run(run func()) *Application_MakeMail_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_MakeMail_Call) Return(_a0 mail.Mail) *Application_MakeMail_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_MakeMail_Call) RunAndReturn(run func() mail.Mail) *Application_MakeMail_Call { + _c.Call.Return(run) + return _c +} + // MakeOrm provides a mock function with given fields: func (_m *Application) MakeOrm() orm.Orm { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeOrm") + } + var r0 orm.Orm if rf, ok := ret.Get(0).(func() orm.Orm); ok { r0 = rf() @@ -401,10 +1156,41 @@ func (_m *Application) MakeOrm() orm.Orm { return r0 } +// Application_MakeOrm_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeOrm' +type Application_MakeOrm_Call struct { + *mock.Call +} + +// MakeOrm is a helper method to define mock.On call +func (_e *Application_Expecter) MakeOrm() *Application_MakeOrm_Call { + return &Application_MakeOrm_Call{Call: _e.mock.On("MakeOrm")} +} + +func (_c *Application_MakeOrm_Call) Run(run func()) *Application_MakeOrm_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_MakeOrm_Call) Return(_a0 orm.Orm) *Application_MakeOrm_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_MakeOrm_Call) RunAndReturn(run func() orm.Orm) *Application_MakeOrm_Call { + _c.Call.Return(run) + return _c +} + // MakeQueue provides a mock function with given fields: func (_m *Application) MakeQueue() queue.Queue { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeQueue") + } + var r0 queue.Queue if rf, ok := ret.Get(0).(func() queue.Queue); ok { r0 = rf() @@ -417,10 +1203,41 @@ func (_m *Application) MakeQueue() queue.Queue { return r0 } +// Application_MakeQueue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeQueue' +type Application_MakeQueue_Call struct { + *mock.Call +} + +// MakeQueue is a helper method to define mock.On call +func (_e *Application_Expecter) MakeQueue() *Application_MakeQueue_Call { + return &Application_MakeQueue_Call{Call: _e.mock.On("MakeQueue")} +} + +func (_c *Application_MakeQueue_Call) Run(run func()) *Application_MakeQueue_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_MakeQueue_Call) Return(_a0 queue.Queue) *Application_MakeQueue_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_MakeQueue_Call) RunAndReturn(run func() queue.Queue) *Application_MakeQueue_Call { + _c.Call.Return(run) + return _c +} + // MakeRateLimiter provides a mock function with given fields: func (_m *Application) MakeRateLimiter() http.RateLimiter { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeRateLimiter") + } + var r0 http.RateLimiter if rf, ok := ret.Get(0).(func() http.RateLimiter); ok { r0 = rf() @@ -433,10 +1250,41 @@ func (_m *Application) MakeRateLimiter() http.RateLimiter { return r0 } +// Application_MakeRateLimiter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeRateLimiter' +type Application_MakeRateLimiter_Call struct { + *mock.Call +} + +// MakeRateLimiter is a helper method to define mock.On call +func (_e *Application_Expecter) MakeRateLimiter() *Application_MakeRateLimiter_Call { + return &Application_MakeRateLimiter_Call{Call: _e.mock.On("MakeRateLimiter")} +} + +func (_c *Application_MakeRateLimiter_Call) Run(run func()) *Application_MakeRateLimiter_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_MakeRateLimiter_Call) Return(_a0 http.RateLimiter) *Application_MakeRateLimiter_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_MakeRateLimiter_Call) RunAndReturn(run func() http.RateLimiter) *Application_MakeRateLimiter_Call { + _c.Call.Return(run) + return _c +} + // MakeRoute provides a mock function with given fields: func (_m *Application) MakeRoute() route.Route { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeRoute") + } + var r0 route.Route if rf, ok := ret.Get(0).(func() route.Route); ok { r0 = rf() @@ -449,10 +1297,41 @@ func (_m *Application) MakeRoute() route.Route { return r0 } +// Application_MakeRoute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeRoute' +type Application_MakeRoute_Call struct { + *mock.Call +} + +// MakeRoute is a helper method to define mock.On call +func (_e *Application_Expecter) MakeRoute() *Application_MakeRoute_Call { + return &Application_MakeRoute_Call{Call: _e.mock.On("MakeRoute")} +} + +func (_c *Application_MakeRoute_Call) Run(run func()) *Application_MakeRoute_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_MakeRoute_Call) Return(_a0 route.Route) *Application_MakeRoute_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_MakeRoute_Call) RunAndReturn(run func() route.Route) *Application_MakeRoute_Call { + _c.Call.Return(run) + return _c +} + // MakeSchedule provides a mock function with given fields: func (_m *Application) MakeSchedule() schedule.Schedule { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeSchedule") + } + var r0 schedule.Schedule if rf, ok := ret.Get(0).(func() schedule.Schedule); ok { r0 = rf() @@ -465,10 +1344,88 @@ func (_m *Application) MakeSchedule() schedule.Schedule { return r0 } +// Application_MakeSchedule_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeSchedule' +type Application_MakeSchedule_Call struct { + *mock.Call +} + +// MakeSchedule is a helper method to define mock.On call +func (_e *Application_Expecter) MakeSchedule() *Application_MakeSchedule_Call { + return &Application_MakeSchedule_Call{Call: _e.mock.On("MakeSchedule")} +} + +func (_c *Application_MakeSchedule_Call) Run(run func()) *Application_MakeSchedule_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_MakeSchedule_Call) Return(_a0 schedule.Schedule) *Application_MakeSchedule_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_MakeSchedule_Call) RunAndReturn(run func() schedule.Schedule) *Application_MakeSchedule_Call { + _c.Call.Return(run) + return _c +} + +// MakeSchema provides a mock function with given fields: +func (_m *Application) MakeSchema() schema.Schema { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for MakeSchema") + } + + var r0 schema.Schema + if rf, ok := ret.Get(0).(func() schema.Schema); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.Schema) + } + } + + return r0 +} + +// Application_MakeSchema_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeSchema' +type Application_MakeSchema_Call struct { + *mock.Call +} + +// MakeSchema is a helper method to define mock.On call +func (_e *Application_Expecter) MakeSchema() *Application_MakeSchema_Call { + return &Application_MakeSchema_Call{Call: _e.mock.On("MakeSchema")} +} + +func (_c *Application_MakeSchema_Call) Run(run func()) *Application_MakeSchema_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_MakeSchema_Call) Return(_a0 schema.Schema) *Application_MakeSchema_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_MakeSchema_Call) RunAndReturn(run func() schema.Schema) *Application_MakeSchema_Call { + _c.Call.Return(run) + return _c +} + // MakeSeeder provides a mock function with given fields: func (_m *Application) MakeSeeder() seeder.Facade { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeSeeder") + } + var r0 seeder.Facade if rf, ok := ret.Get(0).(func() seeder.Facade); ok { r0 = rf() @@ -481,10 +1438,41 @@ func (_m *Application) MakeSeeder() seeder.Facade { return r0 } +// Application_MakeSeeder_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeSeeder' +type Application_MakeSeeder_Call struct { + *mock.Call +} + +// MakeSeeder is a helper method to define mock.On call +func (_e *Application_Expecter) MakeSeeder() *Application_MakeSeeder_Call { + return &Application_MakeSeeder_Call{Call: _e.mock.On("MakeSeeder")} +} + +func (_c *Application_MakeSeeder_Call) Run(run func()) *Application_MakeSeeder_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_MakeSeeder_Call) Return(_a0 seeder.Facade) *Application_MakeSeeder_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_MakeSeeder_Call) RunAndReturn(run func() seeder.Facade) *Application_MakeSeeder_Call { + _c.Call.Return(run) + return _c +} + // MakeSession provides a mock function with given fields: func (_m *Application) MakeSession() session.Manager { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeSession") + } + var r0 session.Manager if rf, ok := ret.Get(0).(func() session.Manager); ok { r0 = rf() @@ -497,10 +1485,41 @@ func (_m *Application) MakeSession() session.Manager { return r0 } +// Application_MakeSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeSession' +type Application_MakeSession_Call struct { + *mock.Call +} + +// MakeSession is a helper method to define mock.On call +func (_e *Application_Expecter) MakeSession() *Application_MakeSession_Call { + return &Application_MakeSession_Call{Call: _e.mock.On("MakeSession")} +} + +func (_c *Application_MakeSession_Call) Run(run func()) *Application_MakeSession_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_MakeSession_Call) Return(_a0 session.Manager) *Application_MakeSession_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_MakeSession_Call) RunAndReturn(run func() session.Manager) *Application_MakeSession_Call { + _c.Call.Return(run) + return _c +} + // MakeStorage provides a mock function with given fields: func (_m *Application) MakeStorage() filesystem.Storage { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeStorage") + } + var r0 filesystem.Storage if rf, ok := ret.Get(0).(func() filesystem.Storage); ok { r0 = rf() @@ -513,10 +1532,41 @@ func (_m *Application) MakeStorage() filesystem.Storage { return r0 } +// Application_MakeStorage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeStorage' +type Application_MakeStorage_Call struct { + *mock.Call +} + +// MakeStorage is a helper method to define mock.On call +func (_e *Application_Expecter) MakeStorage() *Application_MakeStorage_Call { + return &Application_MakeStorage_Call{Call: _e.mock.On("MakeStorage")} +} + +func (_c *Application_MakeStorage_Call) Run(run func()) *Application_MakeStorage_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_MakeStorage_Call) Return(_a0 filesystem.Storage) *Application_MakeStorage_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_MakeStorage_Call) RunAndReturn(run func() filesystem.Storage) *Application_MakeStorage_Call { + _c.Call.Return(run) + return _c +} + // MakeTesting provides a mock function with given fields: func (_m *Application) MakeTesting() testing.Testing { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeTesting") + } + var r0 testing.Testing if rf, ok := ret.Get(0).(func() testing.Testing); ok { r0 = rf() @@ -529,10 +1579,41 @@ func (_m *Application) MakeTesting() testing.Testing { return r0 } +// Application_MakeTesting_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeTesting' +type Application_MakeTesting_Call struct { + *mock.Call +} + +// MakeTesting is a helper method to define mock.On call +func (_e *Application_Expecter) MakeTesting() *Application_MakeTesting_Call { + return &Application_MakeTesting_Call{Call: _e.mock.On("MakeTesting")} +} + +func (_c *Application_MakeTesting_Call) Run(run func()) *Application_MakeTesting_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_MakeTesting_Call) Return(_a0 testing.Testing) *Application_MakeTesting_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_MakeTesting_Call) RunAndReturn(run func() testing.Testing) *Application_MakeTesting_Call { + _c.Call.Return(run) + return _c +} + // MakeValidation provides a mock function with given fields: func (_m *Application) MakeValidation() validation.Validation { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeValidation") + } + var r0 validation.Validation if rf, ok := ret.Get(0).(func() validation.Validation); ok { r0 = rf() @@ -545,10 +1626,41 @@ func (_m *Application) MakeValidation() validation.Validation { return r0 } +// Application_MakeValidation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeValidation' +type Application_MakeValidation_Call struct { + *mock.Call +} + +// MakeValidation is a helper method to define mock.On call +func (_e *Application_Expecter) MakeValidation() *Application_MakeValidation_Call { + return &Application_MakeValidation_Call{Call: _e.mock.On("MakeValidation")} +} + +func (_c *Application_MakeValidation_Call) Run(run func()) *Application_MakeValidation_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_MakeValidation_Call) Return(_a0 validation.Validation) *Application_MakeValidation_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_MakeValidation_Call) RunAndReturn(run func() validation.Validation) *Application_MakeValidation_Call { + _c.Call.Return(run) + return _c +} + // MakeView provides a mock function with given fields: func (_m *Application) MakeView() http.View { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeView") + } + var r0 http.View if rf, ok := ret.Get(0).(func() http.View); ok { r0 = rf() @@ -561,10 +1673,41 @@ func (_m *Application) MakeView() http.View { return r0 } +// Application_MakeView_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeView' +type Application_MakeView_Call struct { + *mock.Call +} + +// MakeView is a helper method to define mock.On call +func (_e *Application_Expecter) MakeView() *Application_MakeView_Call { + return &Application_MakeView_Call{Call: _e.mock.On("MakeView")} +} + +func (_c *Application_MakeView_Call) Run(run func()) *Application_MakeView_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_MakeView_Call) Return(_a0 http.View) *Application_MakeView_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_MakeView_Call) RunAndReturn(run func() http.View) *Application_MakeView_Call { + _c.Call.Return(run) + return _c +} + // MakeWith provides a mock function with given fields: key, parameters func (_m *Application) MakeWith(key interface{}, parameters map[string]interface{}) (interface{}, error) { ret := _m.Called(key, parameters) + if len(ret) == 0 { + panic("no return value specified for MakeWith") + } + var r0 interface{} var r1 error if rf, ok := ret.Get(0).(func(interface{}, map[string]interface{}) (interface{}, error)); ok { @@ -587,10 +1730,43 @@ func (_m *Application) MakeWith(key interface{}, parameters map[string]interface return r0, r1 } +// Application_MakeWith_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeWith' +type Application_MakeWith_Call struct { + *mock.Call +} + +// MakeWith is a helper method to define mock.On call +// - key interface{} +// - parameters map[string]interface{} +func (_e *Application_Expecter) MakeWith(key interface{}, parameters interface{}) *Application_MakeWith_Call { + return &Application_MakeWith_Call{Call: _e.mock.On("MakeWith", key, parameters)} +} + +func (_c *Application_MakeWith_Call) Run(run func(key interface{}, parameters map[string]interface{})) *Application_MakeWith_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{}), args[1].(map[string]interface{})) + }) + return _c +} + +func (_c *Application_MakeWith_Call) Return(_a0 interface{}, _a1 error) *Application_MakeWith_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Application_MakeWith_Call) RunAndReturn(run func(interface{}, map[string]interface{}) (interface{}, error)) *Application_MakeWith_Call { + _c.Call.Return(run) + return _c +} + // Path provides a mock function with given fields: path func (_m *Application) Path(path string) string { ret := _m.Called(path) + if len(ret) == 0 { + panic("no return value specified for Path") + } + var r0 string if rf, ok := ret.Get(0).(func(string) string); ok { r0 = rf(path) @@ -601,10 +1777,42 @@ func (_m *Application) Path(path string) string { return r0 } +// Application_Path_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Path' +type Application_Path_Call struct { + *mock.Call +} + +// Path is a helper method to define mock.On call +// - path string +func (_e *Application_Expecter) Path(path interface{}) *Application_Path_Call { + return &Application_Path_Call{Call: _e.mock.On("Path", path)} +} + +func (_c *Application_Path_Call) Run(run func(path string)) *Application_Path_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Application_Path_Call) Return(_a0 string) *Application_Path_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_Path_Call) RunAndReturn(run func(string) string) *Application_Path_Call { + _c.Call.Return(run) + return _c +} + // PublicPath provides a mock function with given fields: path func (_m *Application) PublicPath(path string) string { ret := _m.Called(path) + if len(ret) == 0 { + panic("no return value specified for PublicPath") + } + var r0 string if rf, ok := ret.Get(0).(func(string) string); ok { r0 = rf(path) @@ -615,6 +1823,34 @@ func (_m *Application) PublicPath(path string) string { return r0 } +// Application_PublicPath_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PublicPath' +type Application_PublicPath_Call struct { + *mock.Call +} + +// PublicPath is a helper method to define mock.On call +// - path string +func (_e *Application_Expecter) PublicPath(path interface{}) *Application_PublicPath_Call { + return &Application_PublicPath_Call{Call: _e.mock.On("PublicPath", path)} +} + +func (_c *Application_PublicPath_Call) Run(run func(path string)) *Application_PublicPath_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Application_PublicPath_Call) Return(_a0 string) *Application_PublicPath_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_PublicPath_Call) RunAndReturn(run func(string) string) *Application_PublicPath_Call { + _c.Call.Return(run) + return _c +} + // Publishes provides a mock function with given fields: packageName, paths, groups func (_m *Application) Publishes(packageName string, paths map[string]string, groups ...string) { _va := make([]interface{}, len(groups)) @@ -627,10 +1863,51 @@ func (_m *Application) Publishes(packageName string, paths map[string]string, gr _m.Called(_ca...) } +// Application_Publishes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Publishes' +type Application_Publishes_Call struct { + *mock.Call +} + +// Publishes is a helper method to define mock.On call +// - packageName string +// - paths map[string]string +// - groups ...string +func (_e *Application_Expecter) Publishes(packageName interface{}, paths interface{}, groups ...interface{}) *Application_Publishes_Call { + return &Application_Publishes_Call{Call: _e.mock.On("Publishes", + append([]interface{}{packageName, paths}, groups...)...)} +} + +func (_c *Application_Publishes_Call) Run(run func(packageName string, paths map[string]string, groups ...string)) *Application_Publishes_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(args[0].(string), args[1].(map[string]string), variadicArgs...) + }) + return _c +} + +func (_c *Application_Publishes_Call) Return() *Application_Publishes_Call { + _c.Call.Return() + return _c +} + +func (_c *Application_Publishes_Call) RunAndReturn(run func(string, map[string]string, ...string)) *Application_Publishes_Call { + _c.Call.Return(run) + return _c +} + // SetLocale provides a mock function with given fields: ctx, locale func (_m *Application) SetLocale(ctx context.Context, locale string) context.Context { ret := _m.Called(ctx, locale) + if len(ret) == 0 { + panic("no return value specified for SetLocale") + } + var r0 context.Context if rf, ok := ret.Get(0).(func(context.Context, string) context.Context); ok { r0 = rf(ctx, locale) @@ -643,15 +1920,77 @@ func (_m *Application) SetLocale(ctx context.Context, locale string) context.Con return r0 } +// Application_SetLocale_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLocale' +type Application_SetLocale_Call struct { + *mock.Call +} + +// SetLocale is a helper method to define mock.On call +// - ctx context.Context +// - locale string +func (_e *Application_Expecter) SetLocale(ctx interface{}, locale interface{}) *Application_SetLocale_Call { + return &Application_SetLocale_Call{Call: _e.mock.On("SetLocale", ctx, locale)} +} + +func (_c *Application_SetLocale_Call) Run(run func(ctx context.Context, locale string)) *Application_SetLocale_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Application_SetLocale_Call) Return(_a0 context.Context) *Application_SetLocale_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_SetLocale_Call) RunAndReturn(run func(context.Context, string) context.Context) *Application_SetLocale_Call { + _c.Call.Return(run) + return _c +} + // Singleton provides a mock function with given fields: key, callback func (_m *Application) Singleton(key interface{}, callback func(foundation.Application) (interface{}, error)) { _m.Called(key, callback) } +// Application_Singleton_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Singleton' +type Application_Singleton_Call struct { + *mock.Call +} + +// Singleton is a helper method to define mock.On call +// - key interface{} +// - callback func(foundation.Application)(interface{} , error) +func (_e *Application_Expecter) Singleton(key interface{}, callback interface{}) *Application_Singleton_Call { + return &Application_Singleton_Call{Call: _e.mock.On("Singleton", key, callback)} +} + +func (_c *Application_Singleton_Call) Run(run func(key interface{}, callback func(foundation.Application) (interface{}, error))) *Application_Singleton_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{}), args[1].(func(foundation.Application) (interface{}, error))) + }) + return _c +} + +func (_c *Application_Singleton_Call) Return() *Application_Singleton_Call { + _c.Call.Return() + return _c +} + +func (_c *Application_Singleton_Call) RunAndReturn(run func(interface{}, func(foundation.Application) (interface{}, error))) *Application_Singleton_Call { + _c.Call.Return(run) + return _c +} + // StoragePath provides a mock function with given fields: path func (_m *Application) StoragePath(path string) string { ret := _m.Called(path) + if len(ret) == 0 { + panic("no return value specified for StoragePath") + } + var r0 string if rf, ok := ret.Get(0).(func(string) string); ok { r0 = rf(path) @@ -662,10 +2001,42 @@ func (_m *Application) StoragePath(path string) string { return r0 } +// Application_StoragePath_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StoragePath' +type Application_StoragePath_Call struct { + *mock.Call +} + +// StoragePath is a helper method to define mock.On call +// - path string +func (_e *Application_Expecter) StoragePath(path interface{}) *Application_StoragePath_Call { + return &Application_StoragePath_Call{Call: _e.mock.On("StoragePath", path)} +} + +func (_c *Application_StoragePath_Call) Run(run func(path string)) *Application_StoragePath_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Application_StoragePath_Call) Return(_a0 string) *Application_StoragePath_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_StoragePath_Call) RunAndReturn(run func(string) string) *Application_StoragePath_Call { + _c.Call.Return(run) + return _c +} + // Version provides a mock function with given fields: func (_m *Application) Version() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Version") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -676,6 +2047,33 @@ func (_m *Application) Version() string { return r0 } +// Application_Version_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Version' +type Application_Version_Call struct { + *mock.Call +} + +// Version is a helper method to define mock.On call +func (_e *Application_Expecter) Version() *Application_Version_Call { + return &Application_Version_Call{Call: _e.mock.On("Version")} +} + +func (_c *Application_Version_Call) Run(run func()) *Application_Version_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_Version_Call) Return(_a0 string) *Application_Version_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_Version_Call) RunAndReturn(run func() string) *Application_Version_Call { + _c.Call.Return(run) + return _c +} + // NewApplication creates a new instance of Application. 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 NewApplication(t interface { diff --git a/mocks/foundation/Container.go b/mocks/foundation/Container.go index ab97f6ba0..c0b20da4e 100644 --- a/mocks/foundation/Container.go +++ b/mocks/foundation/Container.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -42,6 +42,8 @@ import ( schedule "github.com/goravel/framework/contracts/schedule" + schema "github.com/goravel/framework/contracts/database/schema" + seeder "github.com/goravel/framework/contracts/database/seeder" session "github.com/goravel/framework/contracts/session" @@ -58,25 +60,124 @@ type Container struct { mock.Mock } +type Container_Expecter struct { + mock *mock.Mock +} + +func (_m *Container) EXPECT() *Container_Expecter { + return &Container_Expecter{mock: &_m.Mock} +} + // Bind provides a mock function with given fields: key, callback func (_m *Container) Bind(key interface{}, callback func(foundation.Application) (interface{}, error)) { _m.Called(key, callback) } +// Container_Bind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bind' +type Container_Bind_Call struct { + *mock.Call +} + +// Bind is a helper method to define mock.On call +// - key interface{} +// - callback func(foundation.Application)(interface{} , error) +func (_e *Container_Expecter) Bind(key interface{}, callback interface{}) *Container_Bind_Call { + return &Container_Bind_Call{Call: _e.mock.On("Bind", key, callback)} +} + +func (_c *Container_Bind_Call) Run(run func(key interface{}, callback func(foundation.Application) (interface{}, error))) *Container_Bind_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{}), args[1].(func(foundation.Application) (interface{}, error))) + }) + return _c +} + +func (_c *Container_Bind_Call) Return() *Container_Bind_Call { + _c.Call.Return() + return _c +} + +func (_c *Container_Bind_Call) RunAndReturn(run func(interface{}, func(foundation.Application) (interface{}, error))) *Container_Bind_Call { + _c.Call.Return(run) + return _c +} + // BindWith provides a mock function with given fields: key, callback func (_m *Container) BindWith(key interface{}, callback func(foundation.Application, map[string]interface{}) (interface{}, error)) { _m.Called(key, callback) } +// Container_BindWith_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BindWith' +type Container_BindWith_Call struct { + *mock.Call +} + +// BindWith is a helper method to define mock.On call +// - key interface{} +// - callback func(foundation.Application , map[string]interface{})(interface{} , error) +func (_e *Container_Expecter) BindWith(key interface{}, callback interface{}) *Container_BindWith_Call { + return &Container_BindWith_Call{Call: _e.mock.On("BindWith", key, callback)} +} + +func (_c *Container_BindWith_Call) Run(run func(key interface{}, callback func(foundation.Application, map[string]interface{}) (interface{}, error))) *Container_BindWith_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{}), args[1].(func(foundation.Application, map[string]interface{}) (interface{}, error))) + }) + return _c +} + +func (_c *Container_BindWith_Call) Return() *Container_BindWith_Call { + _c.Call.Return() + return _c +} + +func (_c *Container_BindWith_Call) RunAndReturn(run func(interface{}, func(foundation.Application, map[string]interface{}) (interface{}, error))) *Container_BindWith_Call { + _c.Call.Return(run) + return _c +} + // Instance provides a mock function with given fields: key, instance func (_m *Container) Instance(key interface{}, instance interface{}) { _m.Called(key, instance) } +// Container_Instance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Instance' +type Container_Instance_Call struct { + *mock.Call +} + +// Instance is a helper method to define mock.On call +// - key interface{} +// - instance interface{} +func (_e *Container_Expecter) Instance(key interface{}, instance interface{}) *Container_Instance_Call { + return &Container_Instance_Call{Call: _e.mock.On("Instance", key, instance)} +} + +func (_c *Container_Instance_Call) Run(run func(key interface{}, instance interface{})) *Container_Instance_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{}), args[1].(interface{})) + }) + return _c +} + +func (_c *Container_Instance_Call) Return() *Container_Instance_Call { + _c.Call.Return() + return _c +} + +func (_c *Container_Instance_Call) RunAndReturn(run func(interface{}, interface{})) *Container_Instance_Call { + _c.Call.Return(run) + return _c +} + // Make provides a mock function with given fields: key func (_m *Container) Make(key interface{}) (interface{}, error) { ret := _m.Called(key) + if len(ret) == 0 { + panic("no return value specified for Make") + } + var r0 interface{} var r1 error if rf, ok := ret.Get(0).(func(interface{}) (interface{}, error)); ok { @@ -99,10 +200,42 @@ func (_m *Container) Make(key interface{}) (interface{}, error) { return r0, r1 } +// Container_Make_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Make' +type Container_Make_Call struct { + *mock.Call +} + +// Make is a helper method to define mock.On call +// - key interface{} +func (_e *Container_Expecter) Make(key interface{}) *Container_Make_Call { + return &Container_Make_Call{Call: _e.mock.On("Make", key)} +} + +func (_c *Container_Make_Call) Run(run func(key interface{})) *Container_Make_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Container_Make_Call) Return(_a0 interface{}, _a1 error) *Container_Make_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Container_Make_Call) RunAndReturn(run func(interface{}) (interface{}, error)) *Container_Make_Call { + _c.Call.Return(run) + return _c +} + // MakeArtisan provides a mock function with given fields: func (_m *Container) MakeArtisan() console.Artisan { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeArtisan") + } + var r0 console.Artisan if rf, ok := ret.Get(0).(func() console.Artisan); ok { r0 = rf() @@ -115,10 +248,41 @@ func (_m *Container) MakeArtisan() console.Artisan { return r0 } +// Container_MakeArtisan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeArtisan' +type Container_MakeArtisan_Call struct { + *mock.Call +} + +// MakeArtisan is a helper method to define mock.On call +func (_e *Container_Expecter) MakeArtisan() *Container_MakeArtisan_Call { + return &Container_MakeArtisan_Call{Call: _e.mock.On("MakeArtisan")} +} + +func (_c *Container_MakeArtisan_Call) Run(run func()) *Container_MakeArtisan_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Container_MakeArtisan_Call) Return(_a0 console.Artisan) *Container_MakeArtisan_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Container_MakeArtisan_Call) RunAndReturn(run func() console.Artisan) *Container_MakeArtisan_Call { + _c.Call.Return(run) + return _c +} + // MakeAuth provides a mock function with given fields: ctx func (_m *Container) MakeAuth(ctx http.Context) auth.Auth { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for MakeAuth") + } + var r0 auth.Auth if rf, ok := ret.Get(0).(func(http.Context) auth.Auth); ok { r0 = rf(ctx) @@ -131,10 +295,42 @@ func (_m *Container) MakeAuth(ctx http.Context) auth.Auth { return r0 } +// Container_MakeAuth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeAuth' +type Container_MakeAuth_Call struct { + *mock.Call +} + +// MakeAuth is a helper method to define mock.On call +// - ctx http.Context +func (_e *Container_Expecter) MakeAuth(ctx interface{}) *Container_MakeAuth_Call { + return &Container_MakeAuth_Call{Call: _e.mock.On("MakeAuth", ctx)} +} + +func (_c *Container_MakeAuth_Call) Run(run func(ctx http.Context)) *Container_MakeAuth_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(http.Context)) + }) + return _c +} + +func (_c *Container_MakeAuth_Call) Return(_a0 auth.Auth) *Container_MakeAuth_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Container_MakeAuth_Call) RunAndReturn(run func(http.Context) auth.Auth) *Container_MakeAuth_Call { + _c.Call.Return(run) + return _c +} + // MakeCache provides a mock function with given fields: func (_m *Container) MakeCache() cache.Cache { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeCache") + } + var r0 cache.Cache if rf, ok := ret.Get(0).(func() cache.Cache); ok { r0 = rf() @@ -147,10 +343,41 @@ func (_m *Container) MakeCache() cache.Cache { return r0 } +// Container_MakeCache_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeCache' +type Container_MakeCache_Call struct { + *mock.Call +} + +// MakeCache is a helper method to define mock.On call +func (_e *Container_Expecter) MakeCache() *Container_MakeCache_Call { + return &Container_MakeCache_Call{Call: _e.mock.On("MakeCache")} +} + +func (_c *Container_MakeCache_Call) Run(run func()) *Container_MakeCache_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Container_MakeCache_Call) Return(_a0 cache.Cache) *Container_MakeCache_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Container_MakeCache_Call) RunAndReturn(run func() cache.Cache) *Container_MakeCache_Call { + _c.Call.Return(run) + return _c +} + // MakeConfig provides a mock function with given fields: func (_m *Container) MakeConfig() config.Config { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeConfig") + } + var r0 config.Config if rf, ok := ret.Get(0).(func() config.Config); ok { r0 = rf() @@ -163,10 +390,41 @@ func (_m *Container) MakeConfig() config.Config { return r0 } +// Container_MakeConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeConfig' +type Container_MakeConfig_Call struct { + *mock.Call +} + +// MakeConfig is a helper method to define mock.On call +func (_e *Container_Expecter) MakeConfig() *Container_MakeConfig_Call { + return &Container_MakeConfig_Call{Call: _e.mock.On("MakeConfig")} +} + +func (_c *Container_MakeConfig_Call) Run(run func()) *Container_MakeConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Container_MakeConfig_Call) Return(_a0 config.Config) *Container_MakeConfig_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Container_MakeConfig_Call) RunAndReturn(run func() config.Config) *Container_MakeConfig_Call { + _c.Call.Return(run) + return _c +} + // MakeCrypt provides a mock function with given fields: func (_m *Container) MakeCrypt() crypt.Crypt { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeCrypt") + } + var r0 crypt.Crypt if rf, ok := ret.Get(0).(func() crypt.Crypt); ok { r0 = rf() @@ -179,10 +437,41 @@ func (_m *Container) MakeCrypt() crypt.Crypt { return r0 } +// Container_MakeCrypt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeCrypt' +type Container_MakeCrypt_Call struct { + *mock.Call +} + +// MakeCrypt is a helper method to define mock.On call +func (_e *Container_Expecter) MakeCrypt() *Container_MakeCrypt_Call { + return &Container_MakeCrypt_Call{Call: _e.mock.On("MakeCrypt")} +} + +func (_c *Container_MakeCrypt_Call) Run(run func()) *Container_MakeCrypt_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Container_MakeCrypt_Call) Return(_a0 crypt.Crypt) *Container_MakeCrypt_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Container_MakeCrypt_Call) RunAndReturn(run func() crypt.Crypt) *Container_MakeCrypt_Call { + _c.Call.Return(run) + return _c +} + // MakeEvent provides a mock function with given fields: func (_m *Container) MakeEvent() event.Instance { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeEvent") + } + var r0 event.Instance if rf, ok := ret.Get(0).(func() event.Instance); ok { r0 = rf() @@ -195,10 +484,41 @@ func (_m *Container) MakeEvent() event.Instance { return r0 } +// Container_MakeEvent_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeEvent' +type Container_MakeEvent_Call struct { + *mock.Call +} + +// MakeEvent is a helper method to define mock.On call +func (_e *Container_Expecter) MakeEvent() *Container_MakeEvent_Call { + return &Container_MakeEvent_Call{Call: _e.mock.On("MakeEvent")} +} + +func (_c *Container_MakeEvent_Call) Run(run func()) *Container_MakeEvent_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Container_MakeEvent_Call) Return(_a0 event.Instance) *Container_MakeEvent_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Container_MakeEvent_Call) RunAndReturn(run func() event.Instance) *Container_MakeEvent_Call { + _c.Call.Return(run) + return _c +} + // MakeGate provides a mock function with given fields: func (_m *Container) MakeGate() access.Gate { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeGate") + } + var r0 access.Gate if rf, ok := ret.Get(0).(func() access.Gate); ok { r0 = rf() @@ -211,10 +531,41 @@ func (_m *Container) MakeGate() access.Gate { return r0 } +// Container_MakeGate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeGate' +type Container_MakeGate_Call struct { + *mock.Call +} + +// MakeGate is a helper method to define mock.On call +func (_e *Container_Expecter) MakeGate() *Container_MakeGate_Call { + return &Container_MakeGate_Call{Call: _e.mock.On("MakeGate")} +} + +func (_c *Container_MakeGate_Call) Run(run func()) *Container_MakeGate_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Container_MakeGate_Call) Return(_a0 access.Gate) *Container_MakeGate_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Container_MakeGate_Call) RunAndReturn(run func() access.Gate) *Container_MakeGate_Call { + _c.Call.Return(run) + return _c +} + // MakeGrpc provides a mock function with given fields: func (_m *Container) MakeGrpc() grpc.Grpc { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeGrpc") + } + var r0 grpc.Grpc if rf, ok := ret.Get(0).(func() grpc.Grpc); ok { r0 = rf() @@ -227,10 +578,41 @@ func (_m *Container) MakeGrpc() grpc.Grpc { return r0 } +// Container_MakeGrpc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeGrpc' +type Container_MakeGrpc_Call struct { + *mock.Call +} + +// MakeGrpc is a helper method to define mock.On call +func (_e *Container_Expecter) MakeGrpc() *Container_MakeGrpc_Call { + return &Container_MakeGrpc_Call{Call: _e.mock.On("MakeGrpc")} +} + +func (_c *Container_MakeGrpc_Call) Run(run func()) *Container_MakeGrpc_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Container_MakeGrpc_Call) Return(_a0 grpc.Grpc) *Container_MakeGrpc_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Container_MakeGrpc_Call) RunAndReturn(run func() grpc.Grpc) *Container_MakeGrpc_Call { + _c.Call.Return(run) + return _c +} + // MakeHash provides a mock function with given fields: func (_m *Container) MakeHash() hash.Hash { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeHash") + } + var r0 hash.Hash if rf, ok := ret.Get(0).(func() hash.Hash); ok { r0 = rf() @@ -243,10 +625,41 @@ func (_m *Container) MakeHash() hash.Hash { return r0 } +// Container_MakeHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeHash' +type Container_MakeHash_Call struct { + *mock.Call +} + +// MakeHash is a helper method to define mock.On call +func (_e *Container_Expecter) MakeHash() *Container_MakeHash_Call { + return &Container_MakeHash_Call{Call: _e.mock.On("MakeHash")} +} + +func (_c *Container_MakeHash_Call) Run(run func()) *Container_MakeHash_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Container_MakeHash_Call) Return(_a0 hash.Hash) *Container_MakeHash_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Container_MakeHash_Call) RunAndReturn(run func() hash.Hash) *Container_MakeHash_Call { + _c.Call.Return(run) + return _c +} + // MakeLang provides a mock function with given fields: ctx func (_m *Container) MakeLang(ctx context.Context) translation.Translator { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for MakeLang") + } + var r0 translation.Translator if rf, ok := ret.Get(0).(func(context.Context) translation.Translator); ok { r0 = rf(ctx) @@ -259,10 +672,42 @@ func (_m *Container) MakeLang(ctx context.Context) translation.Translator { return r0 } +// Container_MakeLang_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeLang' +type Container_MakeLang_Call struct { + *mock.Call +} + +// MakeLang is a helper method to define mock.On call +// - ctx context.Context +func (_e *Container_Expecter) MakeLang(ctx interface{}) *Container_MakeLang_Call { + return &Container_MakeLang_Call{Call: _e.mock.On("MakeLang", ctx)} +} + +func (_c *Container_MakeLang_Call) Run(run func(ctx context.Context)) *Container_MakeLang_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Container_MakeLang_Call) Return(_a0 translation.Translator) *Container_MakeLang_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Container_MakeLang_Call) RunAndReturn(run func(context.Context) translation.Translator) *Container_MakeLang_Call { + _c.Call.Return(run) + return _c +} + // MakeLog provides a mock function with given fields: func (_m *Container) MakeLog() log.Log { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeLog") + } + var r0 log.Log if rf, ok := ret.Get(0).(func() log.Log); ok { r0 = rf() @@ -275,10 +720,41 @@ func (_m *Container) MakeLog() log.Log { return r0 } +// Container_MakeLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeLog' +type Container_MakeLog_Call struct { + *mock.Call +} + +// MakeLog is a helper method to define mock.On call +func (_e *Container_Expecter) MakeLog() *Container_MakeLog_Call { + return &Container_MakeLog_Call{Call: _e.mock.On("MakeLog")} +} + +func (_c *Container_MakeLog_Call) Run(run func()) *Container_MakeLog_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Container_MakeLog_Call) Return(_a0 log.Log) *Container_MakeLog_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Container_MakeLog_Call) RunAndReturn(run func() log.Log) *Container_MakeLog_Call { + _c.Call.Return(run) + return _c +} + // MakeMail provides a mock function with given fields: func (_m *Container) MakeMail() mail.Mail { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeMail") + } + var r0 mail.Mail if rf, ok := ret.Get(0).(func() mail.Mail); ok { r0 = rf() @@ -291,10 +767,41 @@ func (_m *Container) MakeMail() mail.Mail { return r0 } +// Container_MakeMail_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeMail' +type Container_MakeMail_Call struct { + *mock.Call +} + +// MakeMail is a helper method to define mock.On call +func (_e *Container_Expecter) MakeMail() *Container_MakeMail_Call { + return &Container_MakeMail_Call{Call: _e.mock.On("MakeMail")} +} + +func (_c *Container_MakeMail_Call) Run(run func()) *Container_MakeMail_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Container_MakeMail_Call) Return(_a0 mail.Mail) *Container_MakeMail_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Container_MakeMail_Call) RunAndReturn(run func() mail.Mail) *Container_MakeMail_Call { + _c.Call.Return(run) + return _c +} + // MakeOrm provides a mock function with given fields: func (_m *Container) MakeOrm() orm.Orm { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeOrm") + } + var r0 orm.Orm if rf, ok := ret.Get(0).(func() orm.Orm); ok { r0 = rf() @@ -307,10 +814,41 @@ func (_m *Container) MakeOrm() orm.Orm { return r0 } +// Container_MakeOrm_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeOrm' +type Container_MakeOrm_Call struct { + *mock.Call +} + +// MakeOrm is a helper method to define mock.On call +func (_e *Container_Expecter) MakeOrm() *Container_MakeOrm_Call { + return &Container_MakeOrm_Call{Call: _e.mock.On("MakeOrm")} +} + +func (_c *Container_MakeOrm_Call) Run(run func()) *Container_MakeOrm_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Container_MakeOrm_Call) Return(_a0 orm.Orm) *Container_MakeOrm_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Container_MakeOrm_Call) RunAndReturn(run func() orm.Orm) *Container_MakeOrm_Call { + _c.Call.Return(run) + return _c +} + // MakeQueue provides a mock function with given fields: func (_m *Container) MakeQueue() queue.Queue { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeQueue") + } + var r0 queue.Queue if rf, ok := ret.Get(0).(func() queue.Queue); ok { r0 = rf() @@ -323,10 +861,41 @@ func (_m *Container) MakeQueue() queue.Queue { return r0 } +// Container_MakeQueue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeQueue' +type Container_MakeQueue_Call struct { + *mock.Call +} + +// MakeQueue is a helper method to define mock.On call +func (_e *Container_Expecter) MakeQueue() *Container_MakeQueue_Call { + return &Container_MakeQueue_Call{Call: _e.mock.On("MakeQueue")} +} + +func (_c *Container_MakeQueue_Call) Run(run func()) *Container_MakeQueue_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Container_MakeQueue_Call) Return(_a0 queue.Queue) *Container_MakeQueue_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Container_MakeQueue_Call) RunAndReturn(run func() queue.Queue) *Container_MakeQueue_Call { + _c.Call.Return(run) + return _c +} + // MakeRateLimiter provides a mock function with given fields: func (_m *Container) MakeRateLimiter() http.RateLimiter { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeRateLimiter") + } + var r0 http.RateLimiter if rf, ok := ret.Get(0).(func() http.RateLimiter); ok { r0 = rf() @@ -339,10 +908,41 @@ func (_m *Container) MakeRateLimiter() http.RateLimiter { return r0 } +// Container_MakeRateLimiter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeRateLimiter' +type Container_MakeRateLimiter_Call struct { + *mock.Call +} + +// MakeRateLimiter is a helper method to define mock.On call +func (_e *Container_Expecter) MakeRateLimiter() *Container_MakeRateLimiter_Call { + return &Container_MakeRateLimiter_Call{Call: _e.mock.On("MakeRateLimiter")} +} + +func (_c *Container_MakeRateLimiter_Call) Run(run func()) *Container_MakeRateLimiter_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Container_MakeRateLimiter_Call) Return(_a0 http.RateLimiter) *Container_MakeRateLimiter_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Container_MakeRateLimiter_Call) RunAndReturn(run func() http.RateLimiter) *Container_MakeRateLimiter_Call { + _c.Call.Return(run) + return _c +} + // MakeRoute provides a mock function with given fields: func (_m *Container) MakeRoute() route.Route { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeRoute") + } + var r0 route.Route if rf, ok := ret.Get(0).(func() route.Route); ok { r0 = rf() @@ -355,10 +955,41 @@ func (_m *Container) MakeRoute() route.Route { return r0 } +// Container_MakeRoute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeRoute' +type Container_MakeRoute_Call struct { + *mock.Call +} + +// MakeRoute is a helper method to define mock.On call +func (_e *Container_Expecter) MakeRoute() *Container_MakeRoute_Call { + return &Container_MakeRoute_Call{Call: _e.mock.On("MakeRoute")} +} + +func (_c *Container_MakeRoute_Call) Run(run func()) *Container_MakeRoute_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Container_MakeRoute_Call) Return(_a0 route.Route) *Container_MakeRoute_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Container_MakeRoute_Call) RunAndReturn(run func() route.Route) *Container_MakeRoute_Call { + _c.Call.Return(run) + return _c +} + // MakeSchedule provides a mock function with given fields: func (_m *Container) MakeSchedule() schedule.Schedule { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeSchedule") + } + var r0 schedule.Schedule if rf, ok := ret.Get(0).(func() schedule.Schedule); ok { r0 = rf() @@ -371,10 +1002,88 @@ func (_m *Container) MakeSchedule() schedule.Schedule { return r0 } +// Container_MakeSchedule_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeSchedule' +type Container_MakeSchedule_Call struct { + *mock.Call +} + +// MakeSchedule is a helper method to define mock.On call +func (_e *Container_Expecter) MakeSchedule() *Container_MakeSchedule_Call { + return &Container_MakeSchedule_Call{Call: _e.mock.On("MakeSchedule")} +} + +func (_c *Container_MakeSchedule_Call) Run(run func()) *Container_MakeSchedule_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Container_MakeSchedule_Call) Return(_a0 schedule.Schedule) *Container_MakeSchedule_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Container_MakeSchedule_Call) RunAndReturn(run func() schedule.Schedule) *Container_MakeSchedule_Call { + _c.Call.Return(run) + return _c +} + +// MakeSchema provides a mock function with given fields: +func (_m *Container) MakeSchema() schema.Schema { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for MakeSchema") + } + + var r0 schema.Schema + if rf, ok := ret.Get(0).(func() schema.Schema); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(schema.Schema) + } + } + + return r0 +} + +// Container_MakeSchema_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeSchema' +type Container_MakeSchema_Call struct { + *mock.Call +} + +// MakeSchema is a helper method to define mock.On call +func (_e *Container_Expecter) MakeSchema() *Container_MakeSchema_Call { + return &Container_MakeSchema_Call{Call: _e.mock.On("MakeSchema")} +} + +func (_c *Container_MakeSchema_Call) Run(run func()) *Container_MakeSchema_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Container_MakeSchema_Call) Return(_a0 schema.Schema) *Container_MakeSchema_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Container_MakeSchema_Call) RunAndReturn(run func() schema.Schema) *Container_MakeSchema_Call { + _c.Call.Return(run) + return _c +} + // MakeSeeder provides a mock function with given fields: func (_m *Container) MakeSeeder() seeder.Facade { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeSeeder") + } + var r0 seeder.Facade if rf, ok := ret.Get(0).(func() seeder.Facade); ok { r0 = rf() @@ -387,10 +1096,41 @@ func (_m *Container) MakeSeeder() seeder.Facade { return r0 } +// Container_MakeSeeder_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeSeeder' +type Container_MakeSeeder_Call struct { + *mock.Call +} + +// MakeSeeder is a helper method to define mock.On call +func (_e *Container_Expecter) MakeSeeder() *Container_MakeSeeder_Call { + return &Container_MakeSeeder_Call{Call: _e.mock.On("MakeSeeder")} +} + +func (_c *Container_MakeSeeder_Call) Run(run func()) *Container_MakeSeeder_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Container_MakeSeeder_Call) Return(_a0 seeder.Facade) *Container_MakeSeeder_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Container_MakeSeeder_Call) RunAndReturn(run func() seeder.Facade) *Container_MakeSeeder_Call { + _c.Call.Return(run) + return _c +} + // MakeSession provides a mock function with given fields: func (_m *Container) MakeSession() session.Manager { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeSession") + } + var r0 session.Manager if rf, ok := ret.Get(0).(func() session.Manager); ok { r0 = rf() @@ -403,10 +1143,41 @@ func (_m *Container) MakeSession() session.Manager { return r0 } +// Container_MakeSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeSession' +type Container_MakeSession_Call struct { + *mock.Call +} + +// MakeSession is a helper method to define mock.On call +func (_e *Container_Expecter) MakeSession() *Container_MakeSession_Call { + return &Container_MakeSession_Call{Call: _e.mock.On("MakeSession")} +} + +func (_c *Container_MakeSession_Call) Run(run func()) *Container_MakeSession_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Container_MakeSession_Call) Return(_a0 session.Manager) *Container_MakeSession_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Container_MakeSession_Call) RunAndReturn(run func() session.Manager) *Container_MakeSession_Call { + _c.Call.Return(run) + return _c +} + // MakeStorage provides a mock function with given fields: func (_m *Container) MakeStorage() filesystem.Storage { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeStorage") + } + var r0 filesystem.Storage if rf, ok := ret.Get(0).(func() filesystem.Storage); ok { r0 = rf() @@ -419,10 +1190,41 @@ func (_m *Container) MakeStorage() filesystem.Storage { return r0 } +// Container_MakeStorage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeStorage' +type Container_MakeStorage_Call struct { + *mock.Call +} + +// MakeStorage is a helper method to define mock.On call +func (_e *Container_Expecter) MakeStorage() *Container_MakeStorage_Call { + return &Container_MakeStorage_Call{Call: _e.mock.On("MakeStorage")} +} + +func (_c *Container_MakeStorage_Call) Run(run func()) *Container_MakeStorage_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Container_MakeStorage_Call) Return(_a0 filesystem.Storage) *Container_MakeStorage_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Container_MakeStorage_Call) RunAndReturn(run func() filesystem.Storage) *Container_MakeStorage_Call { + _c.Call.Return(run) + return _c +} + // MakeTesting provides a mock function with given fields: func (_m *Container) MakeTesting() testing.Testing { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeTesting") + } + var r0 testing.Testing if rf, ok := ret.Get(0).(func() testing.Testing); ok { r0 = rf() @@ -435,10 +1237,41 @@ func (_m *Container) MakeTesting() testing.Testing { return r0 } +// Container_MakeTesting_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeTesting' +type Container_MakeTesting_Call struct { + *mock.Call +} + +// MakeTesting is a helper method to define mock.On call +func (_e *Container_Expecter) MakeTesting() *Container_MakeTesting_Call { + return &Container_MakeTesting_Call{Call: _e.mock.On("MakeTesting")} +} + +func (_c *Container_MakeTesting_Call) Run(run func()) *Container_MakeTesting_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Container_MakeTesting_Call) Return(_a0 testing.Testing) *Container_MakeTesting_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Container_MakeTesting_Call) RunAndReturn(run func() testing.Testing) *Container_MakeTesting_Call { + _c.Call.Return(run) + return _c +} + // MakeValidation provides a mock function with given fields: func (_m *Container) MakeValidation() validation.Validation { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeValidation") + } + var r0 validation.Validation if rf, ok := ret.Get(0).(func() validation.Validation); ok { r0 = rf() @@ -451,10 +1284,41 @@ func (_m *Container) MakeValidation() validation.Validation { return r0 } +// Container_MakeValidation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeValidation' +type Container_MakeValidation_Call struct { + *mock.Call +} + +// MakeValidation is a helper method to define mock.On call +func (_e *Container_Expecter) MakeValidation() *Container_MakeValidation_Call { + return &Container_MakeValidation_Call{Call: _e.mock.On("MakeValidation")} +} + +func (_c *Container_MakeValidation_Call) Run(run func()) *Container_MakeValidation_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Container_MakeValidation_Call) Return(_a0 validation.Validation) *Container_MakeValidation_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Container_MakeValidation_Call) RunAndReturn(run func() validation.Validation) *Container_MakeValidation_Call { + _c.Call.Return(run) + return _c +} + // MakeView provides a mock function with given fields: func (_m *Container) MakeView() http.View { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for MakeView") + } + var r0 http.View if rf, ok := ret.Get(0).(func() http.View); ok { r0 = rf() @@ -467,10 +1331,41 @@ func (_m *Container) MakeView() http.View { return r0 } +// Container_MakeView_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeView' +type Container_MakeView_Call struct { + *mock.Call +} + +// MakeView is a helper method to define mock.On call +func (_e *Container_Expecter) MakeView() *Container_MakeView_Call { + return &Container_MakeView_Call{Call: _e.mock.On("MakeView")} +} + +func (_c *Container_MakeView_Call) Run(run func()) *Container_MakeView_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Container_MakeView_Call) Return(_a0 http.View) *Container_MakeView_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Container_MakeView_Call) RunAndReturn(run func() http.View) *Container_MakeView_Call { + _c.Call.Return(run) + return _c +} + // MakeWith provides a mock function with given fields: key, parameters func (_m *Container) MakeWith(key interface{}, parameters map[string]interface{}) (interface{}, error) { ret := _m.Called(key, parameters) + if len(ret) == 0 { + panic("no return value specified for MakeWith") + } + var r0 interface{} var r1 error if rf, ok := ret.Get(0).(func(interface{}, map[string]interface{}) (interface{}, error)); ok { @@ -493,11 +1388,69 @@ func (_m *Container) MakeWith(key interface{}, parameters map[string]interface{} return r0, r1 } +// Container_MakeWith_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeWith' +type Container_MakeWith_Call struct { + *mock.Call +} + +// MakeWith is a helper method to define mock.On call +// - key interface{} +// - parameters map[string]interface{} +func (_e *Container_Expecter) MakeWith(key interface{}, parameters interface{}) *Container_MakeWith_Call { + return &Container_MakeWith_Call{Call: _e.mock.On("MakeWith", key, parameters)} +} + +func (_c *Container_MakeWith_Call) Run(run func(key interface{}, parameters map[string]interface{})) *Container_MakeWith_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{}), args[1].(map[string]interface{})) + }) + return _c +} + +func (_c *Container_MakeWith_Call) Return(_a0 interface{}, _a1 error) *Container_MakeWith_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Container_MakeWith_Call) RunAndReturn(run func(interface{}, map[string]interface{}) (interface{}, error)) *Container_MakeWith_Call { + _c.Call.Return(run) + return _c +} + // Singleton provides a mock function with given fields: key, callback func (_m *Container) Singleton(key interface{}, callback func(foundation.Application) (interface{}, error)) { _m.Called(key, callback) } +// Container_Singleton_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Singleton' +type Container_Singleton_Call struct { + *mock.Call +} + +// Singleton is a helper method to define mock.On call +// - key interface{} +// - callback func(foundation.Application)(interface{} , error) +func (_e *Container_Expecter) Singleton(key interface{}, callback interface{}) *Container_Singleton_Call { + return &Container_Singleton_Call{Call: _e.mock.On("Singleton", key, callback)} +} + +func (_c *Container_Singleton_Call) Run(run func(key interface{}, callback func(foundation.Application) (interface{}, error))) *Container_Singleton_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{}), args[1].(func(foundation.Application) (interface{}, error))) + }) + return _c +} + +func (_c *Container_Singleton_Call) Return() *Container_Singleton_Call { + _c.Call.Return() + return _c +} + +func (_c *Container_Singleton_Call) RunAndReturn(run func(interface{}, func(foundation.Application) (interface{}, error))) *Container_Singleton_Call { + _c.Call.Return(run) + return _c +} + // NewContainer creates a new instance of Container. 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 NewContainer(t interface { diff --git a/mocks/foundation/ServiceProvider.go b/mocks/foundation/ServiceProvider.go index 134b12fe3..e3de617cc 100644 --- a/mocks/foundation/ServiceProvider.go +++ b/mocks/foundation/ServiceProvider.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,16 +12,80 @@ type ServiceProvider struct { mock.Mock } +type ServiceProvider_Expecter struct { + mock *mock.Mock +} + +func (_m *ServiceProvider) EXPECT() *ServiceProvider_Expecter { + return &ServiceProvider_Expecter{mock: &_m.Mock} +} + // Boot provides a mock function with given fields: app func (_m *ServiceProvider) Boot(app foundation.Application) { _m.Called(app) } +// ServiceProvider_Boot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Boot' +type ServiceProvider_Boot_Call struct { + *mock.Call +} + +// Boot is a helper method to define mock.On call +// - app foundation.Application +func (_e *ServiceProvider_Expecter) Boot(app interface{}) *ServiceProvider_Boot_Call { + return &ServiceProvider_Boot_Call{Call: _e.mock.On("Boot", app)} +} + +func (_c *ServiceProvider_Boot_Call) Run(run func(app foundation.Application)) *ServiceProvider_Boot_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(foundation.Application)) + }) + return _c +} + +func (_c *ServiceProvider_Boot_Call) Return() *ServiceProvider_Boot_Call { + _c.Call.Return() + return _c +} + +func (_c *ServiceProvider_Boot_Call) RunAndReturn(run func(foundation.Application)) *ServiceProvider_Boot_Call { + _c.Call.Return(run) + return _c +} + // Register provides a mock function with given fields: app func (_m *ServiceProvider) Register(app foundation.Application) { _m.Called(app) } +// ServiceProvider_Register_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Register' +type ServiceProvider_Register_Call struct { + *mock.Call +} + +// Register is a helper method to define mock.On call +// - app foundation.Application +func (_e *ServiceProvider_Expecter) Register(app interface{}) *ServiceProvider_Register_Call { + return &ServiceProvider_Register_Call{Call: _e.mock.On("Register", app)} +} + +func (_c *ServiceProvider_Register_Call) Run(run func(app foundation.Application)) *ServiceProvider_Register_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(foundation.Application)) + }) + return _c +} + +func (_c *ServiceProvider_Register_Call) Return() *ServiceProvider_Register_Call { + _c.Call.Return() + return _c +} + +func (_c *ServiceProvider_Register_Call) RunAndReturn(run func(foundation.Application)) *ServiceProvider_Register_Call { + _c.Call.Return(run) + return _c +} + // NewServiceProvider creates a new instance of ServiceProvider. 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 NewServiceProvider(t interface { diff --git a/mocks/grpc/Grpc.go b/mocks/grpc/Grpc.go index 5c0ae592f..226949d05 100644 --- a/mocks/grpc/Grpc.go +++ b/mocks/grpc/Grpc.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -15,10 +15,22 @@ type Grpc struct { mock.Mock } +type Grpc_Expecter struct { + mock *mock.Mock +} + +func (_m *Grpc) EXPECT() *Grpc_Expecter { + return &Grpc_Expecter{mock: &_m.Mock} +} + // Client provides a mock function with given fields: ctx, name func (_m *Grpc) Client(ctx context.Context, name string) (*grpc.ClientConn, error) { ret := _m.Called(ctx, name) + if len(ret) == 0 { + panic("no return value specified for Client") + } + var r0 *grpc.ClientConn var r1 error if rf, ok := ret.Get(0).(func(context.Context, string) (*grpc.ClientConn, error)); ok { @@ -41,6 +53,35 @@ func (_m *Grpc) Client(ctx context.Context, name string) (*grpc.ClientConn, erro return r0, r1 } +// Grpc_Client_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Client' +type Grpc_Client_Call struct { + *mock.Call +} + +// Client is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *Grpc_Expecter) Client(ctx interface{}, name interface{}) *Grpc_Client_Call { + return &Grpc_Client_Call{Call: _e.mock.On("Client", ctx, name)} +} + +func (_c *Grpc_Client_Call) Run(run func(ctx context.Context, name string)) *Grpc_Client_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Grpc_Client_Call) Return(_a0 *grpc.ClientConn, _a1 error) *Grpc_Client_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Grpc_Client_Call) RunAndReturn(run func(context.Context, string) (*grpc.ClientConn, error)) *Grpc_Client_Call { + _c.Call.Return(run) + return _c +} + // Run provides a mock function with given fields: host func (_m *Grpc) Run(host ...string) error { _va := make([]interface{}, len(host)) @@ -51,6 +92,10 @@ func (_m *Grpc) Run(host ...string) error { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Run") + } + var r0 error if rf, ok := ret.Get(0).(func(...string) error); ok { r0 = rf(host...) @@ -61,10 +106,49 @@ func (_m *Grpc) Run(host ...string) error { return r0 } +// Grpc_Run_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Run' +type Grpc_Run_Call struct { + *mock.Call +} + +// Run is a helper method to define mock.On call +// - host ...string +func (_e *Grpc_Expecter) Run(host ...interface{}) *Grpc_Run_Call { + return &Grpc_Run_Call{Call: _e.mock.On("Run", + append([]interface{}{}, host...)...)} +} + +func (_c *Grpc_Run_Call) Run(run func(host ...string)) *Grpc_Run_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Grpc_Run_Call) Return(_a0 error) *Grpc_Run_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grpc_Run_Call) RunAndReturn(run func(...string) error) *Grpc_Run_Call { + _c.Call.Return(run) + return _c +} + // Server provides a mock function with given fields: func (_m *Grpc) Server() *grpc.Server { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Server") + } + var r0 *grpc.Server if rf, ok := ret.Get(0).(func() *grpc.Server); ok { r0 = rf() @@ -77,16 +161,99 @@ func (_m *Grpc) Server() *grpc.Server { return r0 } +// Grpc_Server_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Server' +type Grpc_Server_Call struct { + *mock.Call +} + +// Server is a helper method to define mock.On call +func (_e *Grpc_Expecter) Server() *Grpc_Server_Call { + return &Grpc_Server_Call{Call: _e.mock.On("Server")} +} + +func (_c *Grpc_Server_Call) Run(run func()) *Grpc_Server_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Grpc_Server_Call) Return(_a0 *grpc.Server) *Grpc_Server_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Grpc_Server_Call) RunAndReturn(run func() *grpc.Server) *Grpc_Server_Call { + _c.Call.Return(run) + return _c +} + // UnaryClientInterceptorGroups provides a mock function with given fields: _a0 func (_m *Grpc) UnaryClientInterceptorGroups(_a0 map[string][]grpc.UnaryClientInterceptor) { _m.Called(_a0) } +// Grpc_UnaryClientInterceptorGroups_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnaryClientInterceptorGroups' +type Grpc_UnaryClientInterceptorGroups_Call struct { + *mock.Call +} + +// UnaryClientInterceptorGroups is a helper method to define mock.On call +// - _a0 map[string][]grpc.UnaryClientInterceptor +func (_e *Grpc_Expecter) UnaryClientInterceptorGroups(_a0 interface{}) *Grpc_UnaryClientInterceptorGroups_Call { + return &Grpc_UnaryClientInterceptorGroups_Call{Call: _e.mock.On("UnaryClientInterceptorGroups", _a0)} +} + +func (_c *Grpc_UnaryClientInterceptorGroups_Call) Run(run func(_a0 map[string][]grpc.UnaryClientInterceptor)) *Grpc_UnaryClientInterceptorGroups_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(map[string][]grpc.UnaryClientInterceptor)) + }) + return _c +} + +func (_c *Grpc_UnaryClientInterceptorGroups_Call) Return() *Grpc_UnaryClientInterceptorGroups_Call { + _c.Call.Return() + return _c +} + +func (_c *Grpc_UnaryClientInterceptorGroups_Call) RunAndReturn(run func(map[string][]grpc.UnaryClientInterceptor)) *Grpc_UnaryClientInterceptorGroups_Call { + _c.Call.Return(run) + return _c +} + // UnaryServerInterceptors provides a mock function with given fields: _a0 func (_m *Grpc) UnaryServerInterceptors(_a0 []grpc.UnaryServerInterceptor) { _m.Called(_a0) } +// Grpc_UnaryServerInterceptors_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnaryServerInterceptors' +type Grpc_UnaryServerInterceptors_Call struct { + *mock.Call +} + +// UnaryServerInterceptors is a helper method to define mock.On call +// - _a0 []grpc.UnaryServerInterceptor +func (_e *Grpc_Expecter) UnaryServerInterceptors(_a0 interface{}) *Grpc_UnaryServerInterceptors_Call { + return &Grpc_UnaryServerInterceptors_Call{Call: _e.mock.On("UnaryServerInterceptors", _a0)} +} + +func (_c *Grpc_UnaryServerInterceptors_Call) Run(run func(_a0 []grpc.UnaryServerInterceptor)) *Grpc_UnaryServerInterceptors_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]grpc.UnaryServerInterceptor)) + }) + return _c +} + +func (_c *Grpc_UnaryServerInterceptors_Call) Return() *Grpc_UnaryServerInterceptors_Call { + _c.Call.Return() + return _c +} + +func (_c *Grpc_UnaryServerInterceptors_Call) RunAndReturn(run func([]grpc.UnaryServerInterceptor)) *Grpc_UnaryServerInterceptors_Call { + _c.Call.Return(run) + return _c +} + // NewGrpc creates a new instance of Grpc. 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 NewGrpc(t interface { diff --git a/mocks/hash/Hash.go b/mocks/hash/Hash.go index 0e3b6cd86..aaf5c9e80 100644 --- a/mocks/hash/Hash.go +++ b/mocks/hash/Hash.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -9,10 +9,22 @@ type Hash struct { mock.Mock } +type Hash_Expecter struct { + mock *mock.Mock +} + +func (_m *Hash) EXPECT() *Hash_Expecter { + return &Hash_Expecter{mock: &_m.Mock} +} + // Check provides a mock function with given fields: value, hashedValue func (_m *Hash) Check(value string, hashedValue string) bool { ret := _m.Called(value, hashedValue) + if len(ret) == 0 { + panic("no return value specified for Check") + } + var r0 bool if rf, ok := ret.Get(0).(func(string, string) bool); ok { r0 = rf(value, hashedValue) @@ -23,10 +35,43 @@ func (_m *Hash) Check(value string, hashedValue string) bool { return r0 } +// Hash_Check_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Check' +type Hash_Check_Call struct { + *mock.Call +} + +// Check is a helper method to define mock.On call +// - value string +// - hashedValue string +func (_e *Hash_Expecter) Check(value interface{}, hashedValue interface{}) *Hash_Check_Call { + return &Hash_Check_Call{Call: _e.mock.On("Check", value, hashedValue)} +} + +func (_c *Hash_Check_Call) Run(run func(value string, hashedValue string)) *Hash_Check_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Hash_Check_Call) Return(_a0 bool) *Hash_Check_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Hash_Check_Call) RunAndReturn(run func(string, string) bool) *Hash_Check_Call { + _c.Call.Return(run) + return _c +} + // Make provides a mock function with given fields: value func (_m *Hash) Make(value string) (string, error) { ret := _m.Called(value) + if len(ret) == 0 { + panic("no return value specified for Make") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func(string) (string, error)); ok { @@ -47,10 +92,42 @@ func (_m *Hash) Make(value string) (string, error) { return r0, r1 } +// Hash_Make_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Make' +type Hash_Make_Call struct { + *mock.Call +} + +// Make is a helper method to define mock.On call +// - value string +func (_e *Hash_Expecter) Make(value interface{}) *Hash_Make_Call { + return &Hash_Make_Call{Call: _e.mock.On("Make", value)} +} + +func (_c *Hash_Make_Call) Run(run func(value string)) *Hash_Make_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Hash_Make_Call) Return(_a0 string, _a1 error) *Hash_Make_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Hash_Make_Call) RunAndReturn(run func(string) (string, error)) *Hash_Make_Call { + _c.Call.Return(run) + return _c +} + // NeedsRehash provides a mock function with given fields: hashedValue func (_m *Hash) NeedsRehash(hashedValue string) bool { ret := _m.Called(hashedValue) + if len(ret) == 0 { + panic("no return value specified for NeedsRehash") + } + var r0 bool if rf, ok := ret.Get(0).(func(string) bool); ok { r0 = rf(hashedValue) @@ -61,6 +138,34 @@ func (_m *Hash) NeedsRehash(hashedValue string) bool { return r0 } +// Hash_NeedsRehash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NeedsRehash' +type Hash_NeedsRehash_Call struct { + *mock.Call +} + +// NeedsRehash is a helper method to define mock.On call +// - hashedValue string +func (_e *Hash_Expecter) NeedsRehash(hashedValue interface{}) *Hash_NeedsRehash_Call { + return &Hash_NeedsRehash_Call{Call: _e.mock.On("NeedsRehash", hashedValue)} +} + +func (_c *Hash_NeedsRehash_Call) Run(run func(hashedValue string)) *Hash_NeedsRehash_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Hash_NeedsRehash_Call) Return(_a0 bool) *Hash_NeedsRehash_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Hash_NeedsRehash_Call) RunAndReturn(run func(string) bool) *Hash_NeedsRehash_Call { + _c.Call.Return(run) + return _c +} + // NewHash creates a new instance of Hash. 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 NewHash(t interface { diff --git a/mocks/http/Context.go b/mocks/http/Context.go index 47109b5bd..17b0f1197 100644 --- a/mocks/http/Context.go +++ b/mocks/http/Context.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -16,10 +16,22 @@ type Context struct { mock.Mock } +type Context_Expecter struct { + mock *mock.Mock +} + +func (_m *Context) EXPECT() *Context_Expecter { + return &Context_Expecter{mock: &_m.Mock} +} + // Context provides a mock function with given fields: func (_m *Context) Context() context.Context { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Context") + } + var r0 context.Context if rf, ok := ret.Get(0).(func() context.Context); ok { r0 = rf() @@ -32,10 +44,41 @@ func (_m *Context) Context() context.Context { return r0 } +// Context_Context_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Context' +type Context_Context_Call struct { + *mock.Call +} + +// Context is a helper method to define mock.On call +func (_e *Context_Expecter) Context() *Context_Context_Call { + return &Context_Context_Call{Call: _e.mock.On("Context")} +} + +func (_c *Context_Context_Call) Run(run func()) *Context_Context_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Context_Context_Call) Return(_a0 context.Context) *Context_Context_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_Context_Call) RunAndReturn(run func() context.Context) *Context_Context_Call { + _c.Call.Return(run) + return _c +} + // Deadline provides a mock function with given fields: func (_m *Context) Deadline() (time.Time, bool) { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Deadline") + } + var r0 time.Time var r1 bool if rf, ok := ret.Get(0).(func() (time.Time, bool)); ok { @@ -56,10 +99,41 @@ func (_m *Context) Deadline() (time.Time, bool) { return r0, r1 } +// Context_Deadline_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Deadline' +type Context_Deadline_Call struct { + *mock.Call +} + +// Deadline is a helper method to define mock.On call +func (_e *Context_Expecter) Deadline() *Context_Deadline_Call { + return &Context_Deadline_Call{Call: _e.mock.On("Deadline")} +} + +func (_c *Context_Deadline_Call) Run(run func()) *Context_Deadline_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Context_Deadline_Call) Return(deadline time.Time, ok bool) *Context_Deadline_Call { + _c.Call.Return(deadline, ok) + return _c +} + +func (_c *Context_Deadline_Call) RunAndReturn(run func() (time.Time, bool)) *Context_Deadline_Call { + _c.Call.Return(run) + return _c +} + // Done provides a mock function with given fields: func (_m *Context) Done() <-chan struct{} { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Done") + } + var r0 <-chan struct{} if rf, ok := ret.Get(0).(func() <-chan struct{}); ok { r0 = rf() @@ -72,10 +146,41 @@ func (_m *Context) Done() <-chan struct{} { return r0 } +// Context_Done_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Done' +type Context_Done_Call struct { + *mock.Call +} + +// Done is a helper method to define mock.On call +func (_e *Context_Expecter) Done() *Context_Done_Call { + return &Context_Done_Call{Call: _e.mock.On("Done")} +} + +func (_c *Context_Done_Call) Run(run func()) *Context_Done_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Context_Done_Call) Return(_a0 <-chan struct{}) *Context_Done_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_Done_Call) RunAndReturn(run func() <-chan struct{}) *Context_Done_Call { + _c.Call.Return(run) + return _c +} + // Err provides a mock function with given fields: func (_m *Context) Err() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Err") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -86,10 +191,41 @@ func (_m *Context) Err() error { return r0 } +// Context_Err_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Err' +type Context_Err_Call struct { + *mock.Call +} + +// Err is a helper method to define mock.On call +func (_e *Context_Expecter) Err() *Context_Err_Call { + return &Context_Err_Call{Call: _e.mock.On("Err")} +} + +func (_c *Context_Err_Call) Run(run func()) *Context_Err_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Context_Err_Call) Return(_a0 error) *Context_Err_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_Err_Call) RunAndReturn(run func() error) *Context_Err_Call { + _c.Call.Return(run) + return _c +} + // Request provides a mock function with given fields: func (_m *Context) Request() http.ContextRequest { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Request") + } + var r0 http.ContextRequest if rf, ok := ret.Get(0).(func() http.ContextRequest); ok { r0 = rf() @@ -102,10 +238,41 @@ func (_m *Context) Request() http.ContextRequest { return r0 } +// Context_Request_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Request' +type Context_Request_Call struct { + *mock.Call +} + +// Request is a helper method to define mock.On call +func (_e *Context_Expecter) Request() *Context_Request_Call { + return &Context_Request_Call{Call: _e.mock.On("Request")} +} + +func (_c *Context_Request_Call) Run(run func()) *Context_Request_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Context_Request_Call) Return(_a0 http.ContextRequest) *Context_Request_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_Request_Call) RunAndReturn(run func() http.ContextRequest) *Context_Request_Call { + _c.Call.Return(run) + return _c +} + // Response provides a mock function with given fields: func (_m *Context) Response() http.ContextResponse { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Response") + } + var r0 http.ContextResponse if rf, ok := ret.Get(0).(func() http.ContextResponse); ok { r0 = rf() @@ -118,10 +285,41 @@ func (_m *Context) Response() http.ContextResponse { return r0 } +// Context_Response_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Response' +type Context_Response_Call struct { + *mock.Call +} + +// Response is a helper method to define mock.On call +func (_e *Context_Expecter) Response() *Context_Response_Call { + return &Context_Response_Call{Call: _e.mock.On("Response")} +} + +func (_c *Context_Response_Call) Run(run func()) *Context_Response_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Context_Response_Call) Return(_a0 http.ContextResponse) *Context_Response_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_Response_Call) RunAndReturn(run func() http.ContextResponse) *Context_Response_Call { + _c.Call.Return(run) + return _c +} + // Value provides a mock function with given fields: key func (_m *Context) Value(key interface{}) interface{} { ret := _m.Called(key) + if len(ret) == 0 { + panic("no return value specified for Value") + } + var r0 interface{} if rf, ok := ret.Get(0).(func(interface{}) interface{}); ok { r0 = rf(key) @@ -134,11 +332,68 @@ func (_m *Context) Value(key interface{}) interface{} { return r0 } +// Context_Value_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Value' +type Context_Value_Call struct { + *mock.Call +} + +// Value is a helper method to define mock.On call +// - key interface{} +func (_e *Context_Expecter) Value(key interface{}) *Context_Value_Call { + return &Context_Value_Call{Call: _e.mock.On("Value", key)} +} + +func (_c *Context_Value_Call) Run(run func(key interface{})) *Context_Value_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Context_Value_Call) Return(_a0 interface{}) *Context_Value_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_Value_Call) RunAndReturn(run func(interface{}) interface{}) *Context_Value_Call { + _c.Call.Return(run) + return _c +} + // WithValue provides a mock function with given fields: key, value func (_m *Context) WithValue(key string, value interface{}) { _m.Called(key, value) } +// Context_WithValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithValue' +type Context_WithValue_Call struct { + *mock.Call +} + +// WithValue is a helper method to define mock.On call +// - key string +// - value interface{} +func (_e *Context_Expecter) WithValue(key interface{}, value interface{}) *Context_WithValue_Call { + return &Context_WithValue_Call{Call: _e.mock.On("WithValue", key, value)} +} + +func (_c *Context_WithValue_Call) Run(run func(key string, value interface{})) *Context_WithValue_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(interface{})) + }) + return _c +} + +func (_c *Context_WithValue_Call) Return() *Context_WithValue_Call { + _c.Call.Return() + return _c +} + +func (_c *Context_WithValue_Call) RunAndReturn(run func(string, interface{})) *Context_WithValue_Call { + _c.Call.Return(run) + return _c +} + // NewContext creates a new instance of Context. 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 NewContext(t interface { diff --git a/mocks/http/ContextRequest.go b/mocks/http/ContextRequest.go index 71a7ca250..ccb1e0e80 100644 --- a/mocks/http/ContextRequest.go +++ b/mocks/http/ContextRequest.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -18,20 +18,89 @@ type ContextRequest struct { mock.Mock } +type ContextRequest_Expecter struct { + mock *mock.Mock +} + +func (_m *ContextRequest) EXPECT() *ContextRequest_Expecter { + return &ContextRequest_Expecter{mock: &_m.Mock} +} + // AbortWithStatus provides a mock function with given fields: code func (_m *ContextRequest) AbortWithStatus(code int) { _m.Called(code) } +// ContextRequest_AbortWithStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AbortWithStatus' +type ContextRequest_AbortWithStatus_Call struct { + *mock.Call +} + +// AbortWithStatus is a helper method to define mock.On call +// - code int +func (_e *ContextRequest_Expecter) AbortWithStatus(code interface{}) *ContextRequest_AbortWithStatus_Call { + return &ContextRequest_AbortWithStatus_Call{Call: _e.mock.On("AbortWithStatus", code)} +} + +func (_c *ContextRequest_AbortWithStatus_Call) Run(run func(code int)) *ContextRequest_AbortWithStatus_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int)) + }) + return _c +} + +func (_c *ContextRequest_AbortWithStatus_Call) Return() *ContextRequest_AbortWithStatus_Call { + _c.Call.Return() + return _c +} + +func (_c *ContextRequest_AbortWithStatus_Call) RunAndReturn(run func(int)) *ContextRequest_AbortWithStatus_Call { + _c.Call.Return(run) + return _c +} + // AbortWithStatusJson provides a mock function with given fields: code, jsonObj func (_m *ContextRequest) AbortWithStatusJson(code int, jsonObj interface{}) { _m.Called(code, jsonObj) } +// ContextRequest_AbortWithStatusJson_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AbortWithStatusJson' +type ContextRequest_AbortWithStatusJson_Call struct { + *mock.Call +} + +// AbortWithStatusJson is a helper method to define mock.On call +// - code int +// - jsonObj interface{} +func (_e *ContextRequest_Expecter) AbortWithStatusJson(code interface{}, jsonObj interface{}) *ContextRequest_AbortWithStatusJson_Call { + return &ContextRequest_AbortWithStatusJson_Call{Call: _e.mock.On("AbortWithStatusJson", code, jsonObj)} +} + +func (_c *ContextRequest_AbortWithStatusJson_Call) Run(run func(code int, jsonObj interface{})) *ContextRequest_AbortWithStatusJson_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int), args[1].(interface{})) + }) + return _c +} + +func (_c *ContextRequest_AbortWithStatusJson_Call) Return() *ContextRequest_AbortWithStatusJson_Call { + _c.Call.Return() + return _c +} + +func (_c *ContextRequest_AbortWithStatusJson_Call) RunAndReturn(run func(int, interface{})) *ContextRequest_AbortWithStatusJson_Call { + _c.Call.Return(run) + return _c +} + // All provides a mock function with given fields: func (_m *ContextRequest) All() map[string]interface{} { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for All") + } + var r0 map[string]interface{} if rf, ok := ret.Get(0).(func() map[string]interface{}); ok { r0 = rf() @@ -44,10 +113,41 @@ func (_m *ContextRequest) All() map[string]interface{} { return r0 } +// ContextRequest_All_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'All' +type ContextRequest_All_Call struct { + *mock.Call +} + +// All is a helper method to define mock.On call +func (_e *ContextRequest_Expecter) All() *ContextRequest_All_Call { + return &ContextRequest_All_Call{Call: _e.mock.On("All")} +} + +func (_c *ContextRequest_All_Call) Run(run func()) *ContextRequest_All_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ContextRequest_All_Call) Return(_a0 map[string]interface{}) *ContextRequest_All_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextRequest_All_Call) RunAndReturn(run func() map[string]interface{}) *ContextRequest_All_Call { + _c.Call.Return(run) + return _c +} + // Bind provides a mock function with given fields: obj func (_m *ContextRequest) Bind(obj interface{}) error { ret := _m.Called(obj) + if len(ret) == 0 { + panic("no return value specified for Bind") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}) error); ok { r0 = rf(obj) @@ -58,6 +158,34 @@ func (_m *ContextRequest) Bind(obj interface{}) error { return r0 } +// ContextRequest_Bind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bind' +type ContextRequest_Bind_Call struct { + *mock.Call +} + +// Bind is a helper method to define mock.On call +// - obj interface{} +func (_e *ContextRequest_Expecter) Bind(obj interface{}) *ContextRequest_Bind_Call { + return &ContextRequest_Bind_Call{Call: _e.mock.On("Bind", obj)} +} + +func (_c *ContextRequest_Bind_Call) Run(run func(obj interface{})) *ContextRequest_Bind_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *ContextRequest_Bind_Call) Return(_a0 error) *ContextRequest_Bind_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextRequest_Bind_Call) RunAndReturn(run func(interface{}) error) *ContextRequest_Bind_Call { + _c.Call.Return(run) + return _c +} + // Cookie provides a mock function with given fields: key, defaultValue func (_m *ContextRequest) Cookie(key string, defaultValue ...string) string { _va := make([]interface{}, len(defaultValue)) @@ -69,6 +197,10 @@ func (_m *ContextRequest) Cookie(key string, defaultValue ...string) string { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Cookie") + } + var r0 string if rf, ok := ret.Get(0).(func(string, ...string) string); ok { r0 = rf(key, defaultValue...) @@ -79,10 +211,50 @@ func (_m *ContextRequest) Cookie(key string, defaultValue ...string) string { return r0 } +// ContextRequest_Cookie_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Cookie' +type ContextRequest_Cookie_Call struct { + *mock.Call +} + +// Cookie is a helper method to define mock.On call +// - key string +// - defaultValue ...string +func (_e *ContextRequest_Expecter) Cookie(key interface{}, defaultValue ...interface{}) *ContextRequest_Cookie_Call { + return &ContextRequest_Cookie_Call{Call: _e.mock.On("Cookie", + append([]interface{}{key}, defaultValue...)...)} +} + +func (_c *ContextRequest_Cookie_Call) Run(run func(key string, defaultValue ...string)) *ContextRequest_Cookie_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *ContextRequest_Cookie_Call) Return(_a0 string) *ContextRequest_Cookie_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextRequest_Cookie_Call) RunAndReturn(run func(string, ...string) string) *ContextRequest_Cookie_Call { + _c.Call.Return(run) + return _c +} + // File provides a mock function with given fields: name func (_m *ContextRequest) File(name string) (filesystem.File, error) { ret := _m.Called(name) + if len(ret) == 0 { + panic("no return value specified for File") + } + var r0 filesystem.File var r1 error if rf, ok := ret.Get(0).(func(string) (filesystem.File, error)); ok { @@ -105,10 +277,42 @@ func (_m *ContextRequest) File(name string) (filesystem.File, error) { return r0, r1 } +// ContextRequest_File_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'File' +type ContextRequest_File_Call struct { + *mock.Call +} + +// File is a helper method to define mock.On call +// - name string +func (_e *ContextRequest_Expecter) File(name interface{}) *ContextRequest_File_Call { + return &ContextRequest_File_Call{Call: _e.mock.On("File", name)} +} + +func (_c *ContextRequest_File_Call) Run(run func(name string)) *ContextRequest_File_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *ContextRequest_File_Call) Return(_a0 filesystem.File, _a1 error) *ContextRequest_File_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ContextRequest_File_Call) RunAndReturn(run func(string) (filesystem.File, error)) *ContextRequest_File_Call { + _c.Call.Return(run) + return _c +} + // FullUrl provides a mock function with given fields: func (_m *ContextRequest) FullUrl() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for FullUrl") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -119,6 +323,33 @@ func (_m *ContextRequest) FullUrl() string { return r0 } +// ContextRequest_FullUrl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FullUrl' +type ContextRequest_FullUrl_Call struct { + *mock.Call +} + +// FullUrl is a helper method to define mock.On call +func (_e *ContextRequest_Expecter) FullUrl() *ContextRequest_FullUrl_Call { + return &ContextRequest_FullUrl_Call{Call: _e.mock.On("FullUrl")} +} + +func (_c *ContextRequest_FullUrl_Call) Run(run func()) *ContextRequest_FullUrl_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ContextRequest_FullUrl_Call) Return(_a0 string) *ContextRequest_FullUrl_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextRequest_FullUrl_Call) RunAndReturn(run func() string) *ContextRequest_FullUrl_Call { + _c.Call.Return(run) + return _c +} + // Header provides a mock function with given fields: key, defaultValue func (_m *ContextRequest) Header(key string, defaultValue ...string) string { _va := make([]interface{}, len(defaultValue)) @@ -130,6 +361,10 @@ func (_m *ContextRequest) Header(key string, defaultValue ...string) string { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Header") + } + var r0 string if rf, ok := ret.Get(0).(func(string, ...string) string); ok { r0 = rf(key, defaultValue...) @@ -140,10 +375,50 @@ func (_m *ContextRequest) Header(key string, defaultValue ...string) string { return r0 } +// ContextRequest_Header_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Header' +type ContextRequest_Header_Call struct { + *mock.Call +} + +// Header is a helper method to define mock.On call +// - key string +// - defaultValue ...string +func (_e *ContextRequest_Expecter) Header(key interface{}, defaultValue ...interface{}) *ContextRequest_Header_Call { + return &ContextRequest_Header_Call{Call: _e.mock.On("Header", + append([]interface{}{key}, defaultValue...)...)} +} + +func (_c *ContextRequest_Header_Call) Run(run func(key string, defaultValue ...string)) *ContextRequest_Header_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *ContextRequest_Header_Call) Return(_a0 string) *ContextRequest_Header_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextRequest_Header_Call) RunAndReturn(run func(string, ...string) string) *ContextRequest_Header_Call { + _c.Call.Return(run) + return _c +} + // Headers provides a mock function with given fields: func (_m *ContextRequest) Headers() nethttp.Header { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Headers") + } + var r0 nethttp.Header if rf, ok := ret.Get(0).(func() nethttp.Header); ok { r0 = rf() @@ -156,10 +431,41 @@ func (_m *ContextRequest) Headers() nethttp.Header { return r0 } +// ContextRequest_Headers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Headers' +type ContextRequest_Headers_Call struct { + *mock.Call +} + +// Headers is a helper method to define mock.On call +func (_e *ContextRequest_Expecter) Headers() *ContextRequest_Headers_Call { + return &ContextRequest_Headers_Call{Call: _e.mock.On("Headers")} +} + +func (_c *ContextRequest_Headers_Call) Run(run func()) *ContextRequest_Headers_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ContextRequest_Headers_Call) Return(_a0 nethttp.Header) *ContextRequest_Headers_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextRequest_Headers_Call) RunAndReturn(run func() nethttp.Header) *ContextRequest_Headers_Call { + _c.Call.Return(run) + return _c +} + // Host provides a mock function with given fields: func (_m *ContextRequest) Host() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Host") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -170,6 +476,33 @@ func (_m *ContextRequest) Host() string { return r0 } +// ContextRequest_Host_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Host' +type ContextRequest_Host_Call struct { + *mock.Call +} + +// Host is a helper method to define mock.On call +func (_e *ContextRequest_Expecter) Host() *ContextRequest_Host_Call { + return &ContextRequest_Host_Call{Call: _e.mock.On("Host")} +} + +func (_c *ContextRequest_Host_Call) Run(run func()) *ContextRequest_Host_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ContextRequest_Host_Call) Return(_a0 string) *ContextRequest_Host_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextRequest_Host_Call) RunAndReturn(run func() string) *ContextRequest_Host_Call { + _c.Call.Return(run) + return _c +} + // Input provides a mock function with given fields: key, defaultValue func (_m *ContextRequest) Input(key string, defaultValue ...string) string { _va := make([]interface{}, len(defaultValue)) @@ -181,6 +514,10 @@ func (_m *ContextRequest) Input(key string, defaultValue ...string) string { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Input") + } + var r0 string if rf, ok := ret.Get(0).(func(string, ...string) string); ok { r0 = rf(key, defaultValue...) @@ -191,6 +528,42 @@ func (_m *ContextRequest) Input(key string, defaultValue ...string) string { return r0 } +// ContextRequest_Input_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Input' +type ContextRequest_Input_Call struct { + *mock.Call +} + +// Input is a helper method to define mock.On call +// - key string +// - defaultValue ...string +func (_e *ContextRequest_Expecter) Input(key interface{}, defaultValue ...interface{}) *ContextRequest_Input_Call { + return &ContextRequest_Input_Call{Call: _e.mock.On("Input", + append([]interface{}{key}, defaultValue...)...)} +} + +func (_c *ContextRequest_Input_Call) Run(run func(key string, defaultValue ...string)) *ContextRequest_Input_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *ContextRequest_Input_Call) Return(_a0 string) *ContextRequest_Input_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextRequest_Input_Call) RunAndReturn(run func(string, ...string) string) *ContextRequest_Input_Call { + _c.Call.Return(run) + return _c +} + // InputArray provides a mock function with given fields: key, defaultValue func (_m *ContextRequest) InputArray(key string, defaultValue ...[]string) []string { _va := make([]interface{}, len(defaultValue)) @@ -202,6 +575,10 @@ func (_m *ContextRequest) InputArray(key string, defaultValue ...[]string) []str _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for InputArray") + } + var r0 []string if rf, ok := ret.Get(0).(func(string, ...[]string) []string); ok { r0 = rf(key, defaultValue...) @@ -214,6 +591,42 @@ func (_m *ContextRequest) InputArray(key string, defaultValue ...[]string) []str return r0 } +// ContextRequest_InputArray_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InputArray' +type ContextRequest_InputArray_Call struct { + *mock.Call +} + +// InputArray is a helper method to define mock.On call +// - key string +// - defaultValue ...[]string +func (_e *ContextRequest_Expecter) InputArray(key interface{}, defaultValue ...interface{}) *ContextRequest_InputArray_Call { + return &ContextRequest_InputArray_Call{Call: _e.mock.On("InputArray", + append([]interface{}{key}, defaultValue...)...)} +} + +func (_c *ContextRequest_InputArray_Call) Run(run func(key string, defaultValue ...[]string)) *ContextRequest_InputArray_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([][]string, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.([]string) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *ContextRequest_InputArray_Call) Return(_a0 []string) *ContextRequest_InputArray_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextRequest_InputArray_Call) RunAndReturn(run func(string, ...[]string) []string) *ContextRequest_InputArray_Call { + _c.Call.Return(run) + return _c +} + // InputBool provides a mock function with given fields: key, defaultValue func (_m *ContextRequest) InputBool(key string, defaultValue ...bool) bool { _va := make([]interface{}, len(defaultValue)) @@ -225,6 +638,10 @@ func (_m *ContextRequest) InputBool(key string, defaultValue ...bool) bool { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for InputBool") + } + var r0 bool if rf, ok := ret.Get(0).(func(string, ...bool) bool); ok { r0 = rf(key, defaultValue...) @@ -235,6 +652,42 @@ func (_m *ContextRequest) InputBool(key string, defaultValue ...bool) bool { return r0 } +// ContextRequest_InputBool_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InputBool' +type ContextRequest_InputBool_Call struct { + *mock.Call +} + +// InputBool is a helper method to define mock.On call +// - key string +// - defaultValue ...bool +func (_e *ContextRequest_Expecter) InputBool(key interface{}, defaultValue ...interface{}) *ContextRequest_InputBool_Call { + return &ContextRequest_InputBool_Call{Call: _e.mock.On("InputBool", + append([]interface{}{key}, defaultValue...)...)} +} + +func (_c *ContextRequest_InputBool_Call) Run(run func(key string, defaultValue ...bool)) *ContextRequest_InputBool_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]bool, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(bool) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *ContextRequest_InputBool_Call) Return(_a0 bool) *ContextRequest_InputBool_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextRequest_InputBool_Call) RunAndReturn(run func(string, ...bool) bool) *ContextRequest_InputBool_Call { + _c.Call.Return(run) + return _c +} + // InputInt provides a mock function with given fields: key, defaultValue func (_m *ContextRequest) InputInt(key string, defaultValue ...int) int { _va := make([]interface{}, len(defaultValue)) @@ -246,6 +699,10 @@ func (_m *ContextRequest) InputInt(key string, defaultValue ...int) int { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for InputInt") + } + var r0 int if rf, ok := ret.Get(0).(func(string, ...int) int); ok { r0 = rf(key, defaultValue...) @@ -256,6 +713,42 @@ func (_m *ContextRequest) InputInt(key string, defaultValue ...int) int { return r0 } +// ContextRequest_InputInt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InputInt' +type ContextRequest_InputInt_Call struct { + *mock.Call +} + +// InputInt is a helper method to define mock.On call +// - key string +// - defaultValue ...int +func (_e *ContextRequest_Expecter) InputInt(key interface{}, defaultValue ...interface{}) *ContextRequest_InputInt_Call { + return &ContextRequest_InputInt_Call{Call: _e.mock.On("InputInt", + append([]interface{}{key}, defaultValue...)...)} +} + +func (_c *ContextRequest_InputInt_Call) Run(run func(key string, defaultValue ...int)) *ContextRequest_InputInt_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]int, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(int) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *ContextRequest_InputInt_Call) Return(_a0 int) *ContextRequest_InputInt_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextRequest_InputInt_Call) RunAndReturn(run func(string, ...int) int) *ContextRequest_InputInt_Call { + _c.Call.Return(run) + return _c +} + // InputInt64 provides a mock function with given fields: key, defaultValue func (_m *ContextRequest) InputInt64(key string, defaultValue ...int64) int64 { _va := make([]interface{}, len(defaultValue)) @@ -267,6 +760,10 @@ func (_m *ContextRequest) InputInt64(key string, defaultValue ...int64) int64 { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for InputInt64") + } + var r0 int64 if rf, ok := ret.Get(0).(func(string, ...int64) int64); ok { r0 = rf(key, defaultValue...) @@ -277,6 +774,42 @@ func (_m *ContextRequest) InputInt64(key string, defaultValue ...int64) int64 { return r0 } +// ContextRequest_InputInt64_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InputInt64' +type ContextRequest_InputInt64_Call struct { + *mock.Call +} + +// InputInt64 is a helper method to define mock.On call +// - key string +// - defaultValue ...int64 +func (_e *ContextRequest_Expecter) InputInt64(key interface{}, defaultValue ...interface{}) *ContextRequest_InputInt64_Call { + return &ContextRequest_InputInt64_Call{Call: _e.mock.On("InputInt64", + append([]interface{}{key}, defaultValue...)...)} +} + +func (_c *ContextRequest_InputInt64_Call) Run(run func(key string, defaultValue ...int64)) *ContextRequest_InputInt64_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]int64, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(int64) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *ContextRequest_InputInt64_Call) Return(_a0 int64) *ContextRequest_InputInt64_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextRequest_InputInt64_Call) RunAndReturn(run func(string, ...int64) int64) *ContextRequest_InputInt64_Call { + _c.Call.Return(run) + return _c +} + // InputMap provides a mock function with given fields: key, defaultValue func (_m *ContextRequest) InputMap(key string, defaultValue ...map[string]string) map[string]string { _va := make([]interface{}, len(defaultValue)) @@ -288,6 +821,10 @@ func (_m *ContextRequest) InputMap(key string, defaultValue ...map[string]string _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for InputMap") + } + var r0 map[string]string if rf, ok := ret.Get(0).(func(string, ...map[string]string) map[string]string); ok { r0 = rf(key, defaultValue...) @@ -300,10 +837,50 @@ func (_m *ContextRequest) InputMap(key string, defaultValue ...map[string]string return r0 } +// ContextRequest_InputMap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InputMap' +type ContextRequest_InputMap_Call struct { + *mock.Call +} + +// InputMap is a helper method to define mock.On call +// - key string +// - defaultValue ...map[string]string +func (_e *ContextRequest_Expecter) InputMap(key interface{}, defaultValue ...interface{}) *ContextRequest_InputMap_Call { + return &ContextRequest_InputMap_Call{Call: _e.mock.On("InputMap", + append([]interface{}{key}, defaultValue...)...)} +} + +func (_c *ContextRequest_InputMap_Call) Run(run func(key string, defaultValue ...map[string]string)) *ContextRequest_InputMap_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]map[string]string, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(map[string]string) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *ContextRequest_InputMap_Call) Return(_a0 map[string]string) *ContextRequest_InputMap_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextRequest_InputMap_Call) RunAndReturn(run func(string, ...map[string]string) map[string]string) *ContextRequest_InputMap_Call { + _c.Call.Return(run) + return _c +} + // Ip provides a mock function with given fields: func (_m *ContextRequest) Ip() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Ip") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -314,10 +891,41 @@ func (_m *ContextRequest) Ip() string { return r0 } +// ContextRequest_Ip_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ip' +type ContextRequest_Ip_Call struct { + *mock.Call +} + +// Ip is a helper method to define mock.On call +func (_e *ContextRequest_Expecter) Ip() *ContextRequest_Ip_Call { + return &ContextRequest_Ip_Call{Call: _e.mock.On("Ip")} +} + +func (_c *ContextRequest_Ip_Call) Run(run func()) *ContextRequest_Ip_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ContextRequest_Ip_Call) Return(_a0 string) *ContextRequest_Ip_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextRequest_Ip_Call) RunAndReturn(run func() string) *ContextRequest_Ip_Call { + _c.Call.Return(run) + return _c +} + // Method provides a mock function with given fields: func (_m *ContextRequest) Method() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Method") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -328,15 +936,73 @@ func (_m *ContextRequest) Method() string { return r0 } +// ContextRequest_Method_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Method' +type ContextRequest_Method_Call struct { + *mock.Call +} + +// Method is a helper method to define mock.On call +func (_e *ContextRequest_Expecter) Method() *ContextRequest_Method_Call { + return &ContextRequest_Method_Call{Call: _e.mock.On("Method")} +} + +func (_c *ContextRequest_Method_Call) Run(run func()) *ContextRequest_Method_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ContextRequest_Method_Call) Return(_a0 string) *ContextRequest_Method_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextRequest_Method_Call) RunAndReturn(run func() string) *ContextRequest_Method_Call { + _c.Call.Return(run) + return _c +} + // Next provides a mock function with given fields: func (_m *ContextRequest) Next() { _m.Called() } +// ContextRequest_Next_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Next' +type ContextRequest_Next_Call struct { + *mock.Call +} + +// Next is a helper method to define mock.On call +func (_e *ContextRequest_Expecter) Next() *ContextRequest_Next_Call { + return &ContextRequest_Next_Call{Call: _e.mock.On("Next")} +} + +func (_c *ContextRequest_Next_Call) Run(run func()) *ContextRequest_Next_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ContextRequest_Next_Call) Return() *ContextRequest_Next_Call { + _c.Call.Return() + return _c +} + +func (_c *ContextRequest_Next_Call) RunAndReturn(run func()) *ContextRequest_Next_Call { + _c.Call.Return(run) + return _c +} + // Origin provides a mock function with given fields: func (_m *ContextRequest) Origin() *nethttp.Request { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Origin") + } + var r0 *nethttp.Request if rf, ok := ret.Get(0).(func() *nethttp.Request); ok { r0 = rf() @@ -349,10 +1015,41 @@ func (_m *ContextRequest) Origin() *nethttp.Request { return r0 } +// ContextRequest_Origin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Origin' +type ContextRequest_Origin_Call struct { + *mock.Call +} + +// Origin is a helper method to define mock.On call +func (_e *ContextRequest_Expecter) Origin() *ContextRequest_Origin_Call { + return &ContextRequest_Origin_Call{Call: _e.mock.On("Origin")} +} + +func (_c *ContextRequest_Origin_Call) Run(run func()) *ContextRequest_Origin_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ContextRequest_Origin_Call) Return(_a0 *nethttp.Request) *ContextRequest_Origin_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextRequest_Origin_Call) RunAndReturn(run func() *nethttp.Request) *ContextRequest_Origin_Call { + _c.Call.Return(run) + return _c +} + // Path provides a mock function with given fields: func (_m *ContextRequest) Path() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Path") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -363,10 +1060,41 @@ func (_m *ContextRequest) Path() string { return r0 } +// ContextRequest_Path_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Path' +type ContextRequest_Path_Call struct { + *mock.Call +} + +// Path is a helper method to define mock.On call +func (_e *ContextRequest_Expecter) Path() *ContextRequest_Path_Call { + return &ContextRequest_Path_Call{Call: _e.mock.On("Path")} +} + +func (_c *ContextRequest_Path_Call) Run(run func()) *ContextRequest_Path_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ContextRequest_Path_Call) Return(_a0 string) *ContextRequest_Path_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextRequest_Path_Call) RunAndReturn(run func() string) *ContextRequest_Path_Call { + _c.Call.Return(run) + return _c +} + // Queries provides a mock function with given fields: func (_m *ContextRequest) Queries() map[string]string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Queries") + } + var r0 map[string]string if rf, ok := ret.Get(0).(func() map[string]string); ok { r0 = rf() @@ -379,6 +1107,33 @@ func (_m *ContextRequest) Queries() map[string]string { return r0 } +// ContextRequest_Queries_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Queries' +type ContextRequest_Queries_Call struct { + *mock.Call +} + +// Queries is a helper method to define mock.On call +func (_e *ContextRequest_Expecter) Queries() *ContextRequest_Queries_Call { + return &ContextRequest_Queries_Call{Call: _e.mock.On("Queries")} +} + +func (_c *ContextRequest_Queries_Call) Run(run func()) *ContextRequest_Queries_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ContextRequest_Queries_Call) Return(_a0 map[string]string) *ContextRequest_Queries_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextRequest_Queries_Call) RunAndReturn(run func() map[string]string) *ContextRequest_Queries_Call { + _c.Call.Return(run) + return _c +} + // Query provides a mock function with given fields: key, defaultValue func (_m *ContextRequest) Query(key string, defaultValue ...string) string { _va := make([]interface{}, len(defaultValue)) @@ -390,6 +1145,10 @@ func (_m *ContextRequest) Query(key string, defaultValue ...string) string { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Query") + } + var r0 string if rf, ok := ret.Get(0).(func(string, ...string) string); ok { r0 = rf(key, defaultValue...) @@ -400,10 +1159,50 @@ func (_m *ContextRequest) Query(key string, defaultValue ...string) string { return r0 } +// ContextRequest_Query_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Query' +type ContextRequest_Query_Call struct { + *mock.Call +} + +// Query is a helper method to define mock.On call +// - key string +// - defaultValue ...string +func (_e *ContextRequest_Expecter) Query(key interface{}, defaultValue ...interface{}) *ContextRequest_Query_Call { + return &ContextRequest_Query_Call{Call: _e.mock.On("Query", + append([]interface{}{key}, defaultValue...)...)} +} + +func (_c *ContextRequest_Query_Call) Run(run func(key string, defaultValue ...string)) *ContextRequest_Query_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *ContextRequest_Query_Call) Return(_a0 string) *ContextRequest_Query_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextRequest_Query_Call) RunAndReturn(run func(string, ...string) string) *ContextRequest_Query_Call { + _c.Call.Return(run) + return _c +} + // QueryArray provides a mock function with given fields: key func (_m *ContextRequest) QueryArray(key string) []string { ret := _m.Called(key) + if len(ret) == 0 { + panic("no return value specified for QueryArray") + } + var r0 []string if rf, ok := ret.Get(0).(func(string) []string); ok { r0 = rf(key) @@ -416,6 +1215,34 @@ func (_m *ContextRequest) QueryArray(key string) []string { return r0 } +// ContextRequest_QueryArray_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueryArray' +type ContextRequest_QueryArray_Call struct { + *mock.Call +} + +// QueryArray is a helper method to define mock.On call +// - key string +func (_e *ContextRequest_Expecter) QueryArray(key interface{}) *ContextRequest_QueryArray_Call { + return &ContextRequest_QueryArray_Call{Call: _e.mock.On("QueryArray", key)} +} + +func (_c *ContextRequest_QueryArray_Call) Run(run func(key string)) *ContextRequest_QueryArray_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *ContextRequest_QueryArray_Call) Return(_a0 []string) *ContextRequest_QueryArray_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextRequest_QueryArray_Call) RunAndReturn(run func(string) []string) *ContextRequest_QueryArray_Call { + _c.Call.Return(run) + return _c +} + // QueryBool provides a mock function with given fields: key, defaultValue func (_m *ContextRequest) QueryBool(key string, defaultValue ...bool) bool { _va := make([]interface{}, len(defaultValue)) @@ -427,6 +1254,10 @@ func (_m *ContextRequest) QueryBool(key string, defaultValue ...bool) bool { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for QueryBool") + } + var r0 bool if rf, ok := ret.Get(0).(func(string, ...bool) bool); ok { r0 = rf(key, defaultValue...) @@ -437,6 +1268,42 @@ func (_m *ContextRequest) QueryBool(key string, defaultValue ...bool) bool { return r0 } +// ContextRequest_QueryBool_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueryBool' +type ContextRequest_QueryBool_Call struct { + *mock.Call +} + +// QueryBool is a helper method to define mock.On call +// - key string +// - defaultValue ...bool +func (_e *ContextRequest_Expecter) QueryBool(key interface{}, defaultValue ...interface{}) *ContextRequest_QueryBool_Call { + return &ContextRequest_QueryBool_Call{Call: _e.mock.On("QueryBool", + append([]interface{}{key}, defaultValue...)...)} +} + +func (_c *ContextRequest_QueryBool_Call) Run(run func(key string, defaultValue ...bool)) *ContextRequest_QueryBool_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]bool, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(bool) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *ContextRequest_QueryBool_Call) Return(_a0 bool) *ContextRequest_QueryBool_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextRequest_QueryBool_Call) RunAndReturn(run func(string, ...bool) bool) *ContextRequest_QueryBool_Call { + _c.Call.Return(run) + return _c +} + // QueryInt provides a mock function with given fields: key, defaultValue func (_m *ContextRequest) QueryInt(key string, defaultValue ...int) int { _va := make([]interface{}, len(defaultValue)) @@ -448,6 +1315,10 @@ func (_m *ContextRequest) QueryInt(key string, defaultValue ...int) int { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for QueryInt") + } + var r0 int if rf, ok := ret.Get(0).(func(string, ...int) int); ok { r0 = rf(key, defaultValue...) @@ -458,6 +1329,42 @@ func (_m *ContextRequest) QueryInt(key string, defaultValue ...int) int { return r0 } +// ContextRequest_QueryInt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueryInt' +type ContextRequest_QueryInt_Call struct { + *mock.Call +} + +// QueryInt is a helper method to define mock.On call +// - key string +// - defaultValue ...int +func (_e *ContextRequest_Expecter) QueryInt(key interface{}, defaultValue ...interface{}) *ContextRequest_QueryInt_Call { + return &ContextRequest_QueryInt_Call{Call: _e.mock.On("QueryInt", + append([]interface{}{key}, defaultValue...)...)} +} + +func (_c *ContextRequest_QueryInt_Call) Run(run func(key string, defaultValue ...int)) *ContextRequest_QueryInt_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]int, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(int) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *ContextRequest_QueryInt_Call) Return(_a0 int) *ContextRequest_QueryInt_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextRequest_QueryInt_Call) RunAndReturn(run func(string, ...int) int) *ContextRequest_QueryInt_Call { + _c.Call.Return(run) + return _c +} + // QueryInt64 provides a mock function with given fields: key, defaultValue func (_m *ContextRequest) QueryInt64(key string, defaultValue ...int64) int64 { _va := make([]interface{}, len(defaultValue)) @@ -469,6 +1376,10 @@ func (_m *ContextRequest) QueryInt64(key string, defaultValue ...int64) int64 { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for QueryInt64") + } + var r0 int64 if rf, ok := ret.Get(0).(func(string, ...int64) int64); ok { r0 = rf(key, defaultValue...) @@ -479,10 +1390,50 @@ func (_m *ContextRequest) QueryInt64(key string, defaultValue ...int64) int64 { return r0 } +// ContextRequest_QueryInt64_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueryInt64' +type ContextRequest_QueryInt64_Call struct { + *mock.Call +} + +// QueryInt64 is a helper method to define mock.On call +// - key string +// - defaultValue ...int64 +func (_e *ContextRequest_Expecter) QueryInt64(key interface{}, defaultValue ...interface{}) *ContextRequest_QueryInt64_Call { + return &ContextRequest_QueryInt64_Call{Call: _e.mock.On("QueryInt64", + append([]interface{}{key}, defaultValue...)...)} +} + +func (_c *ContextRequest_QueryInt64_Call) Run(run func(key string, defaultValue ...int64)) *ContextRequest_QueryInt64_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]int64, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(int64) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *ContextRequest_QueryInt64_Call) Return(_a0 int64) *ContextRequest_QueryInt64_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextRequest_QueryInt64_Call) RunAndReturn(run func(string, ...int64) int64) *ContextRequest_QueryInt64_Call { + _c.Call.Return(run) + return _c +} + // QueryMap provides a mock function with given fields: key func (_m *ContextRequest) QueryMap(key string) map[string]string { ret := _m.Called(key) + if len(ret) == 0 { + panic("no return value specified for QueryMap") + } + var r0 map[string]string if rf, ok := ret.Get(0).(func(string) map[string]string); ok { r0 = rf(key) @@ -495,10 +1446,42 @@ func (_m *ContextRequest) QueryMap(key string) map[string]string { return r0 } +// ContextRequest_QueryMap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueryMap' +type ContextRequest_QueryMap_Call struct { + *mock.Call +} + +// QueryMap is a helper method to define mock.On call +// - key string +func (_e *ContextRequest_Expecter) QueryMap(key interface{}) *ContextRequest_QueryMap_Call { + return &ContextRequest_QueryMap_Call{Call: _e.mock.On("QueryMap", key)} +} + +func (_c *ContextRequest_QueryMap_Call) Run(run func(key string)) *ContextRequest_QueryMap_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *ContextRequest_QueryMap_Call) Return(_a0 map[string]string) *ContextRequest_QueryMap_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextRequest_QueryMap_Call) RunAndReturn(run func(string) map[string]string) *ContextRequest_QueryMap_Call { + _c.Call.Return(run) + return _c +} + // Route provides a mock function with given fields: key func (_m *ContextRequest) Route(key string) string { ret := _m.Called(key) + if len(ret) == 0 { + panic("no return value specified for Route") + } + var r0 string if rf, ok := ret.Get(0).(func(string) string); ok { r0 = rf(key) @@ -509,10 +1492,42 @@ func (_m *ContextRequest) Route(key string) string { return r0 } +// ContextRequest_Route_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Route' +type ContextRequest_Route_Call struct { + *mock.Call +} + +// Route is a helper method to define mock.On call +// - key string +func (_e *ContextRequest_Expecter) Route(key interface{}) *ContextRequest_Route_Call { + return &ContextRequest_Route_Call{Call: _e.mock.On("Route", key)} +} + +func (_c *ContextRequest_Route_Call) Run(run func(key string)) *ContextRequest_Route_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *ContextRequest_Route_Call) Return(_a0 string) *ContextRequest_Route_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextRequest_Route_Call) RunAndReturn(run func(string) string) *ContextRequest_Route_Call { + _c.Call.Return(run) + return _c +} + // RouteInt provides a mock function with given fields: key func (_m *ContextRequest) RouteInt(key string) int { ret := _m.Called(key) + if len(ret) == 0 { + panic("no return value specified for RouteInt") + } + var r0 int if rf, ok := ret.Get(0).(func(string) int); ok { r0 = rf(key) @@ -523,10 +1538,42 @@ func (_m *ContextRequest) RouteInt(key string) int { return r0 } +// ContextRequest_RouteInt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RouteInt' +type ContextRequest_RouteInt_Call struct { + *mock.Call +} + +// RouteInt is a helper method to define mock.On call +// - key string +func (_e *ContextRequest_Expecter) RouteInt(key interface{}) *ContextRequest_RouteInt_Call { + return &ContextRequest_RouteInt_Call{Call: _e.mock.On("RouteInt", key)} +} + +func (_c *ContextRequest_RouteInt_Call) Run(run func(key string)) *ContextRequest_RouteInt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *ContextRequest_RouteInt_Call) Return(_a0 int) *ContextRequest_RouteInt_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextRequest_RouteInt_Call) RunAndReturn(run func(string) int) *ContextRequest_RouteInt_Call { + _c.Call.Return(run) + return _c +} + // RouteInt64 provides a mock function with given fields: key func (_m *ContextRequest) RouteInt64(key string) int64 { ret := _m.Called(key) + if len(ret) == 0 { + panic("no return value specified for RouteInt64") + } + var r0 int64 if rf, ok := ret.Get(0).(func(string) int64); ok { r0 = rf(key) @@ -537,10 +1584,42 @@ func (_m *ContextRequest) RouteInt64(key string) int64 { return r0 } +// ContextRequest_RouteInt64_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RouteInt64' +type ContextRequest_RouteInt64_Call struct { + *mock.Call +} + +// RouteInt64 is a helper method to define mock.On call +// - key string +func (_e *ContextRequest_Expecter) RouteInt64(key interface{}) *ContextRequest_RouteInt64_Call { + return &ContextRequest_RouteInt64_Call{Call: _e.mock.On("RouteInt64", key)} +} + +func (_c *ContextRequest_RouteInt64_Call) Run(run func(key string)) *ContextRequest_RouteInt64_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *ContextRequest_RouteInt64_Call) Return(_a0 int64) *ContextRequest_RouteInt64_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextRequest_RouteInt64_Call) RunAndReturn(run func(string) int64) *ContextRequest_RouteInt64_Call { + _c.Call.Return(run) + return _c +} + // Url provides a mock function with given fields: func (_m *ContextRequest) Url() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Url") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -551,6 +1630,33 @@ func (_m *ContextRequest) Url() string { return r0 } +// ContextRequest_Url_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Url' +type ContextRequest_Url_Call struct { + *mock.Call +} + +// Url is a helper method to define mock.On call +func (_e *ContextRequest_Expecter) Url() *ContextRequest_Url_Call { + return &ContextRequest_Url_Call{Call: _e.mock.On("Url")} +} + +func (_c *ContextRequest_Url_Call) Run(run func()) *ContextRequest_Url_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ContextRequest_Url_Call) Return(_a0 string) *ContextRequest_Url_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextRequest_Url_Call) RunAndReturn(run func() string) *ContextRequest_Url_Call { + _c.Call.Return(run) + return _c +} + // Validate provides a mock function with given fields: rules, options func (_m *ContextRequest) Validate(rules map[string]string, options ...validation.Option) (validation.Validator, error) { _va := make([]interface{}, len(options)) @@ -562,6 +1668,10 @@ func (_m *ContextRequest) Validate(rules map[string]string, options ...validatio _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Validate") + } + var r0 validation.Validator var r1 error if rf, ok := ret.Get(0).(func(map[string]string, ...validation.Option) (validation.Validator, error)); ok { @@ -584,10 +1694,50 @@ func (_m *ContextRequest) Validate(rules map[string]string, options ...validatio return r0, r1 } +// ContextRequest_Validate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Validate' +type ContextRequest_Validate_Call struct { + *mock.Call +} + +// Validate is a helper method to define mock.On call +// - rules map[string]string +// - options ...validation.Option +func (_e *ContextRequest_Expecter) Validate(rules interface{}, options ...interface{}) *ContextRequest_Validate_Call { + return &ContextRequest_Validate_Call{Call: _e.mock.On("Validate", + append([]interface{}{rules}, options...)...)} +} + +func (_c *ContextRequest_Validate_Call) Run(run func(rules map[string]string, options ...validation.Option)) *ContextRequest_Validate_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]validation.Option, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(validation.Option) + } + } + run(args[0].(map[string]string), variadicArgs...) + }) + return _c +} + +func (_c *ContextRequest_Validate_Call) Return(_a0 validation.Validator, _a1 error) *ContextRequest_Validate_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ContextRequest_Validate_Call) RunAndReturn(run func(map[string]string, ...validation.Option) (validation.Validator, error)) *ContextRequest_Validate_Call { + _c.Call.Return(run) + return _c +} + // ValidateRequest provides a mock function with given fields: request func (_m *ContextRequest) ValidateRequest(request http.FormRequest) (validation.Errors, error) { ret := _m.Called(request) + if len(ret) == 0 { + panic("no return value specified for ValidateRequest") + } + var r0 validation.Errors var r1 error if rf, ok := ret.Get(0).(func(http.FormRequest) (validation.Errors, error)); ok { @@ -610,6 +1760,34 @@ func (_m *ContextRequest) ValidateRequest(request http.FormRequest) (validation. return r0, r1 } +// ContextRequest_ValidateRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidateRequest' +type ContextRequest_ValidateRequest_Call struct { + *mock.Call +} + +// ValidateRequest is a helper method to define mock.On call +// - request http.FormRequest +func (_e *ContextRequest_Expecter) ValidateRequest(request interface{}) *ContextRequest_ValidateRequest_Call { + return &ContextRequest_ValidateRequest_Call{Call: _e.mock.On("ValidateRequest", request)} +} + +func (_c *ContextRequest_ValidateRequest_Call) Run(run func(request http.FormRequest)) *ContextRequest_ValidateRequest_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(http.FormRequest)) + }) + return _c +} + +func (_c *ContextRequest_ValidateRequest_Call) Return(_a0 validation.Errors, _a1 error) *ContextRequest_ValidateRequest_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ContextRequest_ValidateRequest_Call) RunAndReturn(run func(http.FormRequest) (validation.Errors, error)) *ContextRequest_ValidateRequest_Call { + _c.Call.Return(run) + return _c +} + // NewContextRequest creates a new instance of ContextRequest. 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 NewContextRequest(t interface { diff --git a/mocks/http/ContextResponse.go b/mocks/http/ContextResponse.go index 8174e6cb2..609e4e067 100644 --- a/mocks/http/ContextResponse.go +++ b/mocks/http/ContextResponse.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -14,10 +14,22 @@ type ContextResponse struct { mock.Mock } +type ContextResponse_Expecter struct { + mock *mock.Mock +} + +func (_m *ContextResponse) EXPECT() *ContextResponse_Expecter { + return &ContextResponse_Expecter{mock: &_m.Mock} +} + // Cookie provides a mock function with given fields: cookie func (_m *ContextResponse) Cookie(cookie http.Cookie) http.ContextResponse { ret := _m.Called(cookie) + if len(ret) == 0 { + panic("no return value specified for Cookie") + } + var r0 http.ContextResponse if rf, ok := ret.Get(0).(func(http.Cookie) http.ContextResponse); ok { r0 = rf(cookie) @@ -30,10 +42,42 @@ func (_m *ContextResponse) Cookie(cookie http.Cookie) http.ContextResponse { return r0 } +// ContextResponse_Cookie_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Cookie' +type ContextResponse_Cookie_Call struct { + *mock.Call +} + +// Cookie is a helper method to define mock.On call +// - cookie http.Cookie +func (_e *ContextResponse_Expecter) Cookie(cookie interface{}) *ContextResponse_Cookie_Call { + return &ContextResponse_Cookie_Call{Call: _e.mock.On("Cookie", cookie)} +} + +func (_c *ContextResponse_Cookie_Call) Run(run func(cookie http.Cookie)) *ContextResponse_Cookie_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(http.Cookie)) + }) + return _c +} + +func (_c *ContextResponse_Cookie_Call) Return(_a0 http.ContextResponse) *ContextResponse_Cookie_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextResponse_Cookie_Call) RunAndReturn(run func(http.Cookie) http.ContextResponse) *ContextResponse_Cookie_Call { + _c.Call.Return(run) + return _c +} + // Data provides a mock function with given fields: code, contentType, data func (_m *ContextResponse) Data(code int, contentType string, data []byte) http.Response { ret := _m.Called(code, contentType, data) + if len(ret) == 0 { + panic("no return value specified for Data") + } + var r0 http.Response if rf, ok := ret.Get(0).(func(int, string, []byte) http.Response); ok { r0 = rf(code, contentType, data) @@ -46,10 +90,44 @@ func (_m *ContextResponse) Data(code int, contentType string, data []byte) http. return r0 } +// ContextResponse_Data_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Data' +type ContextResponse_Data_Call struct { + *mock.Call +} + +// Data is a helper method to define mock.On call +// - code int +// - contentType string +// - data []byte +func (_e *ContextResponse_Expecter) Data(code interface{}, contentType interface{}, data interface{}) *ContextResponse_Data_Call { + return &ContextResponse_Data_Call{Call: _e.mock.On("Data", code, contentType, data)} +} + +func (_c *ContextResponse_Data_Call) Run(run func(code int, contentType string, data []byte)) *ContextResponse_Data_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int), args[1].(string), args[2].([]byte)) + }) + return _c +} + +func (_c *ContextResponse_Data_Call) Return(_a0 http.Response) *ContextResponse_Data_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextResponse_Data_Call) RunAndReturn(run func(int, string, []byte) http.Response) *ContextResponse_Data_Call { + _c.Call.Return(run) + return _c +} + // Download provides a mock function with given fields: filepath, filename func (_m *ContextResponse) Download(filepath string, filename string) http.Response { ret := _m.Called(filepath, filename) + if len(ret) == 0 { + panic("no return value specified for Download") + } + var r0 http.Response if rf, ok := ret.Get(0).(func(string, string) http.Response); ok { r0 = rf(filepath, filename) @@ -62,10 +140,43 @@ func (_m *ContextResponse) Download(filepath string, filename string) http.Respo return r0 } +// ContextResponse_Download_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Download' +type ContextResponse_Download_Call struct { + *mock.Call +} + +// Download is a helper method to define mock.On call +// - filepath string +// - filename string +func (_e *ContextResponse_Expecter) Download(filepath interface{}, filename interface{}) *ContextResponse_Download_Call { + return &ContextResponse_Download_Call{Call: _e.mock.On("Download", filepath, filename)} +} + +func (_c *ContextResponse_Download_Call) Run(run func(filepath string, filename string)) *ContextResponse_Download_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *ContextResponse_Download_Call) Return(_a0 http.Response) *ContextResponse_Download_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextResponse_Download_Call) RunAndReturn(run func(string, string) http.Response) *ContextResponse_Download_Call { + _c.Call.Return(run) + return _c +} + // File provides a mock function with given fields: filepath func (_m *ContextResponse) File(filepath string) http.Response { ret := _m.Called(filepath) + if len(ret) == 0 { + panic("no return value specified for File") + } + var r0 http.Response if rf, ok := ret.Get(0).(func(string) http.Response); ok { r0 = rf(filepath) @@ -78,15 +189,74 @@ func (_m *ContextResponse) File(filepath string) http.Response { return r0 } +// ContextResponse_File_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'File' +type ContextResponse_File_Call struct { + *mock.Call +} + +// File is a helper method to define mock.On call +// - filepath string +func (_e *ContextResponse_Expecter) File(filepath interface{}) *ContextResponse_File_Call { + return &ContextResponse_File_Call{Call: _e.mock.On("File", filepath)} +} + +func (_c *ContextResponse_File_Call) Run(run func(filepath string)) *ContextResponse_File_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *ContextResponse_File_Call) Return(_a0 http.Response) *ContextResponse_File_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextResponse_File_Call) RunAndReturn(run func(string) http.Response) *ContextResponse_File_Call { + _c.Call.Return(run) + return _c +} + // Flush provides a mock function with given fields: func (_m *ContextResponse) Flush() { _m.Called() } +// ContextResponse_Flush_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Flush' +type ContextResponse_Flush_Call struct { + *mock.Call +} + +// Flush is a helper method to define mock.On call +func (_e *ContextResponse_Expecter) Flush() *ContextResponse_Flush_Call { + return &ContextResponse_Flush_Call{Call: _e.mock.On("Flush")} +} + +func (_c *ContextResponse_Flush_Call) Run(run func()) *ContextResponse_Flush_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ContextResponse_Flush_Call) Return() *ContextResponse_Flush_Call { + _c.Call.Return() + return _c +} + +func (_c *ContextResponse_Flush_Call) RunAndReturn(run func()) *ContextResponse_Flush_Call { + _c.Call.Return(run) + return _c +} + // Header provides a mock function with given fields: key, value func (_m *ContextResponse) Header(key string, value string) http.ContextResponse { ret := _m.Called(key, value) + if len(ret) == 0 { + panic("no return value specified for Header") + } + var r0 http.ContextResponse if rf, ok := ret.Get(0).(func(string, string) http.ContextResponse); ok { r0 = rf(key, value) @@ -99,10 +269,43 @@ func (_m *ContextResponse) Header(key string, value string) http.ContextResponse return r0 } +// ContextResponse_Header_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Header' +type ContextResponse_Header_Call struct { + *mock.Call +} + +// Header is a helper method to define mock.On call +// - key string +// - value string +func (_e *ContextResponse_Expecter) Header(key interface{}, value interface{}) *ContextResponse_Header_Call { + return &ContextResponse_Header_Call{Call: _e.mock.On("Header", key, value)} +} + +func (_c *ContextResponse_Header_Call) Run(run func(key string, value string)) *ContextResponse_Header_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *ContextResponse_Header_Call) Return(_a0 http.ContextResponse) *ContextResponse_Header_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextResponse_Header_Call) RunAndReturn(run func(string, string) http.ContextResponse) *ContextResponse_Header_Call { + _c.Call.Return(run) + return _c +} + // Json provides a mock function with given fields: code, obj func (_m *ContextResponse) Json(code int, obj interface{}) http.Response { ret := _m.Called(code, obj) + if len(ret) == 0 { + panic("no return value specified for Json") + } + var r0 http.Response if rf, ok := ret.Get(0).(func(int, interface{}) http.Response); ok { r0 = rf(code, obj) @@ -115,10 +318,43 @@ func (_m *ContextResponse) Json(code int, obj interface{}) http.Response { return r0 } +// ContextResponse_Json_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Json' +type ContextResponse_Json_Call struct { + *mock.Call +} + +// Json is a helper method to define mock.On call +// - code int +// - obj interface{} +func (_e *ContextResponse_Expecter) Json(code interface{}, obj interface{}) *ContextResponse_Json_Call { + return &ContextResponse_Json_Call{Call: _e.mock.On("Json", code, obj)} +} + +func (_c *ContextResponse_Json_Call) Run(run func(code int, obj interface{})) *ContextResponse_Json_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int), args[1].(interface{})) + }) + return _c +} + +func (_c *ContextResponse_Json_Call) Return(_a0 http.Response) *ContextResponse_Json_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextResponse_Json_Call) RunAndReturn(run func(int, interface{}) http.Response) *ContextResponse_Json_Call { + _c.Call.Return(run) + return _c +} + // Origin provides a mock function with given fields: func (_m *ContextResponse) Origin() http.ResponseOrigin { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Origin") + } + var r0 http.ResponseOrigin if rf, ok := ret.Get(0).(func() http.ResponseOrigin); ok { r0 = rf() @@ -131,10 +367,41 @@ func (_m *ContextResponse) Origin() http.ResponseOrigin { return r0 } +// ContextResponse_Origin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Origin' +type ContextResponse_Origin_Call struct { + *mock.Call +} + +// Origin is a helper method to define mock.On call +func (_e *ContextResponse_Expecter) Origin() *ContextResponse_Origin_Call { + return &ContextResponse_Origin_Call{Call: _e.mock.On("Origin")} +} + +func (_c *ContextResponse_Origin_Call) Run(run func()) *ContextResponse_Origin_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ContextResponse_Origin_Call) Return(_a0 http.ResponseOrigin) *ContextResponse_Origin_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextResponse_Origin_Call) RunAndReturn(run func() http.ResponseOrigin) *ContextResponse_Origin_Call { + _c.Call.Return(run) + return _c +} + // Redirect provides a mock function with given fields: code, location func (_m *ContextResponse) Redirect(code int, location string) http.Response { ret := _m.Called(code, location) + if len(ret) == 0 { + panic("no return value specified for Redirect") + } + var r0 http.Response if rf, ok := ret.Get(0).(func(int, string) http.Response); ok { r0 = rf(code, location) @@ -147,10 +414,43 @@ func (_m *ContextResponse) Redirect(code int, location string) http.Response { return r0 } +// ContextResponse_Redirect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Redirect' +type ContextResponse_Redirect_Call struct { + *mock.Call +} + +// Redirect is a helper method to define mock.On call +// - code int +// - location string +func (_e *ContextResponse_Expecter) Redirect(code interface{}, location interface{}) *ContextResponse_Redirect_Call { + return &ContextResponse_Redirect_Call{Call: _e.mock.On("Redirect", code, location)} +} + +func (_c *ContextResponse_Redirect_Call) Run(run func(code int, location string)) *ContextResponse_Redirect_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int), args[1].(string)) + }) + return _c +} + +func (_c *ContextResponse_Redirect_Call) Return(_a0 http.Response) *ContextResponse_Redirect_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextResponse_Redirect_Call) RunAndReturn(run func(int, string) http.Response) *ContextResponse_Redirect_Call { + _c.Call.Return(run) + return _c +} + // Status provides a mock function with given fields: code func (_m *ContextResponse) Status(code int) http.ResponseStatus { ret := _m.Called(code) + if len(ret) == 0 { + panic("no return value specified for Status") + } + var r0 http.ResponseStatus if rf, ok := ret.Get(0).(func(int) http.ResponseStatus); ok { r0 = rf(code) @@ -163,6 +463,34 @@ func (_m *ContextResponse) Status(code int) http.ResponseStatus { return r0 } +// ContextResponse_Status_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Status' +type ContextResponse_Status_Call struct { + *mock.Call +} + +// Status is a helper method to define mock.On call +// - code int +func (_e *ContextResponse_Expecter) Status(code interface{}) *ContextResponse_Status_Call { + return &ContextResponse_Status_Call{Call: _e.mock.On("Status", code)} +} + +func (_c *ContextResponse_Status_Call) Run(run func(code int)) *ContextResponse_Status_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int)) + }) + return _c +} + +func (_c *ContextResponse_Status_Call) Return(_a0 http.ResponseStatus) *ContextResponse_Status_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextResponse_Status_Call) RunAndReturn(run func(int) http.ResponseStatus) *ContextResponse_Status_Call { + _c.Call.Return(run) + return _c +} + // String provides a mock function with given fields: code, format, values func (_m *ContextResponse) String(code int, format string, values ...interface{}) http.Response { var _ca []interface{} @@ -170,6 +498,10 @@ func (_m *ContextResponse) String(code int, format string, values ...interface{} _ca = append(_ca, values...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for String") + } + var r0 http.Response if rf, ok := ret.Get(0).(func(int, string, ...interface{}) http.Response); ok { r0 = rf(code, format, values...) @@ -182,10 +514,51 @@ func (_m *ContextResponse) String(code int, format string, values ...interface{} return r0 } +// ContextResponse_String_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'String' +type ContextResponse_String_Call struct { + *mock.Call +} + +// String is a helper method to define mock.On call +// - code int +// - format string +// - values ...interface{} +func (_e *ContextResponse_Expecter) String(code interface{}, format interface{}, values ...interface{}) *ContextResponse_String_Call { + return &ContextResponse_String_Call{Call: _e.mock.On("String", + append([]interface{}{code, format}, values...)...)} +} + +func (_c *ContextResponse_String_Call) Run(run func(code int, format string, values ...interface{})) *ContextResponse_String_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(int), args[1].(string), variadicArgs...) + }) + return _c +} + +func (_c *ContextResponse_String_Call) Return(_a0 http.Response) *ContextResponse_String_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextResponse_String_Call) RunAndReturn(run func(int, string, ...interface{}) http.Response) *ContextResponse_String_Call { + _c.Call.Return(run) + return _c +} + // Success provides a mock function with given fields: func (_m *ContextResponse) Success() http.ResponseSuccess { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Success") + } + var r0 http.ResponseSuccess if rf, ok := ret.Get(0).(func() http.ResponseSuccess); ok { r0 = rf() @@ -198,10 +571,41 @@ func (_m *ContextResponse) Success() http.ResponseSuccess { return r0 } +// ContextResponse_Success_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Success' +type ContextResponse_Success_Call struct { + *mock.Call +} + +// Success is a helper method to define mock.On call +func (_e *ContextResponse_Expecter) Success() *ContextResponse_Success_Call { + return &ContextResponse_Success_Call{Call: _e.mock.On("Success")} +} + +func (_c *ContextResponse_Success_Call) Run(run func()) *ContextResponse_Success_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ContextResponse_Success_Call) Return(_a0 http.ResponseSuccess) *ContextResponse_Success_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextResponse_Success_Call) RunAndReturn(run func() http.ResponseSuccess) *ContextResponse_Success_Call { + _c.Call.Return(run) + return _c +} + // View provides a mock function with given fields: func (_m *ContextResponse) View() http.ResponseView { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for View") + } + var r0 http.ResponseView if rf, ok := ret.Get(0).(func() http.ResponseView); ok { r0 = rf() @@ -214,10 +618,41 @@ func (_m *ContextResponse) View() http.ResponseView { return r0 } +// ContextResponse_View_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'View' +type ContextResponse_View_Call struct { + *mock.Call +} + +// View is a helper method to define mock.On call +func (_e *ContextResponse_Expecter) View() *ContextResponse_View_Call { + return &ContextResponse_View_Call{Call: _e.mock.On("View")} +} + +func (_c *ContextResponse_View_Call) Run(run func()) *ContextResponse_View_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ContextResponse_View_Call) Return(_a0 http.ResponseView) *ContextResponse_View_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextResponse_View_Call) RunAndReturn(run func() http.ResponseView) *ContextResponse_View_Call { + _c.Call.Return(run) + return _c +} + // WithoutCookie provides a mock function with given fields: name func (_m *ContextResponse) WithoutCookie(name string) http.ContextResponse { ret := _m.Called(name) + if len(ret) == 0 { + panic("no return value specified for WithoutCookie") + } + var r0 http.ContextResponse if rf, ok := ret.Get(0).(func(string) http.ContextResponse); ok { r0 = rf(name) @@ -230,10 +665,42 @@ func (_m *ContextResponse) WithoutCookie(name string) http.ContextResponse { return r0 } +// ContextResponse_WithoutCookie_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithoutCookie' +type ContextResponse_WithoutCookie_Call struct { + *mock.Call +} + +// WithoutCookie is a helper method to define mock.On call +// - name string +func (_e *ContextResponse_Expecter) WithoutCookie(name interface{}) *ContextResponse_WithoutCookie_Call { + return &ContextResponse_WithoutCookie_Call{Call: _e.mock.On("WithoutCookie", name)} +} + +func (_c *ContextResponse_WithoutCookie_Call) Run(run func(name string)) *ContextResponse_WithoutCookie_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *ContextResponse_WithoutCookie_Call) Return(_a0 http.ContextResponse) *ContextResponse_WithoutCookie_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextResponse_WithoutCookie_Call) RunAndReturn(run func(string) http.ContextResponse) *ContextResponse_WithoutCookie_Call { + _c.Call.Return(run) + return _c +} + // Writer provides a mock function with given fields: func (_m *ContextResponse) Writer() nethttp.ResponseWriter { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Writer") + } + var r0 nethttp.ResponseWriter if rf, ok := ret.Get(0).(func() nethttp.ResponseWriter); ok { r0 = rf() @@ -246,6 +713,33 @@ func (_m *ContextResponse) Writer() nethttp.ResponseWriter { return r0 } +// ContextResponse_Writer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Writer' +type ContextResponse_Writer_Call struct { + *mock.Call +} + +// Writer is a helper method to define mock.On call +func (_e *ContextResponse_Expecter) Writer() *ContextResponse_Writer_Call { + return &ContextResponse_Writer_Call{Call: _e.mock.On("Writer")} +} + +func (_c *ContextResponse_Writer_Call) Run(run func()) *ContextResponse_Writer_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ContextResponse_Writer_Call) Return(_a0 nethttp.ResponseWriter) *ContextResponse_Writer_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContextResponse_Writer_Call) RunAndReturn(run func() nethttp.ResponseWriter) *ContextResponse_Writer_Call { + _c.Call.Return(run) + return _c +} + // NewContextResponse creates a new instance of ContextResponse. 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 NewContextResponse(t interface { diff --git a/mocks/http/FormRequest.go b/mocks/http/FormRequest.go index 4ae11112d..aa0943a6b 100644 --- a/mocks/http/FormRequest.go +++ b/mocks/http/FormRequest.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -14,10 +14,22 @@ type FormRequest struct { mock.Mock } +type FormRequest_Expecter struct { + mock *mock.Mock +} + +func (_m *FormRequest) EXPECT() *FormRequest_Expecter { + return &FormRequest_Expecter{mock: &_m.Mock} +} + // Attributes provides a mock function with given fields: ctx func (_m *FormRequest) Attributes(ctx http.Context) map[string]string { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for Attributes") + } + var r0 map[string]string if rf, ok := ret.Get(0).(func(http.Context) map[string]string); ok { r0 = rf(ctx) @@ -30,10 +42,42 @@ func (_m *FormRequest) Attributes(ctx http.Context) map[string]string { return r0 } +// FormRequest_Attributes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Attributes' +type FormRequest_Attributes_Call struct { + *mock.Call +} + +// Attributes is a helper method to define mock.On call +// - ctx http.Context +func (_e *FormRequest_Expecter) Attributes(ctx interface{}) *FormRequest_Attributes_Call { + return &FormRequest_Attributes_Call{Call: _e.mock.On("Attributes", ctx)} +} + +func (_c *FormRequest_Attributes_Call) Run(run func(ctx http.Context)) *FormRequest_Attributes_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(http.Context)) + }) + return _c +} + +func (_c *FormRequest_Attributes_Call) Return(_a0 map[string]string) *FormRequest_Attributes_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FormRequest_Attributes_Call) RunAndReturn(run func(http.Context) map[string]string) *FormRequest_Attributes_Call { + _c.Call.Return(run) + return _c +} + // Authorize provides a mock function with given fields: ctx func (_m *FormRequest) Authorize(ctx http.Context) error { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for Authorize") + } + var r0 error if rf, ok := ret.Get(0).(func(http.Context) error); ok { r0 = rf(ctx) @@ -44,10 +88,42 @@ func (_m *FormRequest) Authorize(ctx http.Context) error { return r0 } +// FormRequest_Authorize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Authorize' +type FormRequest_Authorize_Call struct { + *mock.Call +} + +// Authorize is a helper method to define mock.On call +// - ctx http.Context +func (_e *FormRequest_Expecter) Authorize(ctx interface{}) *FormRequest_Authorize_Call { + return &FormRequest_Authorize_Call{Call: _e.mock.On("Authorize", ctx)} +} + +func (_c *FormRequest_Authorize_Call) Run(run func(ctx http.Context)) *FormRequest_Authorize_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(http.Context)) + }) + return _c +} + +func (_c *FormRequest_Authorize_Call) Return(_a0 error) *FormRequest_Authorize_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FormRequest_Authorize_Call) RunAndReturn(run func(http.Context) error) *FormRequest_Authorize_Call { + _c.Call.Return(run) + return _c +} + // Messages provides a mock function with given fields: ctx func (_m *FormRequest) Messages(ctx http.Context) map[string]string { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for Messages") + } + var r0 map[string]string if rf, ok := ret.Get(0).(func(http.Context) map[string]string); ok { r0 = rf(ctx) @@ -60,10 +136,42 @@ func (_m *FormRequest) Messages(ctx http.Context) map[string]string { return r0 } +// FormRequest_Messages_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Messages' +type FormRequest_Messages_Call struct { + *mock.Call +} + +// Messages is a helper method to define mock.On call +// - ctx http.Context +func (_e *FormRequest_Expecter) Messages(ctx interface{}) *FormRequest_Messages_Call { + return &FormRequest_Messages_Call{Call: _e.mock.On("Messages", ctx)} +} + +func (_c *FormRequest_Messages_Call) Run(run func(ctx http.Context)) *FormRequest_Messages_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(http.Context)) + }) + return _c +} + +func (_c *FormRequest_Messages_Call) Return(_a0 map[string]string) *FormRequest_Messages_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FormRequest_Messages_Call) RunAndReturn(run func(http.Context) map[string]string) *FormRequest_Messages_Call { + _c.Call.Return(run) + return _c +} + // PrepareForValidation provides a mock function with given fields: ctx, data func (_m *FormRequest) PrepareForValidation(ctx http.Context, data validation.Data) error { ret := _m.Called(ctx, data) + if len(ret) == 0 { + panic("no return value specified for PrepareForValidation") + } + var r0 error if rf, ok := ret.Get(0).(func(http.Context, validation.Data) error); ok { r0 = rf(ctx, data) @@ -74,10 +182,43 @@ func (_m *FormRequest) PrepareForValidation(ctx http.Context, data validation.Da return r0 } +// FormRequest_PrepareForValidation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PrepareForValidation' +type FormRequest_PrepareForValidation_Call struct { + *mock.Call +} + +// PrepareForValidation is a helper method to define mock.On call +// - ctx http.Context +// - data validation.Data +func (_e *FormRequest_Expecter) PrepareForValidation(ctx interface{}, data interface{}) *FormRequest_PrepareForValidation_Call { + return &FormRequest_PrepareForValidation_Call{Call: _e.mock.On("PrepareForValidation", ctx, data)} +} + +func (_c *FormRequest_PrepareForValidation_Call) Run(run func(ctx http.Context, data validation.Data)) *FormRequest_PrepareForValidation_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(http.Context), args[1].(validation.Data)) + }) + return _c +} + +func (_c *FormRequest_PrepareForValidation_Call) Return(_a0 error) *FormRequest_PrepareForValidation_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FormRequest_PrepareForValidation_Call) RunAndReturn(run func(http.Context, validation.Data) error) *FormRequest_PrepareForValidation_Call { + _c.Call.Return(run) + return _c +} + // Rules provides a mock function with given fields: ctx func (_m *FormRequest) Rules(ctx http.Context) map[string]string { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for Rules") + } + var r0 map[string]string if rf, ok := ret.Get(0).(func(http.Context) map[string]string); ok { r0 = rf(ctx) @@ -90,6 +231,34 @@ func (_m *FormRequest) Rules(ctx http.Context) map[string]string { return r0 } +// FormRequest_Rules_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Rules' +type FormRequest_Rules_Call struct { + *mock.Call +} + +// Rules is a helper method to define mock.On call +// - ctx http.Context +func (_e *FormRequest_Expecter) Rules(ctx interface{}) *FormRequest_Rules_Call { + return &FormRequest_Rules_Call{Call: _e.mock.On("Rules", ctx)} +} + +func (_c *FormRequest_Rules_Call) Run(run func(ctx http.Context)) *FormRequest_Rules_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(http.Context)) + }) + return _c +} + +func (_c *FormRequest_Rules_Call) Return(_a0 map[string]string) *FormRequest_Rules_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FormRequest_Rules_Call) RunAndReturn(run func(http.Context) map[string]string) *FormRequest_Rules_Call { + _c.Call.Return(run) + return _c +} + // NewFormRequest creates a new instance of FormRequest. 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 NewFormRequest(t interface { diff --git a/mocks/http/HandlerFunc.go b/mocks/http/HandlerFunc.go index f6dbd3943..b48ef4474 100644 --- a/mocks/http/HandlerFunc.go +++ b/mocks/http/HandlerFunc.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,10 +12,22 @@ type HandlerFunc struct { mock.Mock } +type HandlerFunc_Expecter struct { + mock *mock.Mock +} + +func (_m *HandlerFunc) EXPECT() *HandlerFunc_Expecter { + return &HandlerFunc_Expecter{mock: &_m.Mock} +} + // Execute provides a mock function with given fields: _a0 func (_m *HandlerFunc) Execute(_a0 http.Context) http.Response { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Execute") + } + var r0 http.Response if rf, ok := ret.Get(0).(func(http.Context) http.Response); ok { r0 = rf(_a0) @@ -28,6 +40,34 @@ func (_m *HandlerFunc) Execute(_a0 http.Context) http.Response { return r0 } +// HandlerFunc_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute' +type HandlerFunc_Execute_Call struct { + *mock.Call +} + +// Execute is a helper method to define mock.On call +// - _a0 http.Context +func (_e *HandlerFunc_Expecter) Execute(_a0 interface{}) *HandlerFunc_Execute_Call { + return &HandlerFunc_Execute_Call{Call: _e.mock.On("Execute", _a0)} +} + +func (_c *HandlerFunc_Execute_Call) Run(run func(_a0 http.Context)) *HandlerFunc_Execute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(http.Context)) + }) + return _c +} + +func (_c *HandlerFunc_Execute_Call) Return(_a0 http.Response) *HandlerFunc_Execute_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *HandlerFunc_Execute_Call) RunAndReturn(run func(http.Context) http.Response) *HandlerFunc_Execute_Call { + _c.Call.Return(run) + return _c +} + // NewHandlerFunc creates a new instance of HandlerFunc. 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 NewHandlerFunc(t interface { diff --git a/mocks/http/Limit.go b/mocks/http/Limit.go index a64e3e440..a31532a9a 100644 --- a/mocks/http/Limit.go +++ b/mocks/http/Limit.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,10 +12,22 @@ type Limit struct { mock.Mock } +type Limit_Expecter struct { + mock *mock.Mock +} + +func (_m *Limit) EXPECT() *Limit_Expecter { + return &Limit_Expecter{mock: &_m.Mock} +} + // By provides a mock function with given fields: key func (_m *Limit) By(key string) http.Limit { ret := _m.Called(key) + if len(ret) == 0 { + panic("no return value specified for By") + } + var r0 http.Limit if rf, ok := ret.Get(0).(func(string) http.Limit); ok { r0 = rf(key) @@ -28,10 +40,42 @@ func (_m *Limit) By(key string) http.Limit { return r0 } +// Limit_By_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'By' +type Limit_By_Call struct { + *mock.Call +} + +// By is a helper method to define mock.On call +// - key string +func (_e *Limit_Expecter) By(key interface{}) *Limit_By_Call { + return &Limit_By_Call{Call: _e.mock.On("By", key)} +} + +func (_c *Limit_By_Call) Run(run func(key string)) *Limit_By_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Limit_By_Call) Return(_a0 http.Limit) *Limit_By_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Limit_By_Call) RunAndReturn(run func(string) http.Limit) *Limit_By_Call { + _c.Call.Return(run) + return _c +} + // Response provides a mock function with given fields: _a0 func (_m *Limit) Response(_a0 func(http.Context)) http.Limit { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Response") + } + var r0 http.Limit if rf, ok := ret.Get(0).(func(func(http.Context)) http.Limit); ok { r0 = rf(_a0) @@ -44,6 +88,34 @@ func (_m *Limit) Response(_a0 func(http.Context)) http.Limit { return r0 } +// Limit_Response_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Response' +type Limit_Response_Call struct { + *mock.Call +} + +// Response is a helper method to define mock.On call +// - _a0 func(http.Context) +func (_e *Limit_Expecter) Response(_a0 interface{}) *Limit_Response_Call { + return &Limit_Response_Call{Call: _e.mock.On("Response", _a0)} +} + +func (_c *Limit_Response_Call) Run(run func(_a0 func(http.Context))) *Limit_Response_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(func(http.Context))) + }) + return _c +} + +func (_c *Limit_Response_Call) Return(_a0 http.Limit) *Limit_Response_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Limit_Response_Call) RunAndReturn(run func(func(http.Context)) http.Limit) *Limit_Response_Call { + _c.Call.Return(run) + return _c +} + // NewLimit creates a new instance of Limit. 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 NewLimit(t interface { diff --git a/mocks/http/Middleware.go b/mocks/http/Middleware.go index e8fe5fe5b..4cbb3b688 100644 --- a/mocks/http/Middleware.go +++ b/mocks/http/Middleware.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,11 +12,47 @@ type Middleware struct { mock.Mock } +type Middleware_Expecter struct { + mock *mock.Mock +} + +func (_m *Middleware) EXPECT() *Middleware_Expecter { + return &Middleware_Expecter{mock: &_m.Mock} +} + // Execute provides a mock function with given fields: _a0 func (_m *Middleware) Execute(_a0 http.Context) { _m.Called(_a0) } +// Middleware_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute' +type Middleware_Execute_Call struct { + *mock.Call +} + +// Execute is a helper method to define mock.On call +// - _a0 http.Context +func (_e *Middleware_Expecter) Execute(_a0 interface{}) *Middleware_Execute_Call { + return &Middleware_Execute_Call{Call: _e.mock.On("Execute", _a0)} +} + +func (_c *Middleware_Execute_Call) Run(run func(_a0 http.Context)) *Middleware_Execute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(http.Context)) + }) + return _c +} + +func (_c *Middleware_Execute_Call) Return() *Middleware_Execute_Call { + _c.Call.Return() + return _c +} + +func (_c *Middleware_Execute_Call) RunAndReturn(run func(http.Context)) *Middleware_Execute_Call { + _c.Call.Return(run) + return _c +} + // NewMiddleware creates a new instance of Middleware. 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 NewMiddleware(t interface { diff --git a/mocks/http/RateLimiter.go b/mocks/http/RateLimiter.go index 2a19090dd..62b01c1a6 100644 --- a/mocks/http/RateLimiter.go +++ b/mocks/http/RateLimiter.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,20 +12,90 @@ type RateLimiter struct { mock.Mock } +type RateLimiter_Expecter struct { + mock *mock.Mock +} + +func (_m *RateLimiter) EXPECT() *RateLimiter_Expecter { + return &RateLimiter_Expecter{mock: &_m.Mock} +} + // For provides a mock function with given fields: name, callback func (_m *RateLimiter) For(name string, callback func(http.Context) http.Limit) { _m.Called(name, callback) } +// RateLimiter_For_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'For' +type RateLimiter_For_Call struct { + *mock.Call +} + +// For is a helper method to define mock.On call +// - name string +// - callback func(http.Context) http.Limit +func (_e *RateLimiter_Expecter) For(name interface{}, callback interface{}) *RateLimiter_For_Call { + return &RateLimiter_For_Call{Call: _e.mock.On("For", name, callback)} +} + +func (_c *RateLimiter_For_Call) Run(run func(name string, callback func(http.Context) http.Limit)) *RateLimiter_For_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(func(http.Context) http.Limit)) + }) + return _c +} + +func (_c *RateLimiter_For_Call) Return() *RateLimiter_For_Call { + _c.Call.Return() + return _c +} + +func (_c *RateLimiter_For_Call) RunAndReturn(run func(string, func(http.Context) http.Limit)) *RateLimiter_For_Call { + _c.Call.Return(run) + return _c +} + // ForWithLimits provides a mock function with given fields: name, callback func (_m *RateLimiter) ForWithLimits(name string, callback func(http.Context) []http.Limit) { _m.Called(name, callback) } +// RateLimiter_ForWithLimits_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ForWithLimits' +type RateLimiter_ForWithLimits_Call struct { + *mock.Call +} + +// ForWithLimits is a helper method to define mock.On call +// - name string +// - callback func(http.Context) []http.Limit +func (_e *RateLimiter_Expecter) ForWithLimits(name interface{}, callback interface{}) *RateLimiter_ForWithLimits_Call { + return &RateLimiter_ForWithLimits_Call{Call: _e.mock.On("ForWithLimits", name, callback)} +} + +func (_c *RateLimiter_ForWithLimits_Call) Run(run func(name string, callback func(http.Context) []http.Limit)) *RateLimiter_ForWithLimits_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(func(http.Context) []http.Limit)) + }) + return _c +} + +func (_c *RateLimiter_ForWithLimits_Call) Return() *RateLimiter_ForWithLimits_Call { + _c.Call.Return() + return _c +} + +func (_c *RateLimiter_ForWithLimits_Call) RunAndReturn(run func(string, func(http.Context) []http.Limit)) *RateLimiter_ForWithLimits_Call { + _c.Call.Return(run) + return _c +} + // Limiter provides a mock function with given fields: name func (_m *RateLimiter) Limiter(name string) func(http.Context) []http.Limit { ret := _m.Called(name) + if len(ret) == 0 { + panic("no return value specified for Limiter") + } + var r0 func(http.Context) []http.Limit if rf, ok := ret.Get(0).(func(string) func(http.Context) []http.Limit); ok { r0 = rf(name) @@ -38,6 +108,34 @@ func (_m *RateLimiter) Limiter(name string) func(http.Context) []http.Limit { return r0 } +// RateLimiter_Limiter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Limiter' +type RateLimiter_Limiter_Call struct { + *mock.Call +} + +// Limiter is a helper method to define mock.On call +// - name string +func (_e *RateLimiter_Expecter) Limiter(name interface{}) *RateLimiter_Limiter_Call { + return &RateLimiter_Limiter_Call{Call: _e.mock.On("Limiter", name)} +} + +func (_c *RateLimiter_Limiter_Call) Run(run func(name string)) *RateLimiter_Limiter_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *RateLimiter_Limiter_Call) Return(_a0 func(http.Context) []http.Limit) *RateLimiter_Limiter_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *RateLimiter_Limiter_Call) RunAndReturn(run func(string) func(http.Context) []http.Limit) *RateLimiter_Limiter_Call { + _c.Call.Return(run) + return _c +} + // NewRateLimiter creates a new instance of RateLimiter. 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 NewRateLimiter(t interface { diff --git a/mocks/http/ResourceController.go b/mocks/http/ResourceController.go index 842acd3ba..2d9913e65 100644 --- a/mocks/http/ResourceController.go +++ b/mocks/http/ResourceController.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,10 +12,22 @@ type ResourceController struct { mock.Mock } +type ResourceController_Expecter struct { + mock *mock.Mock +} + +func (_m *ResourceController) EXPECT() *ResourceController_Expecter { + return &ResourceController_Expecter{mock: &_m.Mock} +} + // Destroy provides a mock function with given fields: _a0 func (_m *ResourceController) Destroy(_a0 http.Context) http.Response { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Destroy") + } + var r0 http.Response if rf, ok := ret.Get(0).(func(http.Context) http.Response); ok { r0 = rf(_a0) @@ -28,10 +40,42 @@ func (_m *ResourceController) Destroy(_a0 http.Context) http.Response { return r0 } +// ResourceController_Destroy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Destroy' +type ResourceController_Destroy_Call struct { + *mock.Call +} + +// Destroy is a helper method to define mock.On call +// - _a0 http.Context +func (_e *ResourceController_Expecter) Destroy(_a0 interface{}) *ResourceController_Destroy_Call { + return &ResourceController_Destroy_Call{Call: _e.mock.On("Destroy", _a0)} +} + +func (_c *ResourceController_Destroy_Call) Run(run func(_a0 http.Context)) *ResourceController_Destroy_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(http.Context)) + }) + return _c +} + +func (_c *ResourceController_Destroy_Call) Return(_a0 http.Response) *ResourceController_Destroy_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ResourceController_Destroy_Call) RunAndReturn(run func(http.Context) http.Response) *ResourceController_Destroy_Call { + _c.Call.Return(run) + return _c +} + // Index provides a mock function with given fields: _a0 func (_m *ResourceController) Index(_a0 http.Context) http.Response { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Index") + } + var r0 http.Response if rf, ok := ret.Get(0).(func(http.Context) http.Response); ok { r0 = rf(_a0) @@ -44,10 +88,42 @@ func (_m *ResourceController) Index(_a0 http.Context) http.Response { return r0 } +// ResourceController_Index_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Index' +type ResourceController_Index_Call struct { + *mock.Call +} + +// Index is a helper method to define mock.On call +// - _a0 http.Context +func (_e *ResourceController_Expecter) Index(_a0 interface{}) *ResourceController_Index_Call { + return &ResourceController_Index_Call{Call: _e.mock.On("Index", _a0)} +} + +func (_c *ResourceController_Index_Call) Run(run func(_a0 http.Context)) *ResourceController_Index_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(http.Context)) + }) + return _c +} + +func (_c *ResourceController_Index_Call) Return(_a0 http.Response) *ResourceController_Index_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ResourceController_Index_Call) RunAndReturn(run func(http.Context) http.Response) *ResourceController_Index_Call { + _c.Call.Return(run) + return _c +} + // Show provides a mock function with given fields: _a0 func (_m *ResourceController) Show(_a0 http.Context) http.Response { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Show") + } + var r0 http.Response if rf, ok := ret.Get(0).(func(http.Context) http.Response); ok { r0 = rf(_a0) @@ -60,10 +136,42 @@ func (_m *ResourceController) Show(_a0 http.Context) http.Response { return r0 } +// ResourceController_Show_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Show' +type ResourceController_Show_Call struct { + *mock.Call +} + +// Show is a helper method to define mock.On call +// - _a0 http.Context +func (_e *ResourceController_Expecter) Show(_a0 interface{}) *ResourceController_Show_Call { + return &ResourceController_Show_Call{Call: _e.mock.On("Show", _a0)} +} + +func (_c *ResourceController_Show_Call) Run(run func(_a0 http.Context)) *ResourceController_Show_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(http.Context)) + }) + return _c +} + +func (_c *ResourceController_Show_Call) Return(_a0 http.Response) *ResourceController_Show_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ResourceController_Show_Call) RunAndReturn(run func(http.Context) http.Response) *ResourceController_Show_Call { + _c.Call.Return(run) + return _c +} + // Store provides a mock function with given fields: _a0 func (_m *ResourceController) Store(_a0 http.Context) http.Response { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Store") + } + var r0 http.Response if rf, ok := ret.Get(0).(func(http.Context) http.Response); ok { r0 = rf(_a0) @@ -76,10 +184,42 @@ func (_m *ResourceController) Store(_a0 http.Context) http.Response { return r0 } +// ResourceController_Store_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Store' +type ResourceController_Store_Call struct { + *mock.Call +} + +// Store is a helper method to define mock.On call +// - _a0 http.Context +func (_e *ResourceController_Expecter) Store(_a0 interface{}) *ResourceController_Store_Call { + return &ResourceController_Store_Call{Call: _e.mock.On("Store", _a0)} +} + +func (_c *ResourceController_Store_Call) Run(run func(_a0 http.Context)) *ResourceController_Store_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(http.Context)) + }) + return _c +} + +func (_c *ResourceController_Store_Call) Return(_a0 http.Response) *ResourceController_Store_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ResourceController_Store_Call) RunAndReturn(run func(http.Context) http.Response) *ResourceController_Store_Call { + _c.Call.Return(run) + return _c +} + // Update provides a mock function with given fields: _a0 func (_m *ResourceController) Update(_a0 http.Context) http.Response { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Update") + } + var r0 http.Response if rf, ok := ret.Get(0).(func(http.Context) http.Response); ok { r0 = rf(_a0) @@ -92,6 +232,34 @@ func (_m *ResourceController) Update(_a0 http.Context) http.Response { return r0 } +// ResourceController_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type ResourceController_Update_Call struct { + *mock.Call +} + +// Update is a helper method to define mock.On call +// - _a0 http.Context +func (_e *ResourceController_Expecter) Update(_a0 interface{}) *ResourceController_Update_Call { + return &ResourceController_Update_Call{Call: _e.mock.On("Update", _a0)} +} + +func (_c *ResourceController_Update_Call) Run(run func(_a0 http.Context)) *ResourceController_Update_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(http.Context)) + }) + return _c +} + +func (_c *ResourceController_Update_Call) Return(_a0 http.Response) *ResourceController_Update_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ResourceController_Update_Call) RunAndReturn(run func(http.Context) http.Response) *ResourceController_Update_Call { + _c.Call.Return(run) + return _c +} + // NewResourceController creates a new instance of ResourceController. 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 NewResourceController(t interface { diff --git a/mocks/http/Response.go b/mocks/http/Response.go index 4d94d2fe6..ae4382058 100644 --- a/mocks/http/Response.go +++ b/mocks/http/Response.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -9,10 +9,22 @@ type Response struct { mock.Mock } +type Response_Expecter struct { + mock *mock.Mock +} + +func (_m *Response) EXPECT() *Response_Expecter { + return &Response_Expecter{mock: &_m.Mock} +} + // Render provides a mock function with given fields: func (_m *Response) Render() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Render") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -23,6 +35,33 @@ func (_m *Response) Render() error { return r0 } +// Response_Render_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Render' +type Response_Render_Call struct { + *mock.Call +} + +// Render is a helper method to define mock.On call +func (_e *Response_Expecter) Render() *Response_Render_Call { + return &Response_Render_Call{Call: _e.mock.On("Render")} +} + +func (_c *Response_Render_Call) Run(run func()) *Response_Render_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Response_Render_Call) Return(_a0 error) *Response_Render_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Response_Render_Call) RunAndReturn(run func() error) *Response_Render_Call { + _c.Call.Return(run) + return _c +} + // NewResponse creates a new instance of Response. 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 NewResponse(t interface { diff --git a/mocks/http/ResponseOrigin.go b/mocks/http/ResponseOrigin.go index 7ada6d658..6c9fdefdb 100644 --- a/mocks/http/ResponseOrigin.go +++ b/mocks/http/ResponseOrigin.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -15,10 +15,22 @@ type ResponseOrigin struct { mock.Mock } +type ResponseOrigin_Expecter struct { + mock *mock.Mock +} + +func (_m *ResponseOrigin) EXPECT() *ResponseOrigin_Expecter { + return &ResponseOrigin_Expecter{mock: &_m.Mock} +} + // Body provides a mock function with given fields: func (_m *ResponseOrigin) Body() *bytes.Buffer { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Body") + } + var r0 *bytes.Buffer if rf, ok := ret.Get(0).(func() *bytes.Buffer); ok { r0 = rf() @@ -31,10 +43,41 @@ func (_m *ResponseOrigin) Body() *bytes.Buffer { return r0 } +// ResponseOrigin_Body_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Body' +type ResponseOrigin_Body_Call struct { + *mock.Call +} + +// Body is a helper method to define mock.On call +func (_e *ResponseOrigin_Expecter) Body() *ResponseOrigin_Body_Call { + return &ResponseOrigin_Body_Call{Call: _e.mock.On("Body")} +} + +func (_c *ResponseOrigin_Body_Call) Run(run func()) *ResponseOrigin_Body_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ResponseOrigin_Body_Call) Return(_a0 *bytes.Buffer) *ResponseOrigin_Body_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ResponseOrigin_Body_Call) RunAndReturn(run func() *bytes.Buffer) *ResponseOrigin_Body_Call { + _c.Call.Return(run) + return _c +} + // Header provides a mock function with given fields: func (_m *ResponseOrigin) Header() nethttp.Header { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Header") + } + var r0 nethttp.Header if rf, ok := ret.Get(0).(func() nethttp.Header); ok { r0 = rf() @@ -47,10 +90,41 @@ func (_m *ResponseOrigin) Header() nethttp.Header { return r0 } +// ResponseOrigin_Header_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Header' +type ResponseOrigin_Header_Call struct { + *mock.Call +} + +// Header is a helper method to define mock.On call +func (_e *ResponseOrigin_Expecter) Header() *ResponseOrigin_Header_Call { + return &ResponseOrigin_Header_Call{Call: _e.mock.On("Header")} +} + +func (_c *ResponseOrigin_Header_Call) Run(run func()) *ResponseOrigin_Header_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ResponseOrigin_Header_Call) Return(_a0 nethttp.Header) *ResponseOrigin_Header_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ResponseOrigin_Header_Call) RunAndReturn(run func() nethttp.Header) *ResponseOrigin_Header_Call { + _c.Call.Return(run) + return _c +} + // Size provides a mock function with given fields: func (_m *ResponseOrigin) Size() int { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Size") + } + var r0 int if rf, ok := ret.Get(0).(func() int); ok { r0 = rf() @@ -61,10 +135,41 @@ func (_m *ResponseOrigin) Size() int { return r0 } +// ResponseOrigin_Size_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Size' +type ResponseOrigin_Size_Call struct { + *mock.Call +} + +// Size is a helper method to define mock.On call +func (_e *ResponseOrigin_Expecter) Size() *ResponseOrigin_Size_Call { + return &ResponseOrigin_Size_Call{Call: _e.mock.On("Size")} +} + +func (_c *ResponseOrigin_Size_Call) Run(run func()) *ResponseOrigin_Size_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ResponseOrigin_Size_Call) Return(_a0 int) *ResponseOrigin_Size_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ResponseOrigin_Size_Call) RunAndReturn(run func() int) *ResponseOrigin_Size_Call { + _c.Call.Return(run) + return _c +} + // Status provides a mock function with given fields: func (_m *ResponseOrigin) Status() int { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Status") + } + var r0 int if rf, ok := ret.Get(0).(func() int); ok { r0 = rf() @@ -75,6 +180,33 @@ func (_m *ResponseOrigin) Status() int { return r0 } +// ResponseOrigin_Status_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Status' +type ResponseOrigin_Status_Call struct { + *mock.Call +} + +// Status is a helper method to define mock.On call +func (_e *ResponseOrigin_Expecter) Status() *ResponseOrigin_Status_Call { + return &ResponseOrigin_Status_Call{Call: _e.mock.On("Status")} +} + +func (_c *ResponseOrigin_Status_Call) Run(run func()) *ResponseOrigin_Status_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ResponseOrigin_Status_Call) Return(_a0 int) *ResponseOrigin_Status_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ResponseOrigin_Status_Call) RunAndReturn(run func() int) *ResponseOrigin_Status_Call { + _c.Call.Return(run) + return _c +} + // NewResponseOrigin creates a new instance of ResponseOrigin. 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 NewResponseOrigin(t interface { diff --git a/mocks/http/ResponseStatus.go b/mocks/http/ResponseStatus.go index f26b374aa..701440fa4 100644 --- a/mocks/http/ResponseStatus.go +++ b/mocks/http/ResponseStatus.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,10 +12,22 @@ type ResponseStatus struct { mock.Mock } +type ResponseStatus_Expecter struct { + mock *mock.Mock +} + +func (_m *ResponseStatus) EXPECT() *ResponseStatus_Expecter { + return &ResponseStatus_Expecter{mock: &_m.Mock} +} + // Data provides a mock function with given fields: contentType, data func (_m *ResponseStatus) Data(contentType string, data []byte) http.Response { ret := _m.Called(contentType, data) + if len(ret) == 0 { + panic("no return value specified for Data") + } + var r0 http.Response if rf, ok := ret.Get(0).(func(string, []byte) http.Response); ok { r0 = rf(contentType, data) @@ -28,10 +40,43 @@ func (_m *ResponseStatus) Data(contentType string, data []byte) http.Response { return r0 } +// ResponseStatus_Data_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Data' +type ResponseStatus_Data_Call struct { + *mock.Call +} + +// Data is a helper method to define mock.On call +// - contentType string +// - data []byte +func (_e *ResponseStatus_Expecter) Data(contentType interface{}, data interface{}) *ResponseStatus_Data_Call { + return &ResponseStatus_Data_Call{Call: _e.mock.On("Data", contentType, data)} +} + +func (_c *ResponseStatus_Data_Call) Run(run func(contentType string, data []byte)) *ResponseStatus_Data_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].([]byte)) + }) + return _c +} + +func (_c *ResponseStatus_Data_Call) Return(_a0 http.Response) *ResponseStatus_Data_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ResponseStatus_Data_Call) RunAndReturn(run func(string, []byte) http.Response) *ResponseStatus_Data_Call { + _c.Call.Return(run) + return _c +} + // Json provides a mock function with given fields: obj func (_m *ResponseStatus) Json(obj interface{}) http.Response { ret := _m.Called(obj) + if len(ret) == 0 { + panic("no return value specified for Json") + } + var r0 http.Response if rf, ok := ret.Get(0).(func(interface{}) http.Response); ok { r0 = rf(obj) @@ -44,6 +89,34 @@ func (_m *ResponseStatus) Json(obj interface{}) http.Response { return r0 } +// ResponseStatus_Json_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Json' +type ResponseStatus_Json_Call struct { + *mock.Call +} + +// Json is a helper method to define mock.On call +// - obj interface{} +func (_e *ResponseStatus_Expecter) Json(obj interface{}) *ResponseStatus_Json_Call { + return &ResponseStatus_Json_Call{Call: _e.mock.On("Json", obj)} +} + +func (_c *ResponseStatus_Json_Call) Run(run func(obj interface{})) *ResponseStatus_Json_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *ResponseStatus_Json_Call) Return(_a0 http.Response) *ResponseStatus_Json_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ResponseStatus_Json_Call) RunAndReturn(run func(interface{}) http.Response) *ResponseStatus_Json_Call { + _c.Call.Return(run) + return _c +} + // String provides a mock function with given fields: format, values func (_m *ResponseStatus) String(format string, values ...interface{}) http.Response { var _ca []interface{} @@ -51,6 +124,10 @@ func (_m *ResponseStatus) String(format string, values ...interface{}) http.Resp _ca = append(_ca, values...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for String") + } + var r0 http.Response if rf, ok := ret.Get(0).(func(string, ...interface{}) http.Response); ok { r0 = rf(format, values...) @@ -63,6 +140,42 @@ func (_m *ResponseStatus) String(format string, values ...interface{}) http.Resp return r0 } +// ResponseStatus_String_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'String' +type ResponseStatus_String_Call struct { + *mock.Call +} + +// String is a helper method to define mock.On call +// - format string +// - values ...interface{} +func (_e *ResponseStatus_Expecter) String(format interface{}, values ...interface{}) *ResponseStatus_String_Call { + return &ResponseStatus_String_Call{Call: _e.mock.On("String", + append([]interface{}{format}, values...)...)} +} + +func (_c *ResponseStatus_String_Call) Run(run func(format string, values ...interface{})) *ResponseStatus_String_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *ResponseStatus_String_Call) Return(_a0 http.Response) *ResponseStatus_String_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ResponseStatus_String_Call) RunAndReturn(run func(string, ...interface{}) http.Response) *ResponseStatus_String_Call { + _c.Call.Return(run) + return _c +} + // NewResponseStatus creates a new instance of ResponseStatus. 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 NewResponseStatus(t interface { diff --git a/mocks/http/ResponseSuccess.go b/mocks/http/ResponseSuccess.go index ccabf4a28..4c44e5cdb 100644 --- a/mocks/http/ResponseSuccess.go +++ b/mocks/http/ResponseSuccess.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,10 +12,22 @@ type ResponseSuccess struct { mock.Mock } +type ResponseSuccess_Expecter struct { + mock *mock.Mock +} + +func (_m *ResponseSuccess) EXPECT() *ResponseSuccess_Expecter { + return &ResponseSuccess_Expecter{mock: &_m.Mock} +} + // Data provides a mock function with given fields: contentType, data func (_m *ResponseSuccess) Data(contentType string, data []byte) http.Response { ret := _m.Called(contentType, data) + if len(ret) == 0 { + panic("no return value specified for Data") + } + var r0 http.Response if rf, ok := ret.Get(0).(func(string, []byte) http.Response); ok { r0 = rf(contentType, data) @@ -28,10 +40,43 @@ func (_m *ResponseSuccess) Data(contentType string, data []byte) http.Response { return r0 } +// ResponseSuccess_Data_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Data' +type ResponseSuccess_Data_Call struct { + *mock.Call +} + +// Data is a helper method to define mock.On call +// - contentType string +// - data []byte +func (_e *ResponseSuccess_Expecter) Data(contentType interface{}, data interface{}) *ResponseSuccess_Data_Call { + return &ResponseSuccess_Data_Call{Call: _e.mock.On("Data", contentType, data)} +} + +func (_c *ResponseSuccess_Data_Call) Run(run func(contentType string, data []byte)) *ResponseSuccess_Data_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].([]byte)) + }) + return _c +} + +func (_c *ResponseSuccess_Data_Call) Return(_a0 http.Response) *ResponseSuccess_Data_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ResponseSuccess_Data_Call) RunAndReturn(run func(string, []byte) http.Response) *ResponseSuccess_Data_Call { + _c.Call.Return(run) + return _c +} + // Json provides a mock function with given fields: obj func (_m *ResponseSuccess) Json(obj interface{}) http.Response { ret := _m.Called(obj) + if len(ret) == 0 { + panic("no return value specified for Json") + } + var r0 http.Response if rf, ok := ret.Get(0).(func(interface{}) http.Response); ok { r0 = rf(obj) @@ -44,6 +89,34 @@ func (_m *ResponseSuccess) Json(obj interface{}) http.Response { return r0 } +// ResponseSuccess_Json_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Json' +type ResponseSuccess_Json_Call struct { + *mock.Call +} + +// Json is a helper method to define mock.On call +// - obj interface{} +func (_e *ResponseSuccess_Expecter) Json(obj interface{}) *ResponseSuccess_Json_Call { + return &ResponseSuccess_Json_Call{Call: _e.mock.On("Json", obj)} +} + +func (_c *ResponseSuccess_Json_Call) Run(run func(obj interface{})) *ResponseSuccess_Json_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *ResponseSuccess_Json_Call) Return(_a0 http.Response) *ResponseSuccess_Json_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ResponseSuccess_Json_Call) RunAndReturn(run func(interface{}) http.Response) *ResponseSuccess_Json_Call { + _c.Call.Return(run) + return _c +} + // String provides a mock function with given fields: format, values func (_m *ResponseSuccess) String(format string, values ...interface{}) http.Response { var _ca []interface{} @@ -51,6 +124,10 @@ func (_m *ResponseSuccess) String(format string, values ...interface{}) http.Res _ca = append(_ca, values...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for String") + } + var r0 http.Response if rf, ok := ret.Get(0).(func(string, ...interface{}) http.Response); ok { r0 = rf(format, values...) @@ -63,6 +140,42 @@ func (_m *ResponseSuccess) String(format string, values ...interface{}) http.Res return r0 } +// ResponseSuccess_String_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'String' +type ResponseSuccess_String_Call struct { + *mock.Call +} + +// String is a helper method to define mock.On call +// - format string +// - values ...interface{} +func (_e *ResponseSuccess_Expecter) String(format interface{}, values ...interface{}) *ResponseSuccess_String_Call { + return &ResponseSuccess_String_Call{Call: _e.mock.On("String", + append([]interface{}{format}, values...)...)} +} + +func (_c *ResponseSuccess_String_Call) Run(run func(format string, values ...interface{})) *ResponseSuccess_String_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *ResponseSuccess_String_Call) Return(_a0 http.Response) *ResponseSuccess_String_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ResponseSuccess_String_Call) RunAndReturn(run func(string, ...interface{}) http.Response) *ResponseSuccess_String_Call { + _c.Call.Return(run) + return _c +} + // NewResponseSuccess creates a new instance of ResponseSuccess. 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 NewResponseSuccess(t interface { diff --git a/mocks/http/ResponseView.go b/mocks/http/ResponseView.go index fd24b7c88..b9a0ef3ae 100644 --- a/mocks/http/ResponseView.go +++ b/mocks/http/ResponseView.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,6 +12,14 @@ type ResponseView struct { mock.Mock } +type ResponseView_Expecter struct { + mock *mock.Mock +} + +func (_m *ResponseView) EXPECT() *ResponseView_Expecter { + return &ResponseView_Expecter{mock: &_m.Mock} +} + // First provides a mock function with given fields: views, data func (_m *ResponseView) First(views []string, data ...interface{}) http.Response { var _ca []interface{} @@ -19,6 +27,10 @@ func (_m *ResponseView) First(views []string, data ...interface{}) http.Response _ca = append(_ca, data...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for First") + } + var r0 http.Response if rf, ok := ret.Get(0).(func([]string, ...interface{}) http.Response); ok { r0 = rf(views, data...) @@ -31,6 +43,42 @@ func (_m *ResponseView) First(views []string, data ...interface{}) http.Response return r0 } +// ResponseView_First_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'First' +type ResponseView_First_Call struct { + *mock.Call +} + +// First is a helper method to define mock.On call +// - views []string +// - data ...interface{} +func (_e *ResponseView_Expecter) First(views interface{}, data ...interface{}) *ResponseView_First_Call { + return &ResponseView_First_Call{Call: _e.mock.On("First", + append([]interface{}{views}, data...)...)} +} + +func (_c *ResponseView_First_Call) Run(run func(views []string, data ...interface{})) *ResponseView_First_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].([]string), variadicArgs...) + }) + return _c +} + +func (_c *ResponseView_First_Call) Return(_a0 http.Response) *ResponseView_First_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ResponseView_First_Call) RunAndReturn(run func([]string, ...interface{}) http.Response) *ResponseView_First_Call { + _c.Call.Return(run) + return _c +} + // Make provides a mock function with given fields: view, data func (_m *ResponseView) Make(view string, data ...interface{}) http.Response { var _ca []interface{} @@ -38,6 +86,10 @@ func (_m *ResponseView) Make(view string, data ...interface{}) http.Response { _ca = append(_ca, data...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Make") + } + var r0 http.Response if rf, ok := ret.Get(0).(func(string, ...interface{}) http.Response); ok { r0 = rf(view, data...) @@ -50,6 +102,42 @@ func (_m *ResponseView) Make(view string, data ...interface{}) http.Response { return r0 } +// ResponseView_Make_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Make' +type ResponseView_Make_Call struct { + *mock.Call +} + +// Make is a helper method to define mock.On call +// - view string +// - data ...interface{} +func (_e *ResponseView_Expecter) Make(view interface{}, data ...interface{}) *ResponseView_Make_Call { + return &ResponseView_Make_Call{Call: _e.mock.On("Make", + append([]interface{}{view}, data...)...)} +} + +func (_c *ResponseView_Make_Call) Run(run func(view string, data ...interface{})) *ResponseView_Make_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *ResponseView_Make_Call) Return(_a0 http.Response) *ResponseView_Make_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ResponseView_Make_Call) RunAndReturn(run func(string, ...interface{}) http.Response) *ResponseView_Make_Call { + _c.Call.Return(run) + return _c +} + // NewResponseView creates a new instance of ResponseView. 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 NewResponseView(t interface { diff --git a/mocks/http/View.go b/mocks/http/View.go index 0c7bdf8b2..5d3d941c5 100644 --- a/mocks/http/View.go +++ b/mocks/http/View.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -9,10 +9,22 @@ type View struct { mock.Mock } +type View_Expecter struct { + mock *mock.Mock +} + +func (_m *View) EXPECT() *View_Expecter { + return &View_Expecter{mock: &_m.Mock} +} + // Exists provides a mock function with given fields: view func (_m *View) Exists(view string) bool { ret := _m.Called(view) + if len(ret) == 0 { + panic("no return value specified for Exists") + } + var r0 bool if rf, ok := ret.Get(0).(func(string) bool); ok { r0 = rf(view) @@ -23,10 +35,42 @@ func (_m *View) Exists(view string) bool { return r0 } +// View_Exists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Exists' +type View_Exists_Call struct { + *mock.Call +} + +// Exists is a helper method to define mock.On call +// - view string +func (_e *View_Expecter) Exists(view interface{}) *View_Exists_Call { + return &View_Exists_Call{Call: _e.mock.On("Exists", view)} +} + +func (_c *View_Exists_Call) Run(run func(view string)) *View_Exists_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *View_Exists_Call) Return(_a0 bool) *View_Exists_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *View_Exists_Call) RunAndReturn(run func(string) bool) *View_Exists_Call { + _c.Call.Return(run) + return _c +} + // GetShared provides a mock function with given fields: func (_m *View) GetShared() map[string]interface{} { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for GetShared") + } + var r0 map[string]interface{} if rf, ok := ret.Get(0).(func() map[string]interface{}); ok { r0 = rf() @@ -39,11 +83,67 @@ func (_m *View) GetShared() map[string]interface{} { return r0 } +// View_GetShared_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetShared' +type View_GetShared_Call struct { + *mock.Call +} + +// GetShared is a helper method to define mock.On call +func (_e *View_Expecter) GetShared() *View_GetShared_Call { + return &View_GetShared_Call{Call: _e.mock.On("GetShared")} +} + +func (_c *View_GetShared_Call) Run(run func()) *View_GetShared_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *View_GetShared_Call) Return(_a0 map[string]interface{}) *View_GetShared_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *View_GetShared_Call) RunAndReturn(run func() map[string]interface{}) *View_GetShared_Call { + _c.Call.Return(run) + return _c +} + // Share provides a mock function with given fields: key, value func (_m *View) Share(key string, value interface{}) { _m.Called(key, value) } +// View_Share_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Share' +type View_Share_Call struct { + *mock.Call +} + +// Share is a helper method to define mock.On call +// - key string +// - value interface{} +func (_e *View_Expecter) Share(key interface{}, value interface{}) *View_Share_Call { + return &View_Share_Call{Call: _e.mock.On("Share", key, value)} +} + +func (_c *View_Share_Call) Run(run func(key string, value interface{})) *View_Share_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(interface{})) + }) + return _c +} + +func (_c *View_Share_Call) Return() *View_Share_Call { + _c.Call.Return() + return _c +} + +func (_c *View_Share_Call) RunAndReturn(run func(string, interface{})) *View_Share_Call { + _c.Call.Return(run) + return _c +} + // Shared provides a mock function with given fields: key, def func (_m *View) Shared(key string, def ...interface{}) interface{} { var _ca []interface{} @@ -51,6 +151,10 @@ func (_m *View) Shared(key string, def ...interface{}) interface{} { _ca = append(_ca, def...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Shared") + } + var r0 interface{} if rf, ok := ret.Get(0).(func(string, ...interface{}) interface{}); ok { r0 = rf(key, def...) @@ -63,6 +167,42 @@ func (_m *View) Shared(key string, def ...interface{}) interface{} { return r0 } +// View_Shared_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Shared' +type View_Shared_Call struct { + *mock.Call +} + +// Shared is a helper method to define mock.On call +// - key string +// - def ...interface{} +func (_e *View_Expecter) Shared(key interface{}, def ...interface{}) *View_Shared_Call { + return &View_Shared_Call{Call: _e.mock.On("Shared", + append([]interface{}{key}, def...)...)} +} + +func (_c *View_Shared_Call) Run(run func(key string, def ...interface{})) *View_Shared_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *View_Shared_Call) Return(_a0 interface{}) *View_Shared_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *View_Shared_Call) RunAndReturn(run func(string, ...interface{}) interface{}) *View_Shared_Call { + _c.Call.Return(run) + return _c +} + // NewView creates a new instance of View. 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 NewView(t interface { diff --git a/mocks/log/Entry.go b/mocks/log/Entry.go index ed2ed69af..8ce8bb9f5 100644 --- a/mocks/log/Entry.go +++ b/mocks/log/Entry.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -16,10 +16,22 @@ type Entry struct { mock.Mock } +type Entry_Expecter struct { + mock *mock.Mock +} + +func (_m *Entry) EXPECT() *Entry_Expecter { + return &Entry_Expecter{mock: &_m.Mock} +} + // Context provides a mock function with given fields: func (_m *Entry) Context() context.Context { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Context") + } + var r0 context.Context if rf, ok := ret.Get(0).(func() context.Context); ok { r0 = rf() @@ -32,10 +44,41 @@ func (_m *Entry) Context() context.Context { return r0 } +// Entry_Context_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Context' +type Entry_Context_Call struct { + *mock.Call +} + +// Context is a helper method to define mock.On call +func (_e *Entry_Expecter) Context() *Entry_Context_Call { + return &Entry_Context_Call{Call: _e.mock.On("Context")} +} + +func (_c *Entry_Context_Call) Run(run func()) *Entry_Context_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Entry_Context_Call) Return(_a0 context.Context) *Entry_Context_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Entry_Context_Call) RunAndReturn(run func() context.Context) *Entry_Context_Call { + _c.Call.Return(run) + return _c +} + // Level provides a mock function with given fields: func (_m *Entry) Level() log.Level { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Level") + } + var r0 log.Level if rf, ok := ret.Get(0).(func() log.Level); ok { r0 = rf() @@ -46,10 +89,41 @@ func (_m *Entry) Level() log.Level { return r0 } +// Entry_Level_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Level' +type Entry_Level_Call struct { + *mock.Call +} + +// Level is a helper method to define mock.On call +func (_e *Entry_Expecter) Level() *Entry_Level_Call { + return &Entry_Level_Call{Call: _e.mock.On("Level")} +} + +func (_c *Entry_Level_Call) Run(run func()) *Entry_Level_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Entry_Level_Call) Return(_a0 log.Level) *Entry_Level_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Entry_Level_Call) RunAndReturn(run func() log.Level) *Entry_Level_Call { + _c.Call.Return(run) + return _c +} + // Message provides a mock function with given fields: func (_m *Entry) Message() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Message") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -60,10 +134,41 @@ func (_m *Entry) Message() string { return r0 } +// Entry_Message_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Message' +type Entry_Message_Call struct { + *mock.Call +} + +// Message is a helper method to define mock.On call +func (_e *Entry_Expecter) Message() *Entry_Message_Call { + return &Entry_Message_Call{Call: _e.mock.On("Message")} +} + +func (_c *Entry_Message_Call) Run(run func()) *Entry_Message_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Entry_Message_Call) Return(_a0 string) *Entry_Message_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Entry_Message_Call) RunAndReturn(run func() string) *Entry_Message_Call { + _c.Call.Return(run) + return _c +} + // Time provides a mock function with given fields: func (_m *Entry) Time() time.Time { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Time") + } + var r0 time.Time if rf, ok := ret.Get(0).(func() time.Time); ok { r0 = rf() @@ -74,6 +179,33 @@ func (_m *Entry) Time() time.Time { return r0 } +// Entry_Time_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Time' +type Entry_Time_Call struct { + *mock.Call +} + +// Time is a helper method to define mock.On call +func (_e *Entry_Expecter) Time() *Entry_Time_Call { + return &Entry_Time_Call{Call: _e.mock.On("Time")} +} + +func (_c *Entry_Time_Call) Run(run func()) *Entry_Time_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Entry_Time_Call) Return(_a0 time.Time) *Entry_Time_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Entry_Time_Call) RunAndReturn(run func() time.Time) *Entry_Time_Call { + _c.Call.Return(run) + return _c +} + // NewEntry creates a new instance of Entry. 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 NewEntry(t interface { diff --git a/mocks/log/Hook.go b/mocks/log/Hook.go index 360366276..83c5d435a 100644 --- a/mocks/log/Hook.go +++ b/mocks/log/Hook.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,10 +12,22 @@ type Hook struct { mock.Mock } +type Hook_Expecter struct { + mock *mock.Mock +} + +func (_m *Hook) EXPECT() *Hook_Expecter { + return &Hook_Expecter{mock: &_m.Mock} +} + // Fire provides a mock function with given fields: _a0 func (_m *Hook) Fire(_a0 log.Entry) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Fire") + } + var r0 error if rf, ok := ret.Get(0).(func(log.Entry) error); ok { r0 = rf(_a0) @@ -26,10 +38,42 @@ func (_m *Hook) Fire(_a0 log.Entry) error { return r0 } +// Hook_Fire_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Fire' +type Hook_Fire_Call struct { + *mock.Call +} + +// Fire is a helper method to define mock.On call +// - _a0 log.Entry +func (_e *Hook_Expecter) Fire(_a0 interface{}) *Hook_Fire_Call { + return &Hook_Fire_Call{Call: _e.mock.On("Fire", _a0)} +} + +func (_c *Hook_Fire_Call) Run(run func(_a0 log.Entry)) *Hook_Fire_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(log.Entry)) + }) + return _c +} + +func (_c *Hook_Fire_Call) Return(_a0 error) *Hook_Fire_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Hook_Fire_Call) RunAndReturn(run func(log.Entry) error) *Hook_Fire_Call { + _c.Call.Return(run) + return _c +} + // Levels provides a mock function with given fields: func (_m *Hook) Levels() []log.Level { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Levels") + } + var r0 []log.Level if rf, ok := ret.Get(0).(func() []log.Level); ok { r0 = rf() @@ -42,6 +86,33 @@ func (_m *Hook) Levels() []log.Level { return r0 } +// Hook_Levels_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Levels' +type Hook_Levels_Call struct { + *mock.Call +} + +// Levels is a helper method to define mock.On call +func (_e *Hook_Expecter) Levels() *Hook_Levels_Call { + return &Hook_Levels_Call{Call: _e.mock.On("Levels")} +} + +func (_c *Hook_Levels_Call) Run(run func()) *Hook_Levels_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Hook_Levels_Call) Return(_a0 []log.Level) *Hook_Levels_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Hook_Levels_Call) RunAndReturn(run func() []log.Level) *Hook_Levels_Call { + _c.Call.Return(run) + return _c +} + // NewHook creates a new instance of Hook. 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 NewHook(t interface { diff --git a/mocks/log/Log.go b/mocks/log/Log.go index b6fce9cdf..054427d7c 100644 --- a/mocks/log/Log.go +++ b/mocks/log/Log.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -16,10 +16,22 @@ type Log struct { mock.Mock } +type Log_Expecter struct { + mock *mock.Mock +} + +func (_m *Log) EXPECT() *Log_Expecter { + return &Log_Expecter{mock: &_m.Mock} +} + // Code provides a mock function with given fields: code func (_m *Log) Code(code string) log.Writer { ret := _m.Called(code) + if len(ret) == 0 { + panic("no return value specified for Code") + } + var r0 log.Writer if rf, ok := ret.Get(0).(func(string) log.Writer); ok { r0 = rf(code) @@ -32,6 +44,34 @@ func (_m *Log) Code(code string) log.Writer { return r0 } +// Log_Code_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Code' +type Log_Code_Call struct { + *mock.Call +} + +// Code is a helper method to define mock.On call +// - code string +func (_e *Log_Expecter) Code(code interface{}) *Log_Code_Call { + return &Log_Code_Call{Call: _e.mock.On("Code", code)} +} + +func (_c *Log_Code_Call) Run(run func(code string)) *Log_Code_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Log_Code_Call) Return(_a0 log.Writer) *Log_Code_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Log_Code_Call) RunAndReturn(run func(string) log.Writer) *Log_Code_Call { + _c.Call.Return(run) + return _c +} + // Debug provides a mock function with given fields: args func (_m *Log) Debug(args ...interface{}) { var _ca []interface{} @@ -39,6 +79,41 @@ func (_m *Log) Debug(args ...interface{}) { _m.Called(_ca...) } +// Log_Debug_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Debug' +type Log_Debug_Call struct { + *mock.Call +} + +// Debug is a helper method to define mock.On call +// - args ...interface{} +func (_e *Log_Expecter) Debug(args ...interface{}) *Log_Debug_Call { + return &Log_Debug_Call{Call: _e.mock.On("Debug", + append([]interface{}{}, args...)...)} +} + +func (_c *Log_Debug_Call) Run(run func(args ...interface{})) *Log_Debug_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Log_Debug_Call) Return() *Log_Debug_Call { + _c.Call.Return() + return _c +} + +func (_c *Log_Debug_Call) RunAndReturn(run func(...interface{})) *Log_Debug_Call { + _c.Call.Return(run) + return _c +} + // Debugf provides a mock function with given fields: format, args func (_m *Log) Debugf(format string, args ...interface{}) { var _ca []interface{} @@ -47,6 +122,42 @@ func (_m *Log) Debugf(format string, args ...interface{}) { _m.Called(_ca...) } +// Log_Debugf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Debugf' +type Log_Debugf_Call struct { + *mock.Call +} + +// Debugf is a helper method to define mock.On call +// - format string +// - args ...interface{} +func (_e *Log_Expecter) Debugf(format interface{}, args ...interface{}) *Log_Debugf_Call { + return &Log_Debugf_Call{Call: _e.mock.On("Debugf", + append([]interface{}{format}, args...)...)} +} + +func (_c *Log_Debugf_Call) Run(run func(format string, args ...interface{})) *Log_Debugf_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Log_Debugf_Call) Return() *Log_Debugf_Call { + _c.Call.Return() + return _c +} + +func (_c *Log_Debugf_Call) RunAndReturn(run func(string, ...interface{})) *Log_Debugf_Call { + _c.Call.Return(run) + return _c +} + // Error provides a mock function with given fields: args func (_m *Log) Error(args ...interface{}) { var _ca []interface{} @@ -54,6 +165,41 @@ func (_m *Log) Error(args ...interface{}) { _m.Called(_ca...) } +// Log_Error_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Error' +type Log_Error_Call struct { + *mock.Call +} + +// Error is a helper method to define mock.On call +// - args ...interface{} +func (_e *Log_Expecter) Error(args ...interface{}) *Log_Error_Call { + return &Log_Error_Call{Call: _e.mock.On("Error", + append([]interface{}{}, args...)...)} +} + +func (_c *Log_Error_Call) Run(run func(args ...interface{})) *Log_Error_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Log_Error_Call) Return() *Log_Error_Call { + _c.Call.Return() + return _c +} + +func (_c *Log_Error_Call) RunAndReturn(run func(...interface{})) *Log_Error_Call { + _c.Call.Return(run) + return _c +} + // Errorf provides a mock function with given fields: format, args func (_m *Log) Errorf(format string, args ...interface{}) { var _ca []interface{} @@ -62,6 +208,42 @@ func (_m *Log) Errorf(format string, args ...interface{}) { _m.Called(_ca...) } +// Log_Errorf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Errorf' +type Log_Errorf_Call struct { + *mock.Call +} + +// Errorf is a helper method to define mock.On call +// - format string +// - args ...interface{} +func (_e *Log_Expecter) Errorf(format interface{}, args ...interface{}) *Log_Errorf_Call { + return &Log_Errorf_Call{Call: _e.mock.On("Errorf", + append([]interface{}{format}, args...)...)} +} + +func (_c *Log_Errorf_Call) Run(run func(format string, args ...interface{})) *Log_Errorf_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Log_Errorf_Call) Return() *Log_Errorf_Call { + _c.Call.Return() + return _c +} + +func (_c *Log_Errorf_Call) RunAndReturn(run func(string, ...interface{})) *Log_Errorf_Call { + _c.Call.Return(run) + return _c +} + // Fatal provides a mock function with given fields: args func (_m *Log) Fatal(args ...interface{}) { var _ca []interface{} @@ -69,6 +251,41 @@ func (_m *Log) Fatal(args ...interface{}) { _m.Called(_ca...) } +// Log_Fatal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Fatal' +type Log_Fatal_Call struct { + *mock.Call +} + +// Fatal is a helper method to define mock.On call +// - args ...interface{} +func (_e *Log_Expecter) Fatal(args ...interface{}) *Log_Fatal_Call { + return &Log_Fatal_Call{Call: _e.mock.On("Fatal", + append([]interface{}{}, args...)...)} +} + +func (_c *Log_Fatal_Call) Run(run func(args ...interface{})) *Log_Fatal_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Log_Fatal_Call) Return() *Log_Fatal_Call { + _c.Call.Return() + return _c +} + +func (_c *Log_Fatal_Call) RunAndReturn(run func(...interface{})) *Log_Fatal_Call { + _c.Call.Return(run) + return _c +} + // Fatalf provides a mock function with given fields: format, args func (_m *Log) Fatalf(format string, args ...interface{}) { var _ca []interface{} @@ -77,10 +294,50 @@ func (_m *Log) Fatalf(format string, args ...interface{}) { _m.Called(_ca...) } +// Log_Fatalf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Fatalf' +type Log_Fatalf_Call struct { + *mock.Call +} + +// Fatalf is a helper method to define mock.On call +// - format string +// - args ...interface{} +func (_e *Log_Expecter) Fatalf(format interface{}, args ...interface{}) *Log_Fatalf_Call { + return &Log_Fatalf_Call{Call: _e.mock.On("Fatalf", + append([]interface{}{format}, args...)...)} +} + +func (_c *Log_Fatalf_Call) Run(run func(format string, args ...interface{})) *Log_Fatalf_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Log_Fatalf_Call) Return() *Log_Fatalf_Call { + _c.Call.Return() + return _c +} + +func (_c *Log_Fatalf_Call) RunAndReturn(run func(string, ...interface{})) *Log_Fatalf_Call { + _c.Call.Return(run) + return _c +} + // Hint provides a mock function with given fields: hint func (_m *Log) Hint(hint string) log.Writer { ret := _m.Called(hint) + if len(ret) == 0 { + panic("no return value specified for Hint") + } + var r0 log.Writer if rf, ok := ret.Get(0).(func(string) log.Writer); ok { r0 = rf(hint) @@ -93,10 +350,42 @@ func (_m *Log) Hint(hint string) log.Writer { return r0 } +// Log_Hint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Hint' +type Log_Hint_Call struct { + *mock.Call +} + +// Hint is a helper method to define mock.On call +// - hint string +func (_e *Log_Expecter) Hint(hint interface{}) *Log_Hint_Call { + return &Log_Hint_Call{Call: _e.mock.On("Hint", hint)} +} + +func (_c *Log_Hint_Call) Run(run func(hint string)) *Log_Hint_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Log_Hint_Call) Return(_a0 log.Writer) *Log_Hint_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Log_Hint_Call) RunAndReturn(run func(string) log.Writer) *Log_Hint_Call { + _c.Call.Return(run) + return _c +} + // In provides a mock function with given fields: domain func (_m *Log) In(domain string) log.Writer { ret := _m.Called(domain) + if len(ret) == 0 { + panic("no return value specified for In") + } + var r0 log.Writer if rf, ok := ret.Get(0).(func(string) log.Writer); ok { r0 = rf(domain) @@ -109,6 +398,34 @@ func (_m *Log) In(domain string) log.Writer { return r0 } +// Log_In_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'In' +type Log_In_Call struct { + *mock.Call +} + +// In is a helper method to define mock.On call +// - domain string +func (_e *Log_Expecter) In(domain interface{}) *Log_In_Call { + return &Log_In_Call{Call: _e.mock.On("In", domain)} +} + +func (_c *Log_In_Call) Run(run func(domain string)) *Log_In_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Log_In_Call) Return(_a0 log.Writer) *Log_In_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Log_In_Call) RunAndReturn(run func(string) log.Writer) *Log_In_Call { + _c.Call.Return(run) + return _c +} + // Info provides a mock function with given fields: args func (_m *Log) Info(args ...interface{}) { var _ca []interface{} @@ -116,6 +433,41 @@ func (_m *Log) Info(args ...interface{}) { _m.Called(_ca...) } +// Log_Info_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Info' +type Log_Info_Call struct { + *mock.Call +} + +// Info is a helper method to define mock.On call +// - args ...interface{} +func (_e *Log_Expecter) Info(args ...interface{}) *Log_Info_Call { + return &Log_Info_Call{Call: _e.mock.On("Info", + append([]interface{}{}, args...)...)} +} + +func (_c *Log_Info_Call) Run(run func(args ...interface{})) *Log_Info_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Log_Info_Call) Return() *Log_Info_Call { + _c.Call.Return() + return _c +} + +func (_c *Log_Info_Call) RunAndReturn(run func(...interface{})) *Log_Info_Call { + _c.Call.Return(run) + return _c +} + // Infof provides a mock function with given fields: format, args func (_m *Log) Infof(format string, args ...interface{}) { var _ca []interface{} @@ -124,10 +476,50 @@ func (_m *Log) Infof(format string, args ...interface{}) { _m.Called(_ca...) } +// Log_Infof_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Infof' +type Log_Infof_Call struct { + *mock.Call +} + +// Infof is a helper method to define mock.On call +// - format string +// - args ...interface{} +func (_e *Log_Expecter) Infof(format interface{}, args ...interface{}) *Log_Infof_Call { + return &Log_Infof_Call{Call: _e.mock.On("Infof", + append([]interface{}{format}, args...)...)} +} + +func (_c *Log_Infof_Call) Run(run func(format string, args ...interface{})) *Log_Infof_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Log_Infof_Call) Return() *Log_Infof_Call { + _c.Call.Return() + return _c +} + +func (_c *Log_Infof_Call) RunAndReturn(run func(string, ...interface{})) *Log_Infof_Call { + _c.Call.Return(run) + return _c +} + // Owner provides a mock function with given fields: owner func (_m *Log) Owner(owner interface{}) log.Writer { ret := _m.Called(owner) + if len(ret) == 0 { + panic("no return value specified for Owner") + } + var r0 log.Writer if rf, ok := ret.Get(0).(func(interface{}) log.Writer); ok { r0 = rf(owner) @@ -140,6 +532,34 @@ func (_m *Log) Owner(owner interface{}) log.Writer { return r0 } +// Log_Owner_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Owner' +type Log_Owner_Call struct { + *mock.Call +} + +// Owner is a helper method to define mock.On call +// - owner interface{} +func (_e *Log_Expecter) Owner(owner interface{}) *Log_Owner_Call { + return &Log_Owner_Call{Call: _e.mock.On("Owner", owner)} +} + +func (_c *Log_Owner_Call) Run(run func(owner interface{})) *Log_Owner_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Log_Owner_Call) Return(_a0 log.Writer) *Log_Owner_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Log_Owner_Call) RunAndReturn(run func(interface{}) log.Writer) *Log_Owner_Call { + _c.Call.Return(run) + return _c +} + // Panic provides a mock function with given fields: args func (_m *Log) Panic(args ...interface{}) { var _ca []interface{} @@ -147,6 +567,41 @@ func (_m *Log) Panic(args ...interface{}) { _m.Called(_ca...) } +// Log_Panic_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Panic' +type Log_Panic_Call struct { + *mock.Call +} + +// Panic is a helper method to define mock.On call +// - args ...interface{} +func (_e *Log_Expecter) Panic(args ...interface{}) *Log_Panic_Call { + return &Log_Panic_Call{Call: _e.mock.On("Panic", + append([]interface{}{}, args...)...)} +} + +func (_c *Log_Panic_Call) Run(run func(args ...interface{})) *Log_Panic_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Log_Panic_Call) Return() *Log_Panic_Call { + _c.Call.Return() + return _c +} + +func (_c *Log_Panic_Call) RunAndReturn(run func(...interface{})) *Log_Panic_Call { + _c.Call.Return(run) + return _c +} + // Panicf provides a mock function with given fields: format, args func (_m *Log) Panicf(format string, args ...interface{}) { var _ca []interface{} @@ -155,10 +610,50 @@ func (_m *Log) Panicf(format string, args ...interface{}) { _m.Called(_ca...) } +// Log_Panicf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Panicf' +type Log_Panicf_Call struct { + *mock.Call +} + +// Panicf is a helper method to define mock.On call +// - format string +// - args ...interface{} +func (_e *Log_Expecter) Panicf(format interface{}, args ...interface{}) *Log_Panicf_Call { + return &Log_Panicf_Call{Call: _e.mock.On("Panicf", + append([]interface{}{format}, args...)...)} +} + +func (_c *Log_Panicf_Call) Run(run func(format string, args ...interface{})) *Log_Panicf_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Log_Panicf_Call) Return() *Log_Panicf_Call { + _c.Call.Return() + return _c +} + +func (_c *Log_Panicf_Call) RunAndReturn(run func(string, ...interface{})) *Log_Panicf_Call { + _c.Call.Return(run) + return _c +} + // Request provides a mock function with given fields: req func (_m *Log) Request(req http.ContextRequest) log.Writer { ret := _m.Called(req) + if len(ret) == 0 { + panic("no return value specified for Request") + } + var r0 log.Writer if rf, ok := ret.Get(0).(func(http.ContextRequest) log.Writer); ok { r0 = rf(req) @@ -171,10 +666,42 @@ func (_m *Log) Request(req http.ContextRequest) log.Writer { return r0 } +// Log_Request_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Request' +type Log_Request_Call struct { + *mock.Call +} + +// Request is a helper method to define mock.On call +// - req http.ContextRequest +func (_e *Log_Expecter) Request(req interface{}) *Log_Request_Call { + return &Log_Request_Call{Call: _e.mock.On("Request", req)} +} + +func (_c *Log_Request_Call) Run(run func(req http.ContextRequest)) *Log_Request_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(http.ContextRequest)) + }) + return _c +} + +func (_c *Log_Request_Call) Return(_a0 log.Writer) *Log_Request_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Log_Request_Call) RunAndReturn(run func(http.ContextRequest) log.Writer) *Log_Request_Call { + _c.Call.Return(run) + return _c +} + // Response provides a mock function with given fields: res func (_m *Log) Response(res http.ContextResponse) log.Writer { ret := _m.Called(res) + if len(ret) == 0 { + panic("no return value specified for Response") + } + var r0 log.Writer if rf, ok := ret.Get(0).(func(http.ContextResponse) log.Writer); ok { r0 = rf(res) @@ -187,6 +714,34 @@ func (_m *Log) Response(res http.ContextResponse) log.Writer { return r0 } +// Log_Response_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Response' +type Log_Response_Call struct { + *mock.Call +} + +// Response is a helper method to define mock.On call +// - res http.ContextResponse +func (_e *Log_Expecter) Response(res interface{}) *Log_Response_Call { + return &Log_Response_Call{Call: _e.mock.On("Response", res)} +} + +func (_c *Log_Response_Call) Run(run func(res http.ContextResponse)) *Log_Response_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(http.ContextResponse)) + }) + return _c +} + +func (_c *Log_Response_Call) Return(_a0 log.Writer) *Log_Response_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Log_Response_Call) RunAndReturn(run func(http.ContextResponse) log.Writer) *Log_Response_Call { + _c.Call.Return(run) + return _c +} + // Tags provides a mock function with given fields: tags func (_m *Log) Tags(tags ...string) log.Writer { _va := make([]interface{}, len(tags)) @@ -197,6 +752,10 @@ func (_m *Log) Tags(tags ...string) log.Writer { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Tags") + } + var r0 log.Writer if rf, ok := ret.Get(0).(func(...string) log.Writer); ok { r0 = rf(tags...) @@ -209,10 +768,49 @@ func (_m *Log) Tags(tags ...string) log.Writer { return r0 } +// Log_Tags_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Tags' +type Log_Tags_Call struct { + *mock.Call +} + +// Tags is a helper method to define mock.On call +// - tags ...string +func (_e *Log_Expecter) Tags(tags ...interface{}) *Log_Tags_Call { + return &Log_Tags_Call{Call: _e.mock.On("Tags", + append([]interface{}{}, tags...)...)} +} + +func (_c *Log_Tags_Call) Run(run func(tags ...string)) *Log_Tags_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Log_Tags_Call) Return(_a0 log.Writer) *Log_Tags_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Log_Tags_Call) RunAndReturn(run func(...string) log.Writer) *Log_Tags_Call { + _c.Call.Return(run) + return _c +} + // User provides a mock function with given fields: user func (_m *Log) User(user interface{}) log.Writer { ret := _m.Called(user) + if len(ret) == 0 { + panic("no return value specified for User") + } + var r0 log.Writer if rf, ok := ret.Get(0).(func(interface{}) log.Writer); ok { r0 = rf(user) @@ -225,6 +823,34 @@ func (_m *Log) User(user interface{}) log.Writer { return r0 } +// Log_User_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'User' +type Log_User_Call struct { + *mock.Call +} + +// User is a helper method to define mock.On call +// - user interface{} +func (_e *Log_Expecter) User(user interface{}) *Log_User_Call { + return &Log_User_Call{Call: _e.mock.On("User", user)} +} + +func (_c *Log_User_Call) Run(run func(user interface{})) *Log_User_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Log_User_Call) Return(_a0 log.Writer) *Log_User_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Log_User_Call) RunAndReturn(run func(interface{}) log.Writer) *Log_User_Call { + _c.Call.Return(run) + return _c +} + // Warning provides a mock function with given fields: args func (_m *Log) Warning(args ...interface{}) { var _ca []interface{} @@ -232,6 +858,41 @@ func (_m *Log) Warning(args ...interface{}) { _m.Called(_ca...) } +// Log_Warning_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Warning' +type Log_Warning_Call struct { + *mock.Call +} + +// Warning is a helper method to define mock.On call +// - args ...interface{} +func (_e *Log_Expecter) Warning(args ...interface{}) *Log_Warning_Call { + return &Log_Warning_Call{Call: _e.mock.On("Warning", + append([]interface{}{}, args...)...)} +} + +func (_c *Log_Warning_Call) Run(run func(args ...interface{})) *Log_Warning_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Log_Warning_Call) Return() *Log_Warning_Call { + _c.Call.Return() + return _c +} + +func (_c *Log_Warning_Call) RunAndReturn(run func(...interface{})) *Log_Warning_Call { + _c.Call.Return(run) + return _c +} + // Warningf provides a mock function with given fields: format, args func (_m *Log) Warningf(format string, args ...interface{}) { var _ca []interface{} @@ -240,10 +901,50 @@ func (_m *Log) Warningf(format string, args ...interface{}) { _m.Called(_ca...) } +// Log_Warningf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Warningf' +type Log_Warningf_Call struct { + *mock.Call +} + +// Warningf is a helper method to define mock.On call +// - format string +// - args ...interface{} +func (_e *Log_Expecter) Warningf(format interface{}, args ...interface{}) *Log_Warningf_Call { + return &Log_Warningf_Call{Call: _e.mock.On("Warningf", + append([]interface{}{format}, args...)...)} +} + +func (_c *Log_Warningf_Call) Run(run func(format string, args ...interface{})) *Log_Warningf_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Log_Warningf_Call) Return() *Log_Warningf_Call { + _c.Call.Return() + return _c +} + +func (_c *Log_Warningf_Call) RunAndReturn(run func(string, ...interface{})) *Log_Warningf_Call { + _c.Call.Return(run) + return _c +} + // With provides a mock function with given fields: data func (_m *Log) With(data map[string]interface{}) log.Writer { ret := _m.Called(data) + if len(ret) == 0 { + panic("no return value specified for With") + } + var r0 log.Writer if rf, ok := ret.Get(0).(func(map[string]interface{}) log.Writer); ok { r0 = rf(data) @@ -256,10 +957,42 @@ func (_m *Log) With(data map[string]interface{}) log.Writer { return r0 } +// Log_With_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'With' +type Log_With_Call struct { + *mock.Call +} + +// With is a helper method to define mock.On call +// - data map[string]interface{} +func (_e *Log_Expecter) With(data interface{}) *Log_With_Call { + return &Log_With_Call{Call: _e.mock.On("With", data)} +} + +func (_c *Log_With_Call) Run(run func(data map[string]interface{})) *Log_With_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(map[string]interface{})) + }) + return _c +} + +func (_c *Log_With_Call) Return(_a0 log.Writer) *Log_With_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Log_With_Call) RunAndReturn(run func(map[string]interface{}) log.Writer) *Log_With_Call { + _c.Call.Return(run) + return _c +} + // WithContext provides a mock function with given fields: ctx func (_m *Log) WithContext(ctx context.Context) log.Writer { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for WithContext") + } + var r0 log.Writer if rf, ok := ret.Get(0).(func(context.Context) log.Writer); ok { r0 = rf(ctx) @@ -272,10 +1005,42 @@ func (_m *Log) WithContext(ctx context.Context) log.Writer { return r0 } +// Log_WithContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithContext' +type Log_WithContext_Call struct { + *mock.Call +} + +// WithContext is a helper method to define mock.On call +// - ctx context.Context +func (_e *Log_Expecter) WithContext(ctx interface{}) *Log_WithContext_Call { + return &Log_WithContext_Call{Call: _e.mock.On("WithContext", ctx)} +} + +func (_c *Log_WithContext_Call) Run(run func(ctx context.Context)) *Log_WithContext_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Log_WithContext_Call) Return(_a0 log.Writer) *Log_WithContext_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Log_WithContext_Call) RunAndReturn(run func(context.Context) log.Writer) *Log_WithContext_Call { + _c.Call.Return(run) + return _c +} + // WithTrace provides a mock function with given fields: func (_m *Log) WithTrace() log.Writer { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for WithTrace") + } + var r0 log.Writer if rf, ok := ret.Get(0).(func() log.Writer); ok { r0 = rf() @@ -288,6 +1053,33 @@ func (_m *Log) WithTrace() log.Writer { return r0 } +// Log_WithTrace_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithTrace' +type Log_WithTrace_Call struct { + *mock.Call +} + +// WithTrace is a helper method to define mock.On call +func (_e *Log_Expecter) WithTrace() *Log_WithTrace_Call { + return &Log_WithTrace_Call{Call: _e.mock.On("WithTrace")} +} + +func (_c *Log_WithTrace_Call) Run(run func()) *Log_WithTrace_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Log_WithTrace_Call) Return(_a0 log.Writer) *Log_WithTrace_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Log_WithTrace_Call) RunAndReturn(run func() log.Writer) *Log_WithTrace_Call { + _c.Call.Return(run) + return _c +} + // NewLog creates a new instance of Log. 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 NewLog(t interface { diff --git a/mocks/log/Logger.go b/mocks/log/Logger.go index a0ba15eaa..57cf5e9c0 100644 --- a/mocks/log/Logger.go +++ b/mocks/log/Logger.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,10 +12,22 @@ type Logger struct { mock.Mock } +type Logger_Expecter struct { + mock *mock.Mock +} + +func (_m *Logger) EXPECT() *Logger_Expecter { + return &Logger_Expecter{mock: &_m.Mock} +} + // Handle provides a mock function with given fields: channel func (_m *Logger) Handle(channel string) (log.Hook, error) { ret := _m.Called(channel) + if len(ret) == 0 { + panic("no return value specified for Handle") + } + var r0 log.Hook var r1 error if rf, ok := ret.Get(0).(func(string) (log.Hook, error)); ok { @@ -38,6 +50,34 @@ func (_m *Logger) Handle(channel string) (log.Hook, error) { return r0, r1 } +// Logger_Handle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Handle' +type Logger_Handle_Call struct { + *mock.Call +} + +// Handle is a helper method to define mock.On call +// - channel string +func (_e *Logger_Expecter) Handle(channel interface{}) *Logger_Handle_Call { + return &Logger_Handle_Call{Call: _e.mock.On("Handle", channel)} +} + +func (_c *Logger_Handle_Call) Run(run func(channel string)) *Logger_Handle_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Logger_Handle_Call) Return(_a0 log.Hook, _a1 error) *Logger_Handle_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Logger_Handle_Call) RunAndReturn(run func(string) (log.Hook, error)) *Logger_Handle_Call { + _c.Call.Return(run) + return _c +} + // NewLogger creates a new instance of Logger. 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 NewLogger(t interface { diff --git a/mocks/log/Writer.go b/mocks/log/Writer.go index 0cad0c7c1..190bf0535 100644 --- a/mocks/log/Writer.go +++ b/mocks/log/Writer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -14,10 +14,22 @@ type Writer struct { mock.Mock } +type Writer_Expecter struct { + mock *mock.Mock +} + +func (_m *Writer) EXPECT() *Writer_Expecter { + return &Writer_Expecter{mock: &_m.Mock} +} + // Code provides a mock function with given fields: code func (_m *Writer) Code(code string) log.Writer { ret := _m.Called(code) + if len(ret) == 0 { + panic("no return value specified for Code") + } + var r0 log.Writer if rf, ok := ret.Get(0).(func(string) log.Writer); ok { r0 = rf(code) @@ -30,6 +42,34 @@ func (_m *Writer) Code(code string) log.Writer { return r0 } +// Writer_Code_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Code' +type Writer_Code_Call struct { + *mock.Call +} + +// Code is a helper method to define mock.On call +// - code string +func (_e *Writer_Expecter) Code(code interface{}) *Writer_Code_Call { + return &Writer_Code_Call{Call: _e.mock.On("Code", code)} +} + +func (_c *Writer_Code_Call) Run(run func(code string)) *Writer_Code_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Writer_Code_Call) Return(_a0 log.Writer) *Writer_Code_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Writer_Code_Call) RunAndReturn(run func(string) log.Writer) *Writer_Code_Call { + _c.Call.Return(run) + return _c +} + // Debug provides a mock function with given fields: args func (_m *Writer) Debug(args ...interface{}) { var _ca []interface{} @@ -37,6 +77,41 @@ func (_m *Writer) Debug(args ...interface{}) { _m.Called(_ca...) } +// Writer_Debug_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Debug' +type Writer_Debug_Call struct { + *mock.Call +} + +// Debug is a helper method to define mock.On call +// - args ...interface{} +func (_e *Writer_Expecter) Debug(args ...interface{}) *Writer_Debug_Call { + return &Writer_Debug_Call{Call: _e.mock.On("Debug", + append([]interface{}{}, args...)...)} +} + +func (_c *Writer_Debug_Call) Run(run func(args ...interface{})) *Writer_Debug_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Writer_Debug_Call) Return() *Writer_Debug_Call { + _c.Call.Return() + return _c +} + +func (_c *Writer_Debug_Call) RunAndReturn(run func(...interface{})) *Writer_Debug_Call { + _c.Call.Return(run) + return _c +} + // Debugf provides a mock function with given fields: format, args func (_m *Writer) Debugf(format string, args ...interface{}) { var _ca []interface{} @@ -45,6 +120,42 @@ func (_m *Writer) Debugf(format string, args ...interface{}) { _m.Called(_ca...) } +// Writer_Debugf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Debugf' +type Writer_Debugf_Call struct { + *mock.Call +} + +// Debugf is a helper method to define mock.On call +// - format string +// - args ...interface{} +func (_e *Writer_Expecter) Debugf(format interface{}, args ...interface{}) *Writer_Debugf_Call { + return &Writer_Debugf_Call{Call: _e.mock.On("Debugf", + append([]interface{}{format}, args...)...)} +} + +func (_c *Writer_Debugf_Call) Run(run func(format string, args ...interface{})) *Writer_Debugf_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Writer_Debugf_Call) Return() *Writer_Debugf_Call { + _c.Call.Return() + return _c +} + +func (_c *Writer_Debugf_Call) RunAndReturn(run func(string, ...interface{})) *Writer_Debugf_Call { + _c.Call.Return(run) + return _c +} + // Error provides a mock function with given fields: args func (_m *Writer) Error(args ...interface{}) { var _ca []interface{} @@ -52,6 +163,41 @@ func (_m *Writer) Error(args ...interface{}) { _m.Called(_ca...) } +// Writer_Error_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Error' +type Writer_Error_Call struct { + *mock.Call +} + +// Error is a helper method to define mock.On call +// - args ...interface{} +func (_e *Writer_Expecter) Error(args ...interface{}) *Writer_Error_Call { + return &Writer_Error_Call{Call: _e.mock.On("Error", + append([]interface{}{}, args...)...)} +} + +func (_c *Writer_Error_Call) Run(run func(args ...interface{})) *Writer_Error_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Writer_Error_Call) Return() *Writer_Error_Call { + _c.Call.Return() + return _c +} + +func (_c *Writer_Error_Call) RunAndReturn(run func(...interface{})) *Writer_Error_Call { + _c.Call.Return(run) + return _c +} + // Errorf provides a mock function with given fields: format, args func (_m *Writer) Errorf(format string, args ...interface{}) { var _ca []interface{} @@ -60,6 +206,42 @@ func (_m *Writer) Errorf(format string, args ...interface{}) { _m.Called(_ca...) } +// Writer_Errorf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Errorf' +type Writer_Errorf_Call struct { + *mock.Call +} + +// Errorf is a helper method to define mock.On call +// - format string +// - args ...interface{} +func (_e *Writer_Expecter) Errorf(format interface{}, args ...interface{}) *Writer_Errorf_Call { + return &Writer_Errorf_Call{Call: _e.mock.On("Errorf", + append([]interface{}{format}, args...)...)} +} + +func (_c *Writer_Errorf_Call) Run(run func(format string, args ...interface{})) *Writer_Errorf_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Writer_Errorf_Call) Return() *Writer_Errorf_Call { + _c.Call.Return() + return _c +} + +func (_c *Writer_Errorf_Call) RunAndReturn(run func(string, ...interface{})) *Writer_Errorf_Call { + _c.Call.Return(run) + return _c +} + // Fatal provides a mock function with given fields: args func (_m *Writer) Fatal(args ...interface{}) { var _ca []interface{} @@ -67,6 +249,41 @@ func (_m *Writer) Fatal(args ...interface{}) { _m.Called(_ca...) } +// Writer_Fatal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Fatal' +type Writer_Fatal_Call struct { + *mock.Call +} + +// Fatal is a helper method to define mock.On call +// - args ...interface{} +func (_e *Writer_Expecter) Fatal(args ...interface{}) *Writer_Fatal_Call { + return &Writer_Fatal_Call{Call: _e.mock.On("Fatal", + append([]interface{}{}, args...)...)} +} + +func (_c *Writer_Fatal_Call) Run(run func(args ...interface{})) *Writer_Fatal_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Writer_Fatal_Call) Return() *Writer_Fatal_Call { + _c.Call.Return() + return _c +} + +func (_c *Writer_Fatal_Call) RunAndReturn(run func(...interface{})) *Writer_Fatal_Call { + _c.Call.Return(run) + return _c +} + // Fatalf provides a mock function with given fields: format, args func (_m *Writer) Fatalf(format string, args ...interface{}) { var _ca []interface{} @@ -75,10 +292,50 @@ func (_m *Writer) Fatalf(format string, args ...interface{}) { _m.Called(_ca...) } +// Writer_Fatalf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Fatalf' +type Writer_Fatalf_Call struct { + *mock.Call +} + +// Fatalf is a helper method to define mock.On call +// - format string +// - args ...interface{} +func (_e *Writer_Expecter) Fatalf(format interface{}, args ...interface{}) *Writer_Fatalf_Call { + return &Writer_Fatalf_Call{Call: _e.mock.On("Fatalf", + append([]interface{}{format}, args...)...)} +} + +func (_c *Writer_Fatalf_Call) Run(run func(format string, args ...interface{})) *Writer_Fatalf_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Writer_Fatalf_Call) Return() *Writer_Fatalf_Call { + _c.Call.Return() + return _c +} + +func (_c *Writer_Fatalf_Call) RunAndReturn(run func(string, ...interface{})) *Writer_Fatalf_Call { + _c.Call.Return(run) + return _c +} + // Hint provides a mock function with given fields: hint func (_m *Writer) Hint(hint string) log.Writer { ret := _m.Called(hint) + if len(ret) == 0 { + panic("no return value specified for Hint") + } + var r0 log.Writer if rf, ok := ret.Get(0).(func(string) log.Writer); ok { r0 = rf(hint) @@ -91,10 +348,42 @@ func (_m *Writer) Hint(hint string) log.Writer { return r0 } +// Writer_Hint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Hint' +type Writer_Hint_Call struct { + *mock.Call +} + +// Hint is a helper method to define mock.On call +// - hint string +func (_e *Writer_Expecter) Hint(hint interface{}) *Writer_Hint_Call { + return &Writer_Hint_Call{Call: _e.mock.On("Hint", hint)} +} + +func (_c *Writer_Hint_Call) Run(run func(hint string)) *Writer_Hint_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Writer_Hint_Call) Return(_a0 log.Writer) *Writer_Hint_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Writer_Hint_Call) RunAndReturn(run func(string) log.Writer) *Writer_Hint_Call { + _c.Call.Return(run) + return _c +} + // In provides a mock function with given fields: domain func (_m *Writer) In(domain string) log.Writer { ret := _m.Called(domain) + if len(ret) == 0 { + panic("no return value specified for In") + } + var r0 log.Writer if rf, ok := ret.Get(0).(func(string) log.Writer); ok { r0 = rf(domain) @@ -107,6 +396,34 @@ func (_m *Writer) In(domain string) log.Writer { return r0 } +// Writer_In_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'In' +type Writer_In_Call struct { + *mock.Call +} + +// In is a helper method to define mock.On call +// - domain string +func (_e *Writer_Expecter) In(domain interface{}) *Writer_In_Call { + return &Writer_In_Call{Call: _e.mock.On("In", domain)} +} + +func (_c *Writer_In_Call) Run(run func(domain string)) *Writer_In_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Writer_In_Call) Return(_a0 log.Writer) *Writer_In_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Writer_In_Call) RunAndReturn(run func(string) log.Writer) *Writer_In_Call { + _c.Call.Return(run) + return _c +} + // Info provides a mock function with given fields: args func (_m *Writer) Info(args ...interface{}) { var _ca []interface{} @@ -114,6 +431,41 @@ func (_m *Writer) Info(args ...interface{}) { _m.Called(_ca...) } +// Writer_Info_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Info' +type Writer_Info_Call struct { + *mock.Call +} + +// Info is a helper method to define mock.On call +// - args ...interface{} +func (_e *Writer_Expecter) Info(args ...interface{}) *Writer_Info_Call { + return &Writer_Info_Call{Call: _e.mock.On("Info", + append([]interface{}{}, args...)...)} +} + +func (_c *Writer_Info_Call) Run(run func(args ...interface{})) *Writer_Info_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Writer_Info_Call) Return() *Writer_Info_Call { + _c.Call.Return() + return _c +} + +func (_c *Writer_Info_Call) RunAndReturn(run func(...interface{})) *Writer_Info_Call { + _c.Call.Return(run) + return _c +} + // Infof provides a mock function with given fields: format, args func (_m *Writer) Infof(format string, args ...interface{}) { var _ca []interface{} @@ -122,10 +474,50 @@ func (_m *Writer) Infof(format string, args ...interface{}) { _m.Called(_ca...) } +// Writer_Infof_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Infof' +type Writer_Infof_Call struct { + *mock.Call +} + +// Infof is a helper method to define mock.On call +// - format string +// - args ...interface{} +func (_e *Writer_Expecter) Infof(format interface{}, args ...interface{}) *Writer_Infof_Call { + return &Writer_Infof_Call{Call: _e.mock.On("Infof", + append([]interface{}{format}, args...)...)} +} + +func (_c *Writer_Infof_Call) Run(run func(format string, args ...interface{})) *Writer_Infof_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Writer_Infof_Call) Return() *Writer_Infof_Call { + _c.Call.Return() + return _c +} + +func (_c *Writer_Infof_Call) RunAndReturn(run func(string, ...interface{})) *Writer_Infof_Call { + _c.Call.Return(run) + return _c +} + // Owner provides a mock function with given fields: owner func (_m *Writer) Owner(owner interface{}) log.Writer { ret := _m.Called(owner) + if len(ret) == 0 { + panic("no return value specified for Owner") + } + var r0 log.Writer if rf, ok := ret.Get(0).(func(interface{}) log.Writer); ok { r0 = rf(owner) @@ -138,6 +530,34 @@ func (_m *Writer) Owner(owner interface{}) log.Writer { return r0 } +// Writer_Owner_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Owner' +type Writer_Owner_Call struct { + *mock.Call +} + +// Owner is a helper method to define mock.On call +// - owner interface{} +func (_e *Writer_Expecter) Owner(owner interface{}) *Writer_Owner_Call { + return &Writer_Owner_Call{Call: _e.mock.On("Owner", owner)} +} + +func (_c *Writer_Owner_Call) Run(run func(owner interface{})) *Writer_Owner_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Writer_Owner_Call) Return(_a0 log.Writer) *Writer_Owner_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Writer_Owner_Call) RunAndReturn(run func(interface{}) log.Writer) *Writer_Owner_Call { + _c.Call.Return(run) + return _c +} + // Panic provides a mock function with given fields: args func (_m *Writer) Panic(args ...interface{}) { var _ca []interface{} @@ -145,6 +565,41 @@ func (_m *Writer) Panic(args ...interface{}) { _m.Called(_ca...) } +// Writer_Panic_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Panic' +type Writer_Panic_Call struct { + *mock.Call +} + +// Panic is a helper method to define mock.On call +// - args ...interface{} +func (_e *Writer_Expecter) Panic(args ...interface{}) *Writer_Panic_Call { + return &Writer_Panic_Call{Call: _e.mock.On("Panic", + append([]interface{}{}, args...)...)} +} + +func (_c *Writer_Panic_Call) Run(run func(args ...interface{})) *Writer_Panic_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Writer_Panic_Call) Return() *Writer_Panic_Call { + _c.Call.Return() + return _c +} + +func (_c *Writer_Panic_Call) RunAndReturn(run func(...interface{})) *Writer_Panic_Call { + _c.Call.Return(run) + return _c +} + // Panicf provides a mock function with given fields: format, args func (_m *Writer) Panicf(format string, args ...interface{}) { var _ca []interface{} @@ -153,10 +608,50 @@ func (_m *Writer) Panicf(format string, args ...interface{}) { _m.Called(_ca...) } +// Writer_Panicf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Panicf' +type Writer_Panicf_Call struct { + *mock.Call +} + +// Panicf is a helper method to define mock.On call +// - format string +// - args ...interface{} +func (_e *Writer_Expecter) Panicf(format interface{}, args ...interface{}) *Writer_Panicf_Call { + return &Writer_Panicf_Call{Call: _e.mock.On("Panicf", + append([]interface{}{format}, args...)...)} +} + +func (_c *Writer_Panicf_Call) Run(run func(format string, args ...interface{})) *Writer_Panicf_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Writer_Panicf_Call) Return() *Writer_Panicf_Call { + _c.Call.Return() + return _c +} + +func (_c *Writer_Panicf_Call) RunAndReturn(run func(string, ...interface{})) *Writer_Panicf_Call { + _c.Call.Return(run) + return _c +} + // Request provides a mock function with given fields: req func (_m *Writer) Request(req http.ContextRequest) log.Writer { ret := _m.Called(req) + if len(ret) == 0 { + panic("no return value specified for Request") + } + var r0 log.Writer if rf, ok := ret.Get(0).(func(http.ContextRequest) log.Writer); ok { r0 = rf(req) @@ -169,10 +664,42 @@ func (_m *Writer) Request(req http.ContextRequest) log.Writer { return r0 } +// Writer_Request_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Request' +type Writer_Request_Call struct { + *mock.Call +} + +// Request is a helper method to define mock.On call +// - req http.ContextRequest +func (_e *Writer_Expecter) Request(req interface{}) *Writer_Request_Call { + return &Writer_Request_Call{Call: _e.mock.On("Request", req)} +} + +func (_c *Writer_Request_Call) Run(run func(req http.ContextRequest)) *Writer_Request_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(http.ContextRequest)) + }) + return _c +} + +func (_c *Writer_Request_Call) Return(_a0 log.Writer) *Writer_Request_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Writer_Request_Call) RunAndReturn(run func(http.ContextRequest) log.Writer) *Writer_Request_Call { + _c.Call.Return(run) + return _c +} + // Response provides a mock function with given fields: res func (_m *Writer) Response(res http.ContextResponse) log.Writer { ret := _m.Called(res) + if len(ret) == 0 { + panic("no return value specified for Response") + } + var r0 log.Writer if rf, ok := ret.Get(0).(func(http.ContextResponse) log.Writer); ok { r0 = rf(res) @@ -185,6 +712,34 @@ func (_m *Writer) Response(res http.ContextResponse) log.Writer { return r0 } +// Writer_Response_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Response' +type Writer_Response_Call struct { + *mock.Call +} + +// Response is a helper method to define mock.On call +// - res http.ContextResponse +func (_e *Writer_Expecter) Response(res interface{}) *Writer_Response_Call { + return &Writer_Response_Call{Call: _e.mock.On("Response", res)} +} + +func (_c *Writer_Response_Call) Run(run func(res http.ContextResponse)) *Writer_Response_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(http.ContextResponse)) + }) + return _c +} + +func (_c *Writer_Response_Call) Return(_a0 log.Writer) *Writer_Response_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Writer_Response_Call) RunAndReturn(run func(http.ContextResponse) log.Writer) *Writer_Response_Call { + _c.Call.Return(run) + return _c +} + // Tags provides a mock function with given fields: tags func (_m *Writer) Tags(tags ...string) log.Writer { _va := make([]interface{}, len(tags)) @@ -195,6 +750,10 @@ func (_m *Writer) Tags(tags ...string) log.Writer { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Tags") + } + var r0 log.Writer if rf, ok := ret.Get(0).(func(...string) log.Writer); ok { r0 = rf(tags...) @@ -207,10 +766,49 @@ func (_m *Writer) Tags(tags ...string) log.Writer { return r0 } +// Writer_Tags_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Tags' +type Writer_Tags_Call struct { + *mock.Call +} + +// Tags is a helper method to define mock.On call +// - tags ...string +func (_e *Writer_Expecter) Tags(tags ...interface{}) *Writer_Tags_Call { + return &Writer_Tags_Call{Call: _e.mock.On("Tags", + append([]interface{}{}, tags...)...)} +} + +func (_c *Writer_Tags_Call) Run(run func(tags ...string)) *Writer_Tags_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Writer_Tags_Call) Return(_a0 log.Writer) *Writer_Tags_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Writer_Tags_Call) RunAndReturn(run func(...string) log.Writer) *Writer_Tags_Call { + _c.Call.Return(run) + return _c +} + // User provides a mock function with given fields: user func (_m *Writer) User(user interface{}) log.Writer { ret := _m.Called(user) + if len(ret) == 0 { + panic("no return value specified for User") + } + var r0 log.Writer if rf, ok := ret.Get(0).(func(interface{}) log.Writer); ok { r0 = rf(user) @@ -223,6 +821,34 @@ func (_m *Writer) User(user interface{}) log.Writer { return r0 } +// Writer_User_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'User' +type Writer_User_Call struct { + *mock.Call +} + +// User is a helper method to define mock.On call +// - user interface{} +func (_e *Writer_Expecter) User(user interface{}) *Writer_User_Call { + return &Writer_User_Call{Call: _e.mock.On("User", user)} +} + +func (_c *Writer_User_Call) Run(run func(user interface{})) *Writer_User_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Writer_User_Call) Return(_a0 log.Writer) *Writer_User_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Writer_User_Call) RunAndReturn(run func(interface{}) log.Writer) *Writer_User_Call { + _c.Call.Return(run) + return _c +} + // Warning provides a mock function with given fields: args func (_m *Writer) Warning(args ...interface{}) { var _ca []interface{} @@ -230,6 +856,41 @@ func (_m *Writer) Warning(args ...interface{}) { _m.Called(_ca...) } +// Writer_Warning_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Warning' +type Writer_Warning_Call struct { + *mock.Call +} + +// Warning is a helper method to define mock.On call +// - args ...interface{} +func (_e *Writer_Expecter) Warning(args ...interface{}) *Writer_Warning_Call { + return &Writer_Warning_Call{Call: _e.mock.On("Warning", + append([]interface{}{}, args...)...)} +} + +func (_c *Writer_Warning_Call) Run(run func(args ...interface{})) *Writer_Warning_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Writer_Warning_Call) Return() *Writer_Warning_Call { + _c.Call.Return() + return _c +} + +func (_c *Writer_Warning_Call) RunAndReturn(run func(...interface{})) *Writer_Warning_Call { + _c.Call.Return(run) + return _c +} + // Warningf provides a mock function with given fields: format, args func (_m *Writer) Warningf(format string, args ...interface{}) { var _ca []interface{} @@ -238,10 +899,50 @@ func (_m *Writer) Warningf(format string, args ...interface{}) { _m.Called(_ca...) } +// Writer_Warningf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Warningf' +type Writer_Warningf_Call struct { + *mock.Call +} + +// Warningf is a helper method to define mock.On call +// - format string +// - args ...interface{} +func (_e *Writer_Expecter) Warningf(format interface{}, args ...interface{}) *Writer_Warningf_Call { + return &Writer_Warningf_Call{Call: _e.mock.On("Warningf", + append([]interface{}{format}, args...)...)} +} + +func (_c *Writer_Warningf_Call) Run(run func(format string, args ...interface{})) *Writer_Warningf_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Writer_Warningf_Call) Return() *Writer_Warningf_Call { + _c.Call.Return() + return _c +} + +func (_c *Writer_Warningf_Call) RunAndReturn(run func(string, ...interface{})) *Writer_Warningf_Call { + _c.Call.Return(run) + return _c +} + // With provides a mock function with given fields: data func (_m *Writer) With(data map[string]interface{}) log.Writer { ret := _m.Called(data) + if len(ret) == 0 { + panic("no return value specified for With") + } + var r0 log.Writer if rf, ok := ret.Get(0).(func(map[string]interface{}) log.Writer); ok { r0 = rf(data) @@ -254,10 +955,42 @@ func (_m *Writer) With(data map[string]interface{}) log.Writer { return r0 } +// Writer_With_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'With' +type Writer_With_Call struct { + *mock.Call +} + +// With is a helper method to define mock.On call +// - data map[string]interface{} +func (_e *Writer_Expecter) With(data interface{}) *Writer_With_Call { + return &Writer_With_Call{Call: _e.mock.On("With", data)} +} + +func (_c *Writer_With_Call) Run(run func(data map[string]interface{})) *Writer_With_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(map[string]interface{})) + }) + return _c +} + +func (_c *Writer_With_Call) Return(_a0 log.Writer) *Writer_With_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Writer_With_Call) RunAndReturn(run func(map[string]interface{}) log.Writer) *Writer_With_Call { + _c.Call.Return(run) + return _c +} + // WithTrace provides a mock function with given fields: func (_m *Writer) WithTrace() log.Writer { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for WithTrace") + } + var r0 log.Writer if rf, ok := ret.Get(0).(func() log.Writer); ok { r0 = rf() @@ -270,6 +1003,33 @@ func (_m *Writer) WithTrace() log.Writer { return r0 } +// Writer_WithTrace_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithTrace' +type Writer_WithTrace_Call struct { + *mock.Call +} + +// WithTrace is a helper method to define mock.On call +func (_e *Writer_Expecter) WithTrace() *Writer_WithTrace_Call { + return &Writer_WithTrace_Call{Call: _e.mock.On("WithTrace")} +} + +func (_c *Writer_WithTrace_Call) Run(run func()) *Writer_WithTrace_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Writer_WithTrace_Call) Return(_a0 log.Writer) *Writer_WithTrace_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Writer_WithTrace_Call) RunAndReturn(run func() log.Writer) *Writer_WithTrace_Call { + _c.Call.Return(run) + return _c +} + // NewWriter creates a new instance of Writer. 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 NewWriter(t interface { diff --git a/mocks/mail/Mail.go b/mocks/mail/Mail.go index 2eddb7848..7b94c8d2c 100644 --- a/mocks/mail/Mail.go +++ b/mocks/mail/Mail.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,10 +12,22 @@ type Mail struct { mock.Mock } +type Mail_Expecter struct { + mock *mock.Mock +} + +func (_m *Mail) EXPECT() *Mail_Expecter { + return &Mail_Expecter{mock: &_m.Mock} +} + // Attach provides a mock function with given fields: files func (_m *Mail) Attach(files []string) mail.Mail { ret := _m.Called(files) + if len(ret) == 0 { + panic("no return value specified for Attach") + } + var r0 mail.Mail if rf, ok := ret.Get(0).(func([]string) mail.Mail); ok { r0 = rf(files) @@ -28,10 +40,42 @@ func (_m *Mail) Attach(files []string) mail.Mail { return r0 } +// Mail_Attach_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Attach' +type Mail_Attach_Call struct { + *mock.Call +} + +// Attach is a helper method to define mock.On call +// - files []string +func (_e *Mail_Expecter) Attach(files interface{}) *Mail_Attach_Call { + return &Mail_Attach_Call{Call: _e.mock.On("Attach", files)} +} + +func (_c *Mail_Attach_Call) Run(run func(files []string)) *Mail_Attach_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]string)) + }) + return _c +} + +func (_c *Mail_Attach_Call) Return(_a0 mail.Mail) *Mail_Attach_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Mail_Attach_Call) RunAndReturn(run func([]string) mail.Mail) *Mail_Attach_Call { + _c.Call.Return(run) + return _c +} + // Bcc provides a mock function with given fields: addresses func (_m *Mail) Bcc(addresses []string) mail.Mail { ret := _m.Called(addresses) + if len(ret) == 0 { + panic("no return value specified for Bcc") + } + var r0 mail.Mail if rf, ok := ret.Get(0).(func([]string) mail.Mail); ok { r0 = rf(addresses) @@ -44,10 +88,42 @@ func (_m *Mail) Bcc(addresses []string) mail.Mail { return r0 } +// Mail_Bcc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bcc' +type Mail_Bcc_Call struct { + *mock.Call +} + +// Bcc is a helper method to define mock.On call +// - addresses []string +func (_e *Mail_Expecter) Bcc(addresses interface{}) *Mail_Bcc_Call { + return &Mail_Bcc_Call{Call: _e.mock.On("Bcc", addresses)} +} + +func (_c *Mail_Bcc_Call) Run(run func(addresses []string)) *Mail_Bcc_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]string)) + }) + return _c +} + +func (_c *Mail_Bcc_Call) Return(_a0 mail.Mail) *Mail_Bcc_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Mail_Bcc_Call) RunAndReturn(run func([]string) mail.Mail) *Mail_Bcc_Call { + _c.Call.Return(run) + return _c +} + // Cc provides a mock function with given fields: addresses func (_m *Mail) Cc(addresses []string) mail.Mail { ret := _m.Called(addresses) + if len(ret) == 0 { + panic("no return value specified for Cc") + } + var r0 mail.Mail if rf, ok := ret.Get(0).(func([]string) mail.Mail); ok { r0 = rf(addresses) @@ -60,10 +136,42 @@ func (_m *Mail) Cc(addresses []string) mail.Mail { return r0 } +// Mail_Cc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Cc' +type Mail_Cc_Call struct { + *mock.Call +} + +// Cc is a helper method to define mock.On call +// - addresses []string +func (_e *Mail_Expecter) Cc(addresses interface{}) *Mail_Cc_Call { + return &Mail_Cc_Call{Call: _e.mock.On("Cc", addresses)} +} + +func (_c *Mail_Cc_Call) Run(run func(addresses []string)) *Mail_Cc_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]string)) + }) + return _c +} + +func (_c *Mail_Cc_Call) Return(_a0 mail.Mail) *Mail_Cc_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Mail_Cc_Call) RunAndReturn(run func([]string) mail.Mail) *Mail_Cc_Call { + _c.Call.Return(run) + return _c +} + // Content provides a mock function with given fields: content func (_m *Mail) Content(content mail.Content) mail.Mail { ret := _m.Called(content) + if len(ret) == 0 { + panic("no return value specified for Content") + } + var r0 mail.Mail if rf, ok := ret.Get(0).(func(mail.Content) mail.Mail); ok { r0 = rf(content) @@ -76,10 +184,42 @@ func (_m *Mail) Content(content mail.Content) mail.Mail { return r0 } +// Mail_Content_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Content' +type Mail_Content_Call struct { + *mock.Call +} + +// Content is a helper method to define mock.On call +// - content mail.Content +func (_e *Mail_Expecter) Content(content interface{}) *Mail_Content_Call { + return &Mail_Content_Call{Call: _e.mock.On("Content", content)} +} + +func (_c *Mail_Content_Call) Run(run func(content mail.Content)) *Mail_Content_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(mail.Content)) + }) + return _c +} + +func (_c *Mail_Content_Call) Return(_a0 mail.Mail) *Mail_Content_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Mail_Content_Call) RunAndReturn(run func(mail.Content) mail.Mail) *Mail_Content_Call { + _c.Call.Return(run) + return _c +} + // From provides a mock function with given fields: address func (_m *Mail) From(address mail.From) mail.Mail { ret := _m.Called(address) + if len(ret) == 0 { + panic("no return value specified for From") + } + var r0 mail.Mail if rf, ok := ret.Get(0).(func(mail.From) mail.Mail); ok { r0 = rf(address) @@ -92,6 +232,34 @@ func (_m *Mail) From(address mail.From) mail.Mail { return r0 } +// Mail_From_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'From' +type Mail_From_Call struct { + *mock.Call +} + +// From is a helper method to define mock.On call +// - address mail.From +func (_e *Mail_Expecter) From(address interface{}) *Mail_From_Call { + return &Mail_From_Call{Call: _e.mock.On("From", address)} +} + +func (_c *Mail_From_Call) Run(run func(address mail.From)) *Mail_From_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(mail.From)) + }) + return _c +} + +func (_c *Mail_From_Call) Return(_a0 mail.Mail) *Mail_From_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Mail_From_Call) RunAndReturn(run func(mail.From) mail.Mail) *Mail_From_Call { + _c.Call.Return(run) + return _c +} + // Queue provides a mock function with given fields: queue func (_m *Mail) Queue(queue ...mail.Queue) error { _va := make([]interface{}, len(queue)) @@ -102,6 +270,10 @@ func (_m *Mail) Queue(queue ...mail.Queue) error { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Queue") + } + var r0 error if rf, ok := ret.Get(0).(func(...mail.Queue) error); ok { r0 = rf(queue...) @@ -112,10 +284,49 @@ func (_m *Mail) Queue(queue ...mail.Queue) error { return r0 } +// Mail_Queue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Queue' +type Mail_Queue_Call struct { + *mock.Call +} + +// Queue is a helper method to define mock.On call +// - queue ...mail.Queue +func (_e *Mail_Expecter) Queue(queue ...interface{}) *Mail_Queue_Call { + return &Mail_Queue_Call{Call: _e.mock.On("Queue", + append([]interface{}{}, queue...)...)} +} + +func (_c *Mail_Queue_Call) Run(run func(queue ...mail.Queue)) *Mail_Queue_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]mail.Queue, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(mail.Queue) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Mail_Queue_Call) Return(_a0 error) *Mail_Queue_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Mail_Queue_Call) RunAndReturn(run func(...mail.Queue) error) *Mail_Queue_Call { + _c.Call.Return(run) + return _c +} + // Send provides a mock function with given fields: func (_m *Mail) Send() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Send") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -126,10 +337,41 @@ func (_m *Mail) Send() error { return r0 } +// Mail_Send_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Send' +type Mail_Send_Call struct { + *mock.Call +} + +// Send is a helper method to define mock.On call +func (_e *Mail_Expecter) Send() *Mail_Send_Call { + return &Mail_Send_Call{Call: _e.mock.On("Send")} +} + +func (_c *Mail_Send_Call) Run(run func()) *Mail_Send_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Mail_Send_Call) Return(_a0 error) *Mail_Send_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Mail_Send_Call) RunAndReturn(run func() error) *Mail_Send_Call { + _c.Call.Return(run) + return _c +} + // To provides a mock function with given fields: addresses func (_m *Mail) To(addresses []string) mail.Mail { ret := _m.Called(addresses) + if len(ret) == 0 { + panic("no return value specified for To") + } + var r0 mail.Mail if rf, ok := ret.Get(0).(func([]string) mail.Mail); ok { r0 = rf(addresses) @@ -142,6 +384,34 @@ func (_m *Mail) To(addresses []string) mail.Mail { return r0 } +// Mail_To_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'To' +type Mail_To_Call struct { + *mock.Call +} + +// To is a helper method to define mock.On call +// - addresses []string +func (_e *Mail_Expecter) To(addresses interface{}) *Mail_To_Call { + return &Mail_To_Call{Call: _e.mock.On("To", addresses)} +} + +func (_c *Mail_To_Call) Run(run func(addresses []string)) *Mail_To_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]string)) + }) + return _c +} + +func (_c *Mail_To_Call) Return(_a0 mail.Mail) *Mail_To_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Mail_To_Call) RunAndReturn(run func([]string) mail.Mail) *Mail_To_Call { + _c.Call.Return(run) + return _c +} + // NewMail creates a new instance of Mail. 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 NewMail(t interface { diff --git a/mocks/queue/Job.go b/mocks/queue/Job.go index 30282bb45..cefca1554 100644 --- a/mocks/queue/Job.go +++ b/mocks/queue/Job.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -9,12 +9,24 @@ type Job struct { mock.Mock } +type Job_Expecter struct { + mock *mock.Mock +} + +func (_m *Job) EXPECT() *Job_Expecter { + return &Job_Expecter{mock: &_m.Mock} +} + // Handle provides a mock function with given fields: args func (_m *Job) Handle(args ...interface{}) error { var _ca []interface{} _ca = append(_ca, args...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Handle") + } + var r0 error if rf, ok := ret.Get(0).(func(...interface{}) error); ok { r0 = rf(args...) @@ -25,10 +37,49 @@ func (_m *Job) Handle(args ...interface{}) error { return r0 } +// Job_Handle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Handle' +type Job_Handle_Call struct { + *mock.Call +} + +// Handle is a helper method to define mock.On call +// - args ...interface{} +func (_e *Job_Expecter) Handle(args ...interface{}) *Job_Handle_Call { + return &Job_Handle_Call{Call: _e.mock.On("Handle", + append([]interface{}{}, args...)...)} +} + +func (_c *Job_Handle_Call) Run(run func(args ...interface{})) *Job_Handle_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Job_Handle_Call) Return(_a0 error) *Job_Handle_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Job_Handle_Call) RunAndReturn(run func(...interface{}) error) *Job_Handle_Call { + _c.Call.Return(run) + return _c +} + // Signature provides a mock function with given fields: func (_m *Job) Signature() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Signature") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -39,6 +90,33 @@ func (_m *Job) Signature() string { return r0 } +// Job_Signature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Signature' +type Job_Signature_Call struct { + *mock.Call +} + +// Signature is a helper method to define mock.On call +func (_e *Job_Expecter) Signature() *Job_Signature_Call { + return &Job_Signature_Call{Call: _e.mock.On("Signature")} +} + +func (_c *Job_Signature_Call) Run(run func()) *Job_Signature_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Job_Signature_Call) Return(_a0 string) *Job_Signature_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Job_Signature_Call) RunAndReturn(run func() string) *Job_Signature_Call { + _c.Call.Return(run) + return _c +} + // NewJob creates a new instance of Job. 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 NewJob(t interface { diff --git a/mocks/queue/Queue.go b/mocks/queue/Queue.go index b4b1eedd9..96e08562d 100644 --- a/mocks/queue/Queue.go +++ b/mocks/queue/Queue.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,10 +12,22 @@ type Queue struct { mock.Mock } +type Queue_Expecter struct { + mock *mock.Mock +} + +func (_m *Queue) EXPECT() *Queue_Expecter { + return &Queue_Expecter{mock: &_m.Mock} +} + // Chain provides a mock function with given fields: jobs func (_m *Queue) Chain(jobs []queue.Jobs) queue.Task { ret := _m.Called(jobs) + if len(ret) == 0 { + panic("no return value specified for Chain") + } + var r0 queue.Task if rf, ok := ret.Get(0).(func([]queue.Jobs) queue.Task); ok { r0 = rf(jobs) @@ -28,10 +40,42 @@ func (_m *Queue) Chain(jobs []queue.Jobs) queue.Task { return r0 } +// Queue_Chain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Chain' +type Queue_Chain_Call struct { + *mock.Call +} + +// Chain is a helper method to define mock.On call +// - jobs []queue.Jobs +func (_e *Queue_Expecter) Chain(jobs interface{}) *Queue_Chain_Call { + return &Queue_Chain_Call{Call: _e.mock.On("Chain", jobs)} +} + +func (_c *Queue_Chain_Call) Run(run func(jobs []queue.Jobs)) *Queue_Chain_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]queue.Jobs)) + }) + return _c +} + +func (_c *Queue_Chain_Call) Return(_a0 queue.Task) *Queue_Chain_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Queue_Chain_Call) RunAndReturn(run func([]queue.Jobs) queue.Task) *Queue_Chain_Call { + _c.Call.Return(run) + return _c +} + // GetJobs provides a mock function with given fields: func (_m *Queue) GetJobs() []queue.Job { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for GetJobs") + } + var r0 []queue.Job if rf, ok := ret.Get(0).(func() []queue.Job); ok { r0 = rf() @@ -44,10 +88,41 @@ func (_m *Queue) GetJobs() []queue.Job { return r0 } +// Queue_GetJobs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetJobs' +type Queue_GetJobs_Call struct { + *mock.Call +} + +// GetJobs is a helper method to define mock.On call +func (_e *Queue_Expecter) GetJobs() *Queue_GetJobs_Call { + return &Queue_GetJobs_Call{Call: _e.mock.On("GetJobs")} +} + +func (_c *Queue_GetJobs_Call) Run(run func()) *Queue_GetJobs_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Queue_GetJobs_Call) Return(_a0 []queue.Job) *Queue_GetJobs_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Queue_GetJobs_Call) RunAndReturn(run func() []queue.Job) *Queue_GetJobs_Call { + _c.Call.Return(run) + return _c +} + // Job provides a mock function with given fields: job, args func (_m *Queue) Job(job queue.Job, args []queue.Arg) queue.Task { ret := _m.Called(job, args) + if len(ret) == 0 { + panic("no return value specified for Job") + } + var r0 queue.Task if rf, ok := ret.Get(0).(func(queue.Job, []queue.Arg) queue.Task); ok { r0 = rf(job, args) @@ -60,15 +135,76 @@ func (_m *Queue) Job(job queue.Job, args []queue.Arg) queue.Task { return r0 } +// Queue_Job_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Job' +type Queue_Job_Call struct { + *mock.Call +} + +// Job is a helper method to define mock.On call +// - job queue.Job +// - args []queue.Arg +func (_e *Queue_Expecter) Job(job interface{}, args interface{}) *Queue_Job_Call { + return &Queue_Job_Call{Call: _e.mock.On("Job", job, args)} +} + +func (_c *Queue_Job_Call) Run(run func(job queue.Job, args []queue.Arg)) *Queue_Job_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(queue.Job), args[1].([]queue.Arg)) + }) + return _c +} + +func (_c *Queue_Job_Call) Return(_a0 queue.Task) *Queue_Job_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Queue_Job_Call) RunAndReturn(run func(queue.Job, []queue.Arg) queue.Task) *Queue_Job_Call { + _c.Call.Return(run) + return _c +} + // Register provides a mock function with given fields: jobs func (_m *Queue) Register(jobs []queue.Job) { _m.Called(jobs) } +// Queue_Register_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Register' +type Queue_Register_Call struct { + *mock.Call +} + +// Register is a helper method to define mock.On call +// - jobs []queue.Job +func (_e *Queue_Expecter) Register(jobs interface{}) *Queue_Register_Call { + return &Queue_Register_Call{Call: _e.mock.On("Register", jobs)} +} + +func (_c *Queue_Register_Call) Run(run func(jobs []queue.Job)) *Queue_Register_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]queue.Job)) + }) + return _c +} + +func (_c *Queue_Register_Call) Return() *Queue_Register_Call { + _c.Call.Return() + return _c +} + +func (_c *Queue_Register_Call) RunAndReturn(run func([]queue.Job)) *Queue_Register_Call { + _c.Call.Return(run) + return _c +} + // Worker provides a mock function with given fields: args func (_m *Queue) Worker(args *queue.Args) queue.Worker { ret := _m.Called(args) + if len(ret) == 0 { + panic("no return value specified for Worker") + } + var r0 queue.Worker if rf, ok := ret.Get(0).(func(*queue.Args) queue.Worker); ok { r0 = rf(args) @@ -81,6 +217,34 @@ func (_m *Queue) Worker(args *queue.Args) queue.Worker { return r0 } +// Queue_Worker_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Worker' +type Queue_Worker_Call struct { + *mock.Call +} + +// Worker is a helper method to define mock.On call +// - args *queue.Args +func (_e *Queue_Expecter) Worker(args interface{}) *Queue_Worker_Call { + return &Queue_Worker_Call{Call: _e.mock.On("Worker", args)} +} + +func (_c *Queue_Worker_Call) Run(run func(args *queue.Args)) *Queue_Worker_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*queue.Args)) + }) + return _c +} + +func (_c *Queue_Worker_Call) Return(_a0 queue.Worker) *Queue_Worker_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Queue_Worker_Call) RunAndReturn(run func(*queue.Args) queue.Worker) *Queue_Worker_Call { + _c.Call.Return(run) + return _c +} + // NewQueue creates a new instance of Queue. 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 NewQueue(t interface { diff --git a/mocks/queue/Task.go b/mocks/queue/Task.go index d35089871..cd7f952f9 100644 --- a/mocks/queue/Task.go +++ b/mocks/queue/Task.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -14,10 +14,22 @@ type Task struct { mock.Mock } +type Task_Expecter struct { + mock *mock.Mock +} + +func (_m *Task) EXPECT() *Task_Expecter { + return &Task_Expecter{mock: &_m.Mock} +} + // Delay provides a mock function with given fields: _a0 func (_m *Task) Delay(_a0 time.Time) queue.Task { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Delay") + } + var r0 queue.Task if rf, ok := ret.Get(0).(func(time.Time) queue.Task); ok { r0 = rf(_a0) @@ -30,10 +42,42 @@ func (_m *Task) Delay(_a0 time.Time) queue.Task { return r0 } +// Task_Delay_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delay' +type Task_Delay_Call struct { + *mock.Call +} + +// Delay is a helper method to define mock.On call +// - _a0 time.Time +func (_e *Task_Expecter) Delay(_a0 interface{}) *Task_Delay_Call { + return &Task_Delay_Call{Call: _e.mock.On("Delay", _a0)} +} + +func (_c *Task_Delay_Call) Run(run func(_a0 time.Time)) *Task_Delay_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(time.Time)) + }) + return _c +} + +func (_c *Task_Delay_Call) Return(_a0 queue.Task) *Task_Delay_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Task_Delay_Call) RunAndReturn(run func(time.Time) queue.Task) *Task_Delay_Call { + _c.Call.Return(run) + return _c +} + // Dispatch provides a mock function with given fields: func (_m *Task) Dispatch() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Dispatch") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -44,10 +88,41 @@ func (_m *Task) Dispatch() error { return r0 } +// Task_Dispatch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Dispatch' +type Task_Dispatch_Call struct { + *mock.Call +} + +// Dispatch is a helper method to define mock.On call +func (_e *Task_Expecter) Dispatch() *Task_Dispatch_Call { + return &Task_Dispatch_Call{Call: _e.mock.On("Dispatch")} +} + +func (_c *Task_Dispatch_Call) Run(run func()) *Task_Dispatch_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Task_Dispatch_Call) Return(_a0 error) *Task_Dispatch_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Task_Dispatch_Call) RunAndReturn(run func() error) *Task_Dispatch_Call { + _c.Call.Return(run) + return _c +} + // DispatchSync provides a mock function with given fields: func (_m *Task) DispatchSync() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for DispatchSync") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -58,10 +133,41 @@ func (_m *Task) DispatchSync() error { return r0 } +// Task_DispatchSync_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DispatchSync' +type Task_DispatchSync_Call struct { + *mock.Call +} + +// DispatchSync is a helper method to define mock.On call +func (_e *Task_Expecter) DispatchSync() *Task_DispatchSync_Call { + return &Task_DispatchSync_Call{Call: _e.mock.On("DispatchSync")} +} + +func (_c *Task_DispatchSync_Call) Run(run func()) *Task_DispatchSync_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Task_DispatchSync_Call) Return(_a0 error) *Task_DispatchSync_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Task_DispatchSync_Call) RunAndReturn(run func() error) *Task_DispatchSync_Call { + _c.Call.Return(run) + return _c +} + // OnConnection provides a mock function with given fields: connection func (_m *Task) OnConnection(connection string) queue.Task { ret := _m.Called(connection) + if len(ret) == 0 { + panic("no return value specified for OnConnection") + } + var r0 queue.Task if rf, ok := ret.Get(0).(func(string) queue.Task); ok { r0 = rf(connection) @@ -74,10 +180,42 @@ func (_m *Task) OnConnection(connection string) queue.Task { return r0 } +// Task_OnConnection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnConnection' +type Task_OnConnection_Call struct { + *mock.Call +} + +// OnConnection is a helper method to define mock.On call +// - connection string +func (_e *Task_Expecter) OnConnection(connection interface{}) *Task_OnConnection_Call { + return &Task_OnConnection_Call{Call: _e.mock.On("OnConnection", connection)} +} + +func (_c *Task_OnConnection_Call) Run(run func(connection string)) *Task_OnConnection_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Task_OnConnection_Call) Return(_a0 queue.Task) *Task_OnConnection_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Task_OnConnection_Call) RunAndReturn(run func(string) queue.Task) *Task_OnConnection_Call { + _c.Call.Return(run) + return _c +} + // OnQueue provides a mock function with given fields: _a0 func (_m *Task) OnQueue(_a0 string) queue.Task { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for OnQueue") + } + var r0 queue.Task if rf, ok := ret.Get(0).(func(string) queue.Task); ok { r0 = rf(_a0) @@ -90,6 +228,34 @@ func (_m *Task) OnQueue(_a0 string) queue.Task { return r0 } +// Task_OnQueue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnQueue' +type Task_OnQueue_Call struct { + *mock.Call +} + +// OnQueue is a helper method to define mock.On call +// - _a0 string +func (_e *Task_Expecter) OnQueue(_a0 interface{}) *Task_OnQueue_Call { + return &Task_OnQueue_Call{Call: _e.mock.On("OnQueue", _a0)} +} + +func (_c *Task_OnQueue_Call) Run(run func(_a0 string)) *Task_OnQueue_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Task_OnQueue_Call) Return(_a0 queue.Task) *Task_OnQueue_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Task_OnQueue_Call) RunAndReturn(run func(string) queue.Task) *Task_OnQueue_Call { + _c.Call.Return(run) + return _c +} + // NewTask creates a new instance of Task. 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 NewTask(t interface { diff --git a/mocks/queue/Worker.go b/mocks/queue/Worker.go index fbf20a9bd..363f2bf35 100644 --- a/mocks/queue/Worker.go +++ b/mocks/queue/Worker.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -9,10 +9,22 @@ type Worker struct { mock.Mock } +type Worker_Expecter struct { + mock *mock.Mock +} + +func (_m *Worker) EXPECT() *Worker_Expecter { + return &Worker_Expecter{mock: &_m.Mock} +} + // Run provides a mock function with given fields: func (_m *Worker) Run() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Run") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -23,6 +35,33 @@ func (_m *Worker) Run() error { return r0 } +// Worker_Run_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Run' +type Worker_Run_Call struct { + *mock.Call +} + +// Run is a helper method to define mock.On call +func (_e *Worker_Expecter) Run() *Worker_Run_Call { + return &Worker_Run_Call{Call: _e.mock.On("Run")} +} + +func (_c *Worker_Run_Call) Run(run func()) *Worker_Run_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Worker_Run_Call) Return(_a0 error) *Worker_Run_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Worker_Run_Call) RunAndReturn(run func() error) *Worker_Run_Call { + _c.Call.Return(run) + return _c +} + // NewWorker creates a new instance of Worker. 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 NewWorker(t interface { diff --git a/mocks/route/GroupFunc.go b/mocks/route/GroupFunc.go index 11a0f6f8e..ad1727d39 100644 --- a/mocks/route/GroupFunc.go +++ b/mocks/route/GroupFunc.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,11 +12,47 @@ type GroupFunc struct { mock.Mock } +type GroupFunc_Expecter struct { + mock *mock.Mock +} + +func (_m *GroupFunc) EXPECT() *GroupFunc_Expecter { + return &GroupFunc_Expecter{mock: &_m.Mock} +} + // Execute provides a mock function with given fields: router func (_m *GroupFunc) Execute(router route.Router) { _m.Called(router) } +// GroupFunc_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute' +type GroupFunc_Execute_Call struct { + *mock.Call +} + +// Execute is a helper method to define mock.On call +// - router route.Router +func (_e *GroupFunc_Expecter) Execute(router interface{}) *GroupFunc_Execute_Call { + return &GroupFunc_Execute_Call{Call: _e.mock.On("Execute", router)} +} + +func (_c *GroupFunc_Execute_Call) Run(run func(router route.Router)) *GroupFunc_Execute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(route.Router)) + }) + return _c +} + +func (_c *GroupFunc_Execute_Call) Return() *GroupFunc_Execute_Call { + _c.Call.Return() + return _c +} + +func (_c *GroupFunc_Execute_Call) RunAndReturn(run func(route.Router)) *GroupFunc_Execute_Call { + _c.Call.Return(run) + return _c +} + // NewGroupFunc creates a new instance of GroupFunc. 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 NewGroupFunc(t interface { diff --git a/mocks/route/Route.go b/mocks/route/Route.go index 6d35aee8c..c9ba6ba7f 100644 --- a/mocks/route/Route.go +++ b/mocks/route/Route.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -16,26 +16,149 @@ type Route struct { mock.Mock } +type Route_Expecter struct { + mock *mock.Mock +} + +func (_m *Route) EXPECT() *Route_Expecter { + return &Route_Expecter{mock: &_m.Mock} +} + // Any provides a mock function with given fields: relativePath, handler func (_m *Route) Any(relativePath string, handler http.HandlerFunc) { _m.Called(relativePath, handler) } +// Route_Any_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Any' +type Route_Any_Call struct { + *mock.Call +} + +// Any is a helper method to define mock.On call +// - relativePath string +// - handler http.HandlerFunc +func (_e *Route_Expecter) Any(relativePath interface{}, handler interface{}) *Route_Any_Call { + return &Route_Any_Call{Call: _e.mock.On("Any", relativePath, handler)} +} + +func (_c *Route_Any_Call) Run(run func(relativePath string, handler http.HandlerFunc)) *Route_Any_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(http.HandlerFunc)) + }) + return _c +} + +func (_c *Route_Any_Call) Return() *Route_Any_Call { + _c.Call.Return() + return _c +} + +func (_c *Route_Any_Call) RunAndReturn(run func(string, http.HandlerFunc)) *Route_Any_Call { + _c.Call.Return(run) + return _c +} + // Delete provides a mock function with given fields: relativePath, handler func (_m *Route) Delete(relativePath string, handler http.HandlerFunc) { _m.Called(relativePath, handler) } +// Route_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type Route_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - relativePath string +// - handler http.HandlerFunc +func (_e *Route_Expecter) Delete(relativePath interface{}, handler interface{}) *Route_Delete_Call { + return &Route_Delete_Call{Call: _e.mock.On("Delete", relativePath, handler)} +} + +func (_c *Route_Delete_Call) Run(run func(relativePath string, handler http.HandlerFunc)) *Route_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(http.HandlerFunc)) + }) + return _c +} + +func (_c *Route_Delete_Call) Return() *Route_Delete_Call { + _c.Call.Return() + return _c +} + +func (_c *Route_Delete_Call) RunAndReturn(run func(string, http.HandlerFunc)) *Route_Delete_Call { + _c.Call.Return(run) + return _c +} + // Fallback provides a mock function with given fields: handler func (_m *Route) Fallback(handler http.HandlerFunc) { _m.Called(handler) } +// Route_Fallback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Fallback' +type Route_Fallback_Call struct { + *mock.Call +} + +// Fallback is a helper method to define mock.On call +// - handler http.HandlerFunc +func (_e *Route_Expecter) Fallback(handler interface{}) *Route_Fallback_Call { + return &Route_Fallback_Call{Call: _e.mock.On("Fallback", handler)} +} + +func (_c *Route_Fallback_Call) Run(run func(handler http.HandlerFunc)) *Route_Fallback_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(http.HandlerFunc)) + }) + return _c +} + +func (_c *Route_Fallback_Call) Return() *Route_Fallback_Call { + _c.Call.Return() + return _c +} + +func (_c *Route_Fallback_Call) RunAndReturn(run func(http.HandlerFunc)) *Route_Fallback_Call { + _c.Call.Return(run) + return _c +} + // Get provides a mock function with given fields: relativePath, handler func (_m *Route) Get(relativePath string, handler http.HandlerFunc) { _m.Called(relativePath, handler) } +// Route_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type Route_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - relativePath string +// - handler http.HandlerFunc +func (_e *Route_Expecter) Get(relativePath interface{}, handler interface{}) *Route_Get_Call { + return &Route_Get_Call{Call: _e.mock.On("Get", relativePath, handler)} +} + +func (_c *Route_Get_Call) Run(run func(relativePath string, handler http.HandlerFunc)) *Route_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(http.HandlerFunc)) + }) + return _c +} + +func (_c *Route_Get_Call) Return() *Route_Get_Call { + _c.Call.Return() + return _c +} + +func (_c *Route_Get_Call) RunAndReturn(run func(string, http.HandlerFunc)) *Route_Get_Call { + _c.Call.Return(run) + return _c +} + // GlobalMiddleware provides a mock function with given fields: middlewares func (_m *Route) GlobalMiddleware(middlewares ...http.Middleware) { _va := make([]interface{}, len(middlewares)) @@ -47,11 +170,74 @@ func (_m *Route) GlobalMiddleware(middlewares ...http.Middleware) { _m.Called(_ca...) } +// Route_GlobalMiddleware_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GlobalMiddleware' +type Route_GlobalMiddleware_Call struct { + *mock.Call +} + +// GlobalMiddleware is a helper method to define mock.On call +// - middlewares ...http.Middleware +func (_e *Route_Expecter) GlobalMiddleware(middlewares ...interface{}) *Route_GlobalMiddleware_Call { + return &Route_GlobalMiddleware_Call{Call: _e.mock.On("GlobalMiddleware", + append([]interface{}{}, middlewares...)...)} +} + +func (_c *Route_GlobalMiddleware_Call) Run(run func(middlewares ...http.Middleware)) *Route_GlobalMiddleware_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]http.Middleware, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(http.Middleware) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Route_GlobalMiddleware_Call) Return() *Route_GlobalMiddleware_Call { + _c.Call.Return() + return _c +} + +func (_c *Route_GlobalMiddleware_Call) RunAndReturn(run func(...http.Middleware)) *Route_GlobalMiddleware_Call { + _c.Call.Return(run) + return _c +} + // Group provides a mock function with given fields: handler func (_m *Route) Group(handler route.GroupFunc) { _m.Called(handler) } +// Route_Group_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Group' +type Route_Group_Call struct { + *mock.Call +} + +// Group is a helper method to define mock.On call +// - handler route.GroupFunc +func (_e *Route_Expecter) Group(handler interface{}) *Route_Group_Call { + return &Route_Group_Call{Call: _e.mock.On("Group", handler)} +} + +func (_c *Route_Group_Call) Run(run func(handler route.GroupFunc)) *Route_Group_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(route.GroupFunc)) + }) + return _c +} + +func (_c *Route_Group_Call) Return() *Route_Group_Call { + _c.Call.Return() + return _c +} + +func (_c *Route_Group_Call) RunAndReturn(run func(route.GroupFunc)) *Route_Group_Call { + _c.Call.Return(run) + return _c +} + // Middleware provides a mock function with given fields: middlewares func (_m *Route) Middleware(middlewares ...http.Middleware) route.Router { _va := make([]interface{}, len(middlewares)) @@ -62,6 +248,10 @@ func (_m *Route) Middleware(middlewares ...http.Middleware) route.Router { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Middleware") + } + var r0 route.Router if rf, ok := ret.Get(0).(func(...http.Middleware) route.Router); ok { r0 = rf(middlewares...) @@ -74,25 +264,151 @@ func (_m *Route) Middleware(middlewares ...http.Middleware) route.Router { return r0 } +// Route_Middleware_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Middleware' +type Route_Middleware_Call struct { + *mock.Call +} + +// Middleware is a helper method to define mock.On call +// - middlewares ...http.Middleware +func (_e *Route_Expecter) Middleware(middlewares ...interface{}) *Route_Middleware_Call { + return &Route_Middleware_Call{Call: _e.mock.On("Middleware", + append([]interface{}{}, middlewares...)...)} +} + +func (_c *Route_Middleware_Call) Run(run func(middlewares ...http.Middleware)) *Route_Middleware_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]http.Middleware, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(http.Middleware) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Route_Middleware_Call) Return(_a0 route.Router) *Route_Middleware_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Route_Middleware_Call) RunAndReturn(run func(...http.Middleware) route.Router) *Route_Middleware_Call { + _c.Call.Return(run) + return _c +} + // Options provides a mock function with given fields: relativePath, handler func (_m *Route) Options(relativePath string, handler http.HandlerFunc) { _m.Called(relativePath, handler) } +// Route_Options_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Options' +type Route_Options_Call struct { + *mock.Call +} + +// Options is a helper method to define mock.On call +// - relativePath string +// - handler http.HandlerFunc +func (_e *Route_Expecter) Options(relativePath interface{}, handler interface{}) *Route_Options_Call { + return &Route_Options_Call{Call: _e.mock.On("Options", relativePath, handler)} +} + +func (_c *Route_Options_Call) Run(run func(relativePath string, handler http.HandlerFunc)) *Route_Options_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(http.HandlerFunc)) + }) + return _c +} + +func (_c *Route_Options_Call) Return() *Route_Options_Call { + _c.Call.Return() + return _c +} + +func (_c *Route_Options_Call) RunAndReturn(run func(string, http.HandlerFunc)) *Route_Options_Call { + _c.Call.Return(run) + return _c +} + // Patch provides a mock function with given fields: relativePath, handler func (_m *Route) Patch(relativePath string, handler http.HandlerFunc) { _m.Called(relativePath, handler) } +// Route_Patch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Patch' +type Route_Patch_Call struct { + *mock.Call +} + +// Patch is a helper method to define mock.On call +// - relativePath string +// - handler http.HandlerFunc +func (_e *Route_Expecter) Patch(relativePath interface{}, handler interface{}) *Route_Patch_Call { + return &Route_Patch_Call{Call: _e.mock.On("Patch", relativePath, handler)} +} + +func (_c *Route_Patch_Call) Run(run func(relativePath string, handler http.HandlerFunc)) *Route_Patch_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(http.HandlerFunc)) + }) + return _c +} + +func (_c *Route_Patch_Call) Return() *Route_Patch_Call { + _c.Call.Return() + return _c +} + +func (_c *Route_Patch_Call) RunAndReturn(run func(string, http.HandlerFunc)) *Route_Patch_Call { + _c.Call.Return(run) + return _c +} + // Post provides a mock function with given fields: relativePath, handler func (_m *Route) Post(relativePath string, handler http.HandlerFunc) { _m.Called(relativePath, handler) } +// Route_Post_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Post' +type Route_Post_Call struct { + *mock.Call +} + +// Post is a helper method to define mock.On call +// - relativePath string +// - handler http.HandlerFunc +func (_e *Route_Expecter) Post(relativePath interface{}, handler interface{}) *Route_Post_Call { + return &Route_Post_Call{Call: _e.mock.On("Post", relativePath, handler)} +} + +func (_c *Route_Post_Call) Run(run func(relativePath string, handler http.HandlerFunc)) *Route_Post_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(http.HandlerFunc)) + }) + return _c +} + +func (_c *Route_Post_Call) Return() *Route_Post_Call { + _c.Call.Return() + return _c +} + +func (_c *Route_Post_Call) RunAndReturn(run func(string, http.HandlerFunc)) *Route_Post_Call { + _c.Call.Return(run) + return _c +} + // Prefix provides a mock function with given fields: addr func (_m *Route) Prefix(addr string) route.Router { ret := _m.Called(addr) + if len(ret) == 0 { + panic("no return value specified for Prefix") + } + var r0 route.Router if rf, ok := ret.Get(0).(func(string) route.Router); ok { r0 = rf(addr) @@ -105,16 +421,102 @@ func (_m *Route) Prefix(addr string) route.Router { return r0 } +// Route_Prefix_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Prefix' +type Route_Prefix_Call struct { + *mock.Call +} + +// Prefix is a helper method to define mock.On call +// - addr string +func (_e *Route_Expecter) Prefix(addr interface{}) *Route_Prefix_Call { + return &Route_Prefix_Call{Call: _e.mock.On("Prefix", addr)} +} + +func (_c *Route_Prefix_Call) Run(run func(addr string)) *Route_Prefix_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Route_Prefix_Call) Return(_a0 route.Router) *Route_Prefix_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Route_Prefix_Call) RunAndReturn(run func(string) route.Router) *Route_Prefix_Call { + _c.Call.Return(run) + return _c +} + // Put provides a mock function with given fields: relativePath, handler func (_m *Route) Put(relativePath string, handler http.HandlerFunc) { _m.Called(relativePath, handler) } +// Route_Put_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Put' +type Route_Put_Call struct { + *mock.Call +} + +// Put is a helper method to define mock.On call +// - relativePath string +// - handler http.HandlerFunc +func (_e *Route_Expecter) Put(relativePath interface{}, handler interface{}) *Route_Put_Call { + return &Route_Put_Call{Call: _e.mock.On("Put", relativePath, handler)} +} + +func (_c *Route_Put_Call) Run(run func(relativePath string, handler http.HandlerFunc)) *Route_Put_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(http.HandlerFunc)) + }) + return _c +} + +func (_c *Route_Put_Call) Return() *Route_Put_Call { + _c.Call.Return() + return _c +} + +func (_c *Route_Put_Call) RunAndReturn(run func(string, http.HandlerFunc)) *Route_Put_Call { + _c.Call.Return(run) + return _c +} + // Resource provides a mock function with given fields: relativePath, controller func (_m *Route) Resource(relativePath string, controller http.ResourceController) { _m.Called(relativePath, controller) } +// Route_Resource_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Resource' +type Route_Resource_Call struct { + *mock.Call +} + +// Resource is a helper method to define mock.On call +// - relativePath string +// - controller http.ResourceController +func (_e *Route_Expecter) Resource(relativePath interface{}, controller interface{}) *Route_Resource_Call { + return &Route_Resource_Call{Call: _e.mock.On("Resource", relativePath, controller)} +} + +func (_c *Route_Resource_Call) Run(run func(relativePath string, controller http.ResourceController)) *Route_Resource_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(http.ResourceController)) + }) + return _c +} + +func (_c *Route_Resource_Call) Return() *Route_Resource_Call { + _c.Call.Return() + return _c +} + +func (_c *Route_Resource_Call) RunAndReturn(run func(string, http.ResourceController)) *Route_Resource_Call { + _c.Call.Return(run) + return _c +} + // Run provides a mock function with given fields: host func (_m *Route) Run(host ...string) error { _va := make([]interface{}, len(host)) @@ -125,6 +527,10 @@ func (_m *Route) Run(host ...string) error { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Run") + } + var r0 error if rf, ok := ret.Get(0).(func(...string) error); ok { r0 = rf(host...) @@ -135,6 +541,41 @@ func (_m *Route) Run(host ...string) error { return r0 } +// Route_Run_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Run' +type Route_Run_Call struct { + *mock.Call +} + +// Run is a helper method to define mock.On call +// - host ...string +func (_e *Route_Expecter) Run(host ...interface{}) *Route_Run_Call { + return &Route_Run_Call{Call: _e.mock.On("Run", + append([]interface{}{}, host...)...)} +} + +func (_c *Route_Run_Call) Run(run func(host ...string)) *Route_Run_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Route_Run_Call) Return(_a0 error) *Route_Run_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Route_Run_Call) RunAndReturn(run func(...string) error) *Route_Run_Call { + _c.Call.Return(run) + return _c +} + // RunTLS provides a mock function with given fields: host func (_m *Route) RunTLS(host ...string) error { _va := make([]interface{}, len(host)) @@ -145,6 +586,10 @@ func (_m *Route) RunTLS(host ...string) error { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for RunTLS") + } + var r0 error if rf, ok := ret.Get(0).(func(...string) error); ok { r0 = rf(host...) @@ -155,10 +600,49 @@ func (_m *Route) RunTLS(host ...string) error { return r0 } +// Route_RunTLS_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RunTLS' +type Route_RunTLS_Call struct { + *mock.Call +} + +// RunTLS is a helper method to define mock.On call +// - host ...string +func (_e *Route_Expecter) RunTLS(host ...interface{}) *Route_RunTLS_Call { + return &Route_RunTLS_Call{Call: _e.mock.On("RunTLS", + append([]interface{}{}, host...)...)} +} + +func (_c *Route_RunTLS_Call) Run(run func(host ...string)) *Route_RunTLS_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Route_RunTLS_Call) Return(_a0 error) *Route_RunTLS_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Route_RunTLS_Call) RunAndReturn(run func(...string) error) *Route_RunTLS_Call { + _c.Call.Return(run) + return _c +} + // RunTLSWithCert provides a mock function with given fields: host, certFile, keyFile func (_m *Route) RunTLSWithCert(host string, certFile string, keyFile string) error { ret := _m.Called(host, certFile, keyFile) + if len(ret) == 0 { + panic("no return value specified for RunTLSWithCert") + } + var r0 error if rf, ok := ret.Get(0).(func(string, string, string) error); ok { r0 = rf(host, certFile, keyFile) @@ -169,26 +653,172 @@ func (_m *Route) RunTLSWithCert(host string, certFile string, keyFile string) er return r0 } +// Route_RunTLSWithCert_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RunTLSWithCert' +type Route_RunTLSWithCert_Call struct { + *mock.Call +} + +// RunTLSWithCert is a helper method to define mock.On call +// - host string +// - certFile string +// - keyFile string +func (_e *Route_Expecter) RunTLSWithCert(host interface{}, certFile interface{}, keyFile interface{}) *Route_RunTLSWithCert_Call { + return &Route_RunTLSWithCert_Call{Call: _e.mock.On("RunTLSWithCert", host, certFile, keyFile)} +} + +func (_c *Route_RunTLSWithCert_Call) Run(run func(host string, certFile string, keyFile string)) *Route_RunTLSWithCert_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *Route_RunTLSWithCert_Call) Return(_a0 error) *Route_RunTLSWithCert_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Route_RunTLSWithCert_Call) RunAndReturn(run func(string, string, string) error) *Route_RunTLSWithCert_Call { + _c.Call.Return(run) + return _c +} + // ServeHTTP provides a mock function with given fields: writer, request func (_m *Route) ServeHTTP(writer nethttp.ResponseWriter, request *nethttp.Request) { _m.Called(writer, request) } +// Route_ServeHTTP_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ServeHTTP' +type Route_ServeHTTP_Call struct { + *mock.Call +} + +// ServeHTTP is a helper method to define mock.On call +// - writer nethttp.ResponseWriter +// - request *nethttp.Request +func (_e *Route_Expecter) ServeHTTP(writer interface{}, request interface{}) *Route_ServeHTTP_Call { + return &Route_ServeHTTP_Call{Call: _e.mock.On("ServeHTTP", writer, request)} +} + +func (_c *Route_ServeHTTP_Call) Run(run func(writer nethttp.ResponseWriter, request *nethttp.Request)) *Route_ServeHTTP_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(nethttp.ResponseWriter), args[1].(*nethttp.Request)) + }) + return _c +} + +func (_c *Route_ServeHTTP_Call) Return() *Route_ServeHTTP_Call { + _c.Call.Return() + return _c +} + +func (_c *Route_ServeHTTP_Call) RunAndReturn(run func(nethttp.ResponseWriter, *nethttp.Request)) *Route_ServeHTTP_Call { + _c.Call.Return(run) + return _c +} + // Static provides a mock function with given fields: relativePath, root func (_m *Route) Static(relativePath string, root string) { _m.Called(relativePath, root) } +// Route_Static_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Static' +type Route_Static_Call struct { + *mock.Call +} + +// Static is a helper method to define mock.On call +// - relativePath string +// - root string +func (_e *Route_Expecter) Static(relativePath interface{}, root interface{}) *Route_Static_Call { + return &Route_Static_Call{Call: _e.mock.On("Static", relativePath, root)} +} + +func (_c *Route_Static_Call) Run(run func(relativePath string, root string)) *Route_Static_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Route_Static_Call) Return() *Route_Static_Call { + _c.Call.Return() + return _c +} + +func (_c *Route_Static_Call) RunAndReturn(run func(string, string)) *Route_Static_Call { + _c.Call.Return(run) + return _c +} + // StaticFS provides a mock function with given fields: relativePath, fs func (_m *Route) StaticFS(relativePath string, fs nethttp.FileSystem) { _m.Called(relativePath, fs) } +// Route_StaticFS_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StaticFS' +type Route_StaticFS_Call struct { + *mock.Call +} + +// StaticFS is a helper method to define mock.On call +// - relativePath string +// - fs nethttp.FileSystem +func (_e *Route_Expecter) StaticFS(relativePath interface{}, fs interface{}) *Route_StaticFS_Call { + return &Route_StaticFS_Call{Call: _e.mock.On("StaticFS", relativePath, fs)} +} + +func (_c *Route_StaticFS_Call) Run(run func(relativePath string, fs nethttp.FileSystem)) *Route_StaticFS_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(nethttp.FileSystem)) + }) + return _c +} + +func (_c *Route_StaticFS_Call) Return() *Route_StaticFS_Call { + _c.Call.Return() + return _c +} + +func (_c *Route_StaticFS_Call) RunAndReturn(run func(string, nethttp.FileSystem)) *Route_StaticFS_Call { + _c.Call.Return(run) + return _c +} + // StaticFile provides a mock function with given fields: relativePath, filepath func (_m *Route) StaticFile(relativePath string, filepath string) { _m.Called(relativePath, filepath) } +// Route_StaticFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StaticFile' +type Route_StaticFile_Call struct { + *mock.Call +} + +// StaticFile is a helper method to define mock.On call +// - relativePath string +// - filepath string +func (_e *Route_Expecter) StaticFile(relativePath interface{}, filepath interface{}) *Route_StaticFile_Call { + return &Route_StaticFile_Call{Call: _e.mock.On("StaticFile", relativePath, filepath)} +} + +func (_c *Route_StaticFile_Call) Run(run func(relativePath string, filepath string)) *Route_StaticFile_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Route_StaticFile_Call) Return() *Route_StaticFile_Call { + _c.Call.Return() + return _c +} + +func (_c *Route_StaticFile_Call) RunAndReturn(run func(string, string)) *Route_StaticFile_Call { + _c.Call.Return(run) + return _c +} + // NewRoute creates a new instance of Route. 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 NewRoute(t interface { diff --git a/mocks/route/Router.go b/mocks/route/Router.go index 9b62197bc..f16623d21 100644 --- a/mocks/route/Router.go +++ b/mocks/route/Router.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -16,26 +16,149 @@ type Router struct { mock.Mock } +type Router_Expecter struct { + mock *mock.Mock +} + +func (_m *Router) EXPECT() *Router_Expecter { + return &Router_Expecter{mock: &_m.Mock} +} + // Any provides a mock function with given fields: relativePath, handler func (_m *Router) Any(relativePath string, handler http.HandlerFunc) { _m.Called(relativePath, handler) } +// Router_Any_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Any' +type Router_Any_Call struct { + *mock.Call +} + +// Any is a helper method to define mock.On call +// - relativePath string +// - handler http.HandlerFunc +func (_e *Router_Expecter) Any(relativePath interface{}, handler interface{}) *Router_Any_Call { + return &Router_Any_Call{Call: _e.mock.On("Any", relativePath, handler)} +} + +func (_c *Router_Any_Call) Run(run func(relativePath string, handler http.HandlerFunc)) *Router_Any_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(http.HandlerFunc)) + }) + return _c +} + +func (_c *Router_Any_Call) Return() *Router_Any_Call { + _c.Call.Return() + return _c +} + +func (_c *Router_Any_Call) RunAndReturn(run func(string, http.HandlerFunc)) *Router_Any_Call { + _c.Call.Return(run) + return _c +} + // Delete provides a mock function with given fields: relativePath, handler func (_m *Router) Delete(relativePath string, handler http.HandlerFunc) { _m.Called(relativePath, handler) } +// Router_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type Router_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - relativePath string +// - handler http.HandlerFunc +func (_e *Router_Expecter) Delete(relativePath interface{}, handler interface{}) *Router_Delete_Call { + return &Router_Delete_Call{Call: _e.mock.On("Delete", relativePath, handler)} +} + +func (_c *Router_Delete_Call) Run(run func(relativePath string, handler http.HandlerFunc)) *Router_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(http.HandlerFunc)) + }) + return _c +} + +func (_c *Router_Delete_Call) Return() *Router_Delete_Call { + _c.Call.Return() + return _c +} + +func (_c *Router_Delete_Call) RunAndReturn(run func(string, http.HandlerFunc)) *Router_Delete_Call { + _c.Call.Return(run) + return _c +} + // Get provides a mock function with given fields: relativePath, handler func (_m *Router) Get(relativePath string, handler http.HandlerFunc) { _m.Called(relativePath, handler) } +// Router_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type Router_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - relativePath string +// - handler http.HandlerFunc +func (_e *Router_Expecter) Get(relativePath interface{}, handler interface{}) *Router_Get_Call { + return &Router_Get_Call{Call: _e.mock.On("Get", relativePath, handler)} +} + +func (_c *Router_Get_Call) Run(run func(relativePath string, handler http.HandlerFunc)) *Router_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(http.HandlerFunc)) + }) + return _c +} + +func (_c *Router_Get_Call) Return() *Router_Get_Call { + _c.Call.Return() + return _c +} + +func (_c *Router_Get_Call) RunAndReturn(run func(string, http.HandlerFunc)) *Router_Get_Call { + _c.Call.Return(run) + return _c +} + // Group provides a mock function with given fields: handler func (_m *Router) Group(handler route.GroupFunc) { _m.Called(handler) } +// Router_Group_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Group' +type Router_Group_Call struct { + *mock.Call +} + +// Group is a helper method to define mock.On call +// - handler route.GroupFunc +func (_e *Router_Expecter) Group(handler interface{}) *Router_Group_Call { + return &Router_Group_Call{Call: _e.mock.On("Group", handler)} +} + +func (_c *Router_Group_Call) Run(run func(handler route.GroupFunc)) *Router_Group_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(route.GroupFunc)) + }) + return _c +} + +func (_c *Router_Group_Call) Return() *Router_Group_Call { + _c.Call.Return() + return _c +} + +func (_c *Router_Group_Call) RunAndReturn(run func(route.GroupFunc)) *Router_Group_Call { + _c.Call.Return(run) + return _c +} + // Middleware provides a mock function with given fields: middlewares func (_m *Router) Middleware(middlewares ...http.Middleware) route.Router { _va := make([]interface{}, len(middlewares)) @@ -46,6 +169,10 @@ func (_m *Router) Middleware(middlewares ...http.Middleware) route.Router { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Middleware") + } + var r0 route.Router if rf, ok := ret.Get(0).(func(...http.Middleware) route.Router); ok { r0 = rf(middlewares...) @@ -58,25 +185,151 @@ func (_m *Router) Middleware(middlewares ...http.Middleware) route.Router { return r0 } +// Router_Middleware_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Middleware' +type Router_Middleware_Call struct { + *mock.Call +} + +// Middleware is a helper method to define mock.On call +// - middlewares ...http.Middleware +func (_e *Router_Expecter) Middleware(middlewares ...interface{}) *Router_Middleware_Call { + return &Router_Middleware_Call{Call: _e.mock.On("Middleware", + append([]interface{}{}, middlewares...)...)} +} + +func (_c *Router_Middleware_Call) Run(run func(middlewares ...http.Middleware)) *Router_Middleware_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]http.Middleware, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(http.Middleware) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Router_Middleware_Call) Return(_a0 route.Router) *Router_Middleware_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Router_Middleware_Call) RunAndReturn(run func(...http.Middleware) route.Router) *Router_Middleware_Call { + _c.Call.Return(run) + return _c +} + // Options provides a mock function with given fields: relativePath, handler func (_m *Router) Options(relativePath string, handler http.HandlerFunc) { _m.Called(relativePath, handler) } +// Router_Options_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Options' +type Router_Options_Call struct { + *mock.Call +} + +// Options is a helper method to define mock.On call +// - relativePath string +// - handler http.HandlerFunc +func (_e *Router_Expecter) Options(relativePath interface{}, handler interface{}) *Router_Options_Call { + return &Router_Options_Call{Call: _e.mock.On("Options", relativePath, handler)} +} + +func (_c *Router_Options_Call) Run(run func(relativePath string, handler http.HandlerFunc)) *Router_Options_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(http.HandlerFunc)) + }) + return _c +} + +func (_c *Router_Options_Call) Return() *Router_Options_Call { + _c.Call.Return() + return _c +} + +func (_c *Router_Options_Call) RunAndReturn(run func(string, http.HandlerFunc)) *Router_Options_Call { + _c.Call.Return(run) + return _c +} + // Patch provides a mock function with given fields: relativePath, handler func (_m *Router) Patch(relativePath string, handler http.HandlerFunc) { _m.Called(relativePath, handler) } +// Router_Patch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Patch' +type Router_Patch_Call struct { + *mock.Call +} + +// Patch is a helper method to define mock.On call +// - relativePath string +// - handler http.HandlerFunc +func (_e *Router_Expecter) Patch(relativePath interface{}, handler interface{}) *Router_Patch_Call { + return &Router_Patch_Call{Call: _e.mock.On("Patch", relativePath, handler)} +} + +func (_c *Router_Patch_Call) Run(run func(relativePath string, handler http.HandlerFunc)) *Router_Patch_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(http.HandlerFunc)) + }) + return _c +} + +func (_c *Router_Patch_Call) Return() *Router_Patch_Call { + _c.Call.Return() + return _c +} + +func (_c *Router_Patch_Call) RunAndReturn(run func(string, http.HandlerFunc)) *Router_Patch_Call { + _c.Call.Return(run) + return _c +} + // Post provides a mock function with given fields: relativePath, handler func (_m *Router) Post(relativePath string, handler http.HandlerFunc) { _m.Called(relativePath, handler) } +// Router_Post_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Post' +type Router_Post_Call struct { + *mock.Call +} + +// Post is a helper method to define mock.On call +// - relativePath string +// - handler http.HandlerFunc +func (_e *Router_Expecter) Post(relativePath interface{}, handler interface{}) *Router_Post_Call { + return &Router_Post_Call{Call: _e.mock.On("Post", relativePath, handler)} +} + +func (_c *Router_Post_Call) Run(run func(relativePath string, handler http.HandlerFunc)) *Router_Post_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(http.HandlerFunc)) + }) + return _c +} + +func (_c *Router_Post_Call) Return() *Router_Post_Call { + _c.Call.Return() + return _c +} + +func (_c *Router_Post_Call) RunAndReturn(run func(string, http.HandlerFunc)) *Router_Post_Call { + _c.Call.Return(run) + return _c +} + // Prefix provides a mock function with given fields: addr func (_m *Router) Prefix(addr string) route.Router { ret := _m.Called(addr) + if len(ret) == 0 { + panic("no return value specified for Prefix") + } + var r0 route.Router if rf, ok := ret.Get(0).(func(string) route.Router); ok { r0 = rf(addr) @@ -89,31 +342,204 @@ func (_m *Router) Prefix(addr string) route.Router { return r0 } +// Router_Prefix_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Prefix' +type Router_Prefix_Call struct { + *mock.Call +} + +// Prefix is a helper method to define mock.On call +// - addr string +func (_e *Router_Expecter) Prefix(addr interface{}) *Router_Prefix_Call { + return &Router_Prefix_Call{Call: _e.mock.On("Prefix", addr)} +} + +func (_c *Router_Prefix_Call) Run(run func(addr string)) *Router_Prefix_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Router_Prefix_Call) Return(_a0 route.Router) *Router_Prefix_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Router_Prefix_Call) RunAndReturn(run func(string) route.Router) *Router_Prefix_Call { + _c.Call.Return(run) + return _c +} + // Put provides a mock function with given fields: relativePath, handler func (_m *Router) Put(relativePath string, handler http.HandlerFunc) { _m.Called(relativePath, handler) } +// Router_Put_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Put' +type Router_Put_Call struct { + *mock.Call +} + +// Put is a helper method to define mock.On call +// - relativePath string +// - handler http.HandlerFunc +func (_e *Router_Expecter) Put(relativePath interface{}, handler interface{}) *Router_Put_Call { + return &Router_Put_Call{Call: _e.mock.On("Put", relativePath, handler)} +} + +func (_c *Router_Put_Call) Run(run func(relativePath string, handler http.HandlerFunc)) *Router_Put_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(http.HandlerFunc)) + }) + return _c +} + +func (_c *Router_Put_Call) Return() *Router_Put_Call { + _c.Call.Return() + return _c +} + +func (_c *Router_Put_Call) RunAndReturn(run func(string, http.HandlerFunc)) *Router_Put_Call { + _c.Call.Return(run) + return _c +} + // Resource provides a mock function with given fields: relativePath, controller func (_m *Router) Resource(relativePath string, controller http.ResourceController) { _m.Called(relativePath, controller) } +// Router_Resource_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Resource' +type Router_Resource_Call struct { + *mock.Call +} + +// Resource is a helper method to define mock.On call +// - relativePath string +// - controller http.ResourceController +func (_e *Router_Expecter) Resource(relativePath interface{}, controller interface{}) *Router_Resource_Call { + return &Router_Resource_Call{Call: _e.mock.On("Resource", relativePath, controller)} +} + +func (_c *Router_Resource_Call) Run(run func(relativePath string, controller http.ResourceController)) *Router_Resource_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(http.ResourceController)) + }) + return _c +} + +func (_c *Router_Resource_Call) Return() *Router_Resource_Call { + _c.Call.Return() + return _c +} + +func (_c *Router_Resource_Call) RunAndReturn(run func(string, http.ResourceController)) *Router_Resource_Call { + _c.Call.Return(run) + return _c +} + // Static provides a mock function with given fields: relativePath, root func (_m *Router) Static(relativePath string, root string) { _m.Called(relativePath, root) } +// Router_Static_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Static' +type Router_Static_Call struct { + *mock.Call +} + +// Static is a helper method to define mock.On call +// - relativePath string +// - root string +func (_e *Router_Expecter) Static(relativePath interface{}, root interface{}) *Router_Static_Call { + return &Router_Static_Call{Call: _e.mock.On("Static", relativePath, root)} +} + +func (_c *Router_Static_Call) Run(run func(relativePath string, root string)) *Router_Static_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Router_Static_Call) Return() *Router_Static_Call { + _c.Call.Return() + return _c +} + +func (_c *Router_Static_Call) RunAndReturn(run func(string, string)) *Router_Static_Call { + _c.Call.Return(run) + return _c +} + // StaticFS provides a mock function with given fields: relativePath, fs func (_m *Router) StaticFS(relativePath string, fs nethttp.FileSystem) { _m.Called(relativePath, fs) } +// Router_StaticFS_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StaticFS' +type Router_StaticFS_Call struct { + *mock.Call +} + +// StaticFS is a helper method to define mock.On call +// - relativePath string +// - fs nethttp.FileSystem +func (_e *Router_Expecter) StaticFS(relativePath interface{}, fs interface{}) *Router_StaticFS_Call { + return &Router_StaticFS_Call{Call: _e.mock.On("StaticFS", relativePath, fs)} +} + +func (_c *Router_StaticFS_Call) Run(run func(relativePath string, fs nethttp.FileSystem)) *Router_StaticFS_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(nethttp.FileSystem)) + }) + return _c +} + +func (_c *Router_StaticFS_Call) Return() *Router_StaticFS_Call { + _c.Call.Return() + return _c +} + +func (_c *Router_StaticFS_Call) RunAndReturn(run func(string, nethttp.FileSystem)) *Router_StaticFS_Call { + _c.Call.Return(run) + return _c +} + // StaticFile provides a mock function with given fields: relativePath, filepath func (_m *Router) StaticFile(relativePath string, filepath string) { _m.Called(relativePath, filepath) } +// Router_StaticFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StaticFile' +type Router_StaticFile_Call struct { + *mock.Call +} + +// StaticFile is a helper method to define mock.On call +// - relativePath string +// - filepath string +func (_e *Router_Expecter) StaticFile(relativePath interface{}, filepath interface{}) *Router_StaticFile_Call { + return &Router_StaticFile_Call{Call: _e.mock.On("StaticFile", relativePath, filepath)} +} + +func (_c *Router_StaticFile_Call) Run(run func(relativePath string, filepath string)) *Router_StaticFile_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Router_StaticFile_Call) Return() *Router_StaticFile_Call { + _c.Call.Return() + return _c +} + +func (_c *Router_StaticFile_Call) RunAndReturn(run func(string, string)) *Router_StaticFile_Call { + _c.Call.Return(run) + return _c +} + // NewRouter creates a new instance of Router. 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 NewRouter(t interface { diff --git a/mocks/schedule/Event.go b/mocks/schedule/Event.go index 88793dcbd..94cf5cef6 100644 --- a/mocks/schedule/Event.go +++ b/mocks/schedule/Event.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,10 +12,22 @@ type Event struct { mock.Mock } +type Event_Expecter struct { + mock *mock.Mock +} + +func (_m *Event) EXPECT() *Event_Expecter { + return &Event_Expecter{mock: &_m.Mock} +} + // At provides a mock function with given fields: time func (_m *Event) At(time string) schedule.Event { ret := _m.Called(time) + if len(ret) == 0 { + panic("no return value specified for At") + } + var r0 schedule.Event if rf, ok := ret.Get(0).(func(string) schedule.Event); ok { r0 = rf(time) @@ -28,10 +40,42 @@ func (_m *Event) At(time string) schedule.Event { return r0 } +// Event_At_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'At' +type Event_At_Call struct { + *mock.Call +} + +// At is a helper method to define mock.On call +// - time string +func (_e *Event_Expecter) At(time interface{}) *Event_At_Call { + return &Event_At_Call{Call: _e.mock.On("At", time)} +} + +func (_c *Event_At_Call) Run(run func(time string)) *Event_At_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Event_At_Call) Return(_a0 schedule.Event) *Event_At_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_At_Call) RunAndReturn(run func(string) schedule.Event) *Event_At_Call { + _c.Call.Return(run) + return _c +} + // Cron provides a mock function with given fields: expression func (_m *Event) Cron(expression string) schedule.Event { ret := _m.Called(expression) + if len(ret) == 0 { + panic("no return value specified for Cron") + } + var r0 schedule.Event if rf, ok := ret.Get(0).(func(string) schedule.Event); ok { r0 = rf(expression) @@ -44,10 +88,42 @@ func (_m *Event) Cron(expression string) schedule.Event { return r0 } +// Event_Cron_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Cron' +type Event_Cron_Call struct { + *mock.Call +} + +// Cron is a helper method to define mock.On call +// - expression string +func (_e *Event_Expecter) Cron(expression interface{}) *Event_Cron_Call { + return &Event_Cron_Call{Call: _e.mock.On("Cron", expression)} +} + +func (_c *Event_Cron_Call) Run(run func(expression string)) *Event_Cron_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Event_Cron_Call) Return(_a0 schedule.Event) *Event_Cron_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_Cron_Call) RunAndReturn(run func(string) schedule.Event) *Event_Cron_Call { + _c.Call.Return(run) + return _c +} + // Daily provides a mock function with given fields: func (_m *Event) Daily() schedule.Event { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Daily") + } + var r0 schedule.Event if rf, ok := ret.Get(0).(func() schedule.Event); ok { r0 = rf() @@ -60,10 +136,41 @@ func (_m *Event) Daily() schedule.Event { return r0 } +// Event_Daily_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Daily' +type Event_Daily_Call struct { + *mock.Call +} + +// Daily is a helper method to define mock.On call +func (_e *Event_Expecter) Daily() *Event_Daily_Call { + return &Event_Daily_Call{Call: _e.mock.On("Daily")} +} + +func (_c *Event_Daily_Call) Run(run func()) *Event_Daily_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Event_Daily_Call) Return(_a0 schedule.Event) *Event_Daily_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_Daily_Call) RunAndReturn(run func() schedule.Event) *Event_Daily_Call { + _c.Call.Return(run) + return _c +} + // DailyAt provides a mock function with given fields: time func (_m *Event) DailyAt(time string) schedule.Event { ret := _m.Called(time) + if len(ret) == 0 { + panic("no return value specified for DailyAt") + } + var r0 schedule.Event if rf, ok := ret.Get(0).(func(string) schedule.Event); ok { r0 = rf(time) @@ -76,10 +183,42 @@ func (_m *Event) DailyAt(time string) schedule.Event { return r0 } +// Event_DailyAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DailyAt' +type Event_DailyAt_Call struct { + *mock.Call +} + +// DailyAt is a helper method to define mock.On call +// - time string +func (_e *Event_Expecter) DailyAt(time interface{}) *Event_DailyAt_Call { + return &Event_DailyAt_Call{Call: _e.mock.On("DailyAt", time)} +} + +func (_c *Event_DailyAt_Call) Run(run func(time string)) *Event_DailyAt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Event_DailyAt_Call) Return(_a0 schedule.Event) *Event_DailyAt_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_DailyAt_Call) RunAndReturn(run func(string) schedule.Event) *Event_DailyAt_Call { + _c.Call.Return(run) + return _c +} + // DelayIfStillRunning provides a mock function with given fields: func (_m *Event) DelayIfStillRunning() schedule.Event { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for DelayIfStillRunning") + } + var r0 schedule.Event if rf, ok := ret.Get(0).(func() schedule.Event); ok { r0 = rf() @@ -92,10 +231,41 @@ func (_m *Event) DelayIfStillRunning() schedule.Event { return r0 } +// Event_DelayIfStillRunning_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DelayIfStillRunning' +type Event_DelayIfStillRunning_Call struct { + *mock.Call +} + +// DelayIfStillRunning is a helper method to define mock.On call +func (_e *Event_Expecter) DelayIfStillRunning() *Event_DelayIfStillRunning_Call { + return &Event_DelayIfStillRunning_Call{Call: _e.mock.On("DelayIfStillRunning")} +} + +func (_c *Event_DelayIfStillRunning_Call) Run(run func()) *Event_DelayIfStillRunning_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Event_DelayIfStillRunning_Call) Return(_a0 schedule.Event) *Event_DelayIfStillRunning_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_DelayIfStillRunning_Call) RunAndReturn(run func() schedule.Event) *Event_DelayIfStillRunning_Call { + _c.Call.Return(run) + return _c +} + // EveryFifteenMinutes provides a mock function with given fields: func (_m *Event) EveryFifteenMinutes() schedule.Event { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for EveryFifteenMinutes") + } + var r0 schedule.Event if rf, ok := ret.Get(0).(func() schedule.Event); ok { r0 = rf() @@ -108,10 +278,41 @@ func (_m *Event) EveryFifteenMinutes() schedule.Event { return r0 } +// Event_EveryFifteenMinutes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EveryFifteenMinutes' +type Event_EveryFifteenMinutes_Call struct { + *mock.Call +} + +// EveryFifteenMinutes is a helper method to define mock.On call +func (_e *Event_Expecter) EveryFifteenMinutes() *Event_EveryFifteenMinutes_Call { + return &Event_EveryFifteenMinutes_Call{Call: _e.mock.On("EveryFifteenMinutes")} +} + +func (_c *Event_EveryFifteenMinutes_Call) Run(run func()) *Event_EveryFifteenMinutes_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Event_EveryFifteenMinutes_Call) Return(_a0 schedule.Event) *Event_EveryFifteenMinutes_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_EveryFifteenMinutes_Call) RunAndReturn(run func() schedule.Event) *Event_EveryFifteenMinutes_Call { + _c.Call.Return(run) + return _c +} + // EveryFiveMinutes provides a mock function with given fields: func (_m *Event) EveryFiveMinutes() schedule.Event { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for EveryFiveMinutes") + } + var r0 schedule.Event if rf, ok := ret.Get(0).(func() schedule.Event); ok { r0 = rf() @@ -124,10 +325,41 @@ func (_m *Event) EveryFiveMinutes() schedule.Event { return r0 } +// Event_EveryFiveMinutes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EveryFiveMinutes' +type Event_EveryFiveMinutes_Call struct { + *mock.Call +} + +// EveryFiveMinutes is a helper method to define mock.On call +func (_e *Event_Expecter) EveryFiveMinutes() *Event_EveryFiveMinutes_Call { + return &Event_EveryFiveMinutes_Call{Call: _e.mock.On("EveryFiveMinutes")} +} + +func (_c *Event_EveryFiveMinutes_Call) Run(run func()) *Event_EveryFiveMinutes_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Event_EveryFiveMinutes_Call) Return(_a0 schedule.Event) *Event_EveryFiveMinutes_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_EveryFiveMinutes_Call) RunAndReturn(run func() schedule.Event) *Event_EveryFiveMinutes_Call { + _c.Call.Return(run) + return _c +} + // EveryFourHours provides a mock function with given fields: func (_m *Event) EveryFourHours() schedule.Event { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for EveryFourHours") + } + var r0 schedule.Event if rf, ok := ret.Get(0).(func() schedule.Event); ok { r0 = rf() @@ -140,10 +372,41 @@ func (_m *Event) EveryFourHours() schedule.Event { return r0 } +// Event_EveryFourHours_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EveryFourHours' +type Event_EveryFourHours_Call struct { + *mock.Call +} + +// EveryFourHours is a helper method to define mock.On call +func (_e *Event_Expecter) EveryFourHours() *Event_EveryFourHours_Call { + return &Event_EveryFourHours_Call{Call: _e.mock.On("EveryFourHours")} +} + +func (_c *Event_EveryFourHours_Call) Run(run func()) *Event_EveryFourHours_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Event_EveryFourHours_Call) Return(_a0 schedule.Event) *Event_EveryFourHours_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_EveryFourHours_Call) RunAndReturn(run func() schedule.Event) *Event_EveryFourHours_Call { + _c.Call.Return(run) + return _c +} + // EveryFourMinutes provides a mock function with given fields: func (_m *Event) EveryFourMinutes() schedule.Event { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for EveryFourMinutes") + } + var r0 schedule.Event if rf, ok := ret.Get(0).(func() schedule.Event); ok { r0 = rf() @@ -156,10 +419,41 @@ func (_m *Event) EveryFourMinutes() schedule.Event { return r0 } +// Event_EveryFourMinutes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EveryFourMinutes' +type Event_EveryFourMinutes_Call struct { + *mock.Call +} + +// EveryFourMinutes is a helper method to define mock.On call +func (_e *Event_Expecter) EveryFourMinutes() *Event_EveryFourMinutes_Call { + return &Event_EveryFourMinutes_Call{Call: _e.mock.On("EveryFourMinutes")} +} + +func (_c *Event_EveryFourMinutes_Call) Run(run func()) *Event_EveryFourMinutes_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Event_EveryFourMinutes_Call) Return(_a0 schedule.Event) *Event_EveryFourMinutes_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_EveryFourMinutes_Call) RunAndReturn(run func() schedule.Event) *Event_EveryFourMinutes_Call { + _c.Call.Return(run) + return _c +} + // EveryMinute provides a mock function with given fields: func (_m *Event) EveryMinute() schedule.Event { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for EveryMinute") + } + var r0 schedule.Event if rf, ok := ret.Get(0).(func() schedule.Event); ok { r0 = rf() @@ -172,10 +466,41 @@ func (_m *Event) EveryMinute() schedule.Event { return r0 } +// Event_EveryMinute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EveryMinute' +type Event_EveryMinute_Call struct { + *mock.Call +} + +// EveryMinute is a helper method to define mock.On call +func (_e *Event_Expecter) EveryMinute() *Event_EveryMinute_Call { + return &Event_EveryMinute_Call{Call: _e.mock.On("EveryMinute")} +} + +func (_c *Event_EveryMinute_Call) Run(run func()) *Event_EveryMinute_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Event_EveryMinute_Call) Return(_a0 schedule.Event) *Event_EveryMinute_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_EveryMinute_Call) RunAndReturn(run func() schedule.Event) *Event_EveryMinute_Call { + _c.Call.Return(run) + return _c +} + // EverySixHours provides a mock function with given fields: func (_m *Event) EverySixHours() schedule.Event { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for EverySixHours") + } + var r0 schedule.Event if rf, ok := ret.Get(0).(func() schedule.Event); ok { r0 = rf() @@ -188,10 +513,41 @@ func (_m *Event) EverySixHours() schedule.Event { return r0 } +// Event_EverySixHours_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EverySixHours' +type Event_EverySixHours_Call struct { + *mock.Call +} + +// EverySixHours is a helper method to define mock.On call +func (_e *Event_Expecter) EverySixHours() *Event_EverySixHours_Call { + return &Event_EverySixHours_Call{Call: _e.mock.On("EverySixHours")} +} + +func (_c *Event_EverySixHours_Call) Run(run func()) *Event_EverySixHours_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Event_EverySixHours_Call) Return(_a0 schedule.Event) *Event_EverySixHours_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_EverySixHours_Call) RunAndReturn(run func() schedule.Event) *Event_EverySixHours_Call { + _c.Call.Return(run) + return _c +} + // EveryTenMinutes provides a mock function with given fields: func (_m *Event) EveryTenMinutes() schedule.Event { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for EveryTenMinutes") + } + var r0 schedule.Event if rf, ok := ret.Get(0).(func() schedule.Event); ok { r0 = rf() @@ -204,10 +560,41 @@ func (_m *Event) EveryTenMinutes() schedule.Event { return r0 } +// Event_EveryTenMinutes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EveryTenMinutes' +type Event_EveryTenMinutes_Call struct { + *mock.Call +} + +// EveryTenMinutes is a helper method to define mock.On call +func (_e *Event_Expecter) EveryTenMinutes() *Event_EveryTenMinutes_Call { + return &Event_EveryTenMinutes_Call{Call: _e.mock.On("EveryTenMinutes")} +} + +func (_c *Event_EveryTenMinutes_Call) Run(run func()) *Event_EveryTenMinutes_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Event_EveryTenMinutes_Call) Return(_a0 schedule.Event) *Event_EveryTenMinutes_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_EveryTenMinutes_Call) RunAndReturn(run func() schedule.Event) *Event_EveryTenMinutes_Call { + _c.Call.Return(run) + return _c +} + // EveryThirtyMinutes provides a mock function with given fields: func (_m *Event) EveryThirtyMinutes() schedule.Event { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for EveryThirtyMinutes") + } + var r0 schedule.Event if rf, ok := ret.Get(0).(func() schedule.Event); ok { r0 = rf() @@ -220,10 +607,41 @@ func (_m *Event) EveryThirtyMinutes() schedule.Event { return r0 } +// Event_EveryThirtyMinutes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EveryThirtyMinutes' +type Event_EveryThirtyMinutes_Call struct { + *mock.Call +} + +// EveryThirtyMinutes is a helper method to define mock.On call +func (_e *Event_Expecter) EveryThirtyMinutes() *Event_EveryThirtyMinutes_Call { + return &Event_EveryThirtyMinutes_Call{Call: _e.mock.On("EveryThirtyMinutes")} +} + +func (_c *Event_EveryThirtyMinutes_Call) Run(run func()) *Event_EveryThirtyMinutes_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Event_EveryThirtyMinutes_Call) Return(_a0 schedule.Event) *Event_EveryThirtyMinutes_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_EveryThirtyMinutes_Call) RunAndReturn(run func() schedule.Event) *Event_EveryThirtyMinutes_Call { + _c.Call.Return(run) + return _c +} + // EveryThreeHours provides a mock function with given fields: func (_m *Event) EveryThreeHours() schedule.Event { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for EveryThreeHours") + } + var r0 schedule.Event if rf, ok := ret.Get(0).(func() schedule.Event); ok { r0 = rf() @@ -236,10 +654,41 @@ func (_m *Event) EveryThreeHours() schedule.Event { return r0 } +// Event_EveryThreeHours_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EveryThreeHours' +type Event_EveryThreeHours_Call struct { + *mock.Call +} + +// EveryThreeHours is a helper method to define mock.On call +func (_e *Event_Expecter) EveryThreeHours() *Event_EveryThreeHours_Call { + return &Event_EveryThreeHours_Call{Call: _e.mock.On("EveryThreeHours")} +} + +func (_c *Event_EveryThreeHours_Call) Run(run func()) *Event_EveryThreeHours_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Event_EveryThreeHours_Call) Return(_a0 schedule.Event) *Event_EveryThreeHours_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_EveryThreeHours_Call) RunAndReturn(run func() schedule.Event) *Event_EveryThreeHours_Call { + _c.Call.Return(run) + return _c +} + // EveryThreeMinutes provides a mock function with given fields: func (_m *Event) EveryThreeMinutes() schedule.Event { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for EveryThreeMinutes") + } + var r0 schedule.Event if rf, ok := ret.Get(0).(func() schedule.Event); ok { r0 = rf() @@ -252,10 +701,41 @@ func (_m *Event) EveryThreeMinutes() schedule.Event { return r0 } +// Event_EveryThreeMinutes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EveryThreeMinutes' +type Event_EveryThreeMinutes_Call struct { + *mock.Call +} + +// EveryThreeMinutes is a helper method to define mock.On call +func (_e *Event_Expecter) EveryThreeMinutes() *Event_EveryThreeMinutes_Call { + return &Event_EveryThreeMinutes_Call{Call: _e.mock.On("EveryThreeMinutes")} +} + +func (_c *Event_EveryThreeMinutes_Call) Run(run func()) *Event_EveryThreeMinutes_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Event_EveryThreeMinutes_Call) Return(_a0 schedule.Event) *Event_EveryThreeMinutes_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_EveryThreeMinutes_Call) RunAndReturn(run func() schedule.Event) *Event_EveryThreeMinutes_Call { + _c.Call.Return(run) + return _c +} + // EveryTwoHours provides a mock function with given fields: func (_m *Event) EveryTwoHours() schedule.Event { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for EveryTwoHours") + } + var r0 schedule.Event if rf, ok := ret.Get(0).(func() schedule.Event); ok { r0 = rf() @@ -268,10 +748,41 @@ func (_m *Event) EveryTwoHours() schedule.Event { return r0 } +// Event_EveryTwoHours_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EveryTwoHours' +type Event_EveryTwoHours_Call struct { + *mock.Call +} + +// EveryTwoHours is a helper method to define mock.On call +func (_e *Event_Expecter) EveryTwoHours() *Event_EveryTwoHours_Call { + return &Event_EveryTwoHours_Call{Call: _e.mock.On("EveryTwoHours")} +} + +func (_c *Event_EveryTwoHours_Call) Run(run func()) *Event_EveryTwoHours_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Event_EveryTwoHours_Call) Return(_a0 schedule.Event) *Event_EveryTwoHours_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_EveryTwoHours_Call) RunAndReturn(run func() schedule.Event) *Event_EveryTwoHours_Call { + _c.Call.Return(run) + return _c +} + // EveryTwoMinutes provides a mock function with given fields: func (_m *Event) EveryTwoMinutes() schedule.Event { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for EveryTwoMinutes") + } + var r0 schedule.Event if rf, ok := ret.Get(0).(func() schedule.Event); ok { r0 = rf() @@ -284,10 +795,41 @@ func (_m *Event) EveryTwoMinutes() schedule.Event { return r0 } +// Event_EveryTwoMinutes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EveryTwoMinutes' +type Event_EveryTwoMinutes_Call struct { + *mock.Call +} + +// EveryTwoMinutes is a helper method to define mock.On call +func (_e *Event_Expecter) EveryTwoMinutes() *Event_EveryTwoMinutes_Call { + return &Event_EveryTwoMinutes_Call{Call: _e.mock.On("EveryTwoMinutes")} +} + +func (_c *Event_EveryTwoMinutes_Call) Run(run func()) *Event_EveryTwoMinutes_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Event_EveryTwoMinutes_Call) Return(_a0 schedule.Event) *Event_EveryTwoMinutes_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_EveryTwoMinutes_Call) RunAndReturn(run func() schedule.Event) *Event_EveryTwoMinutes_Call { + _c.Call.Return(run) + return _c +} + // GetCallback provides a mock function with given fields: func (_m *Event) GetCallback() func() { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for GetCallback") + } + var r0 func() if rf, ok := ret.Get(0).(func() func()); ok { r0 = rf() @@ -300,10 +842,41 @@ func (_m *Event) GetCallback() func() { return r0 } +// Event_GetCallback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCallback' +type Event_GetCallback_Call struct { + *mock.Call +} + +// GetCallback is a helper method to define mock.On call +func (_e *Event_Expecter) GetCallback() *Event_GetCallback_Call { + return &Event_GetCallback_Call{Call: _e.mock.On("GetCallback")} +} + +func (_c *Event_GetCallback_Call) Run(run func()) *Event_GetCallback_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Event_GetCallback_Call) Return(_a0 func()) *Event_GetCallback_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_GetCallback_Call) RunAndReturn(run func() func()) *Event_GetCallback_Call { + _c.Call.Return(run) + return _c +} + // GetCommand provides a mock function with given fields: func (_m *Event) GetCommand() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for GetCommand") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -314,10 +887,41 @@ func (_m *Event) GetCommand() string { return r0 } +// Event_GetCommand_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCommand' +type Event_GetCommand_Call struct { + *mock.Call +} + +// GetCommand is a helper method to define mock.On call +func (_e *Event_Expecter) GetCommand() *Event_GetCommand_Call { + return &Event_GetCommand_Call{Call: _e.mock.On("GetCommand")} +} + +func (_c *Event_GetCommand_Call) Run(run func()) *Event_GetCommand_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Event_GetCommand_Call) Return(_a0 string) *Event_GetCommand_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_GetCommand_Call) RunAndReturn(run func() string) *Event_GetCommand_Call { + _c.Call.Return(run) + return _c +} + // GetCron provides a mock function with given fields: func (_m *Event) GetCron() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for GetCron") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -328,10 +932,41 @@ func (_m *Event) GetCron() string { return r0 } +// Event_GetCron_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCron' +type Event_GetCron_Call struct { + *mock.Call +} + +// GetCron is a helper method to define mock.On call +func (_e *Event_Expecter) GetCron() *Event_GetCron_Call { + return &Event_GetCron_Call{Call: _e.mock.On("GetCron")} +} + +func (_c *Event_GetCron_Call) Run(run func()) *Event_GetCron_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Event_GetCron_Call) Return(_a0 string) *Event_GetCron_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_GetCron_Call) RunAndReturn(run func() string) *Event_GetCron_Call { + _c.Call.Return(run) + return _c +} + // GetDelayIfStillRunning provides a mock function with given fields: func (_m *Event) GetDelayIfStillRunning() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for GetDelayIfStillRunning") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -342,10 +977,41 @@ func (_m *Event) GetDelayIfStillRunning() bool { return r0 } +// Event_GetDelayIfStillRunning_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDelayIfStillRunning' +type Event_GetDelayIfStillRunning_Call struct { + *mock.Call +} + +// GetDelayIfStillRunning is a helper method to define mock.On call +func (_e *Event_Expecter) GetDelayIfStillRunning() *Event_GetDelayIfStillRunning_Call { + return &Event_GetDelayIfStillRunning_Call{Call: _e.mock.On("GetDelayIfStillRunning")} +} + +func (_c *Event_GetDelayIfStillRunning_Call) Run(run func()) *Event_GetDelayIfStillRunning_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Event_GetDelayIfStillRunning_Call) Return(_a0 bool) *Event_GetDelayIfStillRunning_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_GetDelayIfStillRunning_Call) RunAndReturn(run func() bool) *Event_GetDelayIfStillRunning_Call { + _c.Call.Return(run) + return _c +} + // GetName provides a mock function with given fields: func (_m *Event) GetName() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for GetName") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -356,10 +1022,41 @@ func (_m *Event) GetName() string { return r0 } +// Event_GetName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetName' +type Event_GetName_Call struct { + *mock.Call +} + +// GetName is a helper method to define mock.On call +func (_e *Event_Expecter) GetName() *Event_GetName_Call { + return &Event_GetName_Call{Call: _e.mock.On("GetName")} +} + +func (_c *Event_GetName_Call) Run(run func()) *Event_GetName_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Event_GetName_Call) Return(_a0 string) *Event_GetName_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_GetName_Call) RunAndReturn(run func() string) *Event_GetName_Call { + _c.Call.Return(run) + return _c +} + // GetSkipIfStillRunning provides a mock function with given fields: func (_m *Event) GetSkipIfStillRunning() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for GetSkipIfStillRunning") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -370,10 +1067,41 @@ func (_m *Event) GetSkipIfStillRunning() bool { return r0 } +// Event_GetSkipIfStillRunning_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSkipIfStillRunning' +type Event_GetSkipIfStillRunning_Call struct { + *mock.Call +} + +// GetSkipIfStillRunning is a helper method to define mock.On call +func (_e *Event_Expecter) GetSkipIfStillRunning() *Event_GetSkipIfStillRunning_Call { + return &Event_GetSkipIfStillRunning_Call{Call: _e.mock.On("GetSkipIfStillRunning")} +} + +func (_c *Event_GetSkipIfStillRunning_Call) Run(run func()) *Event_GetSkipIfStillRunning_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Event_GetSkipIfStillRunning_Call) Return(_a0 bool) *Event_GetSkipIfStillRunning_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_GetSkipIfStillRunning_Call) RunAndReturn(run func() bool) *Event_GetSkipIfStillRunning_Call { + _c.Call.Return(run) + return _c +} + // Hourly provides a mock function with given fields: func (_m *Event) Hourly() schedule.Event { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Hourly") + } + var r0 schedule.Event if rf, ok := ret.Get(0).(func() schedule.Event); ok { r0 = rf() @@ -386,10 +1114,41 @@ func (_m *Event) Hourly() schedule.Event { return r0 } +// Event_Hourly_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Hourly' +type Event_Hourly_Call struct { + *mock.Call +} + +// Hourly is a helper method to define mock.On call +func (_e *Event_Expecter) Hourly() *Event_Hourly_Call { + return &Event_Hourly_Call{Call: _e.mock.On("Hourly")} +} + +func (_c *Event_Hourly_Call) Run(run func()) *Event_Hourly_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Event_Hourly_Call) Return(_a0 schedule.Event) *Event_Hourly_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_Hourly_Call) RunAndReturn(run func() schedule.Event) *Event_Hourly_Call { + _c.Call.Return(run) + return _c +} + // HourlyAt provides a mock function with given fields: offset func (_m *Event) HourlyAt(offset []string) schedule.Event { ret := _m.Called(offset) + if len(ret) == 0 { + panic("no return value specified for HourlyAt") + } + var r0 schedule.Event if rf, ok := ret.Get(0).(func([]string) schedule.Event); ok { r0 = rf(offset) @@ -402,10 +1161,42 @@ func (_m *Event) HourlyAt(offset []string) schedule.Event { return r0 } +// Event_HourlyAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HourlyAt' +type Event_HourlyAt_Call struct { + *mock.Call +} + +// HourlyAt is a helper method to define mock.On call +// - offset []string +func (_e *Event_Expecter) HourlyAt(offset interface{}) *Event_HourlyAt_Call { + return &Event_HourlyAt_Call{Call: _e.mock.On("HourlyAt", offset)} +} + +func (_c *Event_HourlyAt_Call) Run(run func(offset []string)) *Event_HourlyAt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]string)) + }) + return _c +} + +func (_c *Event_HourlyAt_Call) Return(_a0 schedule.Event) *Event_HourlyAt_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_HourlyAt_Call) RunAndReturn(run func([]string) schedule.Event) *Event_HourlyAt_Call { + _c.Call.Return(run) + return _c +} + // IsOnOneServer provides a mock function with given fields: func (_m *Event) IsOnOneServer() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for IsOnOneServer") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -416,10 +1207,41 @@ func (_m *Event) IsOnOneServer() bool { return r0 } +// Event_IsOnOneServer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsOnOneServer' +type Event_IsOnOneServer_Call struct { + *mock.Call +} + +// IsOnOneServer is a helper method to define mock.On call +func (_e *Event_Expecter) IsOnOneServer() *Event_IsOnOneServer_Call { + return &Event_IsOnOneServer_Call{Call: _e.mock.On("IsOnOneServer")} +} + +func (_c *Event_IsOnOneServer_Call) Run(run func()) *Event_IsOnOneServer_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Event_IsOnOneServer_Call) Return(_a0 bool) *Event_IsOnOneServer_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_IsOnOneServer_Call) RunAndReturn(run func() bool) *Event_IsOnOneServer_Call { + _c.Call.Return(run) + return _c +} + // Name provides a mock function with given fields: name func (_m *Event) Name(name string) schedule.Event { ret := _m.Called(name) + if len(ret) == 0 { + panic("no return value specified for Name") + } + var r0 schedule.Event if rf, ok := ret.Get(0).(func(string) schedule.Event); ok { r0 = rf(name) @@ -432,10 +1254,42 @@ func (_m *Event) Name(name string) schedule.Event { return r0 } +// Event_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type Event_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +// - name string +func (_e *Event_Expecter) Name(name interface{}) *Event_Name_Call { + return &Event_Name_Call{Call: _e.mock.On("Name", name)} +} + +func (_c *Event_Name_Call) Run(run func(name string)) *Event_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Event_Name_Call) Return(_a0 schedule.Event) *Event_Name_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_Name_Call) RunAndReturn(run func(string) schedule.Event) *Event_Name_Call { + _c.Call.Return(run) + return _c +} + // OnOneServer provides a mock function with given fields: func (_m *Event) OnOneServer() schedule.Event { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for OnOneServer") + } + var r0 schedule.Event if rf, ok := ret.Get(0).(func() schedule.Event); ok { r0 = rf() @@ -448,10 +1302,41 @@ func (_m *Event) OnOneServer() schedule.Event { return r0 } +// Event_OnOneServer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnOneServer' +type Event_OnOneServer_Call struct { + *mock.Call +} + +// OnOneServer is a helper method to define mock.On call +func (_e *Event_Expecter) OnOneServer() *Event_OnOneServer_Call { + return &Event_OnOneServer_Call{Call: _e.mock.On("OnOneServer")} +} + +func (_c *Event_OnOneServer_Call) Run(run func()) *Event_OnOneServer_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Event_OnOneServer_Call) Return(_a0 schedule.Event) *Event_OnOneServer_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_OnOneServer_Call) RunAndReturn(run func() schedule.Event) *Event_OnOneServer_Call { + _c.Call.Return(run) + return _c +} + // SkipIfStillRunning provides a mock function with given fields: func (_m *Event) SkipIfStillRunning() schedule.Event { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for SkipIfStillRunning") + } + var r0 schedule.Event if rf, ok := ret.Get(0).(func() schedule.Event); ok { r0 = rf() @@ -464,6 +1349,33 @@ func (_m *Event) SkipIfStillRunning() schedule.Event { return r0 } +// Event_SkipIfStillRunning_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SkipIfStillRunning' +type Event_SkipIfStillRunning_Call struct { + *mock.Call +} + +// SkipIfStillRunning is a helper method to define mock.On call +func (_e *Event_Expecter) SkipIfStillRunning() *Event_SkipIfStillRunning_Call { + return &Event_SkipIfStillRunning_Call{Call: _e.mock.On("SkipIfStillRunning")} +} + +func (_c *Event_SkipIfStillRunning_Call) Run(run func()) *Event_SkipIfStillRunning_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Event_SkipIfStillRunning_Call) Return(_a0 schedule.Event) *Event_SkipIfStillRunning_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Event_SkipIfStillRunning_Call) RunAndReturn(run func() schedule.Event) *Event_SkipIfStillRunning_Call { + _c.Call.Return(run) + return _c +} + // NewEvent creates a new instance of Event. 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 NewEvent(t interface { diff --git a/mocks/schedule/Schedule.go b/mocks/schedule/Schedule.go index 6e0530a16..5fff9ddbe 100644 --- a/mocks/schedule/Schedule.go +++ b/mocks/schedule/Schedule.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,10 +12,22 @@ type Schedule struct { mock.Mock } +type Schedule_Expecter struct { + mock *mock.Mock +} + +func (_m *Schedule) EXPECT() *Schedule_Expecter { + return &Schedule_Expecter{mock: &_m.Mock} +} + // Call provides a mock function with given fields: callback func (_m *Schedule) Call(callback func()) schedule.Event { ret := _m.Called(callback) + if len(ret) == 0 { + panic("no return value specified for Call") + } + var r0 schedule.Event if rf, ok := ret.Get(0).(func(func()) schedule.Event); ok { r0 = rf(callback) @@ -28,10 +40,42 @@ func (_m *Schedule) Call(callback func()) schedule.Event { return r0 } +// Schedule_Call_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Call' +type Schedule_Call_Call struct { + *mock.Call +} + +// Call is a helper method to define mock.On call +// - callback func() +func (_e *Schedule_Expecter) Call(callback interface{}) *Schedule_Call_Call { + return &Schedule_Call_Call{Call: _e.mock.On("Call", callback)} +} + +func (_c *Schedule_Call_Call) Run(run func(callback func())) *Schedule_Call_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(func())) + }) + return _c +} + +func (_c *Schedule_Call_Call) Return(_a0 schedule.Event) *Schedule_Call_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Schedule_Call_Call) RunAndReturn(run func(func()) schedule.Event) *Schedule_Call_Call { + _c.Call.Return(run) + return _c +} + // Command provides a mock function with given fields: command func (_m *Schedule) Command(command string) schedule.Event { ret := _m.Called(command) + if len(ret) == 0 { + panic("no return value specified for Command") + } + var r0 schedule.Event if rf, ok := ret.Get(0).(func(string) schedule.Event); ok { r0 = rf(command) @@ -44,16 +88,99 @@ func (_m *Schedule) Command(command string) schedule.Event { return r0 } +// Schedule_Command_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Command' +type Schedule_Command_Call struct { + *mock.Call +} + +// Command is a helper method to define mock.On call +// - command string +func (_e *Schedule_Expecter) Command(command interface{}) *Schedule_Command_Call { + return &Schedule_Command_Call{Call: _e.mock.On("Command", command)} +} + +func (_c *Schedule_Command_Call) Run(run func(command string)) *Schedule_Command_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Schedule_Command_Call) Return(_a0 schedule.Event) *Schedule_Command_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Schedule_Command_Call) RunAndReturn(run func(string) schedule.Event) *Schedule_Command_Call { + _c.Call.Return(run) + return _c +} + // Register provides a mock function with given fields: events func (_m *Schedule) Register(events []schedule.Event) { _m.Called(events) } +// Schedule_Register_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Register' +type Schedule_Register_Call struct { + *mock.Call +} + +// Register is a helper method to define mock.On call +// - events []schedule.Event +func (_e *Schedule_Expecter) Register(events interface{}) *Schedule_Register_Call { + return &Schedule_Register_Call{Call: _e.mock.On("Register", events)} +} + +func (_c *Schedule_Register_Call) Run(run func(events []schedule.Event)) *Schedule_Register_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]schedule.Event)) + }) + return _c +} + +func (_c *Schedule_Register_Call) Return() *Schedule_Register_Call { + _c.Call.Return() + return _c +} + +func (_c *Schedule_Register_Call) RunAndReturn(run func([]schedule.Event)) *Schedule_Register_Call { + _c.Call.Return(run) + return _c +} + // Run provides a mock function with given fields: func (_m *Schedule) Run() { _m.Called() } +// Schedule_Run_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Run' +type Schedule_Run_Call struct { + *mock.Call +} + +// Run is a helper method to define mock.On call +func (_e *Schedule_Expecter) Run() *Schedule_Run_Call { + return &Schedule_Run_Call{Call: _e.mock.On("Run")} +} + +func (_c *Schedule_Run_Call) Run(run func()) *Schedule_Run_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Schedule_Run_Call) Return() *Schedule_Run_Call { + _c.Call.Return() + return _c +} + +func (_c *Schedule_Run_Call) RunAndReturn(run func()) *Schedule_Run_Call { + _c.Call.Return(run) + return _c +} + // NewSchedule creates a new instance of Schedule. 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 NewSchedule(t interface { diff --git a/mocks/session/Driver.go b/mocks/session/Driver.go index 7b1890c28..913c72438 100644 --- a/mocks/session/Driver.go +++ b/mocks/session/Driver.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -9,10 +9,22 @@ type Driver struct { mock.Mock } +type Driver_Expecter struct { + mock *mock.Mock +} + +func (_m *Driver) EXPECT() *Driver_Expecter { + return &Driver_Expecter{mock: &_m.Mock} +} + // Close provides a mock function with given fields: func (_m *Driver) Close() error { ret := _m.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() @@ -23,10 +35,41 @@ func (_m *Driver) Close() error { return r0 } +// Driver_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type Driver_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *Driver_Expecter) Close() *Driver_Close_Call { + return &Driver_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *Driver_Close_Call) Run(run func()) *Driver_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Driver_Close_Call) Return(_a0 error) *Driver_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_Close_Call) RunAndReturn(run func() error) *Driver_Close_Call { + _c.Call.Return(run) + return _c +} + // Destroy provides a mock function with given fields: id func (_m *Driver) Destroy(id string) error { ret := _m.Called(id) + if len(ret) == 0 { + panic("no return value specified for Destroy") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(id) @@ -37,10 +80,42 @@ func (_m *Driver) Destroy(id string) error { return r0 } +// Driver_Destroy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Destroy' +type Driver_Destroy_Call struct { + *mock.Call +} + +// Destroy is a helper method to define mock.On call +// - id string +func (_e *Driver_Expecter) Destroy(id interface{}) *Driver_Destroy_Call { + return &Driver_Destroy_Call{Call: _e.mock.On("Destroy", id)} +} + +func (_c *Driver_Destroy_Call) Run(run func(id string)) *Driver_Destroy_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Driver_Destroy_Call) Return(_a0 error) *Driver_Destroy_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_Destroy_Call) RunAndReturn(run func(string) error) *Driver_Destroy_Call { + _c.Call.Return(run) + return _c +} + // Gc provides a mock function with given fields: maxLifetime func (_m *Driver) Gc(maxLifetime int) error { ret := _m.Called(maxLifetime) + if len(ret) == 0 { + panic("no return value specified for Gc") + } + var r0 error if rf, ok := ret.Get(0).(func(int) error); ok { r0 = rf(maxLifetime) @@ -51,10 +126,42 @@ func (_m *Driver) Gc(maxLifetime int) error { return r0 } +// Driver_Gc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Gc' +type Driver_Gc_Call struct { + *mock.Call +} + +// Gc is a helper method to define mock.On call +// - maxLifetime int +func (_e *Driver_Expecter) Gc(maxLifetime interface{}) *Driver_Gc_Call { + return &Driver_Gc_Call{Call: _e.mock.On("Gc", maxLifetime)} +} + +func (_c *Driver_Gc_Call) Run(run func(maxLifetime int)) *Driver_Gc_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int)) + }) + return _c +} + +func (_c *Driver_Gc_Call) Return(_a0 error) *Driver_Gc_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_Gc_Call) RunAndReturn(run func(int) error) *Driver_Gc_Call { + _c.Call.Return(run) + return _c +} + // Open provides a mock function with given fields: path, name func (_m *Driver) Open(path string, name string) error { ret := _m.Called(path, name) + if len(ret) == 0 { + panic("no return value specified for Open") + } + var r0 error if rf, ok := ret.Get(0).(func(string, string) error); ok { r0 = rf(path, name) @@ -65,10 +172,43 @@ func (_m *Driver) Open(path string, name string) error { return r0 } +// Driver_Open_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Open' +type Driver_Open_Call struct { + *mock.Call +} + +// Open is a helper method to define mock.On call +// - path string +// - name string +func (_e *Driver_Expecter) Open(path interface{}, name interface{}) *Driver_Open_Call { + return &Driver_Open_Call{Call: _e.mock.On("Open", path, name)} +} + +func (_c *Driver_Open_Call) Run(run func(path string, name string)) *Driver_Open_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Driver_Open_Call) Return(_a0 error) *Driver_Open_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_Open_Call) RunAndReturn(run func(string, string) error) *Driver_Open_Call { + _c.Call.Return(run) + return _c +} + // Read provides a mock function with given fields: id func (_m *Driver) Read(id string) (string, error) { ret := _m.Called(id) + if len(ret) == 0 { + panic("no return value specified for Read") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func(string) (string, error)); ok { @@ -89,10 +229,42 @@ func (_m *Driver) Read(id string) (string, error) { return r0, r1 } +// Driver_Read_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Read' +type Driver_Read_Call struct { + *mock.Call +} + +// Read is a helper method to define mock.On call +// - id string +func (_e *Driver_Expecter) Read(id interface{}) *Driver_Read_Call { + return &Driver_Read_Call{Call: _e.mock.On("Read", id)} +} + +func (_c *Driver_Read_Call) Run(run func(id string)) *Driver_Read_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Driver_Read_Call) Return(_a0 string, _a1 error) *Driver_Read_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Driver_Read_Call) RunAndReturn(run func(string) (string, error)) *Driver_Read_Call { + _c.Call.Return(run) + return _c +} + // Write provides a mock function with given fields: id, data func (_m *Driver) Write(id string, data string) error { ret := _m.Called(id, data) + if len(ret) == 0 { + panic("no return value specified for Write") + } + var r0 error if rf, ok := ret.Get(0).(func(string, string) error); ok { r0 = rf(id, data) @@ -103,6 +275,35 @@ func (_m *Driver) Write(id string, data string) error { return r0 } +// Driver_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write' +type Driver_Write_Call struct { + *mock.Call +} + +// Write is a helper method to define mock.On call +// - id string +// - data string +func (_e *Driver_Expecter) Write(id interface{}, data interface{}) *Driver_Write_Call { + return &Driver_Write_Call{Call: _e.mock.On("Write", id, data)} +} + +func (_c *Driver_Write_Call) Run(run func(id string, data string)) *Driver_Write_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Driver_Write_Call) Return(_a0 error) *Driver_Write_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Driver_Write_Call) RunAndReturn(run func(string, string) error) *Driver_Write_Call { + _c.Call.Return(run) + return _c +} + // NewDriver creates a new instance of Driver. 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 NewDriver(t interface { diff --git a/mocks/session/Manager.go b/mocks/session/Manager.go index 8220be97d..49ecfbac8 100644 --- a/mocks/session/Manager.go +++ b/mocks/session/Manager.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,6 +12,14 @@ type Manager struct { mock.Mock } +type Manager_Expecter struct { + mock *mock.Mock +} + +func (_m *Manager) EXPECT() *Manager_Expecter { + return &Manager_Expecter{mock: &_m.Mock} +} + // BuildSession provides a mock function with given fields: handler, sessionID func (_m *Manager) BuildSession(handler session.Driver, sessionID ...string) session.Session { _va := make([]interface{}, len(sessionID)) @@ -23,6 +31,10 @@ func (_m *Manager) BuildSession(handler session.Driver, sessionID ...string) ses _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for BuildSession") + } + var r0 session.Session if rf, ok := ret.Get(0).(func(session.Driver, ...string) session.Session); ok { r0 = rf(handler, sessionID...) @@ -35,6 +47,42 @@ func (_m *Manager) BuildSession(handler session.Driver, sessionID ...string) ses return r0 } +// Manager_BuildSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BuildSession' +type Manager_BuildSession_Call struct { + *mock.Call +} + +// BuildSession is a helper method to define mock.On call +// - handler session.Driver +// - sessionID ...string +func (_e *Manager_Expecter) BuildSession(handler interface{}, sessionID ...interface{}) *Manager_BuildSession_Call { + return &Manager_BuildSession_Call{Call: _e.mock.On("BuildSession", + append([]interface{}{handler}, sessionID...)...)} +} + +func (_c *Manager_BuildSession_Call) Run(run func(handler session.Driver, sessionID ...string)) *Manager_BuildSession_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(args[0].(session.Driver), variadicArgs...) + }) + return _c +} + +func (_c *Manager_BuildSession_Call) Return(_a0 session.Session) *Manager_BuildSession_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Manager_BuildSession_Call) RunAndReturn(run func(session.Driver, ...string) session.Session) *Manager_BuildSession_Call { + _c.Call.Return(run) + return _c +} + // Driver provides a mock function with given fields: name func (_m *Manager) Driver(name ...string) (session.Driver, error) { _va := make([]interface{}, len(name)) @@ -45,6 +93,10 @@ func (_m *Manager) Driver(name ...string) (session.Driver, error) { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Driver") + } + var r0 session.Driver var r1 error if rf, ok := ret.Get(0).(func(...string) (session.Driver, error)); ok { @@ -67,10 +119,49 @@ func (_m *Manager) Driver(name ...string) (session.Driver, error) { return r0, r1 } +// Manager_Driver_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Driver' +type Manager_Driver_Call struct { + *mock.Call +} + +// Driver is a helper method to define mock.On call +// - name ...string +func (_e *Manager_Expecter) Driver(name ...interface{}) *Manager_Driver_Call { + return &Manager_Driver_Call{Call: _e.mock.On("Driver", + append([]interface{}{}, name...)...)} +} + +func (_c *Manager_Driver_Call) Run(run func(name ...string)) *Manager_Driver_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Manager_Driver_Call) Return(_a0 session.Driver, _a1 error) *Manager_Driver_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Manager_Driver_Call) RunAndReturn(run func(...string) (session.Driver, error)) *Manager_Driver_Call { + _c.Call.Return(run) + return _c +} + // Extend provides a mock function with given fields: driver, handler func (_m *Manager) Extend(driver string, handler func() session.Driver) session.Manager { ret := _m.Called(driver, handler) + if len(ret) == 0 { + panic("no return value specified for Extend") + } + var r0 session.Manager if rf, ok := ret.Get(0).(func(string, func() session.Driver) session.Manager); ok { r0 = rf(driver, handler) @@ -83,6 +174,35 @@ func (_m *Manager) Extend(driver string, handler func() session.Driver) session. return r0 } +// Manager_Extend_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Extend' +type Manager_Extend_Call struct { + *mock.Call +} + +// Extend is a helper method to define mock.On call +// - driver string +// - handler func() session.Driver +func (_e *Manager_Expecter) Extend(driver interface{}, handler interface{}) *Manager_Extend_Call { + return &Manager_Extend_Call{Call: _e.mock.On("Extend", driver, handler)} +} + +func (_c *Manager_Extend_Call) Run(run func(driver string, handler func() session.Driver)) *Manager_Extend_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(func() session.Driver)) + }) + return _c +} + +func (_c *Manager_Extend_Call) Return(_a0 session.Manager) *Manager_Extend_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Manager_Extend_Call) RunAndReturn(run func(string, func() session.Driver) session.Manager) *Manager_Extend_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 { diff --git a/mocks/testing/Database.go b/mocks/testing/Database.go index 1d0c164d8..44dc13564 100644 --- a/mocks/testing/Database.go +++ b/mocks/testing/Database.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -13,10 +13,22 @@ type Database struct { mock.Mock } +type Database_Expecter struct { + mock *mock.Mock +} + +func (_m *Database) EXPECT() *Database_Expecter { + return &Database_Expecter{mock: &_m.Mock} +} + // Build provides a mock function with given fields: func (_m *Database) Build() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Build") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -27,10 +39,41 @@ func (_m *Database) Build() error { return r0 } +// Database_Build_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Build' +type Database_Build_Call struct { + *mock.Call +} + +// Build is a helper method to define mock.On call +func (_e *Database_Expecter) Build() *Database_Build_Call { + return &Database_Build_Call{Call: _e.mock.On("Build")} +} + +func (_c *Database_Build_Call) Run(run func()) *Database_Build_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Database_Build_Call) Return(_a0 error) *Database_Build_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Database_Build_Call) RunAndReturn(run func() error) *Database_Build_Call { + _c.Call.Return(run) + return _c +} + // Clear provides a mock function with given fields: func (_m *Database) Clear() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Clear") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -41,10 +84,41 @@ func (_m *Database) Clear() error { return r0 } +// Database_Clear_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Clear' +type Database_Clear_Call struct { + *mock.Call +} + +// Clear is a helper method to define mock.On call +func (_e *Database_Expecter) Clear() *Database_Clear_Call { + return &Database_Clear_Call{Call: _e.mock.On("Clear")} +} + +func (_c *Database_Clear_Call) Run(run func()) *Database_Clear_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Database_Clear_Call) Return(_a0 error) *Database_Clear_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Database_Clear_Call) RunAndReturn(run func() error) *Database_Clear_Call { + _c.Call.Return(run) + return _c +} + // Config provides a mock function with given fields: func (_m *Database) Config() testing.DatabaseConfig { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Config") + } + var r0 testing.DatabaseConfig if rf, ok := ret.Get(0).(func() testing.DatabaseConfig); ok { r0 = rf() @@ -55,11 +129,66 @@ func (_m *Database) Config() testing.DatabaseConfig { return r0 } +// Database_Config_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Config' +type Database_Config_Call struct { + *mock.Call +} + +// Config is a helper method to define mock.On call +func (_e *Database_Expecter) Config() *Database_Config_Call { + return &Database_Config_Call{Call: _e.mock.On("Config")} +} + +func (_c *Database_Config_Call) Run(run func()) *Database_Config_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Database_Config_Call) Return(_a0 testing.DatabaseConfig) *Database_Config_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Database_Config_Call) RunAndReturn(run func() testing.DatabaseConfig) *Database_Config_Call { + _c.Call.Return(run) + return _c +} + // Image provides a mock function with given fields: _a0 func (_m *Database) Image(_a0 testing.Image) { _m.Called(_a0) } +// Database_Image_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Image' +type Database_Image_Call struct { + *mock.Call +} + +// Image is a helper method to define mock.On call +// - _a0 testing.Image +func (_e *Database_Expecter) Image(_a0 interface{}) *Database_Image_Call { + return &Database_Image_Call{Call: _e.mock.On("Image", _a0)} +} + +func (_c *Database_Image_Call) Run(run func(_a0 testing.Image)) *Database_Image_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(testing.Image)) + }) + return _c +} + +func (_c *Database_Image_Call) Return() *Database_Image_Call { + _c.Call.Return() + return _c +} + +func (_c *Database_Image_Call) RunAndReturn(run func(testing.Image)) *Database_Image_Call { + _c.Call.Return(run) + return _c +} + // Seed provides a mock function with given fields: seeds func (_m *Database) Seed(seeds ...seeder.Seeder) { _va := make([]interface{}, len(seeds)) @@ -71,10 +200,49 @@ func (_m *Database) Seed(seeds ...seeder.Seeder) { _m.Called(_ca...) } +// Database_Seed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Seed' +type Database_Seed_Call struct { + *mock.Call +} + +// Seed is a helper method to define mock.On call +// - seeds ...seeder.Seeder +func (_e *Database_Expecter) Seed(seeds ...interface{}) *Database_Seed_Call { + return &Database_Seed_Call{Call: _e.mock.On("Seed", + append([]interface{}{}, seeds...)...)} +} + +func (_c *Database_Seed_Call) Run(run func(seeds ...seeder.Seeder)) *Database_Seed_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]seeder.Seeder, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(seeder.Seeder) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Database_Seed_Call) Return() *Database_Seed_Call { + _c.Call.Return() + return _c +} + +func (_c *Database_Seed_Call) RunAndReturn(run func(...seeder.Seeder)) *Database_Seed_Call { + _c.Call.Return(run) + return _c +} + // Stop provides a mock function with given fields: func (_m *Database) Stop() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Stop") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -85,6 +253,33 @@ func (_m *Database) Stop() error { return r0 } +// Database_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop' +type Database_Stop_Call struct { + *mock.Call +} + +// Stop is a helper method to define mock.On call +func (_e *Database_Expecter) Stop() *Database_Stop_Call { + return &Database_Stop_Call{Call: _e.mock.On("Stop")} +} + +func (_c *Database_Stop_Call) Run(run func()) *Database_Stop_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Database_Stop_Call) Return(_a0 error) *Database_Stop_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Database_Stop_Call) RunAndReturn(run func() error) *Database_Stop_Call { + _c.Call.Return(run) + return _c +} + // NewDatabase creates a new instance of Database. 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 NewDatabase(t interface { diff --git a/mocks/testing/DatabaseDriver.go b/mocks/testing/DatabaseDriver.go index 1aa028e94..065036cbb 100644 --- a/mocks/testing/DatabaseDriver.go +++ b/mocks/testing/DatabaseDriver.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -13,10 +13,22 @@ type DatabaseDriver struct { mock.Mock } +type DatabaseDriver_Expecter struct { + mock *mock.Mock +} + +func (_m *DatabaseDriver) EXPECT() *DatabaseDriver_Expecter { + return &DatabaseDriver_Expecter{mock: &_m.Mock} +} + // Build provides a mock function with given fields: func (_m *DatabaseDriver) Build() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Build") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -27,10 +39,41 @@ func (_m *DatabaseDriver) Build() error { return r0 } +// DatabaseDriver_Build_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Build' +type DatabaseDriver_Build_Call struct { + *mock.Call +} + +// Build is a helper method to define mock.On call +func (_e *DatabaseDriver_Expecter) Build() *DatabaseDriver_Build_Call { + return &DatabaseDriver_Build_Call{Call: _e.mock.On("Build")} +} + +func (_c *DatabaseDriver_Build_Call) Run(run func()) *DatabaseDriver_Build_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DatabaseDriver_Build_Call) Return(_a0 error) *DatabaseDriver_Build_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DatabaseDriver_Build_Call) RunAndReturn(run func() error) *DatabaseDriver_Build_Call { + _c.Call.Return(run) + return _c +} + // Config provides a mock function with given fields: func (_m *DatabaseDriver) Config() testing.DatabaseConfig { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Config") + } + var r0 testing.DatabaseConfig if rf, ok := ret.Get(0).(func() testing.DatabaseConfig); ok { r0 = rf() @@ -41,10 +84,41 @@ func (_m *DatabaseDriver) Config() testing.DatabaseConfig { return r0 } +// DatabaseDriver_Config_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Config' +type DatabaseDriver_Config_Call struct { + *mock.Call +} + +// Config is a helper method to define mock.On call +func (_e *DatabaseDriver_Expecter) Config() *DatabaseDriver_Config_Call { + return &DatabaseDriver_Config_Call{Call: _e.mock.On("Config")} +} + +func (_c *DatabaseDriver_Config_Call) Run(run func()) *DatabaseDriver_Config_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DatabaseDriver_Config_Call) Return(_a0 testing.DatabaseConfig) *DatabaseDriver_Config_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DatabaseDriver_Config_Call) RunAndReturn(run func() testing.DatabaseConfig) *DatabaseDriver_Config_Call { + _c.Call.Return(run) + return _c +} + // Fresh provides a mock function with given fields: func (_m *DatabaseDriver) Fresh() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Fresh") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -55,15 +129,74 @@ func (_m *DatabaseDriver) Fresh() error { return r0 } +// DatabaseDriver_Fresh_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Fresh' +type DatabaseDriver_Fresh_Call struct { + *mock.Call +} + +// Fresh is a helper method to define mock.On call +func (_e *DatabaseDriver_Expecter) Fresh() *DatabaseDriver_Fresh_Call { + return &DatabaseDriver_Fresh_Call{Call: _e.mock.On("Fresh")} +} + +func (_c *DatabaseDriver_Fresh_Call) Run(run func()) *DatabaseDriver_Fresh_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DatabaseDriver_Fresh_Call) Return(_a0 error) *DatabaseDriver_Fresh_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DatabaseDriver_Fresh_Call) RunAndReturn(run func() error) *DatabaseDriver_Fresh_Call { + _c.Call.Return(run) + return _c +} + // Image provides a mock function with given fields: image func (_m *DatabaseDriver) Image(image testing.Image) { _m.Called(image) } +// DatabaseDriver_Image_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Image' +type DatabaseDriver_Image_Call struct { + *mock.Call +} + +// Image is a helper method to define mock.On call +// - image testing.Image +func (_e *DatabaseDriver_Expecter) Image(image interface{}) *DatabaseDriver_Image_Call { + return &DatabaseDriver_Image_Call{Call: _e.mock.On("Image", image)} +} + +func (_c *DatabaseDriver_Image_Call) Run(run func(image testing.Image)) *DatabaseDriver_Image_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(testing.Image)) + }) + return _c +} + +func (_c *DatabaseDriver_Image_Call) Return() *DatabaseDriver_Image_Call { + _c.Call.Return() + return _c +} + +func (_c *DatabaseDriver_Image_Call) RunAndReturn(run func(testing.Image)) *DatabaseDriver_Image_Call { + _c.Call.Return(run) + return _c +} + // Name provides a mock function with given fields: func (_m *DatabaseDriver) Name() orm.Driver { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Name") + } + var r0 orm.Driver if rf, ok := ret.Get(0).(func() orm.Driver); ok { r0 = rf() @@ -74,10 +207,41 @@ func (_m *DatabaseDriver) Name() orm.Driver { return r0 } +// DatabaseDriver_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type DatabaseDriver_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *DatabaseDriver_Expecter) Name() *DatabaseDriver_Name_Call { + return &DatabaseDriver_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *DatabaseDriver_Name_Call) Run(run func()) *DatabaseDriver_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DatabaseDriver_Name_Call) Return(_a0 orm.Driver) *DatabaseDriver_Name_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DatabaseDriver_Name_Call) RunAndReturn(run func() orm.Driver) *DatabaseDriver_Name_Call { + _c.Call.Return(run) + return _c +} + // Stop provides a mock function with given fields: func (_m *DatabaseDriver) Stop() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Stop") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -88,6 +252,33 @@ func (_m *DatabaseDriver) Stop() error { return r0 } +// DatabaseDriver_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop' +type DatabaseDriver_Stop_Call struct { + *mock.Call +} + +// Stop is a helper method to define mock.On call +func (_e *DatabaseDriver_Expecter) Stop() *DatabaseDriver_Stop_Call { + return &DatabaseDriver_Stop_Call{Call: _e.mock.On("Stop")} +} + +func (_c *DatabaseDriver_Stop_Call) Run(run func()) *DatabaseDriver_Stop_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DatabaseDriver_Stop_Call) Return(_a0 error) *DatabaseDriver_Stop_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DatabaseDriver_Stop_Call) RunAndReturn(run func() error) *DatabaseDriver_Stop_Call { + _c.Call.Return(run) + return _c +} + // NewDatabaseDriver creates a new instance of DatabaseDriver. 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 NewDatabaseDriver(t interface { diff --git a/mocks/testing/Docker.go b/mocks/testing/Docker.go index e67ff884b..04a4eb68d 100644 --- a/mocks/testing/Docker.go +++ b/mocks/testing/Docker.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,6 +12,14 @@ type Docker struct { mock.Mock } +type Docker_Expecter struct { + mock *mock.Mock +} + +func (_m *Docker) EXPECT() *Docker_Expecter { + return &Docker_Expecter{mock: &_m.Mock} +} + // Database provides a mock function with given fields: connection func (_m *Docker) Database(connection ...string) (testing.Database, error) { _va := make([]interface{}, len(connection)) @@ -22,6 +30,10 @@ func (_m *Docker) Database(connection ...string) (testing.Database, error) { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Database") + } + var r0 testing.Database var r1 error if rf, ok := ret.Get(0).(func(...string) (testing.Database, error)); ok { @@ -44,6 +56,41 @@ func (_m *Docker) Database(connection ...string) (testing.Database, error) { return r0, r1 } +// Docker_Database_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Database' +type Docker_Database_Call struct { + *mock.Call +} + +// Database is a helper method to define mock.On call +// - connection ...string +func (_e *Docker_Expecter) Database(connection ...interface{}) *Docker_Database_Call { + return &Docker_Database_Call{Call: _e.mock.On("Database", + append([]interface{}{}, connection...)...)} +} + +func (_c *Docker_Database_Call) Run(run func(connection ...string)) *Docker_Database_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Docker_Database_Call) Return(_a0 testing.Database, _a1 error) *Docker_Database_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Docker_Database_Call) RunAndReturn(run func(...string) (testing.Database, error)) *Docker_Database_Call { + _c.Call.Return(run) + return _c +} + // NewDocker creates a new instance of Docker. 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 NewDocker(t interface { diff --git a/mocks/testing/Testing.go b/mocks/testing/Testing.go index c2b1f2618..48ca39c43 100644 --- a/mocks/testing/Testing.go +++ b/mocks/testing/Testing.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,10 +12,22 @@ type Testing struct { mock.Mock } +type Testing_Expecter struct { + mock *mock.Mock +} + +func (_m *Testing) EXPECT() *Testing_Expecter { + return &Testing_Expecter{mock: &_m.Mock} +} + // Docker provides a mock function with given fields: func (_m *Testing) Docker() testing.Docker { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Docker") + } + var r0 testing.Docker if rf, ok := ret.Get(0).(func() testing.Docker); ok { r0 = rf() @@ -28,6 +40,33 @@ func (_m *Testing) Docker() testing.Docker { return r0 } +// Testing_Docker_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Docker' +type Testing_Docker_Call struct { + *mock.Call +} + +// Docker is a helper method to define mock.On call +func (_e *Testing_Expecter) Docker() *Testing_Docker_Call { + return &Testing_Docker_Call{Call: _e.mock.On("Docker")} +} + +func (_c *Testing_Docker_Call) Run(run func()) *Testing_Docker_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Testing_Docker_Call) Return(_a0 testing.Docker) *Testing_Docker_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Testing_Docker_Call) RunAndReturn(run func() testing.Docker) *Testing_Docker_Call { + _c.Call.Return(run) + return _c +} + // NewTesting creates a new instance of Testing. 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 NewTesting(t interface { diff --git a/mocks/translation/Loader.go b/mocks/translation/Loader.go index 88c3d3ddd..3c27c29f6 100644 --- a/mocks/translation/Loader.go +++ b/mocks/translation/Loader.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -9,10 +9,22 @@ type Loader struct { mock.Mock } +type Loader_Expecter struct { + mock *mock.Mock +} + +func (_m *Loader) EXPECT() *Loader_Expecter { + return &Loader_Expecter{mock: &_m.Mock} +} + // Load provides a mock function with given fields: locale, group func (_m *Loader) Load(locale string, group string) (map[string]interface{}, error) { ret := _m.Called(locale, group) + if len(ret) == 0 { + panic("no return value specified for Load") + } + var r0 map[string]interface{} var r1 error if rf, ok := ret.Get(0).(func(string, string) (map[string]interface{}, error)); ok { @@ -35,6 +47,35 @@ func (_m *Loader) Load(locale string, group string) (map[string]interface{}, err return r0, r1 } +// Loader_Load_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Load' +type Loader_Load_Call struct { + *mock.Call +} + +// Load is a helper method to define mock.On call +// - locale string +// - group string +func (_e *Loader_Expecter) Load(locale interface{}, group interface{}) *Loader_Load_Call { + return &Loader_Load_Call{Call: _e.mock.On("Load", locale, group)} +} + +func (_c *Loader_Load_Call) Run(run func(locale string, group string)) *Loader_Load_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Loader_Load_Call) Return(_a0 map[string]interface{}, _a1 error) *Loader_Load_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Loader_Load_Call) RunAndReturn(run func(string, string) (map[string]interface{}, error)) *Loader_Load_Call { + _c.Call.Return(run) + return _c +} + // NewLoader creates a new instance of Loader. 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 NewLoader(t interface { diff --git a/mocks/translation/Translator.go b/mocks/translation/Translator.go index c265005a5..d64bd8e07 100644 --- a/mocks/translation/Translator.go +++ b/mocks/translation/Translator.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -14,6 +14,14 @@ type Translator struct { mock.Mock } +type Translator_Expecter struct { + mock *mock.Mock +} + +func (_m *Translator) EXPECT() *Translator_Expecter { + return &Translator_Expecter{mock: &_m.Mock} +} + // Choice provides a mock function with given fields: key, number, options func (_m *Translator) Choice(key string, number int, options ...translation.Option) string { _va := make([]interface{}, len(options)) @@ -25,6 +33,10 @@ func (_m *Translator) Choice(key string, number int, options ...translation.Opti _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Choice") + } + var r0 string if rf, ok := ret.Get(0).(func(string, int, ...translation.Option) string); ok { r0 = rf(key, number, options...) @@ -35,6 +47,43 @@ func (_m *Translator) Choice(key string, number int, options ...translation.Opti return r0 } +// Translator_Choice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Choice' +type Translator_Choice_Call struct { + *mock.Call +} + +// Choice is a helper method to define mock.On call +// - key string +// - number int +// - options ...translation.Option +func (_e *Translator_Expecter) Choice(key interface{}, number interface{}, options ...interface{}) *Translator_Choice_Call { + return &Translator_Choice_Call{Call: _e.mock.On("Choice", + append([]interface{}{key, number}, options...)...)} +} + +func (_c *Translator_Choice_Call) Run(run func(key string, number int, options ...translation.Option)) *Translator_Choice_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]translation.Option, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(translation.Option) + } + } + run(args[0].(string), args[1].(int), variadicArgs...) + }) + return _c +} + +func (_c *Translator_Choice_Call) Return(_a0 string) *Translator_Choice_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Translator_Choice_Call) RunAndReturn(run func(string, int, ...translation.Option) string) *Translator_Choice_Call { + _c.Call.Return(run) + return _c +} + // Get provides a mock function with given fields: key, options func (_m *Translator) Get(key string, options ...translation.Option) string { _va := make([]interface{}, len(options)) @@ -46,6 +95,10 @@ func (_m *Translator) Get(key string, options ...translation.Option) string { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Get") + } + var r0 string if rf, ok := ret.Get(0).(func(string, ...translation.Option) string); ok { r0 = rf(key, options...) @@ -56,10 +109,50 @@ func (_m *Translator) Get(key string, options ...translation.Option) string { return r0 } +// Translator_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type Translator_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - key string +// - options ...translation.Option +func (_e *Translator_Expecter) Get(key interface{}, options ...interface{}) *Translator_Get_Call { + return &Translator_Get_Call{Call: _e.mock.On("Get", + append([]interface{}{key}, options...)...)} +} + +func (_c *Translator_Get_Call) Run(run func(key string, options ...translation.Option)) *Translator_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]translation.Option, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(translation.Option) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Translator_Get_Call) Return(_a0 string) *Translator_Get_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Translator_Get_Call) RunAndReturn(run func(string, ...translation.Option) string) *Translator_Get_Call { + _c.Call.Return(run) + return _c +} + // GetFallback provides a mock function with given fields: func (_m *Translator) GetFallback() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for GetFallback") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -70,10 +163,41 @@ func (_m *Translator) GetFallback() string { return r0 } +// Translator_GetFallback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFallback' +type Translator_GetFallback_Call struct { + *mock.Call +} + +// GetFallback is a helper method to define mock.On call +func (_e *Translator_Expecter) GetFallback() *Translator_GetFallback_Call { + return &Translator_GetFallback_Call{Call: _e.mock.On("GetFallback")} +} + +func (_c *Translator_GetFallback_Call) Run(run func()) *Translator_GetFallback_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Translator_GetFallback_Call) Return(_a0 string) *Translator_GetFallback_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Translator_GetFallback_Call) RunAndReturn(run func() string) *Translator_GetFallback_Call { + _c.Call.Return(run) + return _c +} + // GetLocale provides a mock function with given fields: func (_m *Translator) GetLocale() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for GetLocale") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -84,6 +208,33 @@ func (_m *Translator) GetLocale() string { return r0 } +// Translator_GetLocale_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLocale' +type Translator_GetLocale_Call struct { + *mock.Call +} + +// GetLocale is a helper method to define mock.On call +func (_e *Translator_Expecter) GetLocale() *Translator_GetLocale_Call { + return &Translator_GetLocale_Call{Call: _e.mock.On("GetLocale")} +} + +func (_c *Translator_GetLocale_Call) Run(run func()) *Translator_GetLocale_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Translator_GetLocale_Call) Return(_a0 string) *Translator_GetLocale_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Translator_GetLocale_Call) RunAndReturn(run func() string) *Translator_GetLocale_Call { + _c.Call.Return(run) + return _c +} + // Has provides a mock function with given fields: key, options func (_m *Translator) Has(key string, options ...translation.Option) bool { _va := make([]interface{}, len(options)) @@ -95,6 +246,10 @@ func (_m *Translator) Has(key string, options ...translation.Option) bool { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Has") + } + var r0 bool if rf, ok := ret.Get(0).(func(string, ...translation.Option) bool); ok { r0 = rf(key, options...) @@ -105,10 +260,50 @@ func (_m *Translator) Has(key string, options ...translation.Option) bool { return r0 } +// Translator_Has_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Has' +type Translator_Has_Call struct { + *mock.Call +} + +// Has is a helper method to define mock.On call +// - key string +// - options ...translation.Option +func (_e *Translator_Expecter) Has(key interface{}, options ...interface{}) *Translator_Has_Call { + return &Translator_Has_Call{Call: _e.mock.On("Has", + append([]interface{}{key}, options...)...)} +} + +func (_c *Translator_Has_Call) Run(run func(key string, options ...translation.Option)) *Translator_Has_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]translation.Option, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(translation.Option) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Translator_Has_Call) Return(_a0 bool) *Translator_Has_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Translator_Has_Call) RunAndReturn(run func(string, ...translation.Option) bool) *Translator_Has_Call { + _c.Call.Return(run) + return _c +} + // SetFallback provides a mock function with given fields: locale func (_m *Translator) SetFallback(locale string) context.Context { ret := _m.Called(locale) + if len(ret) == 0 { + panic("no return value specified for SetFallback") + } + var r0 context.Context if rf, ok := ret.Get(0).(func(string) context.Context); ok { r0 = rf(locale) @@ -121,10 +316,42 @@ func (_m *Translator) SetFallback(locale string) context.Context { return r0 } +// Translator_SetFallback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFallback' +type Translator_SetFallback_Call struct { + *mock.Call +} + +// SetFallback is a helper method to define mock.On call +// - locale string +func (_e *Translator_Expecter) SetFallback(locale interface{}) *Translator_SetFallback_Call { + return &Translator_SetFallback_Call{Call: _e.mock.On("SetFallback", locale)} +} + +func (_c *Translator_SetFallback_Call) Run(run func(locale string)) *Translator_SetFallback_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Translator_SetFallback_Call) Return(_a0 context.Context) *Translator_SetFallback_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Translator_SetFallback_Call) RunAndReturn(run func(string) context.Context) *Translator_SetFallback_Call { + _c.Call.Return(run) + return _c +} + // SetLocale provides a mock function with given fields: locale func (_m *Translator) SetLocale(locale string) context.Context { ret := _m.Called(locale) + if len(ret) == 0 { + panic("no return value specified for SetLocale") + } + var r0 context.Context if rf, ok := ret.Get(0).(func(string) context.Context); ok { r0 = rf(locale) @@ -137,6 +364,34 @@ func (_m *Translator) SetLocale(locale string) context.Context { return r0 } +// Translator_SetLocale_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLocale' +type Translator_SetLocale_Call struct { + *mock.Call +} + +// SetLocale is a helper method to define mock.On call +// - locale string +func (_e *Translator_Expecter) SetLocale(locale interface{}) *Translator_SetLocale_Call { + return &Translator_SetLocale_Call{Call: _e.mock.On("SetLocale", locale)} +} + +func (_c *Translator_SetLocale_Call) Run(run func(locale string)) *Translator_SetLocale_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Translator_SetLocale_Call) Return(_a0 context.Context) *Translator_SetLocale_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Translator_SetLocale_Call) RunAndReturn(run func(string) context.Context) *Translator_SetLocale_Call { + _c.Call.Return(run) + return _c +} + // NewTranslator creates a new instance of Translator. 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 NewTranslator(t interface { diff --git a/mocks/validation/Data.go b/mocks/validation/Data.go index 607140441..ccae4643f 100644 --- a/mocks/validation/Data.go +++ b/mocks/validation/Data.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -9,10 +9,22 @@ type Data struct { mock.Mock } +type Data_Expecter struct { + mock *mock.Mock +} + +func (_m *Data) EXPECT() *Data_Expecter { + return &Data_Expecter{mock: &_m.Mock} +} + // Get provides a mock function with given fields: key func (_m *Data) Get(key string) (interface{}, bool) { ret := _m.Called(key) + if len(ret) == 0 { + panic("no return value specified for Get") + } + var r0 interface{} var r1 bool if rf, ok := ret.Get(0).(func(string) (interface{}, bool)); ok { @@ -35,10 +47,42 @@ func (_m *Data) Get(key string) (interface{}, bool) { return r0, r1 } +// Data_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type Data_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - key string +func (_e *Data_Expecter) Get(key interface{}) *Data_Get_Call { + return &Data_Get_Call{Call: _e.mock.On("Get", key)} +} + +func (_c *Data_Get_Call) Run(run func(key string)) *Data_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Data_Get_Call) Return(val interface{}, exist bool) *Data_Get_Call { + _c.Call.Return(val, exist) + return _c +} + +func (_c *Data_Get_Call) RunAndReturn(run func(string) (interface{}, bool)) *Data_Get_Call { + _c.Call.Return(run) + return _c +} + // Set provides a mock function with given fields: key, val func (_m *Data) Set(key string, val interface{}) error { ret := _m.Called(key, val) + if len(ret) == 0 { + panic("no return value specified for Set") + } + var r0 error if rf, ok := ret.Get(0).(func(string, interface{}) error); ok { r0 = rf(key, val) @@ -49,6 +93,35 @@ func (_m *Data) Set(key string, val interface{}) error { return r0 } +// Data_Set_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Set' +type Data_Set_Call struct { + *mock.Call +} + +// Set is a helper method to define mock.On call +// - key string +// - val interface{} +func (_e *Data_Expecter) Set(key interface{}, val interface{}) *Data_Set_Call { + return &Data_Set_Call{Call: _e.mock.On("Set", key, val)} +} + +func (_c *Data_Set_Call) Run(run func(key string, val interface{})) *Data_Set_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(interface{})) + }) + return _c +} + +func (_c *Data_Set_Call) Return(_a0 error) *Data_Set_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Data_Set_Call) RunAndReturn(run func(string, interface{}) error) *Data_Set_Call { + _c.Call.Return(run) + return _c +} + // NewData creates a new instance of Data. 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 NewData(t interface { diff --git a/mocks/validation/Errors.go b/mocks/validation/Errors.go index 2ecf934ab..77e6b284e 100644 --- a/mocks/validation/Errors.go +++ b/mocks/validation/Errors.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -9,10 +9,22 @@ type Errors struct { mock.Mock } +type Errors_Expecter struct { + mock *mock.Mock +} + +func (_m *Errors) EXPECT() *Errors_Expecter { + return &Errors_Expecter{mock: &_m.Mock} +} + // All provides a mock function with given fields: func (_m *Errors) All() map[string]map[string]string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for All") + } + var r0 map[string]map[string]string if rf, ok := ret.Get(0).(func() map[string]map[string]string); ok { r0 = rf() @@ -25,10 +37,41 @@ func (_m *Errors) All() map[string]map[string]string { return r0 } +// Errors_All_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'All' +type Errors_All_Call struct { + *mock.Call +} + +// All is a helper method to define mock.On call +func (_e *Errors_Expecter) All() *Errors_All_Call { + return &Errors_All_Call{Call: _e.mock.On("All")} +} + +func (_c *Errors_All_Call) Run(run func()) *Errors_All_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Errors_All_Call) Return(_a0 map[string]map[string]string) *Errors_All_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Errors_All_Call) RunAndReturn(run func() map[string]map[string]string) *Errors_All_Call { + _c.Call.Return(run) + return _c +} + // Get provides a mock function with given fields: key func (_m *Errors) Get(key string) map[string]string { ret := _m.Called(key) + if len(ret) == 0 { + panic("no return value specified for Get") + } + var r0 map[string]string if rf, ok := ret.Get(0).(func(string) map[string]string); ok { r0 = rf(key) @@ -41,10 +84,42 @@ func (_m *Errors) Get(key string) map[string]string { return r0 } +// Errors_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type Errors_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - key string +func (_e *Errors_Expecter) Get(key interface{}) *Errors_Get_Call { + return &Errors_Get_Call{Call: _e.mock.On("Get", key)} +} + +func (_c *Errors_Get_Call) Run(run func(key string)) *Errors_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Errors_Get_Call) Return(_a0 map[string]string) *Errors_Get_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Errors_Get_Call) RunAndReturn(run func(string) map[string]string) *Errors_Get_Call { + _c.Call.Return(run) + return _c +} + // Has provides a mock function with given fields: key func (_m *Errors) Has(key string) bool { ret := _m.Called(key) + if len(ret) == 0 { + panic("no return value specified for Has") + } + var r0 bool if rf, ok := ret.Get(0).(func(string) bool); ok { r0 = rf(key) @@ -55,6 +130,34 @@ func (_m *Errors) Has(key string) bool { return r0 } +// Errors_Has_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Has' +type Errors_Has_Call struct { + *mock.Call +} + +// Has is a helper method to define mock.On call +// - key string +func (_e *Errors_Expecter) Has(key interface{}) *Errors_Has_Call { + return &Errors_Has_Call{Call: _e.mock.On("Has", key)} +} + +func (_c *Errors_Has_Call) Run(run func(key string)) *Errors_Has_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Errors_Has_Call) Return(_a0 bool) *Errors_Has_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Errors_Has_Call) RunAndReturn(run func(string) bool) *Errors_Has_Call { + _c.Call.Return(run) + return _c +} + // One provides a mock function with given fields: key func (_m *Errors) One(key ...string) string { _va := make([]interface{}, len(key)) @@ -65,6 +168,10 @@ func (_m *Errors) One(key ...string) string { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for One") + } + var r0 string if rf, ok := ret.Get(0).(func(...string) string); ok { r0 = rf(key...) @@ -75,6 +182,41 @@ func (_m *Errors) One(key ...string) string { return r0 } +// Errors_One_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'One' +type Errors_One_Call struct { + *mock.Call +} + +// One is a helper method to define mock.On call +// - key ...string +func (_e *Errors_Expecter) One(key ...interface{}) *Errors_One_Call { + return &Errors_One_Call{Call: _e.mock.On("One", + append([]interface{}{}, key...)...)} +} + +func (_c *Errors_One_Call) Run(run func(key ...string)) *Errors_One_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Errors_One_Call) Return(_a0 string) *Errors_One_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Errors_One_Call) RunAndReturn(run func(...string) string) *Errors_One_Call { + _c.Call.Return(run) + return _c +} + // NewErrors creates a new instance of Errors. 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 NewErrors(t interface { diff --git a/mocks/validation/Option.go b/mocks/validation/Option.go index 623a1a6d2..5a0610546 100644 --- a/mocks/validation/Option.go +++ b/mocks/validation/Option.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -9,11 +9,47 @@ type Option struct { mock.Mock } +type Option_Expecter struct { + mock *mock.Mock +} + +func (_m *Option) EXPECT() *Option_Expecter { + return &Option_Expecter{mock: &_m.Mock} +} + // Execute provides a mock function with given fields: _a0 func (_m *Option) Execute(_a0 map[string]interface{}) { _m.Called(_a0) } +// Option_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute' +type Option_Execute_Call struct { + *mock.Call +} + +// Execute is a helper method to define mock.On call +// - _a0 map[string]interface{} +func (_e *Option_Expecter) Execute(_a0 interface{}) *Option_Execute_Call { + return &Option_Execute_Call{Call: _e.mock.On("Execute", _a0)} +} + +func (_c *Option_Execute_Call) Run(run func(_a0 map[string]interface{})) *Option_Execute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(map[string]interface{})) + }) + return _c +} + +func (_c *Option_Execute_Call) Return() *Option_Execute_Call { + _c.Call.Return() + return _c +} + +func (_c *Option_Execute_Call) RunAndReturn(run func(map[string]interface{})) *Option_Execute_Call { + _c.Call.Return(run) + return _c +} + // NewOption creates a new instance of Option. 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 NewOption(t interface { diff --git a/mocks/validation/Rule.go b/mocks/validation/Rule.go index 83aa2c4bd..0b64e53e5 100644 --- a/mocks/validation/Rule.go +++ b/mocks/validation/Rule.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,10 +12,22 @@ type Rule struct { mock.Mock } +type Rule_Expecter struct { + mock *mock.Mock +} + +func (_m *Rule) EXPECT() *Rule_Expecter { + return &Rule_Expecter{mock: &_m.Mock} +} + // Message provides a mock function with given fields: func (_m *Rule) Message() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Message") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -26,6 +38,33 @@ func (_m *Rule) Message() string { return r0 } +// Rule_Message_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Message' +type Rule_Message_Call struct { + *mock.Call +} + +// Message is a helper method to define mock.On call +func (_e *Rule_Expecter) Message() *Rule_Message_Call { + return &Rule_Message_Call{Call: _e.mock.On("Message")} +} + +func (_c *Rule_Message_Call) Run(run func()) *Rule_Message_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Rule_Message_Call) Return(_a0 string) *Rule_Message_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Rule_Message_Call) RunAndReturn(run func() string) *Rule_Message_Call { + _c.Call.Return(run) + return _c +} + // Passes provides a mock function with given fields: data, val, options func (_m *Rule) Passes(data validation.Data, val interface{}, options ...interface{}) bool { var _ca []interface{} @@ -33,6 +72,10 @@ func (_m *Rule) Passes(data validation.Data, val interface{}, options ...interfa _ca = append(_ca, options...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Passes") + } + var r0 bool if rf, ok := ret.Get(0).(func(validation.Data, interface{}, ...interface{}) bool); ok { r0 = rf(data, val, options...) @@ -43,10 +86,51 @@ func (_m *Rule) Passes(data validation.Data, val interface{}, options ...interfa return r0 } +// Rule_Passes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Passes' +type Rule_Passes_Call struct { + *mock.Call +} + +// Passes is a helper method to define mock.On call +// - data validation.Data +// - val interface{} +// - options ...interface{} +func (_e *Rule_Expecter) Passes(data interface{}, val interface{}, options ...interface{}) *Rule_Passes_Call { + return &Rule_Passes_Call{Call: _e.mock.On("Passes", + append([]interface{}{data, val}, options...)...)} +} + +func (_c *Rule_Passes_Call) Run(run func(data validation.Data, val interface{}, options ...interface{})) *Rule_Passes_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(validation.Data), args[1].(interface{}), variadicArgs...) + }) + return _c +} + +func (_c *Rule_Passes_Call) Return(_a0 bool) *Rule_Passes_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Rule_Passes_Call) RunAndReturn(run func(validation.Data, interface{}, ...interface{}) bool) *Rule_Passes_Call { + _c.Call.Return(run) + return _c +} + // Signature provides a mock function with given fields: func (_m *Rule) Signature() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Signature") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -57,6 +141,33 @@ func (_m *Rule) Signature() string { return r0 } +// Rule_Signature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Signature' +type Rule_Signature_Call struct { + *mock.Call +} + +// Signature is a helper method to define mock.On call +func (_e *Rule_Expecter) Signature() *Rule_Signature_Call { + return &Rule_Signature_Call{Call: _e.mock.On("Signature")} +} + +func (_c *Rule_Signature_Call) Run(run func()) *Rule_Signature_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Rule_Signature_Call) Return(_a0 string) *Rule_Signature_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Rule_Signature_Call) RunAndReturn(run func() string) *Rule_Signature_Call { + _c.Call.Return(run) + return _c +} + // NewRule creates a new instance of Rule. 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 NewRule(t interface { diff --git a/mocks/validation/Validation.go b/mocks/validation/Validation.go index fef8d86eb..a38662458 100644 --- a/mocks/validation/Validation.go +++ b/mocks/validation/Validation.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,10 +12,22 @@ type Validation struct { mock.Mock } +type Validation_Expecter struct { + mock *mock.Mock +} + +func (_m *Validation) EXPECT() *Validation_Expecter { + return &Validation_Expecter{mock: &_m.Mock} +} + // AddRules provides a mock function with given fields: _a0 func (_m *Validation) AddRules(_a0 []validation.Rule) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for AddRules") + } + var r0 error if rf, ok := ret.Get(0).(func([]validation.Rule) error); ok { r0 = rf(_a0) @@ -26,6 +38,34 @@ func (_m *Validation) AddRules(_a0 []validation.Rule) error { return r0 } +// Validation_AddRules_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddRules' +type Validation_AddRules_Call struct { + *mock.Call +} + +// AddRules is a helper method to define mock.On call +// - _a0 []validation.Rule +func (_e *Validation_Expecter) AddRules(_a0 interface{}) *Validation_AddRules_Call { + return &Validation_AddRules_Call{Call: _e.mock.On("AddRules", _a0)} +} + +func (_c *Validation_AddRules_Call) Run(run func(_a0 []validation.Rule)) *Validation_AddRules_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]validation.Rule)) + }) + return _c +} + +func (_c *Validation_AddRules_Call) Return(_a0 error) *Validation_AddRules_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Validation_AddRules_Call) RunAndReturn(run func([]validation.Rule) error) *Validation_AddRules_Call { + _c.Call.Return(run) + return _c +} + // Make provides a mock function with given fields: data, rules, options func (_m *Validation) Make(data interface{}, rules map[string]string, options ...validation.Option) (validation.Validator, error) { _va := make([]interface{}, len(options)) @@ -37,6 +77,10 @@ func (_m *Validation) Make(data interface{}, rules map[string]string, options .. _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Make") + } + var r0 validation.Validator var r1 error if rf, ok := ret.Get(0).(func(interface{}, map[string]string, ...validation.Option) (validation.Validator, error)); ok { @@ -59,10 +103,51 @@ func (_m *Validation) Make(data interface{}, rules map[string]string, options .. return r0, r1 } +// Validation_Make_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Make' +type Validation_Make_Call struct { + *mock.Call +} + +// Make is a helper method to define mock.On call +// - data interface{} +// - rules map[string]string +// - options ...validation.Option +func (_e *Validation_Expecter) Make(data interface{}, rules interface{}, options ...interface{}) *Validation_Make_Call { + return &Validation_Make_Call{Call: _e.mock.On("Make", + append([]interface{}{data, rules}, options...)...)} +} + +func (_c *Validation_Make_Call) Run(run func(data interface{}, rules map[string]string, options ...validation.Option)) *Validation_Make_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]validation.Option, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(validation.Option) + } + } + run(args[0].(interface{}), args[1].(map[string]string), variadicArgs...) + }) + return _c +} + +func (_c *Validation_Make_Call) Return(_a0 validation.Validator, _a1 error) *Validation_Make_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Validation_Make_Call) RunAndReturn(run func(interface{}, map[string]string, ...validation.Option) (validation.Validator, error)) *Validation_Make_Call { + _c.Call.Return(run) + return _c +} + // Rules provides a mock function with given fields: func (_m *Validation) Rules() []validation.Rule { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Rules") + } + var r0 []validation.Rule if rf, ok := ret.Get(0).(func() []validation.Rule); ok { r0 = rf() @@ -75,6 +160,33 @@ func (_m *Validation) Rules() []validation.Rule { return r0 } +// Validation_Rules_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Rules' +type Validation_Rules_Call struct { + *mock.Call +} + +// Rules is a helper method to define mock.On call +func (_e *Validation_Expecter) Rules() *Validation_Rules_Call { + return &Validation_Rules_Call{Call: _e.mock.On("Rules")} +} + +func (_c *Validation_Rules_Call) Run(run func()) *Validation_Rules_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Validation_Rules_Call) Return(_a0 []validation.Rule) *Validation_Rules_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Validation_Rules_Call) RunAndReturn(run func() []validation.Rule) *Validation_Rules_Call { + _c.Call.Return(run) + return _c +} + // NewValidation creates a new instance of Validation. 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 NewValidation(t interface { diff --git a/mocks/validation/Validator.go b/mocks/validation/Validator.go index 7e79ad18f..e1009efdd 100644 --- a/mocks/validation/Validator.go +++ b/mocks/validation/Validator.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package mocks @@ -12,10 +12,22 @@ type Validator struct { mock.Mock } +type Validator_Expecter struct { + mock *mock.Mock +} + +func (_m *Validator) EXPECT() *Validator_Expecter { + return &Validator_Expecter{mock: &_m.Mock} +} + // Bind provides a mock function with given fields: ptr func (_m *Validator) Bind(ptr interface{}) error { ret := _m.Called(ptr) + if len(ret) == 0 { + panic("no return value specified for Bind") + } + var r0 error if rf, ok := ret.Get(0).(func(interface{}) error); ok { r0 = rf(ptr) @@ -26,10 +38,42 @@ func (_m *Validator) Bind(ptr interface{}) error { return r0 } +// Validator_Bind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bind' +type Validator_Bind_Call struct { + *mock.Call +} + +// Bind is a helper method to define mock.On call +// - ptr interface{} +func (_e *Validator_Expecter) Bind(ptr interface{}) *Validator_Bind_Call { + return &Validator_Bind_Call{Call: _e.mock.On("Bind", ptr)} +} + +func (_c *Validator_Bind_Call) Run(run func(ptr interface{})) *Validator_Bind_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Validator_Bind_Call) Return(_a0 error) *Validator_Bind_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Validator_Bind_Call) RunAndReturn(run func(interface{}) error) *Validator_Bind_Call { + _c.Call.Return(run) + return _c +} + // Errors provides a mock function with given fields: func (_m *Validator) Errors() validation.Errors { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Errors") + } + var r0 validation.Errors if rf, ok := ret.Get(0).(func() validation.Errors); ok { r0 = rf() @@ -42,10 +86,41 @@ func (_m *Validator) Errors() validation.Errors { return r0 } +// Validator_Errors_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Errors' +type Validator_Errors_Call struct { + *mock.Call +} + +// Errors is a helper method to define mock.On call +func (_e *Validator_Expecter) Errors() *Validator_Errors_Call { + return &Validator_Errors_Call{Call: _e.mock.On("Errors")} +} + +func (_c *Validator_Errors_Call) Run(run func()) *Validator_Errors_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Validator_Errors_Call) Return(_a0 validation.Errors) *Validator_Errors_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Validator_Errors_Call) RunAndReturn(run func() validation.Errors) *Validator_Errors_Call { + _c.Call.Return(run) + return _c +} + // Fails provides a mock function with given fields: func (_m *Validator) Fails() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Fails") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -56,6 +131,33 @@ func (_m *Validator) Fails() bool { return r0 } +// Validator_Fails_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Fails' +type Validator_Fails_Call struct { + *mock.Call +} + +// Fails is a helper method to define mock.On call +func (_e *Validator_Expecter) Fails() *Validator_Fails_Call { + return &Validator_Fails_Call{Call: _e.mock.On("Fails")} +} + +func (_c *Validator_Fails_Call) Run(run func()) *Validator_Fails_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Validator_Fails_Call) Return(_a0 bool) *Validator_Fails_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Validator_Fails_Call) RunAndReturn(run func() bool) *Validator_Fails_Call { + _c.Call.Return(run) + return _c +} + // NewValidator creates a new instance of Validator. 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 NewValidator(t interface { diff --git a/support/convert/pointer.go b/support/convert/pointer.go new file mode 100644 index 000000000..2e85a3dc7 --- /dev/null +++ b/support/convert/pointer.go @@ -0,0 +1,5 @@ +package convert + +func Pointer[T any](t T) *T { + return &t +} diff --git a/support/docker/database.go b/support/docker/database.go index 0569a81ff..4f801d317 100644 --- a/support/docker/database.go +++ b/support/docker/database.go @@ -7,78 +7,78 @@ const ( ) type Database struct { - Mysql *Mysql - Mysql1 *Mysql - Postgresql *Postgresql - Sqlserver *Sqlserver - Sqlite *Sqlite + Mysql *Mysql + Mysql1 *Mysql + Postgres *Postgres + Sqlserver *Sqlserver + Sqlite *Sqlite } func InitDatabase() (*Database, error) { - mysqlDocker := NewMysql(database, username, password) - if err := mysqlDocker.Build(); err != nil { - return nil, err - } - - mysql1Docker := NewMysql(database, username, password) - if err := mysql1Docker.Build(); err != nil { - return nil, err - } + //mysqlDocker := NewMysql(database, username, password) + //if err := mysqlDocker.Build(); err != nil { + // return nil, err + //} + // + //mysql1Docker := NewMysql(database, username, password) + //if err := mysql1Docker.Build(); err != nil { + // return nil, err + //} - postgresqlDocker := NewPostgresql(database, username, password) + postgresqlDocker := NewPostgres(database, username, password) if err := postgresqlDocker.Build(); err != nil { return nil, err } - sqlserverDocker := NewSqlserver(database, username, password) - if err := sqlserverDocker.Build(); err != nil { - return nil, err - } - - sqliteDocker := NewSqlite(database) - if err := sqliteDocker.Build(); err != nil { - return nil, err - } + //sqlserverDocker := NewSqlserver(database, username, password) + //if err := sqlserverDocker.Build(); err != nil { + // return nil, err + //} + // + //sqliteDocker := NewSqlite(database) + //if err := sqliteDocker.Build(); err != nil { + // return nil, err + //} return &Database{ - Mysql: mysqlDocker, - Mysql1: mysql1Docker, - Postgresql: postgresqlDocker, - Sqlserver: sqlserverDocker, - Sqlite: sqliteDocker, + //Mysql: mysqlDocker, + //Mysql1: mysql1Docker, + Postgres: postgresqlDocker, + //Sqlserver: sqlserverDocker, + //Sqlite: sqliteDocker, }, nil } func (r *Database) Fresh() error { - if err := r.Mysql.Fresh(); err != nil { - return err - } - if err := r.Postgresql.Fresh(); err != nil { - return err - } - if err := r.Sqlserver.Fresh(); err != nil { - return err - } - if err := r.Sqlite.Fresh(); err != nil { + //if err := r.Mysql.Fresh(); err != nil { + // return err + //} + if err := r.Postgres.Fresh(); err != nil { return err } + //if err := r.Sqlserver.Fresh(); err != nil { + // return err + //} + //if err := r.Sqlite.Fresh(); err != nil { + // return err + //} return nil } func (r *Database) Stop() error { - if err := r.Mysql.Stop(); err != nil { - return err - } - if err := r.Postgresql.Stop(); err != nil { - return err - } - if err := r.Sqlserver.Stop(); err != nil { - return err - } - if err := r.Sqlite.Stop(); err != nil { + //if err := r.Mysql.Stop(); err != nil { + // return err + //} + if err := r.Postgres.Stop(); err != nil { return err } + //if err := r.Sqlserver.Stop(); err != nil { + // return err + //} + //if err := r.Sqlite.Stop(); err != nil { + // return err + //} return nil } diff --git a/support/docker/database_test.go b/support/docker/database_test.go index 4abc915bc..d66fc6d90 100644 --- a/support/docker/database_test.go +++ b/support/docker/database_test.go @@ -17,14 +17,14 @@ func TestInitDatabase(t *testing.T) { assert.Nil(t, err) assert.NotNil(t, database1) assert.True(t, database1.Mysql.Config().Port > 0) - assert.True(t, database1.Postgresql.Config().Port > 0) + assert.True(t, database1.Postgres.Config().Port > 0) assert.True(t, database1.Sqlserver.Config().Port > 0) database2, err := InitDatabase() assert.Nil(t, err) assert.NotNil(t, database2) assert.True(t, database2.Mysql.Config().Port > 0) - assert.True(t, database2.Postgresql.Config().Port > 0) + assert.True(t, database2.Postgres.Config().Port > 0) assert.True(t, database2.Sqlserver.Config().Port > 0) assert.Nil(t, database1.Fresh()) diff --git a/support/docker/postgresql.go b/support/docker/postgres.go similarity index 77% rename from support/docker/postgresql.go rename to support/docker/postgres.go index 70459ec1d..5e57252a6 100644 --- a/support/docker/postgresql.go +++ b/support/docker/postgres.go @@ -11,7 +11,7 @@ import ( "github.com/goravel/framework/contracts/testing" ) -type Postgresql struct { +type Postgres struct { containerID string database string host string @@ -21,8 +21,8 @@ type Postgresql struct { port int } -func NewPostgresql(database, username, password string) *Postgresql { - return &Postgresql{ +func NewPostgres(database, username, password string) *Postgres { + return &Postgres{ database: database, host: "127.0.0.1", username: username, @@ -40,27 +40,27 @@ func NewPostgresql(database, username, password string) *Postgresql { } } -func (receiver *Postgresql) Build() error { +func (receiver *Postgres) Build() error { command, exposedPorts := imageToCommand(receiver.image) containerID, err := run(command) if err != nil { - return fmt.Errorf("init Postgresql error: %v", err) + return fmt.Errorf("init Postgres error: %v", err) } if containerID == "" { - return fmt.Errorf("no container id return when creating Postgresql docker") + return fmt.Errorf("no container id return when creating Postgres docker") } receiver.containerID = containerID receiver.port = getExposedPort(exposedPorts, 5432) if _, err := receiver.connect(); err != nil { - return fmt.Errorf("connect Postgresql error: %v", err) + return fmt.Errorf("connect Postgres error: %v", err) } return nil } -func (receiver *Postgresql) Config() testing.DatabaseConfig { +func (receiver *Postgres) Config() testing.DatabaseConfig { return testing.DatabaseConfig{ Host: receiver.host, Port: receiver.port, @@ -70,7 +70,7 @@ func (receiver *Postgresql) Config() testing.DatabaseConfig { } } -func (receiver *Postgresql) Fresh() error { +func (receiver *Postgres) Fresh() error { instance, err := receiver.connect() if err != nil { return fmt.Errorf("connect Postgres error when clearing: %v", err) @@ -87,23 +87,23 @@ func (receiver *Postgresql) Fresh() error { return nil } -func (receiver *Postgresql) Image(image testing.Image) { +func (receiver *Postgres) Image(image testing.Image) { receiver.image = &image } -func (receiver *Postgresql) Name() orm.Driver { +func (receiver *Postgres) Name() orm.Driver { return orm.DriverPostgresql } -func (receiver *Postgresql) Stop() error { +func (receiver *Postgres) Stop() error { if _, err := run(fmt.Sprintf("docker stop %s", receiver.containerID)); err != nil { - return fmt.Errorf("stop Postgresql error: %v", err) + return fmt.Errorf("stop Postgres error: %v", err) } return nil } -func (receiver *Postgresql) connect() (*gormio.DB, error) { +func (receiver *Postgres) connect() (*gormio.DB, error) { var ( instance *gormio.DB err error diff --git a/support/docker/postgresql_test.go b/support/docker/postgres_test.go similarity index 95% rename from support/docker/postgresql_test.go rename to support/docker/postgres_test.go index 6ab0e3214..e5af948d4 100644 --- a/support/docker/postgresql_test.go +++ b/support/docker/postgres_test.go @@ -14,7 +14,7 @@ import ( type PostgresqlTestSuite struct { suite.Suite mockConfig *configmocks.Config - postgresql *Postgresql + postgresql *Postgres } func TestPostgresqlTestSuite(t *testing.T) { @@ -27,7 +27,7 @@ func TestPostgresqlTestSuite(t *testing.T) { func (s *PostgresqlTestSuite) SetupTest() { s.mockConfig = &configmocks.Config{} - s.postgresql = NewPostgresql("goravel", "goravel", "goravel") + s.postgresql = NewPostgres("goravel", "goravel", "goravel") } func (s *PostgresqlTestSuite) TestBuild() { diff --git a/testing/docker/database.go b/testing/docker/database.go index cf55e0a6b..cd319f41a 100644 --- a/testing/docker/database.go +++ b/testing/docker/database.go @@ -40,7 +40,7 @@ func NewDatabase(app foundation.Application, connection string, gormInitialize g case contractsorm.DriverMysql: databaseDriver = supportdocker.NewMysql(database, username, password) case contractsorm.DriverPostgresql: - databaseDriver = supportdocker.NewPostgresql(database, username, password) + databaseDriver = supportdocker.NewPostgres(database, username, password) case contractsorm.DriverSqlserver: databaseDriver = supportdocker.NewSqlserver(database, username, password) case contractsorm.DriverSqlite: diff --git a/testing/docker/database_test.go b/testing/docker/database_test.go index f454bad31..2860c3cf0 100644 --- a/testing/docker/database_test.go +++ b/testing/docker/database_test.go @@ -97,7 +97,7 @@ func TestNewDatabase(t *testing.T) { app: mockApp, config: mockConfig, connection: "postgresql", - driver: supportdocker.NewPostgresql(database, username, password), + driver: supportdocker.NewPostgres(database, username, password), gormInitialize: mockGormInitialize, } },