diff --git a/.github/workflows/autogen.yaml b/.github/workflows/autogen.yaml deleted file mode 100644 index bbcbaba4..00000000 --- a/.github/workflows/autogen.yaml +++ /dev/null @@ -1,47 +0,0 @@ -name: Autogenerate -on: - # Note: When testing with nektos/act, the workflow_dispatch does not work as of version 0.2.63 - workflow_dispatch: - - pull_request: - paths-ignore: - - '*.md' - -jobs: - mockery: - name: Generate mocks - runs-on: ubuntu-latest - - # Permissions are needed to push the changes back to the repository - permissions: - contents: write - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} - - - name: Setup Go - uses: actions/setup-go@v5 - with: - go-version: 1.17 - - - name: Install Mockery - uses: jaxxstorm/action-install-gh-release@v1.10.0 - with: # Grab a specific tag - repo: vektra/mockery - tag: v2.51.0 - - - name: Generate mocks - run: mockery - - # Commit all changed files back to the repository - - uses: stefanzweifel/git-auto-commit-action@v5 - #with: - # commit_message: [ Autogen ] Generated mocks - # # Mockery can generate new files, so we need to add them to the commit as well - # add_options: '$(git ls-files -o --exclude-standard)' - # file_pattern: '*.go' # Only commit changes to Go files - # # Only create a branch when the workflow is triggered manually - # create_branch: ${{ github.event_name == 'workflow_dispatch' }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index cb19cee5..0d960db2 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,5 +1,9 @@ name: Test on: + workflow_run: + workflows: ["Autogenerate"] + types: + - completed push: paths-ignore: - "**.md" @@ -13,12 +17,59 @@ on: workflow_dispatch: jobs: + autogen: + name: Generate mocks + runs-on: ubuntu-latest + + # Permissions are needed to push the changes back to the repository + permissions: + contents: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: 1.17 + - name: Install Mockery + uses: jaxxstorm/action-install-gh-release@v1.10.0 + with: # Grab a specific tag + repo: vektra/mockery + tag: v3.5.3 + - name: Generate mocks + run: mockery --config .mockery.yaml + - name: Cache generated mocks + uses: actions/cache@v4 + with: + path: | + ocpp1.6_test/mocks/ + ocpp2.0.1_test/mocks/ + ocppj/mocks/ + ws/mocks/ + key: ${{ runner.os }}-mocks-${{ github.sha }} unit: runs-on: ubuntu-latest name: Unit tests + needs: autogen steps: - name: Checkout code uses: actions/checkout@v4.2.2 + - name: Restore generated mocks + id: cache-mocks + uses: actions/cache/restore@v4 + with: + path: | + ocpp1.6_test/mocks/ + ocpp2.0.1_test/mocks/ + ocppj/mocks/ + ws/mocks/ + key: ${{ runner.os }}-mocks-${{ github.sha }} + - name: Check cache hit + if: steps.cache-mocks.outputs.cache-hit != 'true' + run: exit 1 - name: Run tests run: | docker compose -f docker-compose.test.yaml up unit_test --abort-on-container-exit @@ -54,7 +105,7 @@ jobs: publish_coverage: runs-on: ubuntu-latest # Unit and integration tests must be run before publishing coverage - needs: [ unit, integration ] + needs: [unit, integration] name: Publish coverage steps: - name: Checkout code @@ -68,4 +119,4 @@ jobs: with: path-to-profile: coverage.out env: - COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 238f1b8e..8ed6a3dc 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,10 @@ certs/ central_system_sim -charge_point_sim \ No newline at end of file +charge_point_sim + +# Generatd files +ocpp1.6_test/mocks/ +ocpp2.0.1_test/mocks/ +ocppj/mocks/ +ws/mocks/ diff --git a/.mockery.yaml b/.mockery.yaml index a451b57a..d3e52bd1 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -1,139 +1,110 @@ -with-expecter: true -dir: "{{.InterfaceDir}}/mocks" -outpkg: mocks -filename: "mock_{{.InterfaceName}}.go" -mockname: "Mock{{.InterfaceName}}" all: true - +dir: '{{.InterfaceDir}}/mocks' +structname: Mock{{.InterfaceName}} +pkgname: mocks +template: testify +template-data: + unroll-variadic: true packages: - github.com/lorenzodonini/ocpp-go/ocpp1.6/core: + github.com/lorenzodonini/ocpp-go/ocpp1.6: config: - dir: "ocpp1.6_test/mocks" - filename: "mock_core_{{.InterfaceName|snakecase}}.go" - mockname: "MockCore{{.InterfaceName}}" + dir: ocpp1.6_test/mocks interfaces: - CentralSystemHandler: - ChargePointHandler: - + CentralSystem: {} + ChargePoint: {} + ChargePointConnection: {} github.com/lorenzodonini/ocpp-go/ocpp1.6/certificates: config: - dir: "ocpp1.6_test/mocks" - filename: "mock_certificates_{{.InterfaceName|snakecase}}.go" - mockname: "MockCertificates{{.InterfaceName}}" - + dir: ocpp1.6_test/mocks + structname: MockCertificates{{.InterfaceName}} + filename: mock_certificates_{{.InterfaceName|snakecase}}.go interfaces: - ChargePointHandler: - - github.com/lorenzodonini/ocpp-go/ocpp1.6/logging: + ChargePointHandler: {} + github.com/lorenzodonini/ocpp-go/ocpp1.6/core: config: - dir: "ocpp1.6_test/mocks" - filename: "mock_logging_{{.InterfaceName|snakecase}}.go" - mockname: "MockLog{{.InterfaceName}}" - + dir: ocpp1.6_test/mocks + structname: MockCore{{.InterfaceName}} + filename: mock_core_{{.InterfaceName|snakecase}}.go interfaces: - CentralSystemHandler: - ChargePointHandler: - + CentralSystemHandler: {} + ChargePointHandler: {} github.com/lorenzodonini/ocpp-go/ocpp1.6/extendedtriggermessage: config: - dir: "ocpp1.6_test/mocks" - filename: "mock_extended_trigger_message_{{.InterfaceName|snakecase}}.go" - mockname: "MockExtendedTriggerMessage{{.InterfaceName}}" - + dir: ocpp1.6_test/mocks + structname: MockExtendedTriggerMessage{{.InterfaceName}} + filename: mock_extended_trigger_message_{{.InterfaceName|snakecase}}.go interfaces: - ChargePointHandler: - + ChargePointHandler: {} github.com/lorenzodonini/ocpp-go/ocpp1.6/firmware: config: - dir: "ocpp1.6_test/mocks" - filename: "mock_firmware_{{.InterfaceName|snakecase}}.go" - mockname: "MockFirmware{{.InterfaceName}}" - + dir: ocpp1.6_test/mocks + structname: MockFirmware{{.InterfaceName}} + filename: mock_firmware_{{.InterfaceName|snakecase}}.go interfaces: - CentralSystemHandler: - ChargePointHandler: - + CentralSystemHandler: {} + ChargePointHandler: {} github.com/lorenzodonini/ocpp-go/ocpp1.6/localauth: config: - dir: "ocpp1.6_test/mocks" - filename: "mock_local_auth_list_{{.InterfaceName|snakecase}}.go" - mockname: "MockLocalAuthList{{.InterfaceName}}" - + dir: ocpp1.6_test/mocks + structname: MockLocalAuthList{{.InterfaceName}} + filename: mock_local_auth_list_{{.InterfaceName|snakecase}}.go + interfaces: + CentralSystemHandler: {} + ChargePointHandler: {} + github.com/lorenzodonini/ocpp-go/ocpp1.6/logging: + config: + dir: ocpp1.6_test/mocks + structname: MockLog{{.InterfaceName}} + filename: mock_logging_{{.InterfaceName|snakecase}}.go interfaces: - CentralSystemHandler: - ChargePointHandler: - - + CentralSystemHandler: {} + ChargePointHandler: {} github.com/lorenzodonini/ocpp-go/ocpp1.6/remotetrigger: config: - dir: "ocpp1.6_test/mocks" - filename: "mock_remote_trigger_{{.InterfaceName|snakecase}}.go" - mockname: "MockRemoteTrigger{{.InterfaceName}}" - + dir: ocpp1.6_test/mocks + structname: MockRemoteTrigger{{.InterfaceName}} + filename: mock_remote_trigger_{{.InterfaceName|snakecase}}.go interfaces: - CentralSystemHandler: - ChargePointHandler: - + CentralSystemHandler: {} + ChargePointHandler: {} github.com/lorenzodonini/ocpp-go/ocpp1.6/reservation: config: - dir: "ocpp1.6_test/mocks" - filename: "mock_reservation_{{.InterfaceName|snakecase}}.go" - mockname: "MockReservation{{.InterfaceName}}" - + dir: ocpp1.6_test/mocks + structname: MockReservation{{.InterfaceName}} + filename: mock_reservation_{{.InterfaceName|snakecase}}.go interfaces: - CentralSystemHandler: - ChargePointHandler: - + CentralSystemHandler: {} + ChargePointHandler: {} github.com/lorenzodonini/ocpp-go/ocpp1.6/securefirmware: config: - dir: "ocpp1.6_test/mocks" - filename: "mock_secure_firmware_{{.InterfaceName}}.go" - mockname: "MockSecureFirmware{{.InterfaceName}}" - + dir: ocpp1.6_test/mocks + structname: MockSecureFirmware{{.InterfaceName}} + filename: mock_secure_firmware_{{.InterfaceName|snakecase}}.go interfaces: - CentralSystemHandler: - ChargePointHandler: - - + CentralSystemHandler: {} + ChargePointHandler: {} github.com/lorenzodonini/ocpp-go/ocpp1.6/security: config: - dir: "ocpp1.6_test/mocks" - filename: "mock_security_{{.InterfaceName|snakecase}}.go" - mockname: "MockSecurity{{.InterfaceName}}" - + dir: ocpp1.6_test/mocks + structname: MockSecurity{{.InterfaceName}} + filename: mock_security_{{.InterfaceName|snakecase}}.go interfaces: - CentralSystemHandler: - ChargePointHandler: - - + CentralSystemHandler: {} + ChargePointHandler: {} github.com/lorenzodonini/ocpp-go/ocpp1.6/smartcharging: config: - dir: "ocpp1.6_test/mocks" - filename: "mock_smart_charging_{{.InterfaceName|snakecase}}.go" - mockname: "MockSmartCharging{{.InterfaceName}}" - - interfaces: - CentralSystemHandler: - ChargePointHandler: - - - github.com/lorenzodonini/ocpp-go/ocpp1.6: - config: - dir: "ocpp1.6_test/mocks" - filename: "mock_ocpp16.go" - + dir: ocpp1.6_test/mocks + structname: MockSmartCharging{{.InterfaceName}} + filename: mock_smart_charging_{{.InterfaceName|snakecase}}.go interfaces: - ChargePointConnection: - ChargePoint: - CentralSystem: - + CentralSystemHandler: {} + ChargePointHandler: {} github.com/lorenzodonini/ocpp-go/ocppj: interfaces: - ServerQueueMap: - RequestQueue: - + RequestQueue: {} + ServerQueueMap: {} github.com/lorenzodonini/ocpp-go/ws: interfaces: - WsClient: - WsServer: - Channel: \ No newline at end of file + Channel: {} + Client: {} + Server: {} diff --git a/Makefile b/Makefile index 4c03455b..cb01e42e 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,7 @@ test: docker compose -f docker-compose.test.yaml up toxiproxy integration_test --abort-on-container-exit + +mocks: + docker run --rm -v $(PWD):/src -w /src vektra/mockery:v3.5.3 --config .mockery.yaml + +.PHONY: test mocks diff --git a/docs/testing.md b/docs/testing.md index c33fa781..8f7ae4fb 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -15,8 +15,7 @@ make test For generating mocks, the `mockery` tool is used. For `mockery` installation, follow the instructions on the [official docs](https://vektra.github.io/mockery/latest/). -**Note**: Mock generation is also run as part of the CI pipeline, so you can check if the mocks are up-to-date by -running the tests. However, It is recommended to run the tests locally before pushing your changes. +**Note**: Mocks are not checked in and are instead generated on-the-fly as part of the CI pipeline. If your local tests fail, it may be due to your mocks being out-of-date. This can be fixed by re-generating the mocks. It is recommended to run the tests locally before pushing your changes. When adding new interfaces and needing to generate mocks, you should: @@ -26,6 +25,17 @@ When adding new interfaces and needing to generate mocks, you should: 2. Run the following command: ```sh - mockery + mockery --config .mockery.yaml ``` + Alternatively, you may generate the mocks via make target: + ```sh + make mocks + ``` + +## Toxiproxy +For testing the resilience of the library against network issues, some tests use Toxiproxy. +If you wish to run the network tests locally (without docker compose) you need to: +- Install [toxiproxy](https://github.com/Shopify/toxiproxy) for your platform +- Start a local toxiproxy - `toxiproxy-server -port 8474 -host localhost` +- Run the tests - `go fmt ./... && go vet ./... && go test -v -count=1 -failfast ./...` diff --git a/ocpp1.6_test/mocks/mock_certificates_charge_point_handler.go b/ocpp1.6_test/mocks/mock_certificates_charge_point_handler.go deleted file mode 100644 index 363c4fde..00000000 --- a/ocpp1.6_test/mocks/mock_certificates_charge_point_handler.go +++ /dev/null @@ -1,209 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - certificates "github.com/lorenzodonini/ocpp-go/ocpp1.6/certificates" - mock "github.com/stretchr/testify/mock" -) - -// MockCertificatesChargePointHandler is an autogenerated mock type for the ChargePointHandler type -type MockCertificatesChargePointHandler struct { - mock.Mock -} - -type MockCertificatesChargePointHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockCertificatesChargePointHandler) EXPECT() *MockCertificatesChargePointHandler_Expecter { - return &MockCertificatesChargePointHandler_Expecter{mock: &_m.Mock} -} - -// OnDeleteCertificate provides a mock function with given fields: request -func (_m *MockCertificatesChargePointHandler) OnDeleteCertificate(request *certificates.DeleteCertificateRequest) (*certificates.DeleteCertificateResponse, error) { - ret := _m.Called(request) - - if len(ret) == 0 { - panic("no return value specified for OnDeleteCertificate") - } - - var r0 *certificates.DeleteCertificateResponse - var r1 error - if rf, ok := ret.Get(0).(func(*certificates.DeleteCertificateRequest) (*certificates.DeleteCertificateResponse, error)); ok { - return rf(request) - } - if rf, ok := ret.Get(0).(func(*certificates.DeleteCertificateRequest) *certificates.DeleteCertificateResponse); ok { - r0 = rf(request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*certificates.DeleteCertificateResponse) - } - } - - if rf, ok := ret.Get(1).(func(*certificates.DeleteCertificateRequest) error); ok { - r1 = rf(request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCertificatesChargePointHandler_OnDeleteCertificate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnDeleteCertificate' -type MockCertificatesChargePointHandler_OnDeleteCertificate_Call struct { - *mock.Call -} - -// OnDeleteCertificate is a helper method to define mock.On call -// - request *certificates.DeleteCertificateRequest -func (_e *MockCertificatesChargePointHandler_Expecter) OnDeleteCertificate(request interface{}) *MockCertificatesChargePointHandler_OnDeleteCertificate_Call { - return &MockCertificatesChargePointHandler_OnDeleteCertificate_Call{Call: _e.mock.On("OnDeleteCertificate", request)} -} - -func (_c *MockCertificatesChargePointHandler_OnDeleteCertificate_Call) Run(run func(request *certificates.DeleteCertificateRequest)) *MockCertificatesChargePointHandler_OnDeleteCertificate_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*certificates.DeleteCertificateRequest)) - }) - return _c -} - -func (_c *MockCertificatesChargePointHandler_OnDeleteCertificate_Call) Return(response *certificates.DeleteCertificateResponse, err error) *MockCertificatesChargePointHandler_OnDeleteCertificate_Call { - _c.Call.Return(response, err) - return _c -} - -func (_c *MockCertificatesChargePointHandler_OnDeleteCertificate_Call) RunAndReturn(run func(*certificates.DeleteCertificateRequest) (*certificates.DeleteCertificateResponse, error)) *MockCertificatesChargePointHandler_OnDeleteCertificate_Call { - _c.Call.Return(run) - return _c -} - -// OnGetInstalledCertificateIds provides a mock function with given fields: request -func (_m *MockCertificatesChargePointHandler) OnGetInstalledCertificateIds(request *certificates.GetInstalledCertificateIdsRequest) (*certificates.GetInstalledCertificateIdsResponse, error) { - ret := _m.Called(request) - - if len(ret) == 0 { - panic("no return value specified for OnGetInstalledCertificateIds") - } - - var r0 *certificates.GetInstalledCertificateIdsResponse - var r1 error - if rf, ok := ret.Get(0).(func(*certificates.GetInstalledCertificateIdsRequest) (*certificates.GetInstalledCertificateIdsResponse, error)); ok { - return rf(request) - } - if rf, ok := ret.Get(0).(func(*certificates.GetInstalledCertificateIdsRequest) *certificates.GetInstalledCertificateIdsResponse); ok { - r0 = rf(request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*certificates.GetInstalledCertificateIdsResponse) - } - } - - if rf, ok := ret.Get(1).(func(*certificates.GetInstalledCertificateIdsRequest) error); ok { - r1 = rf(request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCertificatesChargePointHandler_OnGetInstalledCertificateIds_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnGetInstalledCertificateIds' -type MockCertificatesChargePointHandler_OnGetInstalledCertificateIds_Call struct { - *mock.Call -} - -// OnGetInstalledCertificateIds is a helper method to define mock.On call -// - request *certificates.GetInstalledCertificateIdsRequest -func (_e *MockCertificatesChargePointHandler_Expecter) OnGetInstalledCertificateIds(request interface{}) *MockCertificatesChargePointHandler_OnGetInstalledCertificateIds_Call { - return &MockCertificatesChargePointHandler_OnGetInstalledCertificateIds_Call{Call: _e.mock.On("OnGetInstalledCertificateIds", request)} -} - -func (_c *MockCertificatesChargePointHandler_OnGetInstalledCertificateIds_Call) Run(run func(request *certificates.GetInstalledCertificateIdsRequest)) *MockCertificatesChargePointHandler_OnGetInstalledCertificateIds_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*certificates.GetInstalledCertificateIdsRequest)) - }) - return _c -} - -func (_c *MockCertificatesChargePointHandler_OnGetInstalledCertificateIds_Call) Return(response *certificates.GetInstalledCertificateIdsResponse, err error) *MockCertificatesChargePointHandler_OnGetInstalledCertificateIds_Call { - _c.Call.Return(response, err) - return _c -} - -func (_c *MockCertificatesChargePointHandler_OnGetInstalledCertificateIds_Call) RunAndReturn(run func(*certificates.GetInstalledCertificateIdsRequest) (*certificates.GetInstalledCertificateIdsResponse, error)) *MockCertificatesChargePointHandler_OnGetInstalledCertificateIds_Call { - _c.Call.Return(run) - return _c -} - -// OnInstallCertificate provides a mock function with given fields: request -func (_m *MockCertificatesChargePointHandler) OnInstallCertificate(request *certificates.InstallCertificateRequest) (*certificates.InstallCertificateResponse, error) { - ret := _m.Called(request) - - if len(ret) == 0 { - panic("no return value specified for OnInstallCertificate") - } - - var r0 *certificates.InstallCertificateResponse - var r1 error - if rf, ok := ret.Get(0).(func(*certificates.InstallCertificateRequest) (*certificates.InstallCertificateResponse, error)); ok { - return rf(request) - } - if rf, ok := ret.Get(0).(func(*certificates.InstallCertificateRequest) *certificates.InstallCertificateResponse); ok { - r0 = rf(request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*certificates.InstallCertificateResponse) - } - } - - if rf, ok := ret.Get(1).(func(*certificates.InstallCertificateRequest) error); ok { - r1 = rf(request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCertificatesChargePointHandler_OnInstallCertificate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnInstallCertificate' -type MockCertificatesChargePointHandler_OnInstallCertificate_Call struct { - *mock.Call -} - -// OnInstallCertificate is a helper method to define mock.On call -// - request *certificates.InstallCertificateRequest -func (_e *MockCertificatesChargePointHandler_Expecter) OnInstallCertificate(request interface{}) *MockCertificatesChargePointHandler_OnInstallCertificate_Call { - return &MockCertificatesChargePointHandler_OnInstallCertificate_Call{Call: _e.mock.On("OnInstallCertificate", request)} -} - -func (_c *MockCertificatesChargePointHandler_OnInstallCertificate_Call) Run(run func(request *certificates.InstallCertificateRequest)) *MockCertificatesChargePointHandler_OnInstallCertificate_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*certificates.InstallCertificateRequest)) - }) - return _c -} - -func (_c *MockCertificatesChargePointHandler_OnInstallCertificate_Call) Return(response *certificates.InstallCertificateResponse, err error) *MockCertificatesChargePointHandler_OnInstallCertificate_Call { - _c.Call.Return(response, err) - return _c -} - -func (_c *MockCertificatesChargePointHandler_OnInstallCertificate_Call) RunAndReturn(run func(*certificates.InstallCertificateRequest) (*certificates.InstallCertificateResponse, error)) *MockCertificatesChargePointHandler_OnInstallCertificate_Call { - _c.Call.Return(run) - return _c -} - -// NewMockCertificatesChargePointHandler creates a new instance of MockCertificatesChargePointHandler. 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 NewMockCertificatesChargePointHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockCertificatesChargePointHandler { - mock := &MockCertificatesChargePointHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocpp1.6_test/mocks/mock_core_central_system_handler.go b/ocpp1.6_test/mocks/mock_core_central_system_handler.go deleted file mode 100644 index 6aa1d683..00000000 --- a/ocpp1.6_test/mocks/mock_core_central_system_handler.go +++ /dev/null @@ -1,507 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - core "github.com/lorenzodonini/ocpp-go/ocpp1.6/core" - mock "github.com/stretchr/testify/mock" -) - -// MockCoreCentralSystemHandler is an autogenerated mock type for the CentralSystemHandler type -type MockCoreCentralSystemHandler struct { - mock.Mock -} - -type MockCoreCentralSystemHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockCoreCentralSystemHandler) EXPECT() *MockCoreCentralSystemHandler_Expecter { - return &MockCoreCentralSystemHandler_Expecter{mock: &_m.Mock} -} - -// OnAuthorize provides a mock function with given fields: chargePointId, request -func (_m *MockCoreCentralSystemHandler) OnAuthorize(chargePointId string, request *core.AuthorizeRequest) (*core.AuthorizeConfirmation, error) { - ret := _m.Called(chargePointId, request) - - if len(ret) == 0 { - panic("no return value specified for OnAuthorize") - } - - var r0 *core.AuthorizeConfirmation - var r1 error - if rf, ok := ret.Get(0).(func(string, *core.AuthorizeRequest) (*core.AuthorizeConfirmation, error)); ok { - return rf(chargePointId, request) - } - if rf, ok := ret.Get(0).(func(string, *core.AuthorizeRequest) *core.AuthorizeConfirmation); ok { - r0 = rf(chargePointId, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*core.AuthorizeConfirmation) - } - } - - if rf, ok := ret.Get(1).(func(string, *core.AuthorizeRequest) error); ok { - r1 = rf(chargePointId, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCoreCentralSystemHandler_OnAuthorize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnAuthorize' -type MockCoreCentralSystemHandler_OnAuthorize_Call struct { - *mock.Call -} - -// OnAuthorize is a helper method to define mock.On call -// - chargePointId string -// - request *core.AuthorizeRequest -func (_e *MockCoreCentralSystemHandler_Expecter) OnAuthorize(chargePointId interface{}, request interface{}) *MockCoreCentralSystemHandler_OnAuthorize_Call { - return &MockCoreCentralSystemHandler_OnAuthorize_Call{Call: _e.mock.On("OnAuthorize", chargePointId, request)} -} - -func (_c *MockCoreCentralSystemHandler_OnAuthorize_Call) Run(run func(chargePointId string, request *core.AuthorizeRequest)) *MockCoreCentralSystemHandler_OnAuthorize_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(*core.AuthorizeRequest)) - }) - return _c -} - -func (_c *MockCoreCentralSystemHandler_OnAuthorize_Call) Return(confirmation *core.AuthorizeConfirmation, err error) *MockCoreCentralSystemHandler_OnAuthorize_Call { - _c.Call.Return(confirmation, err) - return _c -} - -func (_c *MockCoreCentralSystemHandler_OnAuthorize_Call) RunAndReturn(run func(string, *core.AuthorizeRequest) (*core.AuthorizeConfirmation, error)) *MockCoreCentralSystemHandler_OnAuthorize_Call { - _c.Call.Return(run) - return _c -} - -// OnBootNotification provides a mock function with given fields: chargePointId, request -func (_m *MockCoreCentralSystemHandler) OnBootNotification(chargePointId string, request *core.BootNotificationRequest) (*core.BootNotificationConfirmation, error) { - ret := _m.Called(chargePointId, request) - - if len(ret) == 0 { - panic("no return value specified for OnBootNotification") - } - - var r0 *core.BootNotificationConfirmation - var r1 error - if rf, ok := ret.Get(0).(func(string, *core.BootNotificationRequest) (*core.BootNotificationConfirmation, error)); ok { - return rf(chargePointId, request) - } - if rf, ok := ret.Get(0).(func(string, *core.BootNotificationRequest) *core.BootNotificationConfirmation); ok { - r0 = rf(chargePointId, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*core.BootNotificationConfirmation) - } - } - - if rf, ok := ret.Get(1).(func(string, *core.BootNotificationRequest) error); ok { - r1 = rf(chargePointId, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCoreCentralSystemHandler_OnBootNotification_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnBootNotification' -type MockCoreCentralSystemHandler_OnBootNotification_Call struct { - *mock.Call -} - -// OnBootNotification is a helper method to define mock.On call -// - chargePointId string -// - request *core.BootNotificationRequest -func (_e *MockCoreCentralSystemHandler_Expecter) OnBootNotification(chargePointId interface{}, request interface{}) *MockCoreCentralSystemHandler_OnBootNotification_Call { - return &MockCoreCentralSystemHandler_OnBootNotification_Call{Call: _e.mock.On("OnBootNotification", chargePointId, request)} -} - -func (_c *MockCoreCentralSystemHandler_OnBootNotification_Call) Run(run func(chargePointId string, request *core.BootNotificationRequest)) *MockCoreCentralSystemHandler_OnBootNotification_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(*core.BootNotificationRequest)) - }) - return _c -} - -func (_c *MockCoreCentralSystemHandler_OnBootNotification_Call) Return(confirmation *core.BootNotificationConfirmation, err error) *MockCoreCentralSystemHandler_OnBootNotification_Call { - _c.Call.Return(confirmation, err) - return _c -} - -func (_c *MockCoreCentralSystemHandler_OnBootNotification_Call) RunAndReturn(run func(string, *core.BootNotificationRequest) (*core.BootNotificationConfirmation, error)) *MockCoreCentralSystemHandler_OnBootNotification_Call { - _c.Call.Return(run) - return _c -} - -// OnDataTransfer provides a mock function with given fields: chargePointId, request -func (_m *MockCoreCentralSystemHandler) OnDataTransfer(chargePointId string, request *core.DataTransferRequest) (*core.DataTransferConfirmation, error) { - ret := _m.Called(chargePointId, request) - - if len(ret) == 0 { - panic("no return value specified for OnDataTransfer") - } - - var r0 *core.DataTransferConfirmation - var r1 error - if rf, ok := ret.Get(0).(func(string, *core.DataTransferRequest) (*core.DataTransferConfirmation, error)); ok { - return rf(chargePointId, request) - } - if rf, ok := ret.Get(0).(func(string, *core.DataTransferRequest) *core.DataTransferConfirmation); ok { - r0 = rf(chargePointId, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*core.DataTransferConfirmation) - } - } - - if rf, ok := ret.Get(1).(func(string, *core.DataTransferRequest) error); ok { - r1 = rf(chargePointId, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCoreCentralSystemHandler_OnDataTransfer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnDataTransfer' -type MockCoreCentralSystemHandler_OnDataTransfer_Call struct { - *mock.Call -} - -// OnDataTransfer is a helper method to define mock.On call -// - chargePointId string -// - request *core.DataTransferRequest -func (_e *MockCoreCentralSystemHandler_Expecter) OnDataTransfer(chargePointId interface{}, request interface{}) *MockCoreCentralSystemHandler_OnDataTransfer_Call { - return &MockCoreCentralSystemHandler_OnDataTransfer_Call{Call: _e.mock.On("OnDataTransfer", chargePointId, request)} -} - -func (_c *MockCoreCentralSystemHandler_OnDataTransfer_Call) Run(run func(chargePointId string, request *core.DataTransferRequest)) *MockCoreCentralSystemHandler_OnDataTransfer_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(*core.DataTransferRequest)) - }) - return _c -} - -func (_c *MockCoreCentralSystemHandler_OnDataTransfer_Call) Return(confirmation *core.DataTransferConfirmation, err error) *MockCoreCentralSystemHandler_OnDataTransfer_Call { - _c.Call.Return(confirmation, err) - return _c -} - -func (_c *MockCoreCentralSystemHandler_OnDataTransfer_Call) RunAndReturn(run func(string, *core.DataTransferRequest) (*core.DataTransferConfirmation, error)) *MockCoreCentralSystemHandler_OnDataTransfer_Call { - _c.Call.Return(run) - return _c -} - -// OnHeartbeat provides a mock function with given fields: chargePointId, request -func (_m *MockCoreCentralSystemHandler) OnHeartbeat(chargePointId string, request *core.HeartbeatRequest) (*core.HeartbeatConfirmation, error) { - ret := _m.Called(chargePointId, request) - - if len(ret) == 0 { - panic("no return value specified for OnHeartbeat") - } - - var r0 *core.HeartbeatConfirmation - var r1 error - if rf, ok := ret.Get(0).(func(string, *core.HeartbeatRequest) (*core.HeartbeatConfirmation, error)); ok { - return rf(chargePointId, request) - } - if rf, ok := ret.Get(0).(func(string, *core.HeartbeatRequest) *core.HeartbeatConfirmation); ok { - r0 = rf(chargePointId, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*core.HeartbeatConfirmation) - } - } - - if rf, ok := ret.Get(1).(func(string, *core.HeartbeatRequest) error); ok { - r1 = rf(chargePointId, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCoreCentralSystemHandler_OnHeartbeat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnHeartbeat' -type MockCoreCentralSystemHandler_OnHeartbeat_Call struct { - *mock.Call -} - -// OnHeartbeat is a helper method to define mock.On call -// - chargePointId string -// - request *core.HeartbeatRequest -func (_e *MockCoreCentralSystemHandler_Expecter) OnHeartbeat(chargePointId interface{}, request interface{}) *MockCoreCentralSystemHandler_OnHeartbeat_Call { - return &MockCoreCentralSystemHandler_OnHeartbeat_Call{Call: _e.mock.On("OnHeartbeat", chargePointId, request)} -} - -func (_c *MockCoreCentralSystemHandler_OnHeartbeat_Call) Run(run func(chargePointId string, request *core.HeartbeatRequest)) *MockCoreCentralSystemHandler_OnHeartbeat_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(*core.HeartbeatRequest)) - }) - return _c -} - -func (_c *MockCoreCentralSystemHandler_OnHeartbeat_Call) Return(confirmation *core.HeartbeatConfirmation, err error) *MockCoreCentralSystemHandler_OnHeartbeat_Call { - _c.Call.Return(confirmation, err) - return _c -} - -func (_c *MockCoreCentralSystemHandler_OnHeartbeat_Call) RunAndReturn(run func(string, *core.HeartbeatRequest) (*core.HeartbeatConfirmation, error)) *MockCoreCentralSystemHandler_OnHeartbeat_Call { - _c.Call.Return(run) - return _c -} - -// OnMeterValues provides a mock function with given fields: chargePointId, request -func (_m *MockCoreCentralSystemHandler) OnMeterValues(chargePointId string, request *core.MeterValuesRequest) (*core.MeterValuesConfirmation, error) { - ret := _m.Called(chargePointId, request) - - if len(ret) == 0 { - panic("no return value specified for OnMeterValues") - } - - var r0 *core.MeterValuesConfirmation - var r1 error - if rf, ok := ret.Get(0).(func(string, *core.MeterValuesRequest) (*core.MeterValuesConfirmation, error)); ok { - return rf(chargePointId, request) - } - if rf, ok := ret.Get(0).(func(string, *core.MeterValuesRequest) *core.MeterValuesConfirmation); ok { - r0 = rf(chargePointId, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*core.MeterValuesConfirmation) - } - } - - if rf, ok := ret.Get(1).(func(string, *core.MeterValuesRequest) error); ok { - r1 = rf(chargePointId, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCoreCentralSystemHandler_OnMeterValues_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnMeterValues' -type MockCoreCentralSystemHandler_OnMeterValues_Call struct { - *mock.Call -} - -// OnMeterValues is a helper method to define mock.On call -// - chargePointId string -// - request *core.MeterValuesRequest -func (_e *MockCoreCentralSystemHandler_Expecter) OnMeterValues(chargePointId interface{}, request interface{}) *MockCoreCentralSystemHandler_OnMeterValues_Call { - return &MockCoreCentralSystemHandler_OnMeterValues_Call{Call: _e.mock.On("OnMeterValues", chargePointId, request)} -} - -func (_c *MockCoreCentralSystemHandler_OnMeterValues_Call) Run(run func(chargePointId string, request *core.MeterValuesRequest)) *MockCoreCentralSystemHandler_OnMeterValues_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(*core.MeterValuesRequest)) - }) - return _c -} - -func (_c *MockCoreCentralSystemHandler_OnMeterValues_Call) Return(confirmation *core.MeterValuesConfirmation, err error) *MockCoreCentralSystemHandler_OnMeterValues_Call { - _c.Call.Return(confirmation, err) - return _c -} - -func (_c *MockCoreCentralSystemHandler_OnMeterValues_Call) RunAndReturn(run func(string, *core.MeterValuesRequest) (*core.MeterValuesConfirmation, error)) *MockCoreCentralSystemHandler_OnMeterValues_Call { - _c.Call.Return(run) - return _c -} - -// OnStartTransaction provides a mock function with given fields: chargePointId, request -func (_m *MockCoreCentralSystemHandler) OnStartTransaction(chargePointId string, request *core.StartTransactionRequest) (*core.StartTransactionConfirmation, error) { - ret := _m.Called(chargePointId, request) - - if len(ret) == 0 { - panic("no return value specified for OnStartTransaction") - } - - var r0 *core.StartTransactionConfirmation - var r1 error - if rf, ok := ret.Get(0).(func(string, *core.StartTransactionRequest) (*core.StartTransactionConfirmation, error)); ok { - return rf(chargePointId, request) - } - if rf, ok := ret.Get(0).(func(string, *core.StartTransactionRequest) *core.StartTransactionConfirmation); ok { - r0 = rf(chargePointId, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*core.StartTransactionConfirmation) - } - } - - if rf, ok := ret.Get(1).(func(string, *core.StartTransactionRequest) error); ok { - r1 = rf(chargePointId, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCoreCentralSystemHandler_OnStartTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnStartTransaction' -type MockCoreCentralSystemHandler_OnStartTransaction_Call struct { - *mock.Call -} - -// OnStartTransaction is a helper method to define mock.On call -// - chargePointId string -// - request *core.StartTransactionRequest -func (_e *MockCoreCentralSystemHandler_Expecter) OnStartTransaction(chargePointId interface{}, request interface{}) *MockCoreCentralSystemHandler_OnStartTransaction_Call { - return &MockCoreCentralSystemHandler_OnStartTransaction_Call{Call: _e.mock.On("OnStartTransaction", chargePointId, request)} -} - -func (_c *MockCoreCentralSystemHandler_OnStartTransaction_Call) Run(run func(chargePointId string, request *core.StartTransactionRequest)) *MockCoreCentralSystemHandler_OnStartTransaction_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(*core.StartTransactionRequest)) - }) - return _c -} - -func (_c *MockCoreCentralSystemHandler_OnStartTransaction_Call) Return(confirmation *core.StartTransactionConfirmation, err error) *MockCoreCentralSystemHandler_OnStartTransaction_Call { - _c.Call.Return(confirmation, err) - return _c -} - -func (_c *MockCoreCentralSystemHandler_OnStartTransaction_Call) RunAndReturn(run func(string, *core.StartTransactionRequest) (*core.StartTransactionConfirmation, error)) *MockCoreCentralSystemHandler_OnStartTransaction_Call { - _c.Call.Return(run) - return _c -} - -// OnStatusNotification provides a mock function with given fields: chargePointId, request -func (_m *MockCoreCentralSystemHandler) OnStatusNotification(chargePointId string, request *core.StatusNotificationRequest) (*core.StatusNotificationConfirmation, error) { - ret := _m.Called(chargePointId, request) - - if len(ret) == 0 { - panic("no return value specified for OnStatusNotification") - } - - var r0 *core.StatusNotificationConfirmation - var r1 error - if rf, ok := ret.Get(0).(func(string, *core.StatusNotificationRequest) (*core.StatusNotificationConfirmation, error)); ok { - return rf(chargePointId, request) - } - if rf, ok := ret.Get(0).(func(string, *core.StatusNotificationRequest) *core.StatusNotificationConfirmation); ok { - r0 = rf(chargePointId, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*core.StatusNotificationConfirmation) - } - } - - if rf, ok := ret.Get(1).(func(string, *core.StatusNotificationRequest) error); ok { - r1 = rf(chargePointId, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCoreCentralSystemHandler_OnStatusNotification_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnStatusNotification' -type MockCoreCentralSystemHandler_OnStatusNotification_Call struct { - *mock.Call -} - -// OnStatusNotification is a helper method to define mock.On call -// - chargePointId string -// - request *core.StatusNotificationRequest -func (_e *MockCoreCentralSystemHandler_Expecter) OnStatusNotification(chargePointId interface{}, request interface{}) *MockCoreCentralSystemHandler_OnStatusNotification_Call { - return &MockCoreCentralSystemHandler_OnStatusNotification_Call{Call: _e.mock.On("OnStatusNotification", chargePointId, request)} -} - -func (_c *MockCoreCentralSystemHandler_OnStatusNotification_Call) Run(run func(chargePointId string, request *core.StatusNotificationRequest)) *MockCoreCentralSystemHandler_OnStatusNotification_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(*core.StatusNotificationRequest)) - }) - return _c -} - -func (_c *MockCoreCentralSystemHandler_OnStatusNotification_Call) Return(confirmation *core.StatusNotificationConfirmation, err error) *MockCoreCentralSystemHandler_OnStatusNotification_Call { - _c.Call.Return(confirmation, err) - return _c -} - -func (_c *MockCoreCentralSystemHandler_OnStatusNotification_Call) RunAndReturn(run func(string, *core.StatusNotificationRequest) (*core.StatusNotificationConfirmation, error)) *MockCoreCentralSystemHandler_OnStatusNotification_Call { - _c.Call.Return(run) - return _c -} - -// OnStopTransaction provides a mock function with given fields: chargePointId, request -func (_m *MockCoreCentralSystemHandler) OnStopTransaction(chargePointId string, request *core.StopTransactionRequest) (*core.StopTransactionConfirmation, error) { - ret := _m.Called(chargePointId, request) - - if len(ret) == 0 { - panic("no return value specified for OnStopTransaction") - } - - var r0 *core.StopTransactionConfirmation - var r1 error - if rf, ok := ret.Get(0).(func(string, *core.StopTransactionRequest) (*core.StopTransactionConfirmation, error)); ok { - return rf(chargePointId, request) - } - if rf, ok := ret.Get(0).(func(string, *core.StopTransactionRequest) *core.StopTransactionConfirmation); ok { - r0 = rf(chargePointId, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*core.StopTransactionConfirmation) - } - } - - if rf, ok := ret.Get(1).(func(string, *core.StopTransactionRequest) error); ok { - r1 = rf(chargePointId, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCoreCentralSystemHandler_OnStopTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnStopTransaction' -type MockCoreCentralSystemHandler_OnStopTransaction_Call struct { - *mock.Call -} - -// OnStopTransaction is a helper method to define mock.On call -// - chargePointId string -// - request *core.StopTransactionRequest -func (_e *MockCoreCentralSystemHandler_Expecter) OnStopTransaction(chargePointId interface{}, request interface{}) *MockCoreCentralSystemHandler_OnStopTransaction_Call { - return &MockCoreCentralSystemHandler_OnStopTransaction_Call{Call: _e.mock.On("OnStopTransaction", chargePointId, request)} -} - -func (_c *MockCoreCentralSystemHandler_OnStopTransaction_Call) Run(run func(chargePointId string, request *core.StopTransactionRequest)) *MockCoreCentralSystemHandler_OnStopTransaction_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(*core.StopTransactionRequest)) - }) - return _c -} - -func (_c *MockCoreCentralSystemHandler_OnStopTransaction_Call) Return(confirmation *core.StopTransactionConfirmation, err error) *MockCoreCentralSystemHandler_OnStopTransaction_Call { - _c.Call.Return(confirmation, err) - return _c -} - -func (_c *MockCoreCentralSystemHandler_OnStopTransaction_Call) RunAndReturn(run func(string, *core.StopTransactionRequest) (*core.StopTransactionConfirmation, error)) *MockCoreCentralSystemHandler_OnStopTransaction_Call { - _c.Call.Return(run) - return _c -} - -// NewMockCoreCentralSystemHandler creates a new instance of MockCoreCentralSystemHandler. 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 NewMockCoreCentralSystemHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockCoreCentralSystemHandler { - mock := &MockCoreCentralSystemHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocpp1.6_test/mocks/mock_core_charge_point_handler.go b/ocpp1.6_test/mocks/mock_core_charge_point_handler.go deleted file mode 100644 index 492865ef..00000000 --- a/ocpp1.6_test/mocks/mock_core_charge_point_handler.go +++ /dev/null @@ -1,557 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - core "github.com/lorenzodonini/ocpp-go/ocpp1.6/core" - mock "github.com/stretchr/testify/mock" -) - -// MockCoreChargePointHandler is an autogenerated mock type for the ChargePointHandler type -type MockCoreChargePointHandler struct { - mock.Mock -} - -type MockCoreChargePointHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockCoreChargePointHandler) EXPECT() *MockCoreChargePointHandler_Expecter { - return &MockCoreChargePointHandler_Expecter{mock: &_m.Mock} -} - -// OnChangeAvailability provides a mock function with given fields: request -func (_m *MockCoreChargePointHandler) OnChangeAvailability(request *core.ChangeAvailabilityRequest) (*core.ChangeAvailabilityConfirmation, error) { - ret := _m.Called(request) - - if len(ret) == 0 { - panic("no return value specified for OnChangeAvailability") - } - - var r0 *core.ChangeAvailabilityConfirmation - var r1 error - if rf, ok := ret.Get(0).(func(*core.ChangeAvailabilityRequest) (*core.ChangeAvailabilityConfirmation, error)); ok { - return rf(request) - } - if rf, ok := ret.Get(0).(func(*core.ChangeAvailabilityRequest) *core.ChangeAvailabilityConfirmation); ok { - r0 = rf(request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*core.ChangeAvailabilityConfirmation) - } - } - - if rf, ok := ret.Get(1).(func(*core.ChangeAvailabilityRequest) error); ok { - r1 = rf(request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCoreChargePointHandler_OnChangeAvailability_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnChangeAvailability' -type MockCoreChargePointHandler_OnChangeAvailability_Call struct { - *mock.Call -} - -// OnChangeAvailability is a helper method to define mock.On call -// - request *core.ChangeAvailabilityRequest -func (_e *MockCoreChargePointHandler_Expecter) OnChangeAvailability(request interface{}) *MockCoreChargePointHandler_OnChangeAvailability_Call { - return &MockCoreChargePointHandler_OnChangeAvailability_Call{Call: _e.mock.On("OnChangeAvailability", request)} -} - -func (_c *MockCoreChargePointHandler_OnChangeAvailability_Call) Run(run func(request *core.ChangeAvailabilityRequest)) *MockCoreChargePointHandler_OnChangeAvailability_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*core.ChangeAvailabilityRequest)) - }) - return _c -} - -func (_c *MockCoreChargePointHandler_OnChangeAvailability_Call) Return(confirmation *core.ChangeAvailabilityConfirmation, err error) *MockCoreChargePointHandler_OnChangeAvailability_Call { - _c.Call.Return(confirmation, err) - return _c -} - -func (_c *MockCoreChargePointHandler_OnChangeAvailability_Call) RunAndReturn(run func(*core.ChangeAvailabilityRequest) (*core.ChangeAvailabilityConfirmation, error)) *MockCoreChargePointHandler_OnChangeAvailability_Call { - _c.Call.Return(run) - return _c -} - -// OnChangeConfiguration provides a mock function with given fields: request -func (_m *MockCoreChargePointHandler) OnChangeConfiguration(request *core.ChangeConfigurationRequest) (*core.ChangeConfigurationConfirmation, error) { - ret := _m.Called(request) - - if len(ret) == 0 { - panic("no return value specified for OnChangeConfiguration") - } - - var r0 *core.ChangeConfigurationConfirmation - var r1 error - if rf, ok := ret.Get(0).(func(*core.ChangeConfigurationRequest) (*core.ChangeConfigurationConfirmation, error)); ok { - return rf(request) - } - if rf, ok := ret.Get(0).(func(*core.ChangeConfigurationRequest) *core.ChangeConfigurationConfirmation); ok { - r0 = rf(request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*core.ChangeConfigurationConfirmation) - } - } - - if rf, ok := ret.Get(1).(func(*core.ChangeConfigurationRequest) error); ok { - r1 = rf(request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCoreChargePointHandler_OnChangeConfiguration_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnChangeConfiguration' -type MockCoreChargePointHandler_OnChangeConfiguration_Call struct { - *mock.Call -} - -// OnChangeConfiguration is a helper method to define mock.On call -// - request *core.ChangeConfigurationRequest -func (_e *MockCoreChargePointHandler_Expecter) OnChangeConfiguration(request interface{}) *MockCoreChargePointHandler_OnChangeConfiguration_Call { - return &MockCoreChargePointHandler_OnChangeConfiguration_Call{Call: _e.mock.On("OnChangeConfiguration", request)} -} - -func (_c *MockCoreChargePointHandler_OnChangeConfiguration_Call) Run(run func(request *core.ChangeConfigurationRequest)) *MockCoreChargePointHandler_OnChangeConfiguration_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*core.ChangeConfigurationRequest)) - }) - return _c -} - -func (_c *MockCoreChargePointHandler_OnChangeConfiguration_Call) Return(confirmation *core.ChangeConfigurationConfirmation, err error) *MockCoreChargePointHandler_OnChangeConfiguration_Call { - _c.Call.Return(confirmation, err) - return _c -} - -func (_c *MockCoreChargePointHandler_OnChangeConfiguration_Call) RunAndReturn(run func(*core.ChangeConfigurationRequest) (*core.ChangeConfigurationConfirmation, error)) *MockCoreChargePointHandler_OnChangeConfiguration_Call { - _c.Call.Return(run) - return _c -} - -// OnClearCache provides a mock function with given fields: request -func (_m *MockCoreChargePointHandler) OnClearCache(request *core.ClearCacheRequest) (*core.ClearCacheConfirmation, error) { - ret := _m.Called(request) - - if len(ret) == 0 { - panic("no return value specified for OnClearCache") - } - - var r0 *core.ClearCacheConfirmation - var r1 error - if rf, ok := ret.Get(0).(func(*core.ClearCacheRequest) (*core.ClearCacheConfirmation, error)); ok { - return rf(request) - } - if rf, ok := ret.Get(0).(func(*core.ClearCacheRequest) *core.ClearCacheConfirmation); ok { - r0 = rf(request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*core.ClearCacheConfirmation) - } - } - - if rf, ok := ret.Get(1).(func(*core.ClearCacheRequest) error); ok { - r1 = rf(request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCoreChargePointHandler_OnClearCache_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnClearCache' -type MockCoreChargePointHandler_OnClearCache_Call struct { - *mock.Call -} - -// OnClearCache is a helper method to define mock.On call -// - request *core.ClearCacheRequest -func (_e *MockCoreChargePointHandler_Expecter) OnClearCache(request interface{}) *MockCoreChargePointHandler_OnClearCache_Call { - return &MockCoreChargePointHandler_OnClearCache_Call{Call: _e.mock.On("OnClearCache", request)} -} - -func (_c *MockCoreChargePointHandler_OnClearCache_Call) Run(run func(request *core.ClearCacheRequest)) *MockCoreChargePointHandler_OnClearCache_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*core.ClearCacheRequest)) - }) - return _c -} - -func (_c *MockCoreChargePointHandler_OnClearCache_Call) Return(confirmation *core.ClearCacheConfirmation, err error) *MockCoreChargePointHandler_OnClearCache_Call { - _c.Call.Return(confirmation, err) - return _c -} - -func (_c *MockCoreChargePointHandler_OnClearCache_Call) RunAndReturn(run func(*core.ClearCacheRequest) (*core.ClearCacheConfirmation, error)) *MockCoreChargePointHandler_OnClearCache_Call { - _c.Call.Return(run) - return _c -} - -// OnDataTransfer provides a mock function with given fields: request -func (_m *MockCoreChargePointHandler) OnDataTransfer(request *core.DataTransferRequest) (*core.DataTransferConfirmation, error) { - ret := _m.Called(request) - - if len(ret) == 0 { - panic("no return value specified for OnDataTransfer") - } - - var r0 *core.DataTransferConfirmation - var r1 error - if rf, ok := ret.Get(0).(func(*core.DataTransferRequest) (*core.DataTransferConfirmation, error)); ok { - return rf(request) - } - if rf, ok := ret.Get(0).(func(*core.DataTransferRequest) *core.DataTransferConfirmation); ok { - r0 = rf(request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*core.DataTransferConfirmation) - } - } - - if rf, ok := ret.Get(1).(func(*core.DataTransferRequest) error); ok { - r1 = rf(request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCoreChargePointHandler_OnDataTransfer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnDataTransfer' -type MockCoreChargePointHandler_OnDataTransfer_Call struct { - *mock.Call -} - -// OnDataTransfer is a helper method to define mock.On call -// - request *core.DataTransferRequest -func (_e *MockCoreChargePointHandler_Expecter) OnDataTransfer(request interface{}) *MockCoreChargePointHandler_OnDataTransfer_Call { - return &MockCoreChargePointHandler_OnDataTransfer_Call{Call: _e.mock.On("OnDataTransfer", request)} -} - -func (_c *MockCoreChargePointHandler_OnDataTransfer_Call) Run(run func(request *core.DataTransferRequest)) *MockCoreChargePointHandler_OnDataTransfer_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*core.DataTransferRequest)) - }) - return _c -} - -func (_c *MockCoreChargePointHandler_OnDataTransfer_Call) Return(confirmation *core.DataTransferConfirmation, err error) *MockCoreChargePointHandler_OnDataTransfer_Call { - _c.Call.Return(confirmation, err) - return _c -} - -func (_c *MockCoreChargePointHandler_OnDataTransfer_Call) RunAndReturn(run func(*core.DataTransferRequest) (*core.DataTransferConfirmation, error)) *MockCoreChargePointHandler_OnDataTransfer_Call { - _c.Call.Return(run) - return _c -} - -// OnGetConfiguration provides a mock function with given fields: request -func (_m *MockCoreChargePointHandler) OnGetConfiguration(request *core.GetConfigurationRequest) (*core.GetConfigurationConfirmation, error) { - ret := _m.Called(request) - - if len(ret) == 0 { - panic("no return value specified for OnGetConfiguration") - } - - var r0 *core.GetConfigurationConfirmation - var r1 error - if rf, ok := ret.Get(0).(func(*core.GetConfigurationRequest) (*core.GetConfigurationConfirmation, error)); ok { - return rf(request) - } - if rf, ok := ret.Get(0).(func(*core.GetConfigurationRequest) *core.GetConfigurationConfirmation); ok { - r0 = rf(request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*core.GetConfigurationConfirmation) - } - } - - if rf, ok := ret.Get(1).(func(*core.GetConfigurationRequest) error); ok { - r1 = rf(request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCoreChargePointHandler_OnGetConfiguration_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnGetConfiguration' -type MockCoreChargePointHandler_OnGetConfiguration_Call struct { - *mock.Call -} - -// OnGetConfiguration is a helper method to define mock.On call -// - request *core.GetConfigurationRequest -func (_e *MockCoreChargePointHandler_Expecter) OnGetConfiguration(request interface{}) *MockCoreChargePointHandler_OnGetConfiguration_Call { - return &MockCoreChargePointHandler_OnGetConfiguration_Call{Call: _e.mock.On("OnGetConfiguration", request)} -} - -func (_c *MockCoreChargePointHandler_OnGetConfiguration_Call) Run(run func(request *core.GetConfigurationRequest)) *MockCoreChargePointHandler_OnGetConfiguration_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*core.GetConfigurationRequest)) - }) - return _c -} - -func (_c *MockCoreChargePointHandler_OnGetConfiguration_Call) Return(confirmation *core.GetConfigurationConfirmation, err error) *MockCoreChargePointHandler_OnGetConfiguration_Call { - _c.Call.Return(confirmation, err) - return _c -} - -func (_c *MockCoreChargePointHandler_OnGetConfiguration_Call) RunAndReturn(run func(*core.GetConfigurationRequest) (*core.GetConfigurationConfirmation, error)) *MockCoreChargePointHandler_OnGetConfiguration_Call { - _c.Call.Return(run) - return _c -} - -// OnRemoteStartTransaction provides a mock function with given fields: request -func (_m *MockCoreChargePointHandler) OnRemoteStartTransaction(request *core.RemoteStartTransactionRequest) (*core.RemoteStartTransactionConfirmation, error) { - ret := _m.Called(request) - - if len(ret) == 0 { - panic("no return value specified for OnRemoteStartTransaction") - } - - var r0 *core.RemoteStartTransactionConfirmation - var r1 error - if rf, ok := ret.Get(0).(func(*core.RemoteStartTransactionRequest) (*core.RemoteStartTransactionConfirmation, error)); ok { - return rf(request) - } - if rf, ok := ret.Get(0).(func(*core.RemoteStartTransactionRequest) *core.RemoteStartTransactionConfirmation); ok { - r0 = rf(request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*core.RemoteStartTransactionConfirmation) - } - } - - if rf, ok := ret.Get(1).(func(*core.RemoteStartTransactionRequest) error); ok { - r1 = rf(request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCoreChargePointHandler_OnRemoteStartTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnRemoteStartTransaction' -type MockCoreChargePointHandler_OnRemoteStartTransaction_Call struct { - *mock.Call -} - -// OnRemoteStartTransaction is a helper method to define mock.On call -// - request *core.RemoteStartTransactionRequest -func (_e *MockCoreChargePointHandler_Expecter) OnRemoteStartTransaction(request interface{}) *MockCoreChargePointHandler_OnRemoteStartTransaction_Call { - return &MockCoreChargePointHandler_OnRemoteStartTransaction_Call{Call: _e.mock.On("OnRemoteStartTransaction", request)} -} - -func (_c *MockCoreChargePointHandler_OnRemoteStartTransaction_Call) Run(run func(request *core.RemoteStartTransactionRequest)) *MockCoreChargePointHandler_OnRemoteStartTransaction_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*core.RemoteStartTransactionRequest)) - }) - return _c -} - -func (_c *MockCoreChargePointHandler_OnRemoteStartTransaction_Call) Return(confirmation *core.RemoteStartTransactionConfirmation, err error) *MockCoreChargePointHandler_OnRemoteStartTransaction_Call { - _c.Call.Return(confirmation, err) - return _c -} - -func (_c *MockCoreChargePointHandler_OnRemoteStartTransaction_Call) RunAndReturn(run func(*core.RemoteStartTransactionRequest) (*core.RemoteStartTransactionConfirmation, error)) *MockCoreChargePointHandler_OnRemoteStartTransaction_Call { - _c.Call.Return(run) - return _c -} - -// OnRemoteStopTransaction provides a mock function with given fields: request -func (_m *MockCoreChargePointHandler) OnRemoteStopTransaction(request *core.RemoteStopTransactionRequest) (*core.RemoteStopTransactionConfirmation, error) { - ret := _m.Called(request) - - if len(ret) == 0 { - panic("no return value specified for OnRemoteStopTransaction") - } - - var r0 *core.RemoteStopTransactionConfirmation - var r1 error - if rf, ok := ret.Get(0).(func(*core.RemoteStopTransactionRequest) (*core.RemoteStopTransactionConfirmation, error)); ok { - return rf(request) - } - if rf, ok := ret.Get(0).(func(*core.RemoteStopTransactionRequest) *core.RemoteStopTransactionConfirmation); ok { - r0 = rf(request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*core.RemoteStopTransactionConfirmation) - } - } - - if rf, ok := ret.Get(1).(func(*core.RemoteStopTransactionRequest) error); ok { - r1 = rf(request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCoreChargePointHandler_OnRemoteStopTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnRemoteStopTransaction' -type MockCoreChargePointHandler_OnRemoteStopTransaction_Call struct { - *mock.Call -} - -// OnRemoteStopTransaction is a helper method to define mock.On call -// - request *core.RemoteStopTransactionRequest -func (_e *MockCoreChargePointHandler_Expecter) OnRemoteStopTransaction(request interface{}) *MockCoreChargePointHandler_OnRemoteStopTransaction_Call { - return &MockCoreChargePointHandler_OnRemoteStopTransaction_Call{Call: _e.mock.On("OnRemoteStopTransaction", request)} -} - -func (_c *MockCoreChargePointHandler_OnRemoteStopTransaction_Call) Run(run func(request *core.RemoteStopTransactionRequest)) *MockCoreChargePointHandler_OnRemoteStopTransaction_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*core.RemoteStopTransactionRequest)) - }) - return _c -} - -func (_c *MockCoreChargePointHandler_OnRemoteStopTransaction_Call) Return(confirmation *core.RemoteStopTransactionConfirmation, err error) *MockCoreChargePointHandler_OnRemoteStopTransaction_Call { - _c.Call.Return(confirmation, err) - return _c -} - -func (_c *MockCoreChargePointHandler_OnRemoteStopTransaction_Call) RunAndReturn(run func(*core.RemoteStopTransactionRequest) (*core.RemoteStopTransactionConfirmation, error)) *MockCoreChargePointHandler_OnRemoteStopTransaction_Call { - _c.Call.Return(run) - return _c -} - -// OnReset provides a mock function with given fields: request -func (_m *MockCoreChargePointHandler) OnReset(request *core.ResetRequest) (*core.ResetConfirmation, error) { - ret := _m.Called(request) - - if len(ret) == 0 { - panic("no return value specified for OnReset") - } - - var r0 *core.ResetConfirmation - var r1 error - if rf, ok := ret.Get(0).(func(*core.ResetRequest) (*core.ResetConfirmation, error)); ok { - return rf(request) - } - if rf, ok := ret.Get(0).(func(*core.ResetRequest) *core.ResetConfirmation); ok { - r0 = rf(request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*core.ResetConfirmation) - } - } - - if rf, ok := ret.Get(1).(func(*core.ResetRequest) error); ok { - r1 = rf(request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCoreChargePointHandler_OnReset_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnReset' -type MockCoreChargePointHandler_OnReset_Call struct { - *mock.Call -} - -// OnReset is a helper method to define mock.On call -// - request *core.ResetRequest -func (_e *MockCoreChargePointHandler_Expecter) OnReset(request interface{}) *MockCoreChargePointHandler_OnReset_Call { - return &MockCoreChargePointHandler_OnReset_Call{Call: _e.mock.On("OnReset", request)} -} - -func (_c *MockCoreChargePointHandler_OnReset_Call) Run(run func(request *core.ResetRequest)) *MockCoreChargePointHandler_OnReset_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*core.ResetRequest)) - }) - return _c -} - -func (_c *MockCoreChargePointHandler_OnReset_Call) Return(confirmation *core.ResetConfirmation, err error) *MockCoreChargePointHandler_OnReset_Call { - _c.Call.Return(confirmation, err) - return _c -} - -func (_c *MockCoreChargePointHandler_OnReset_Call) RunAndReturn(run func(*core.ResetRequest) (*core.ResetConfirmation, error)) *MockCoreChargePointHandler_OnReset_Call { - _c.Call.Return(run) - return _c -} - -// OnUnlockConnector provides a mock function with given fields: request -func (_m *MockCoreChargePointHandler) OnUnlockConnector(request *core.UnlockConnectorRequest) (*core.UnlockConnectorConfirmation, error) { - ret := _m.Called(request) - - if len(ret) == 0 { - panic("no return value specified for OnUnlockConnector") - } - - var r0 *core.UnlockConnectorConfirmation - var r1 error - if rf, ok := ret.Get(0).(func(*core.UnlockConnectorRequest) (*core.UnlockConnectorConfirmation, error)); ok { - return rf(request) - } - if rf, ok := ret.Get(0).(func(*core.UnlockConnectorRequest) *core.UnlockConnectorConfirmation); ok { - r0 = rf(request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*core.UnlockConnectorConfirmation) - } - } - - if rf, ok := ret.Get(1).(func(*core.UnlockConnectorRequest) error); ok { - r1 = rf(request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCoreChargePointHandler_OnUnlockConnector_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnUnlockConnector' -type MockCoreChargePointHandler_OnUnlockConnector_Call struct { - *mock.Call -} - -// OnUnlockConnector is a helper method to define mock.On call -// - request *core.UnlockConnectorRequest -func (_e *MockCoreChargePointHandler_Expecter) OnUnlockConnector(request interface{}) *MockCoreChargePointHandler_OnUnlockConnector_Call { - return &MockCoreChargePointHandler_OnUnlockConnector_Call{Call: _e.mock.On("OnUnlockConnector", request)} -} - -func (_c *MockCoreChargePointHandler_OnUnlockConnector_Call) Run(run func(request *core.UnlockConnectorRequest)) *MockCoreChargePointHandler_OnUnlockConnector_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*core.UnlockConnectorRequest)) - }) - return _c -} - -func (_c *MockCoreChargePointHandler_OnUnlockConnector_Call) Return(confirmation *core.UnlockConnectorConfirmation, err error) *MockCoreChargePointHandler_OnUnlockConnector_Call { - _c.Call.Return(confirmation, err) - return _c -} - -func (_c *MockCoreChargePointHandler_OnUnlockConnector_Call) RunAndReturn(run func(*core.UnlockConnectorRequest) (*core.UnlockConnectorConfirmation, error)) *MockCoreChargePointHandler_OnUnlockConnector_Call { - _c.Call.Return(run) - return _c -} - -// NewMockCoreChargePointHandler creates a new instance of MockCoreChargePointHandler. 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 NewMockCoreChargePointHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockCoreChargePointHandler { - mock := &MockCoreChargePointHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocpp1.6_test/mocks/mock_extended_trigger_message_charge_point_handler.go b/ocpp1.6_test/mocks/mock_extended_trigger_message_charge_point_handler.go deleted file mode 100644 index 606a3412..00000000 --- a/ocpp1.6_test/mocks/mock_extended_trigger_message_charge_point_handler.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - extendedtriggermessage "github.com/lorenzodonini/ocpp-go/ocpp1.6/extendedtriggermessage" - mock "github.com/stretchr/testify/mock" -) - -// MockExtendedTriggerMessageChargePointHandler is an autogenerated mock type for the ChargePointHandler type -type MockExtendedTriggerMessageChargePointHandler struct { - mock.Mock -} - -type MockExtendedTriggerMessageChargePointHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockExtendedTriggerMessageChargePointHandler) EXPECT() *MockExtendedTriggerMessageChargePointHandler_Expecter { - return &MockExtendedTriggerMessageChargePointHandler_Expecter{mock: &_m.Mock} -} - -// OnExtendedTriggerMessage provides a mock function with given fields: request -func (_m *MockExtendedTriggerMessageChargePointHandler) OnExtendedTriggerMessage(request *extendedtriggermessage.ExtendedTriggerMessageRequest) (*extendedtriggermessage.ExtendedTriggerMessageResponse, error) { - ret := _m.Called(request) - - if len(ret) == 0 { - panic("no return value specified for OnExtendedTriggerMessage") - } - - var r0 *extendedtriggermessage.ExtendedTriggerMessageResponse - var r1 error - if rf, ok := ret.Get(0).(func(*extendedtriggermessage.ExtendedTriggerMessageRequest) (*extendedtriggermessage.ExtendedTriggerMessageResponse, error)); ok { - return rf(request) - } - if rf, ok := ret.Get(0).(func(*extendedtriggermessage.ExtendedTriggerMessageRequest) *extendedtriggermessage.ExtendedTriggerMessageResponse); ok { - r0 = rf(request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*extendedtriggermessage.ExtendedTriggerMessageResponse) - } - } - - if rf, ok := ret.Get(1).(func(*extendedtriggermessage.ExtendedTriggerMessageRequest) error); ok { - r1 = rf(request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockExtendedTriggerMessageChargePointHandler_OnExtendedTriggerMessage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnExtendedTriggerMessage' -type MockExtendedTriggerMessageChargePointHandler_OnExtendedTriggerMessage_Call struct { - *mock.Call -} - -// OnExtendedTriggerMessage is a helper method to define mock.On call -// - request *extendedtriggermessage.ExtendedTriggerMessageRequest -func (_e *MockExtendedTriggerMessageChargePointHandler_Expecter) OnExtendedTriggerMessage(request interface{}) *MockExtendedTriggerMessageChargePointHandler_OnExtendedTriggerMessage_Call { - return &MockExtendedTriggerMessageChargePointHandler_OnExtendedTriggerMessage_Call{Call: _e.mock.On("OnExtendedTriggerMessage", request)} -} - -func (_c *MockExtendedTriggerMessageChargePointHandler_OnExtendedTriggerMessage_Call) Run(run func(request *extendedtriggermessage.ExtendedTriggerMessageRequest)) *MockExtendedTriggerMessageChargePointHandler_OnExtendedTriggerMessage_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*extendedtriggermessage.ExtendedTriggerMessageRequest)) - }) - return _c -} - -func (_c *MockExtendedTriggerMessageChargePointHandler_OnExtendedTriggerMessage_Call) Return(response *extendedtriggermessage.ExtendedTriggerMessageResponse, err error) *MockExtendedTriggerMessageChargePointHandler_OnExtendedTriggerMessage_Call { - _c.Call.Return(response, err) - return _c -} - -func (_c *MockExtendedTriggerMessageChargePointHandler_OnExtendedTriggerMessage_Call) RunAndReturn(run func(*extendedtriggermessage.ExtendedTriggerMessageRequest) (*extendedtriggermessage.ExtendedTriggerMessageResponse, error)) *MockExtendedTriggerMessageChargePointHandler_OnExtendedTriggerMessage_Call { - _c.Call.Return(run) - return _c -} - -// NewMockExtendedTriggerMessageChargePointHandler creates a new instance of MockExtendedTriggerMessageChargePointHandler. 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 NewMockExtendedTriggerMessageChargePointHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockExtendedTriggerMessageChargePointHandler { - mock := &MockExtendedTriggerMessageChargePointHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocpp1.6_test/mocks/mock_firmware_central_system_handler.go b/ocpp1.6_test/mocks/mock_firmware_central_system_handler.go deleted file mode 100644 index 46583764..00000000 --- a/ocpp1.6_test/mocks/mock_firmware_central_system_handler.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - firmware "github.com/lorenzodonini/ocpp-go/ocpp1.6/firmware" - mock "github.com/stretchr/testify/mock" -) - -// MockFirmwareCentralSystemHandler is an autogenerated mock type for the CentralSystemHandler type -type MockFirmwareCentralSystemHandler struct { - mock.Mock -} - -type MockFirmwareCentralSystemHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockFirmwareCentralSystemHandler) EXPECT() *MockFirmwareCentralSystemHandler_Expecter { - return &MockFirmwareCentralSystemHandler_Expecter{mock: &_m.Mock} -} - -// OnDiagnosticsStatusNotification provides a mock function with given fields: chargePointId, request -func (_m *MockFirmwareCentralSystemHandler) OnDiagnosticsStatusNotification(chargePointId string, request *firmware.DiagnosticsStatusNotificationRequest) (*firmware.DiagnosticsStatusNotificationConfirmation, error) { - ret := _m.Called(chargePointId, request) - - if len(ret) == 0 { - panic("no return value specified for OnDiagnosticsStatusNotification") - } - - var r0 *firmware.DiagnosticsStatusNotificationConfirmation - var r1 error - if rf, ok := ret.Get(0).(func(string, *firmware.DiagnosticsStatusNotificationRequest) (*firmware.DiagnosticsStatusNotificationConfirmation, error)); ok { - return rf(chargePointId, request) - } - if rf, ok := ret.Get(0).(func(string, *firmware.DiagnosticsStatusNotificationRequest) *firmware.DiagnosticsStatusNotificationConfirmation); ok { - r0 = rf(chargePointId, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*firmware.DiagnosticsStatusNotificationConfirmation) - } - } - - if rf, ok := ret.Get(1).(func(string, *firmware.DiagnosticsStatusNotificationRequest) error); ok { - r1 = rf(chargePointId, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockFirmwareCentralSystemHandler_OnDiagnosticsStatusNotification_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnDiagnosticsStatusNotification' -type MockFirmwareCentralSystemHandler_OnDiagnosticsStatusNotification_Call struct { - *mock.Call -} - -// OnDiagnosticsStatusNotification is a helper method to define mock.On call -// - chargePointId string -// - request *firmware.DiagnosticsStatusNotificationRequest -func (_e *MockFirmwareCentralSystemHandler_Expecter) OnDiagnosticsStatusNotification(chargePointId interface{}, request interface{}) *MockFirmwareCentralSystemHandler_OnDiagnosticsStatusNotification_Call { - return &MockFirmwareCentralSystemHandler_OnDiagnosticsStatusNotification_Call{Call: _e.mock.On("OnDiagnosticsStatusNotification", chargePointId, request)} -} - -func (_c *MockFirmwareCentralSystemHandler_OnDiagnosticsStatusNotification_Call) Run(run func(chargePointId string, request *firmware.DiagnosticsStatusNotificationRequest)) *MockFirmwareCentralSystemHandler_OnDiagnosticsStatusNotification_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(*firmware.DiagnosticsStatusNotificationRequest)) - }) - return _c -} - -func (_c *MockFirmwareCentralSystemHandler_OnDiagnosticsStatusNotification_Call) Return(confirmation *firmware.DiagnosticsStatusNotificationConfirmation, err error) *MockFirmwareCentralSystemHandler_OnDiagnosticsStatusNotification_Call { - _c.Call.Return(confirmation, err) - return _c -} - -func (_c *MockFirmwareCentralSystemHandler_OnDiagnosticsStatusNotification_Call) RunAndReturn(run func(string, *firmware.DiagnosticsStatusNotificationRequest) (*firmware.DiagnosticsStatusNotificationConfirmation, error)) *MockFirmwareCentralSystemHandler_OnDiagnosticsStatusNotification_Call { - _c.Call.Return(run) - return _c -} - -// OnFirmwareStatusNotification provides a mock function with given fields: chargePointId, request -func (_m *MockFirmwareCentralSystemHandler) OnFirmwareStatusNotification(chargePointId string, request *firmware.FirmwareStatusNotificationRequest) (*firmware.FirmwareStatusNotificationConfirmation, error) { - ret := _m.Called(chargePointId, request) - - if len(ret) == 0 { - panic("no return value specified for OnFirmwareStatusNotification") - } - - var r0 *firmware.FirmwareStatusNotificationConfirmation - var r1 error - if rf, ok := ret.Get(0).(func(string, *firmware.FirmwareStatusNotificationRequest) (*firmware.FirmwareStatusNotificationConfirmation, error)); ok { - return rf(chargePointId, request) - } - if rf, ok := ret.Get(0).(func(string, *firmware.FirmwareStatusNotificationRequest) *firmware.FirmwareStatusNotificationConfirmation); ok { - r0 = rf(chargePointId, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*firmware.FirmwareStatusNotificationConfirmation) - } - } - - if rf, ok := ret.Get(1).(func(string, *firmware.FirmwareStatusNotificationRequest) error); ok { - r1 = rf(chargePointId, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockFirmwareCentralSystemHandler_OnFirmwareStatusNotification_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnFirmwareStatusNotification' -type MockFirmwareCentralSystemHandler_OnFirmwareStatusNotification_Call struct { - *mock.Call -} - -// OnFirmwareStatusNotification is a helper method to define mock.On call -// - chargePointId string -// - request *firmware.FirmwareStatusNotificationRequest -func (_e *MockFirmwareCentralSystemHandler_Expecter) OnFirmwareStatusNotification(chargePointId interface{}, request interface{}) *MockFirmwareCentralSystemHandler_OnFirmwareStatusNotification_Call { - return &MockFirmwareCentralSystemHandler_OnFirmwareStatusNotification_Call{Call: _e.mock.On("OnFirmwareStatusNotification", chargePointId, request)} -} - -func (_c *MockFirmwareCentralSystemHandler_OnFirmwareStatusNotification_Call) Run(run func(chargePointId string, request *firmware.FirmwareStatusNotificationRequest)) *MockFirmwareCentralSystemHandler_OnFirmwareStatusNotification_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(*firmware.FirmwareStatusNotificationRequest)) - }) - return _c -} - -func (_c *MockFirmwareCentralSystemHandler_OnFirmwareStatusNotification_Call) Return(confirmation *firmware.FirmwareStatusNotificationConfirmation, err error) *MockFirmwareCentralSystemHandler_OnFirmwareStatusNotification_Call { - _c.Call.Return(confirmation, err) - return _c -} - -func (_c *MockFirmwareCentralSystemHandler_OnFirmwareStatusNotification_Call) RunAndReturn(run func(string, *firmware.FirmwareStatusNotificationRequest) (*firmware.FirmwareStatusNotificationConfirmation, error)) *MockFirmwareCentralSystemHandler_OnFirmwareStatusNotification_Call { - _c.Call.Return(run) - return _c -} - -// NewMockFirmwareCentralSystemHandler creates a new instance of MockFirmwareCentralSystemHandler. 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 NewMockFirmwareCentralSystemHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockFirmwareCentralSystemHandler { - mock := &MockFirmwareCentralSystemHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocpp1.6_test/mocks/mock_firmware_charge_point_handler.go b/ocpp1.6_test/mocks/mock_firmware_charge_point_handler.go deleted file mode 100644 index 13f874ee..00000000 --- a/ocpp1.6_test/mocks/mock_firmware_charge_point_handler.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - firmware "github.com/lorenzodonini/ocpp-go/ocpp1.6/firmware" - mock "github.com/stretchr/testify/mock" -) - -// MockFirmwareChargePointHandler is an autogenerated mock type for the ChargePointHandler type -type MockFirmwareChargePointHandler struct { - mock.Mock -} - -type MockFirmwareChargePointHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockFirmwareChargePointHandler) EXPECT() *MockFirmwareChargePointHandler_Expecter { - return &MockFirmwareChargePointHandler_Expecter{mock: &_m.Mock} -} - -// OnGetDiagnostics provides a mock function with given fields: request -func (_m *MockFirmwareChargePointHandler) OnGetDiagnostics(request *firmware.GetDiagnosticsRequest) (*firmware.GetDiagnosticsConfirmation, error) { - ret := _m.Called(request) - - if len(ret) == 0 { - panic("no return value specified for OnGetDiagnostics") - } - - var r0 *firmware.GetDiagnosticsConfirmation - var r1 error - if rf, ok := ret.Get(0).(func(*firmware.GetDiagnosticsRequest) (*firmware.GetDiagnosticsConfirmation, error)); ok { - return rf(request) - } - if rf, ok := ret.Get(0).(func(*firmware.GetDiagnosticsRequest) *firmware.GetDiagnosticsConfirmation); ok { - r0 = rf(request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*firmware.GetDiagnosticsConfirmation) - } - } - - if rf, ok := ret.Get(1).(func(*firmware.GetDiagnosticsRequest) error); ok { - r1 = rf(request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockFirmwareChargePointHandler_OnGetDiagnostics_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnGetDiagnostics' -type MockFirmwareChargePointHandler_OnGetDiagnostics_Call struct { - *mock.Call -} - -// OnGetDiagnostics is a helper method to define mock.On call -// - request *firmware.GetDiagnosticsRequest -func (_e *MockFirmwareChargePointHandler_Expecter) OnGetDiagnostics(request interface{}) *MockFirmwareChargePointHandler_OnGetDiagnostics_Call { - return &MockFirmwareChargePointHandler_OnGetDiagnostics_Call{Call: _e.mock.On("OnGetDiagnostics", request)} -} - -func (_c *MockFirmwareChargePointHandler_OnGetDiagnostics_Call) Run(run func(request *firmware.GetDiagnosticsRequest)) *MockFirmwareChargePointHandler_OnGetDiagnostics_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*firmware.GetDiagnosticsRequest)) - }) - return _c -} - -func (_c *MockFirmwareChargePointHandler_OnGetDiagnostics_Call) Return(confirmation *firmware.GetDiagnosticsConfirmation, err error) *MockFirmwareChargePointHandler_OnGetDiagnostics_Call { - _c.Call.Return(confirmation, err) - return _c -} - -func (_c *MockFirmwareChargePointHandler_OnGetDiagnostics_Call) RunAndReturn(run func(*firmware.GetDiagnosticsRequest) (*firmware.GetDiagnosticsConfirmation, error)) *MockFirmwareChargePointHandler_OnGetDiagnostics_Call { - _c.Call.Return(run) - return _c -} - -// OnUpdateFirmware provides a mock function with given fields: request -func (_m *MockFirmwareChargePointHandler) OnUpdateFirmware(request *firmware.UpdateFirmwareRequest) (*firmware.UpdateFirmwareConfirmation, error) { - ret := _m.Called(request) - - if len(ret) == 0 { - panic("no return value specified for OnUpdateFirmware") - } - - var r0 *firmware.UpdateFirmwareConfirmation - var r1 error - if rf, ok := ret.Get(0).(func(*firmware.UpdateFirmwareRequest) (*firmware.UpdateFirmwareConfirmation, error)); ok { - return rf(request) - } - if rf, ok := ret.Get(0).(func(*firmware.UpdateFirmwareRequest) *firmware.UpdateFirmwareConfirmation); ok { - r0 = rf(request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*firmware.UpdateFirmwareConfirmation) - } - } - - if rf, ok := ret.Get(1).(func(*firmware.UpdateFirmwareRequest) error); ok { - r1 = rf(request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockFirmwareChargePointHandler_OnUpdateFirmware_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnUpdateFirmware' -type MockFirmwareChargePointHandler_OnUpdateFirmware_Call struct { - *mock.Call -} - -// OnUpdateFirmware is a helper method to define mock.On call -// - request *firmware.UpdateFirmwareRequest -func (_e *MockFirmwareChargePointHandler_Expecter) OnUpdateFirmware(request interface{}) *MockFirmwareChargePointHandler_OnUpdateFirmware_Call { - return &MockFirmwareChargePointHandler_OnUpdateFirmware_Call{Call: _e.mock.On("OnUpdateFirmware", request)} -} - -func (_c *MockFirmwareChargePointHandler_OnUpdateFirmware_Call) Run(run func(request *firmware.UpdateFirmwareRequest)) *MockFirmwareChargePointHandler_OnUpdateFirmware_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*firmware.UpdateFirmwareRequest)) - }) - return _c -} - -func (_c *MockFirmwareChargePointHandler_OnUpdateFirmware_Call) Return(confirmation *firmware.UpdateFirmwareConfirmation, err error) *MockFirmwareChargePointHandler_OnUpdateFirmware_Call { - _c.Call.Return(confirmation, err) - return _c -} - -func (_c *MockFirmwareChargePointHandler_OnUpdateFirmware_Call) RunAndReturn(run func(*firmware.UpdateFirmwareRequest) (*firmware.UpdateFirmwareConfirmation, error)) *MockFirmwareChargePointHandler_OnUpdateFirmware_Call { - _c.Call.Return(run) - return _c -} - -// NewMockFirmwareChargePointHandler creates a new instance of MockFirmwareChargePointHandler. 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 NewMockFirmwareChargePointHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockFirmwareChargePointHandler { - mock := &MockFirmwareChargePointHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocpp1.6_test/mocks/mock_local_auth_list_central_system_handler.go b/ocpp1.6_test/mocks/mock_local_auth_list_central_system_handler.go deleted file mode 100644 index 6da113c5..00000000 --- a/ocpp1.6_test/mocks/mock_local_auth_list_central_system_handler.go +++ /dev/null @@ -1,32 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// MockLocalAuthListCentralSystemHandler is an autogenerated mock type for the CentralSystemHandler type -type MockLocalAuthListCentralSystemHandler struct { - mock.Mock -} - -type MockLocalAuthListCentralSystemHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockLocalAuthListCentralSystemHandler) EXPECT() *MockLocalAuthListCentralSystemHandler_Expecter { - return &MockLocalAuthListCentralSystemHandler_Expecter{mock: &_m.Mock} -} - -// NewMockLocalAuthListCentralSystemHandler creates a new instance of MockLocalAuthListCentralSystemHandler. 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 NewMockLocalAuthListCentralSystemHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockLocalAuthListCentralSystemHandler { - mock := &MockLocalAuthListCentralSystemHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocpp1.6_test/mocks/mock_local_auth_list_charge_point_handler.go b/ocpp1.6_test/mocks/mock_local_auth_list_charge_point_handler.go deleted file mode 100644 index b7a552d6..00000000 --- a/ocpp1.6_test/mocks/mock_local_auth_list_charge_point_handler.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - localauth "github.com/lorenzodonini/ocpp-go/ocpp1.6/localauth" - mock "github.com/stretchr/testify/mock" -) - -// MockLocalAuthListChargePointHandler is an autogenerated mock type for the ChargePointHandler type -type MockLocalAuthListChargePointHandler struct { - mock.Mock -} - -type MockLocalAuthListChargePointHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockLocalAuthListChargePointHandler) EXPECT() *MockLocalAuthListChargePointHandler_Expecter { - return &MockLocalAuthListChargePointHandler_Expecter{mock: &_m.Mock} -} - -// OnGetLocalListVersion provides a mock function with given fields: request -func (_m *MockLocalAuthListChargePointHandler) OnGetLocalListVersion(request *localauth.GetLocalListVersionRequest) (*localauth.GetLocalListVersionConfirmation, error) { - ret := _m.Called(request) - - if len(ret) == 0 { - panic("no return value specified for OnGetLocalListVersion") - } - - var r0 *localauth.GetLocalListVersionConfirmation - var r1 error - if rf, ok := ret.Get(0).(func(*localauth.GetLocalListVersionRequest) (*localauth.GetLocalListVersionConfirmation, error)); ok { - return rf(request) - } - if rf, ok := ret.Get(0).(func(*localauth.GetLocalListVersionRequest) *localauth.GetLocalListVersionConfirmation); ok { - r0 = rf(request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*localauth.GetLocalListVersionConfirmation) - } - } - - if rf, ok := ret.Get(1).(func(*localauth.GetLocalListVersionRequest) error); ok { - r1 = rf(request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockLocalAuthListChargePointHandler_OnGetLocalListVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnGetLocalListVersion' -type MockLocalAuthListChargePointHandler_OnGetLocalListVersion_Call struct { - *mock.Call -} - -// OnGetLocalListVersion is a helper method to define mock.On call -// - request *localauth.GetLocalListVersionRequest -func (_e *MockLocalAuthListChargePointHandler_Expecter) OnGetLocalListVersion(request interface{}) *MockLocalAuthListChargePointHandler_OnGetLocalListVersion_Call { - return &MockLocalAuthListChargePointHandler_OnGetLocalListVersion_Call{Call: _e.mock.On("OnGetLocalListVersion", request)} -} - -func (_c *MockLocalAuthListChargePointHandler_OnGetLocalListVersion_Call) Run(run func(request *localauth.GetLocalListVersionRequest)) *MockLocalAuthListChargePointHandler_OnGetLocalListVersion_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*localauth.GetLocalListVersionRequest)) - }) - return _c -} - -func (_c *MockLocalAuthListChargePointHandler_OnGetLocalListVersion_Call) Return(confirmation *localauth.GetLocalListVersionConfirmation, err error) *MockLocalAuthListChargePointHandler_OnGetLocalListVersion_Call { - _c.Call.Return(confirmation, err) - return _c -} - -func (_c *MockLocalAuthListChargePointHandler_OnGetLocalListVersion_Call) RunAndReturn(run func(*localauth.GetLocalListVersionRequest) (*localauth.GetLocalListVersionConfirmation, error)) *MockLocalAuthListChargePointHandler_OnGetLocalListVersion_Call { - _c.Call.Return(run) - return _c -} - -// OnSendLocalList provides a mock function with given fields: request -func (_m *MockLocalAuthListChargePointHandler) OnSendLocalList(request *localauth.SendLocalListRequest) (*localauth.SendLocalListConfirmation, error) { - ret := _m.Called(request) - - if len(ret) == 0 { - panic("no return value specified for OnSendLocalList") - } - - var r0 *localauth.SendLocalListConfirmation - var r1 error - if rf, ok := ret.Get(0).(func(*localauth.SendLocalListRequest) (*localauth.SendLocalListConfirmation, error)); ok { - return rf(request) - } - if rf, ok := ret.Get(0).(func(*localauth.SendLocalListRequest) *localauth.SendLocalListConfirmation); ok { - r0 = rf(request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*localauth.SendLocalListConfirmation) - } - } - - if rf, ok := ret.Get(1).(func(*localauth.SendLocalListRequest) error); ok { - r1 = rf(request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockLocalAuthListChargePointHandler_OnSendLocalList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnSendLocalList' -type MockLocalAuthListChargePointHandler_OnSendLocalList_Call struct { - *mock.Call -} - -// OnSendLocalList is a helper method to define mock.On call -// - request *localauth.SendLocalListRequest -func (_e *MockLocalAuthListChargePointHandler_Expecter) OnSendLocalList(request interface{}) *MockLocalAuthListChargePointHandler_OnSendLocalList_Call { - return &MockLocalAuthListChargePointHandler_OnSendLocalList_Call{Call: _e.mock.On("OnSendLocalList", request)} -} - -func (_c *MockLocalAuthListChargePointHandler_OnSendLocalList_Call) Run(run func(request *localauth.SendLocalListRequest)) *MockLocalAuthListChargePointHandler_OnSendLocalList_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*localauth.SendLocalListRequest)) - }) - return _c -} - -func (_c *MockLocalAuthListChargePointHandler_OnSendLocalList_Call) Return(confirmation *localauth.SendLocalListConfirmation, err error) *MockLocalAuthListChargePointHandler_OnSendLocalList_Call { - _c.Call.Return(confirmation, err) - return _c -} - -func (_c *MockLocalAuthListChargePointHandler_OnSendLocalList_Call) RunAndReturn(run func(*localauth.SendLocalListRequest) (*localauth.SendLocalListConfirmation, error)) *MockLocalAuthListChargePointHandler_OnSendLocalList_Call { - _c.Call.Return(run) - return _c -} - -// NewMockLocalAuthListChargePointHandler creates a new instance of MockLocalAuthListChargePointHandler. 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 NewMockLocalAuthListChargePointHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockLocalAuthListChargePointHandler { - mock := &MockLocalAuthListChargePointHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocpp1.6_test/mocks/mock_logging_central_system_handler.go b/ocpp1.6_test/mocks/mock_logging_central_system_handler.go deleted file mode 100644 index f8b0ed68..00000000 --- a/ocpp1.6_test/mocks/mock_logging_central_system_handler.go +++ /dev/null @@ -1,94 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - logging "github.com/lorenzodonini/ocpp-go/ocpp1.6/logging" - mock "github.com/stretchr/testify/mock" -) - -// MockLogCentralSystemHandler is an autogenerated mock type for the CentralSystemHandler type -type MockLogCentralSystemHandler struct { - mock.Mock -} - -type MockLogCentralSystemHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockLogCentralSystemHandler) EXPECT() *MockLogCentralSystemHandler_Expecter { - return &MockLogCentralSystemHandler_Expecter{mock: &_m.Mock} -} - -// OnLogStatusNotification provides a mock function with given fields: chargingStationID, request -func (_m *MockLogCentralSystemHandler) OnLogStatusNotification(chargingStationID string, request *logging.LogStatusNotificationRequest) (*logging.LogStatusNotificationResponse, error) { - ret := _m.Called(chargingStationID, request) - - if len(ret) == 0 { - panic("no return value specified for OnLogStatusNotification") - } - - var r0 *logging.LogStatusNotificationResponse - var r1 error - if rf, ok := ret.Get(0).(func(string, *logging.LogStatusNotificationRequest) (*logging.LogStatusNotificationResponse, error)); ok { - return rf(chargingStationID, request) - } - if rf, ok := ret.Get(0).(func(string, *logging.LogStatusNotificationRequest) *logging.LogStatusNotificationResponse); ok { - r0 = rf(chargingStationID, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*logging.LogStatusNotificationResponse) - } - } - - if rf, ok := ret.Get(1).(func(string, *logging.LogStatusNotificationRequest) error); ok { - r1 = rf(chargingStationID, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockLogCentralSystemHandler_OnLogStatusNotification_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnLogStatusNotification' -type MockLogCentralSystemHandler_OnLogStatusNotification_Call struct { - *mock.Call -} - -// OnLogStatusNotification is a helper method to define mock.On call -// - chargingStationID string -// - request *logging.LogStatusNotificationRequest -func (_e *MockLogCentralSystemHandler_Expecter) OnLogStatusNotification(chargingStationID interface{}, request interface{}) *MockLogCentralSystemHandler_OnLogStatusNotification_Call { - return &MockLogCentralSystemHandler_OnLogStatusNotification_Call{Call: _e.mock.On("OnLogStatusNotification", chargingStationID, request)} -} - -func (_c *MockLogCentralSystemHandler_OnLogStatusNotification_Call) Run(run func(chargingStationID string, request *logging.LogStatusNotificationRequest)) *MockLogCentralSystemHandler_OnLogStatusNotification_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(*logging.LogStatusNotificationRequest)) - }) - return _c -} - -func (_c *MockLogCentralSystemHandler_OnLogStatusNotification_Call) Return(response *logging.LogStatusNotificationResponse, err error) *MockLogCentralSystemHandler_OnLogStatusNotification_Call { - _c.Call.Return(response, err) - return _c -} - -func (_c *MockLogCentralSystemHandler_OnLogStatusNotification_Call) RunAndReturn(run func(string, *logging.LogStatusNotificationRequest) (*logging.LogStatusNotificationResponse, error)) *MockLogCentralSystemHandler_OnLogStatusNotification_Call { - _c.Call.Return(run) - return _c -} - -// NewMockLogCentralSystemHandler creates a new instance of MockLogCentralSystemHandler. 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 NewMockLogCentralSystemHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockLogCentralSystemHandler { - mock := &MockLogCentralSystemHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocpp1.6_test/mocks/mock_logging_charge_point_handler.go b/ocpp1.6_test/mocks/mock_logging_charge_point_handler.go deleted file mode 100644 index f26f5227..00000000 --- a/ocpp1.6_test/mocks/mock_logging_charge_point_handler.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - logging "github.com/lorenzodonini/ocpp-go/ocpp1.6/logging" - mock "github.com/stretchr/testify/mock" -) - -// MockLogChargePointHandler is an autogenerated mock type for the ChargePointHandler type -type MockLogChargePointHandler struct { - mock.Mock -} - -type MockLogChargePointHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockLogChargePointHandler) EXPECT() *MockLogChargePointHandler_Expecter { - return &MockLogChargePointHandler_Expecter{mock: &_m.Mock} -} - -// OnGetLog provides a mock function with given fields: request -func (_m *MockLogChargePointHandler) OnGetLog(request *logging.GetLogRequest) (*logging.GetLogResponse, error) { - ret := _m.Called(request) - - if len(ret) == 0 { - panic("no return value specified for OnGetLog") - } - - var r0 *logging.GetLogResponse - var r1 error - if rf, ok := ret.Get(0).(func(*logging.GetLogRequest) (*logging.GetLogResponse, error)); ok { - return rf(request) - } - if rf, ok := ret.Get(0).(func(*logging.GetLogRequest) *logging.GetLogResponse); ok { - r0 = rf(request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*logging.GetLogResponse) - } - } - - if rf, ok := ret.Get(1).(func(*logging.GetLogRequest) error); ok { - r1 = rf(request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockLogChargePointHandler_OnGetLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnGetLog' -type MockLogChargePointHandler_OnGetLog_Call struct { - *mock.Call -} - -// OnGetLog is a helper method to define mock.On call -// - request *logging.GetLogRequest -func (_e *MockLogChargePointHandler_Expecter) OnGetLog(request interface{}) *MockLogChargePointHandler_OnGetLog_Call { - return &MockLogChargePointHandler_OnGetLog_Call{Call: _e.mock.On("OnGetLog", request)} -} - -func (_c *MockLogChargePointHandler_OnGetLog_Call) Run(run func(request *logging.GetLogRequest)) *MockLogChargePointHandler_OnGetLog_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*logging.GetLogRequest)) - }) - return _c -} - -func (_c *MockLogChargePointHandler_OnGetLog_Call) Return(response *logging.GetLogResponse, err error) *MockLogChargePointHandler_OnGetLog_Call { - _c.Call.Return(response, err) - return _c -} - -func (_c *MockLogChargePointHandler_OnGetLog_Call) RunAndReturn(run func(*logging.GetLogRequest) (*logging.GetLogResponse, error)) *MockLogChargePointHandler_OnGetLog_Call { - _c.Call.Return(run) - return _c -} - -// NewMockLogChargePointHandler creates a new instance of MockLogChargePointHandler. 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 NewMockLogChargePointHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockLogChargePointHandler { - mock := &MockLogChargePointHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocpp1.6_test/mocks/mock_ocpp16.go b/ocpp1.6_test/mocks/mock_ocpp16.go deleted file mode 100644 index 330eecee..00000000 --- a/ocpp1.6_test/mocks/mock_ocpp16.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - ocpp16 "github.com/lorenzodonini/ocpp-go/ocpp1.6" - mock "github.com/stretchr/testify/mock" -) - -// MockChargePointConnectionHandler is an autogenerated mock type for the ChargePointConnectionHandler type -type MockChargePointConnectionHandler struct { - mock.Mock -} - -type MockChargePointConnectionHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockChargePointConnectionHandler) EXPECT() *MockChargePointConnectionHandler_Expecter { - return &MockChargePointConnectionHandler_Expecter{mock: &_m.Mock} -} - -// Execute provides a mock function with given fields: chargePoint -func (_m *MockChargePointConnectionHandler) Execute(chargePoint ocpp16.ChargePointConnection) { - _m.Called(chargePoint) -} - -// MockChargePointConnectionHandler_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute' -type MockChargePointConnectionHandler_Execute_Call struct { - *mock.Call -} - -// Execute is a helper method to define mock.On call -// - chargePoint ocpp16.ChargePointConnection -func (_e *MockChargePointConnectionHandler_Expecter) Execute(chargePoint interface{}) *MockChargePointConnectionHandler_Execute_Call { - return &MockChargePointConnectionHandler_Execute_Call{Call: _e.mock.On("Execute", chargePoint)} -} - -func (_c *MockChargePointConnectionHandler_Execute_Call) Run(run func(chargePoint ocpp16.ChargePointConnection)) *MockChargePointConnectionHandler_Execute_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ocpp16.ChargePointConnection)) - }) - return _c -} - -func (_c *MockChargePointConnectionHandler_Execute_Call) Return() *MockChargePointConnectionHandler_Execute_Call { - _c.Call.Return() - return _c -} - -func (_c *MockChargePointConnectionHandler_Execute_Call) RunAndReturn(run func(ocpp16.ChargePointConnection)) *MockChargePointConnectionHandler_Execute_Call { - _c.Run(run) - return _c -} - -// NewMockChargePointConnectionHandler creates a new instance of MockChargePointConnectionHandler. 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 NewMockChargePointConnectionHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockChargePointConnectionHandler { - mock := &MockChargePointConnectionHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocpp1.6_test/mocks/mock_remote_trigger_central_system_handler.go b/ocpp1.6_test/mocks/mock_remote_trigger_central_system_handler.go deleted file mode 100644 index 1d95ec5e..00000000 --- a/ocpp1.6_test/mocks/mock_remote_trigger_central_system_handler.go +++ /dev/null @@ -1,32 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// MockRemoteTriggerCentralSystemHandler is an autogenerated mock type for the CentralSystemHandler type -type MockRemoteTriggerCentralSystemHandler struct { - mock.Mock -} - -type MockRemoteTriggerCentralSystemHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockRemoteTriggerCentralSystemHandler) EXPECT() *MockRemoteTriggerCentralSystemHandler_Expecter { - return &MockRemoteTriggerCentralSystemHandler_Expecter{mock: &_m.Mock} -} - -// NewMockRemoteTriggerCentralSystemHandler creates a new instance of MockRemoteTriggerCentralSystemHandler. 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 NewMockRemoteTriggerCentralSystemHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockRemoteTriggerCentralSystemHandler { - mock := &MockRemoteTriggerCentralSystemHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocpp1.6_test/mocks/mock_remote_trigger_charge_point_handler.go b/ocpp1.6_test/mocks/mock_remote_trigger_charge_point_handler.go deleted file mode 100644 index ae0d35d1..00000000 --- a/ocpp1.6_test/mocks/mock_remote_trigger_charge_point_handler.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - remotetrigger "github.com/lorenzodonini/ocpp-go/ocpp1.6/remotetrigger" - mock "github.com/stretchr/testify/mock" -) - -// MockRemoteTriggerChargePointHandler is an autogenerated mock type for the ChargePointHandler type -type MockRemoteTriggerChargePointHandler struct { - mock.Mock -} - -type MockRemoteTriggerChargePointHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockRemoteTriggerChargePointHandler) EXPECT() *MockRemoteTriggerChargePointHandler_Expecter { - return &MockRemoteTriggerChargePointHandler_Expecter{mock: &_m.Mock} -} - -// OnTriggerMessage provides a mock function with given fields: request -func (_m *MockRemoteTriggerChargePointHandler) OnTriggerMessage(request *remotetrigger.TriggerMessageRequest) (*remotetrigger.TriggerMessageConfirmation, error) { - ret := _m.Called(request) - - if len(ret) == 0 { - panic("no return value specified for OnTriggerMessage") - } - - var r0 *remotetrigger.TriggerMessageConfirmation - var r1 error - if rf, ok := ret.Get(0).(func(*remotetrigger.TriggerMessageRequest) (*remotetrigger.TriggerMessageConfirmation, error)); ok { - return rf(request) - } - if rf, ok := ret.Get(0).(func(*remotetrigger.TriggerMessageRequest) *remotetrigger.TriggerMessageConfirmation); ok { - r0 = rf(request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*remotetrigger.TriggerMessageConfirmation) - } - } - - if rf, ok := ret.Get(1).(func(*remotetrigger.TriggerMessageRequest) error); ok { - r1 = rf(request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockRemoteTriggerChargePointHandler_OnTriggerMessage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnTriggerMessage' -type MockRemoteTriggerChargePointHandler_OnTriggerMessage_Call struct { - *mock.Call -} - -// OnTriggerMessage is a helper method to define mock.On call -// - request *remotetrigger.TriggerMessageRequest -func (_e *MockRemoteTriggerChargePointHandler_Expecter) OnTriggerMessage(request interface{}) *MockRemoteTriggerChargePointHandler_OnTriggerMessage_Call { - return &MockRemoteTriggerChargePointHandler_OnTriggerMessage_Call{Call: _e.mock.On("OnTriggerMessage", request)} -} - -func (_c *MockRemoteTriggerChargePointHandler_OnTriggerMessage_Call) Run(run func(request *remotetrigger.TriggerMessageRequest)) *MockRemoteTriggerChargePointHandler_OnTriggerMessage_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*remotetrigger.TriggerMessageRequest)) - }) - return _c -} - -func (_c *MockRemoteTriggerChargePointHandler_OnTriggerMessage_Call) Return(confirmation *remotetrigger.TriggerMessageConfirmation, err error) *MockRemoteTriggerChargePointHandler_OnTriggerMessage_Call { - _c.Call.Return(confirmation, err) - return _c -} - -func (_c *MockRemoteTriggerChargePointHandler_OnTriggerMessage_Call) RunAndReturn(run func(*remotetrigger.TriggerMessageRequest) (*remotetrigger.TriggerMessageConfirmation, error)) *MockRemoteTriggerChargePointHandler_OnTriggerMessage_Call { - _c.Call.Return(run) - return _c -} - -// NewMockRemoteTriggerChargePointHandler creates a new instance of MockRemoteTriggerChargePointHandler. 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 NewMockRemoteTriggerChargePointHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockRemoteTriggerChargePointHandler { - mock := &MockRemoteTriggerChargePointHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocpp1.6_test/mocks/mock_reservation_central_system_handler.go b/ocpp1.6_test/mocks/mock_reservation_central_system_handler.go deleted file mode 100644 index 7ce97b06..00000000 --- a/ocpp1.6_test/mocks/mock_reservation_central_system_handler.go +++ /dev/null @@ -1,32 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// MockReservationCentralSystemHandler is an autogenerated mock type for the CentralSystemHandler type -type MockReservationCentralSystemHandler struct { - mock.Mock -} - -type MockReservationCentralSystemHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockReservationCentralSystemHandler) EXPECT() *MockReservationCentralSystemHandler_Expecter { - return &MockReservationCentralSystemHandler_Expecter{mock: &_m.Mock} -} - -// NewMockReservationCentralSystemHandler creates a new instance of MockReservationCentralSystemHandler. 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 NewMockReservationCentralSystemHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockReservationCentralSystemHandler { - mock := &MockReservationCentralSystemHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocpp1.6_test/mocks/mock_reservation_charge_point_handler.go b/ocpp1.6_test/mocks/mock_reservation_charge_point_handler.go deleted file mode 100644 index 2800b719..00000000 --- a/ocpp1.6_test/mocks/mock_reservation_charge_point_handler.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - reservation "github.com/lorenzodonini/ocpp-go/ocpp1.6/reservation" - mock "github.com/stretchr/testify/mock" -) - -// MockReservationChargePointHandler is an autogenerated mock type for the ChargePointHandler type -type MockReservationChargePointHandler struct { - mock.Mock -} - -type MockReservationChargePointHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockReservationChargePointHandler) EXPECT() *MockReservationChargePointHandler_Expecter { - return &MockReservationChargePointHandler_Expecter{mock: &_m.Mock} -} - -// OnCancelReservation provides a mock function with given fields: request -func (_m *MockReservationChargePointHandler) OnCancelReservation(request *reservation.CancelReservationRequest) (*reservation.CancelReservationConfirmation, error) { - ret := _m.Called(request) - - if len(ret) == 0 { - panic("no return value specified for OnCancelReservation") - } - - var r0 *reservation.CancelReservationConfirmation - var r1 error - if rf, ok := ret.Get(0).(func(*reservation.CancelReservationRequest) (*reservation.CancelReservationConfirmation, error)); ok { - return rf(request) - } - if rf, ok := ret.Get(0).(func(*reservation.CancelReservationRequest) *reservation.CancelReservationConfirmation); ok { - r0 = rf(request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*reservation.CancelReservationConfirmation) - } - } - - if rf, ok := ret.Get(1).(func(*reservation.CancelReservationRequest) error); ok { - r1 = rf(request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockReservationChargePointHandler_OnCancelReservation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnCancelReservation' -type MockReservationChargePointHandler_OnCancelReservation_Call struct { - *mock.Call -} - -// OnCancelReservation is a helper method to define mock.On call -// - request *reservation.CancelReservationRequest -func (_e *MockReservationChargePointHandler_Expecter) OnCancelReservation(request interface{}) *MockReservationChargePointHandler_OnCancelReservation_Call { - return &MockReservationChargePointHandler_OnCancelReservation_Call{Call: _e.mock.On("OnCancelReservation", request)} -} - -func (_c *MockReservationChargePointHandler_OnCancelReservation_Call) Run(run func(request *reservation.CancelReservationRequest)) *MockReservationChargePointHandler_OnCancelReservation_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*reservation.CancelReservationRequest)) - }) - return _c -} - -func (_c *MockReservationChargePointHandler_OnCancelReservation_Call) Return(confirmation *reservation.CancelReservationConfirmation, err error) *MockReservationChargePointHandler_OnCancelReservation_Call { - _c.Call.Return(confirmation, err) - return _c -} - -func (_c *MockReservationChargePointHandler_OnCancelReservation_Call) RunAndReturn(run func(*reservation.CancelReservationRequest) (*reservation.CancelReservationConfirmation, error)) *MockReservationChargePointHandler_OnCancelReservation_Call { - _c.Call.Return(run) - return _c -} - -// OnReserveNow provides a mock function with given fields: request -func (_m *MockReservationChargePointHandler) OnReserveNow(request *reservation.ReserveNowRequest) (*reservation.ReserveNowConfirmation, error) { - ret := _m.Called(request) - - if len(ret) == 0 { - panic("no return value specified for OnReserveNow") - } - - var r0 *reservation.ReserveNowConfirmation - var r1 error - if rf, ok := ret.Get(0).(func(*reservation.ReserveNowRequest) (*reservation.ReserveNowConfirmation, error)); ok { - return rf(request) - } - if rf, ok := ret.Get(0).(func(*reservation.ReserveNowRequest) *reservation.ReserveNowConfirmation); ok { - r0 = rf(request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*reservation.ReserveNowConfirmation) - } - } - - if rf, ok := ret.Get(1).(func(*reservation.ReserveNowRequest) error); ok { - r1 = rf(request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockReservationChargePointHandler_OnReserveNow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnReserveNow' -type MockReservationChargePointHandler_OnReserveNow_Call struct { - *mock.Call -} - -// OnReserveNow is a helper method to define mock.On call -// - request *reservation.ReserveNowRequest -func (_e *MockReservationChargePointHandler_Expecter) OnReserveNow(request interface{}) *MockReservationChargePointHandler_OnReserveNow_Call { - return &MockReservationChargePointHandler_OnReserveNow_Call{Call: _e.mock.On("OnReserveNow", request)} -} - -func (_c *MockReservationChargePointHandler_OnReserveNow_Call) Run(run func(request *reservation.ReserveNowRequest)) *MockReservationChargePointHandler_OnReserveNow_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*reservation.ReserveNowRequest)) - }) - return _c -} - -func (_c *MockReservationChargePointHandler_OnReserveNow_Call) Return(confirmation *reservation.ReserveNowConfirmation, err error) *MockReservationChargePointHandler_OnReserveNow_Call { - _c.Call.Return(confirmation, err) - return _c -} - -func (_c *MockReservationChargePointHandler_OnReserveNow_Call) RunAndReturn(run func(*reservation.ReserveNowRequest) (*reservation.ReserveNowConfirmation, error)) *MockReservationChargePointHandler_OnReserveNow_Call { - _c.Call.Return(run) - return _c -} - -// NewMockReservationChargePointHandler creates a new instance of MockReservationChargePointHandler. 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 NewMockReservationChargePointHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockReservationChargePointHandler { - mock := &MockReservationChargePointHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocpp1.6_test/mocks/mock_secure_firmware_CentralSystemHandler.go b/ocpp1.6_test/mocks/mock_secure_firmware_CentralSystemHandler.go deleted file mode 100644 index a8540226..00000000 --- a/ocpp1.6_test/mocks/mock_secure_firmware_CentralSystemHandler.go +++ /dev/null @@ -1,94 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - securefirmware "github.com/lorenzodonini/ocpp-go/ocpp1.6/securefirmware" - mock "github.com/stretchr/testify/mock" -) - -// MockSecureFirmwareCentralSystemHandler is an autogenerated mock type for the CentralSystemHandler type -type MockSecureFirmwareCentralSystemHandler struct { - mock.Mock -} - -type MockSecureFirmwareCentralSystemHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockSecureFirmwareCentralSystemHandler) EXPECT() *MockSecureFirmwareCentralSystemHandler_Expecter { - return &MockSecureFirmwareCentralSystemHandler_Expecter{mock: &_m.Mock} -} - -// OnSignedFirmwareStatusNotification provides a mock function with given fields: chargingStationID, request -func (_m *MockSecureFirmwareCentralSystemHandler) OnSignedFirmwareStatusNotification(chargingStationID string, request *securefirmware.SignedFirmwareStatusNotificationRequest) (*securefirmware.SignedFirmwareStatusNotificationResponse, error) { - ret := _m.Called(chargingStationID, request) - - if len(ret) == 0 { - panic("no return value specified for OnSignedFirmwareStatusNotification") - } - - var r0 *securefirmware.SignedFirmwareStatusNotificationResponse - var r1 error - if rf, ok := ret.Get(0).(func(string, *securefirmware.SignedFirmwareStatusNotificationRequest) (*securefirmware.SignedFirmwareStatusNotificationResponse, error)); ok { - return rf(chargingStationID, request) - } - if rf, ok := ret.Get(0).(func(string, *securefirmware.SignedFirmwareStatusNotificationRequest) *securefirmware.SignedFirmwareStatusNotificationResponse); ok { - r0 = rf(chargingStationID, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*securefirmware.SignedFirmwareStatusNotificationResponse) - } - } - - if rf, ok := ret.Get(1).(func(string, *securefirmware.SignedFirmwareStatusNotificationRequest) error); ok { - r1 = rf(chargingStationID, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockSecureFirmwareCentralSystemHandler_OnSignedFirmwareStatusNotification_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnSignedFirmwareStatusNotification' -type MockSecureFirmwareCentralSystemHandler_OnSignedFirmwareStatusNotification_Call struct { - *mock.Call -} - -// OnSignedFirmwareStatusNotification is a helper method to define mock.On call -// - chargingStationID string -// - request *securefirmware.SignedFirmwareStatusNotificationRequest -func (_e *MockSecureFirmwareCentralSystemHandler_Expecter) OnSignedFirmwareStatusNotification(chargingStationID interface{}, request interface{}) *MockSecureFirmwareCentralSystemHandler_OnSignedFirmwareStatusNotification_Call { - return &MockSecureFirmwareCentralSystemHandler_OnSignedFirmwareStatusNotification_Call{Call: _e.mock.On("OnSignedFirmwareStatusNotification", chargingStationID, request)} -} - -func (_c *MockSecureFirmwareCentralSystemHandler_OnSignedFirmwareStatusNotification_Call) Run(run func(chargingStationID string, request *securefirmware.SignedFirmwareStatusNotificationRequest)) *MockSecureFirmwareCentralSystemHandler_OnSignedFirmwareStatusNotification_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(*securefirmware.SignedFirmwareStatusNotificationRequest)) - }) - return _c -} - -func (_c *MockSecureFirmwareCentralSystemHandler_OnSignedFirmwareStatusNotification_Call) Return(response *securefirmware.SignedFirmwareStatusNotificationResponse, err error) *MockSecureFirmwareCentralSystemHandler_OnSignedFirmwareStatusNotification_Call { - _c.Call.Return(response, err) - return _c -} - -func (_c *MockSecureFirmwareCentralSystemHandler_OnSignedFirmwareStatusNotification_Call) RunAndReturn(run func(string, *securefirmware.SignedFirmwareStatusNotificationRequest) (*securefirmware.SignedFirmwareStatusNotificationResponse, error)) *MockSecureFirmwareCentralSystemHandler_OnSignedFirmwareStatusNotification_Call { - _c.Call.Return(run) - return _c -} - -// NewMockSecureFirmwareCentralSystemHandler creates a new instance of MockSecureFirmwareCentralSystemHandler. 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 NewMockSecureFirmwareCentralSystemHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockSecureFirmwareCentralSystemHandler { - mock := &MockSecureFirmwareCentralSystemHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocpp1.6_test/mocks/mock_secure_firmware_ChargePointHandler.go b/ocpp1.6_test/mocks/mock_secure_firmware_ChargePointHandler.go deleted file mode 100644 index fbede0a3..00000000 --- a/ocpp1.6_test/mocks/mock_secure_firmware_ChargePointHandler.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - securefirmware "github.com/lorenzodonini/ocpp-go/ocpp1.6/securefirmware" - mock "github.com/stretchr/testify/mock" -) - -// MockSecureFirmwareChargePointHandler is an autogenerated mock type for the ChargePointHandler type -type MockSecureFirmwareChargePointHandler struct { - mock.Mock -} - -type MockSecureFirmwareChargePointHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockSecureFirmwareChargePointHandler) EXPECT() *MockSecureFirmwareChargePointHandler_Expecter { - return &MockSecureFirmwareChargePointHandler_Expecter{mock: &_m.Mock} -} - -// OnSignedUpdateFirmware provides a mock function with given fields: request -func (_m *MockSecureFirmwareChargePointHandler) OnSignedUpdateFirmware(request *securefirmware.SignedUpdateFirmwareRequest) (*securefirmware.SignedUpdateFirmwareResponse, error) { - ret := _m.Called(request) - - if len(ret) == 0 { - panic("no return value specified for OnSignedUpdateFirmware") - } - - var r0 *securefirmware.SignedUpdateFirmwareResponse - var r1 error - if rf, ok := ret.Get(0).(func(*securefirmware.SignedUpdateFirmwareRequest) (*securefirmware.SignedUpdateFirmwareResponse, error)); ok { - return rf(request) - } - if rf, ok := ret.Get(0).(func(*securefirmware.SignedUpdateFirmwareRequest) *securefirmware.SignedUpdateFirmwareResponse); ok { - r0 = rf(request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*securefirmware.SignedUpdateFirmwareResponse) - } - } - - if rf, ok := ret.Get(1).(func(*securefirmware.SignedUpdateFirmwareRequest) error); ok { - r1 = rf(request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockSecureFirmwareChargePointHandler_OnSignedUpdateFirmware_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnSignedUpdateFirmware' -type MockSecureFirmwareChargePointHandler_OnSignedUpdateFirmware_Call struct { - *mock.Call -} - -// OnSignedUpdateFirmware is a helper method to define mock.On call -// - request *securefirmware.SignedUpdateFirmwareRequest -func (_e *MockSecureFirmwareChargePointHandler_Expecter) OnSignedUpdateFirmware(request interface{}) *MockSecureFirmwareChargePointHandler_OnSignedUpdateFirmware_Call { - return &MockSecureFirmwareChargePointHandler_OnSignedUpdateFirmware_Call{Call: _e.mock.On("OnSignedUpdateFirmware", request)} -} - -func (_c *MockSecureFirmwareChargePointHandler_OnSignedUpdateFirmware_Call) Run(run func(request *securefirmware.SignedUpdateFirmwareRequest)) *MockSecureFirmwareChargePointHandler_OnSignedUpdateFirmware_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*securefirmware.SignedUpdateFirmwareRequest)) - }) - return _c -} - -func (_c *MockSecureFirmwareChargePointHandler_OnSignedUpdateFirmware_Call) Return(response *securefirmware.SignedUpdateFirmwareResponse, err error) *MockSecureFirmwareChargePointHandler_OnSignedUpdateFirmware_Call { - _c.Call.Return(response, err) - return _c -} - -func (_c *MockSecureFirmwareChargePointHandler_OnSignedUpdateFirmware_Call) RunAndReturn(run func(*securefirmware.SignedUpdateFirmwareRequest) (*securefirmware.SignedUpdateFirmwareResponse, error)) *MockSecureFirmwareChargePointHandler_OnSignedUpdateFirmware_Call { - _c.Call.Return(run) - return _c -} - -// NewMockSecureFirmwareChargePointHandler creates a new instance of MockSecureFirmwareChargePointHandler. 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 NewMockSecureFirmwareChargePointHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockSecureFirmwareChargePointHandler { - mock := &MockSecureFirmwareChargePointHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocpp1.6_test/mocks/mock_security_central_system_handler.go b/ocpp1.6_test/mocks/mock_security_central_system_handler.go deleted file mode 100644 index 3728fadc..00000000 --- a/ocpp1.6_test/mocks/mock_security_central_system_handler.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - security "github.com/lorenzodonini/ocpp-go/ocpp1.6/security" - mock "github.com/stretchr/testify/mock" -) - -// MockSecurityCentralSystemHandler is an autogenerated mock type for the CentralSystemHandler type -type MockSecurityCentralSystemHandler struct { - mock.Mock -} - -type MockSecurityCentralSystemHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockSecurityCentralSystemHandler) EXPECT() *MockSecurityCentralSystemHandler_Expecter { - return &MockSecurityCentralSystemHandler_Expecter{mock: &_m.Mock} -} - -// OnSecurityEventNotification provides a mock function with given fields: chargingStationID, request -func (_m *MockSecurityCentralSystemHandler) OnSecurityEventNotification(chargingStationID string, request *security.SecurityEventNotificationRequest) (*security.SecurityEventNotificationResponse, error) { - ret := _m.Called(chargingStationID, request) - - if len(ret) == 0 { - panic("no return value specified for OnSecurityEventNotification") - } - - var r0 *security.SecurityEventNotificationResponse - var r1 error - if rf, ok := ret.Get(0).(func(string, *security.SecurityEventNotificationRequest) (*security.SecurityEventNotificationResponse, error)); ok { - return rf(chargingStationID, request) - } - if rf, ok := ret.Get(0).(func(string, *security.SecurityEventNotificationRequest) *security.SecurityEventNotificationResponse); ok { - r0 = rf(chargingStationID, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*security.SecurityEventNotificationResponse) - } - } - - if rf, ok := ret.Get(1).(func(string, *security.SecurityEventNotificationRequest) error); ok { - r1 = rf(chargingStationID, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockSecurityCentralSystemHandler_OnSecurityEventNotification_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnSecurityEventNotification' -type MockSecurityCentralSystemHandler_OnSecurityEventNotification_Call struct { - *mock.Call -} - -// OnSecurityEventNotification is a helper method to define mock.On call -// - chargingStationID string -// - request *security.SecurityEventNotificationRequest -func (_e *MockSecurityCentralSystemHandler_Expecter) OnSecurityEventNotification(chargingStationID interface{}, request interface{}) *MockSecurityCentralSystemHandler_OnSecurityEventNotification_Call { - return &MockSecurityCentralSystemHandler_OnSecurityEventNotification_Call{Call: _e.mock.On("OnSecurityEventNotification", chargingStationID, request)} -} - -func (_c *MockSecurityCentralSystemHandler_OnSecurityEventNotification_Call) Run(run func(chargingStationID string, request *security.SecurityEventNotificationRequest)) *MockSecurityCentralSystemHandler_OnSecurityEventNotification_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(*security.SecurityEventNotificationRequest)) - }) - return _c -} - -func (_c *MockSecurityCentralSystemHandler_OnSecurityEventNotification_Call) Return(response *security.SecurityEventNotificationResponse, err error) *MockSecurityCentralSystemHandler_OnSecurityEventNotification_Call { - _c.Call.Return(response, err) - return _c -} - -func (_c *MockSecurityCentralSystemHandler_OnSecurityEventNotification_Call) RunAndReturn(run func(string, *security.SecurityEventNotificationRequest) (*security.SecurityEventNotificationResponse, error)) *MockSecurityCentralSystemHandler_OnSecurityEventNotification_Call { - _c.Call.Return(run) - return _c -} - -// OnSignCertificate provides a mock function with given fields: chargingStationID, request -func (_m *MockSecurityCentralSystemHandler) OnSignCertificate(chargingStationID string, request *security.SignCertificateRequest) (*security.SignCertificateResponse, error) { - ret := _m.Called(chargingStationID, request) - - if len(ret) == 0 { - panic("no return value specified for OnSignCertificate") - } - - var r0 *security.SignCertificateResponse - var r1 error - if rf, ok := ret.Get(0).(func(string, *security.SignCertificateRequest) (*security.SignCertificateResponse, error)); ok { - return rf(chargingStationID, request) - } - if rf, ok := ret.Get(0).(func(string, *security.SignCertificateRequest) *security.SignCertificateResponse); ok { - r0 = rf(chargingStationID, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*security.SignCertificateResponse) - } - } - - if rf, ok := ret.Get(1).(func(string, *security.SignCertificateRequest) error); ok { - r1 = rf(chargingStationID, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockSecurityCentralSystemHandler_OnSignCertificate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnSignCertificate' -type MockSecurityCentralSystemHandler_OnSignCertificate_Call struct { - *mock.Call -} - -// OnSignCertificate is a helper method to define mock.On call -// - chargingStationID string -// - request *security.SignCertificateRequest -func (_e *MockSecurityCentralSystemHandler_Expecter) OnSignCertificate(chargingStationID interface{}, request interface{}) *MockSecurityCentralSystemHandler_OnSignCertificate_Call { - return &MockSecurityCentralSystemHandler_OnSignCertificate_Call{Call: _e.mock.On("OnSignCertificate", chargingStationID, request)} -} - -func (_c *MockSecurityCentralSystemHandler_OnSignCertificate_Call) Run(run func(chargingStationID string, request *security.SignCertificateRequest)) *MockSecurityCentralSystemHandler_OnSignCertificate_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(*security.SignCertificateRequest)) - }) - return _c -} - -func (_c *MockSecurityCentralSystemHandler_OnSignCertificate_Call) Return(response *security.SignCertificateResponse, err error) *MockSecurityCentralSystemHandler_OnSignCertificate_Call { - _c.Call.Return(response, err) - return _c -} - -func (_c *MockSecurityCentralSystemHandler_OnSignCertificate_Call) RunAndReturn(run func(string, *security.SignCertificateRequest) (*security.SignCertificateResponse, error)) *MockSecurityCentralSystemHandler_OnSignCertificate_Call { - _c.Call.Return(run) - return _c -} - -// NewMockSecurityCentralSystemHandler creates a new instance of MockSecurityCentralSystemHandler. 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 NewMockSecurityCentralSystemHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockSecurityCentralSystemHandler { - mock := &MockSecurityCentralSystemHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocpp1.6_test/mocks/mock_security_charge_point_handler.go b/ocpp1.6_test/mocks/mock_security_charge_point_handler.go deleted file mode 100644 index 012adec9..00000000 --- a/ocpp1.6_test/mocks/mock_security_charge_point_handler.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - security "github.com/lorenzodonini/ocpp-go/ocpp1.6/security" - mock "github.com/stretchr/testify/mock" -) - -// MockSecurityChargePointHandler is an autogenerated mock type for the ChargePointHandler type -type MockSecurityChargePointHandler struct { - mock.Mock -} - -type MockSecurityChargePointHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockSecurityChargePointHandler) EXPECT() *MockSecurityChargePointHandler_Expecter { - return &MockSecurityChargePointHandler_Expecter{mock: &_m.Mock} -} - -// OnCertificateSigned provides a mock function with given fields: request -func (_m *MockSecurityChargePointHandler) OnCertificateSigned(request *security.CertificateSignedRequest) (*security.CertificateSignedResponse, error) { - ret := _m.Called(request) - - if len(ret) == 0 { - panic("no return value specified for OnCertificateSigned") - } - - var r0 *security.CertificateSignedResponse - var r1 error - if rf, ok := ret.Get(0).(func(*security.CertificateSignedRequest) (*security.CertificateSignedResponse, error)); ok { - return rf(request) - } - if rf, ok := ret.Get(0).(func(*security.CertificateSignedRequest) *security.CertificateSignedResponse); ok { - r0 = rf(request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*security.CertificateSignedResponse) - } - } - - if rf, ok := ret.Get(1).(func(*security.CertificateSignedRequest) error); ok { - r1 = rf(request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockSecurityChargePointHandler_OnCertificateSigned_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnCertificateSigned' -type MockSecurityChargePointHandler_OnCertificateSigned_Call struct { - *mock.Call -} - -// OnCertificateSigned is a helper method to define mock.On call -// - request *security.CertificateSignedRequest -func (_e *MockSecurityChargePointHandler_Expecter) OnCertificateSigned(request interface{}) *MockSecurityChargePointHandler_OnCertificateSigned_Call { - return &MockSecurityChargePointHandler_OnCertificateSigned_Call{Call: _e.mock.On("OnCertificateSigned", request)} -} - -func (_c *MockSecurityChargePointHandler_OnCertificateSigned_Call) Run(run func(request *security.CertificateSignedRequest)) *MockSecurityChargePointHandler_OnCertificateSigned_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*security.CertificateSignedRequest)) - }) - return _c -} - -func (_c *MockSecurityChargePointHandler_OnCertificateSigned_Call) Return(response *security.CertificateSignedResponse, err error) *MockSecurityChargePointHandler_OnCertificateSigned_Call { - _c.Call.Return(response, err) - return _c -} - -func (_c *MockSecurityChargePointHandler_OnCertificateSigned_Call) RunAndReturn(run func(*security.CertificateSignedRequest) (*security.CertificateSignedResponse, error)) *MockSecurityChargePointHandler_OnCertificateSigned_Call { - _c.Call.Return(run) - return _c -} - -// NewMockSecurityChargePointHandler creates a new instance of MockSecurityChargePointHandler. 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 NewMockSecurityChargePointHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockSecurityChargePointHandler { - mock := &MockSecurityChargePointHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocpp1.6_test/mocks/mock_smart_charging_central_system_handler.go b/ocpp1.6_test/mocks/mock_smart_charging_central_system_handler.go deleted file mode 100644 index 1a5ebb75..00000000 --- a/ocpp1.6_test/mocks/mock_smart_charging_central_system_handler.go +++ /dev/null @@ -1,32 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// MockSmartChargingCentralSystemHandler is an autogenerated mock type for the CentralSystemHandler type -type MockSmartChargingCentralSystemHandler struct { - mock.Mock -} - -type MockSmartChargingCentralSystemHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockSmartChargingCentralSystemHandler) EXPECT() *MockSmartChargingCentralSystemHandler_Expecter { - return &MockSmartChargingCentralSystemHandler_Expecter{mock: &_m.Mock} -} - -// NewMockSmartChargingCentralSystemHandler creates a new instance of MockSmartChargingCentralSystemHandler. 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 NewMockSmartChargingCentralSystemHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockSmartChargingCentralSystemHandler { - mock := &MockSmartChargingCentralSystemHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocpp1.6_test/mocks/mock_smart_charging_charge_point_handler.go b/ocpp1.6_test/mocks/mock_smart_charging_charge_point_handler.go deleted file mode 100644 index 61ee69cd..00000000 --- a/ocpp1.6_test/mocks/mock_smart_charging_charge_point_handler.go +++ /dev/null @@ -1,209 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - smartcharging "github.com/lorenzodonini/ocpp-go/ocpp1.6/smartcharging" - mock "github.com/stretchr/testify/mock" -) - -// MockSmartChargingChargePointHandler is an autogenerated mock type for the ChargePointHandler type -type MockSmartChargingChargePointHandler struct { - mock.Mock -} - -type MockSmartChargingChargePointHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockSmartChargingChargePointHandler) EXPECT() *MockSmartChargingChargePointHandler_Expecter { - return &MockSmartChargingChargePointHandler_Expecter{mock: &_m.Mock} -} - -// OnClearChargingProfile provides a mock function with given fields: request -func (_m *MockSmartChargingChargePointHandler) OnClearChargingProfile(request *smartcharging.ClearChargingProfileRequest) (*smartcharging.ClearChargingProfileConfirmation, error) { - ret := _m.Called(request) - - if len(ret) == 0 { - panic("no return value specified for OnClearChargingProfile") - } - - var r0 *smartcharging.ClearChargingProfileConfirmation - var r1 error - if rf, ok := ret.Get(0).(func(*smartcharging.ClearChargingProfileRequest) (*smartcharging.ClearChargingProfileConfirmation, error)); ok { - return rf(request) - } - if rf, ok := ret.Get(0).(func(*smartcharging.ClearChargingProfileRequest) *smartcharging.ClearChargingProfileConfirmation); ok { - r0 = rf(request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*smartcharging.ClearChargingProfileConfirmation) - } - } - - if rf, ok := ret.Get(1).(func(*smartcharging.ClearChargingProfileRequest) error); ok { - r1 = rf(request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockSmartChargingChargePointHandler_OnClearChargingProfile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnClearChargingProfile' -type MockSmartChargingChargePointHandler_OnClearChargingProfile_Call struct { - *mock.Call -} - -// OnClearChargingProfile is a helper method to define mock.On call -// - request *smartcharging.ClearChargingProfileRequest -func (_e *MockSmartChargingChargePointHandler_Expecter) OnClearChargingProfile(request interface{}) *MockSmartChargingChargePointHandler_OnClearChargingProfile_Call { - return &MockSmartChargingChargePointHandler_OnClearChargingProfile_Call{Call: _e.mock.On("OnClearChargingProfile", request)} -} - -func (_c *MockSmartChargingChargePointHandler_OnClearChargingProfile_Call) Run(run func(request *smartcharging.ClearChargingProfileRequest)) *MockSmartChargingChargePointHandler_OnClearChargingProfile_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*smartcharging.ClearChargingProfileRequest)) - }) - return _c -} - -func (_c *MockSmartChargingChargePointHandler_OnClearChargingProfile_Call) Return(confirmation *smartcharging.ClearChargingProfileConfirmation, err error) *MockSmartChargingChargePointHandler_OnClearChargingProfile_Call { - _c.Call.Return(confirmation, err) - return _c -} - -func (_c *MockSmartChargingChargePointHandler_OnClearChargingProfile_Call) RunAndReturn(run func(*smartcharging.ClearChargingProfileRequest) (*smartcharging.ClearChargingProfileConfirmation, error)) *MockSmartChargingChargePointHandler_OnClearChargingProfile_Call { - _c.Call.Return(run) - return _c -} - -// OnGetCompositeSchedule provides a mock function with given fields: request -func (_m *MockSmartChargingChargePointHandler) OnGetCompositeSchedule(request *smartcharging.GetCompositeScheduleRequest) (*smartcharging.GetCompositeScheduleConfirmation, error) { - ret := _m.Called(request) - - if len(ret) == 0 { - panic("no return value specified for OnGetCompositeSchedule") - } - - var r0 *smartcharging.GetCompositeScheduleConfirmation - var r1 error - if rf, ok := ret.Get(0).(func(*smartcharging.GetCompositeScheduleRequest) (*smartcharging.GetCompositeScheduleConfirmation, error)); ok { - return rf(request) - } - if rf, ok := ret.Get(0).(func(*smartcharging.GetCompositeScheduleRequest) *smartcharging.GetCompositeScheduleConfirmation); ok { - r0 = rf(request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*smartcharging.GetCompositeScheduleConfirmation) - } - } - - if rf, ok := ret.Get(1).(func(*smartcharging.GetCompositeScheduleRequest) error); ok { - r1 = rf(request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockSmartChargingChargePointHandler_OnGetCompositeSchedule_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnGetCompositeSchedule' -type MockSmartChargingChargePointHandler_OnGetCompositeSchedule_Call struct { - *mock.Call -} - -// OnGetCompositeSchedule is a helper method to define mock.On call -// - request *smartcharging.GetCompositeScheduleRequest -func (_e *MockSmartChargingChargePointHandler_Expecter) OnGetCompositeSchedule(request interface{}) *MockSmartChargingChargePointHandler_OnGetCompositeSchedule_Call { - return &MockSmartChargingChargePointHandler_OnGetCompositeSchedule_Call{Call: _e.mock.On("OnGetCompositeSchedule", request)} -} - -func (_c *MockSmartChargingChargePointHandler_OnGetCompositeSchedule_Call) Run(run func(request *smartcharging.GetCompositeScheduleRequest)) *MockSmartChargingChargePointHandler_OnGetCompositeSchedule_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*smartcharging.GetCompositeScheduleRequest)) - }) - return _c -} - -func (_c *MockSmartChargingChargePointHandler_OnGetCompositeSchedule_Call) Return(confirmation *smartcharging.GetCompositeScheduleConfirmation, err error) *MockSmartChargingChargePointHandler_OnGetCompositeSchedule_Call { - _c.Call.Return(confirmation, err) - return _c -} - -func (_c *MockSmartChargingChargePointHandler_OnGetCompositeSchedule_Call) RunAndReturn(run func(*smartcharging.GetCompositeScheduleRequest) (*smartcharging.GetCompositeScheduleConfirmation, error)) *MockSmartChargingChargePointHandler_OnGetCompositeSchedule_Call { - _c.Call.Return(run) - return _c -} - -// OnSetChargingProfile provides a mock function with given fields: request -func (_m *MockSmartChargingChargePointHandler) OnSetChargingProfile(request *smartcharging.SetChargingProfileRequest) (*smartcharging.SetChargingProfileConfirmation, error) { - ret := _m.Called(request) - - if len(ret) == 0 { - panic("no return value specified for OnSetChargingProfile") - } - - var r0 *smartcharging.SetChargingProfileConfirmation - var r1 error - if rf, ok := ret.Get(0).(func(*smartcharging.SetChargingProfileRequest) (*smartcharging.SetChargingProfileConfirmation, error)); ok { - return rf(request) - } - if rf, ok := ret.Get(0).(func(*smartcharging.SetChargingProfileRequest) *smartcharging.SetChargingProfileConfirmation); ok { - r0 = rf(request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*smartcharging.SetChargingProfileConfirmation) - } - } - - if rf, ok := ret.Get(1).(func(*smartcharging.SetChargingProfileRequest) error); ok { - r1 = rf(request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockSmartChargingChargePointHandler_OnSetChargingProfile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnSetChargingProfile' -type MockSmartChargingChargePointHandler_OnSetChargingProfile_Call struct { - *mock.Call -} - -// OnSetChargingProfile is a helper method to define mock.On call -// - request *smartcharging.SetChargingProfileRequest -func (_e *MockSmartChargingChargePointHandler_Expecter) OnSetChargingProfile(request interface{}) *MockSmartChargingChargePointHandler_OnSetChargingProfile_Call { - return &MockSmartChargingChargePointHandler_OnSetChargingProfile_Call{Call: _e.mock.On("OnSetChargingProfile", request)} -} - -func (_c *MockSmartChargingChargePointHandler_OnSetChargingProfile_Call) Run(run func(request *smartcharging.SetChargingProfileRequest)) *MockSmartChargingChargePointHandler_OnSetChargingProfile_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*smartcharging.SetChargingProfileRequest)) - }) - return _c -} - -func (_c *MockSmartChargingChargePointHandler_OnSetChargingProfile_Call) Return(confirmation *smartcharging.SetChargingProfileConfirmation, err error) *MockSmartChargingChargePointHandler_OnSetChargingProfile_Call { - _c.Call.Return(confirmation, err) - return _c -} - -func (_c *MockSmartChargingChargePointHandler_OnSetChargingProfile_Call) RunAndReturn(run func(*smartcharging.SetChargingProfileRequest) (*smartcharging.SetChargingProfileConfirmation, error)) *MockSmartChargingChargePointHandler_OnSetChargingProfile_Call { - _c.Call.Return(run) - return _c -} - -// NewMockSmartChargingChargePointHandler creates a new instance of MockSmartChargingChargePointHandler. 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 NewMockSmartChargingChargePointHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockSmartChargingChargePointHandler { - mock := &MockSmartChargingChargePointHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocppj/mocks/mock_CanceledRequestHandler.go b/ocppj/mocks/mock_CanceledRequestHandler.go deleted file mode 100644 index be1be073..00000000 --- a/ocppj/mocks/mock_CanceledRequestHandler.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - ocpp "github.com/lorenzodonini/ocpp-go/ocpp" - mock "github.com/stretchr/testify/mock" -) - -// MockCanceledRequestHandler is an autogenerated mock type for the CanceledRequestHandler type -type MockCanceledRequestHandler struct { - mock.Mock -} - -type MockCanceledRequestHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockCanceledRequestHandler) EXPECT() *MockCanceledRequestHandler_Expecter { - return &MockCanceledRequestHandler_Expecter{mock: &_m.Mock} -} - -// Execute provides a mock function with given fields: clientID, requestID, request, err -func (_m *MockCanceledRequestHandler) Execute(clientID string, requestID string, request ocpp.Request, err *ocpp.Error) { - _m.Called(clientID, requestID, request, err) -} - -// MockCanceledRequestHandler_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute' -type MockCanceledRequestHandler_Execute_Call struct { - *mock.Call -} - -// Execute is a helper method to define mock.On call -// - clientID string -// - requestID string -// - request ocpp.Request -// - err *ocpp.Error -func (_e *MockCanceledRequestHandler_Expecter) Execute(clientID interface{}, requestID interface{}, request interface{}, err interface{}) *MockCanceledRequestHandler_Execute_Call { - return &MockCanceledRequestHandler_Execute_Call{Call: _e.mock.On("Execute", clientID, requestID, request, err)} -} - -func (_c *MockCanceledRequestHandler_Execute_Call) Run(run func(clientID string, requestID string, request ocpp.Request, err *ocpp.Error)) *MockCanceledRequestHandler_Execute_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(string), args[2].(ocpp.Request), args[3].(*ocpp.Error)) - }) - return _c -} - -func (_c *MockCanceledRequestHandler_Execute_Call) Return() *MockCanceledRequestHandler_Execute_Call { - _c.Call.Return() - return _c -} - -func (_c *MockCanceledRequestHandler_Execute_Call) RunAndReturn(run func(string, string, ocpp.Request, *ocpp.Error)) *MockCanceledRequestHandler_Execute_Call { - _c.Run(run) - return _c -} - -// NewMockCanceledRequestHandler creates a new instance of MockCanceledRequestHandler. 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 NewMockCanceledRequestHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockCanceledRequestHandler { - mock := &MockCanceledRequestHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocppj/mocks/mock_ClientDispatcher.go b/ocppj/mocks/mock_ClientDispatcher.go deleted file mode 100644 index 0dd86eff..00000000 --- a/ocppj/mocks/mock_ClientDispatcher.go +++ /dev/null @@ -1,470 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - ocpp "github.com/lorenzodonini/ocpp-go/ocpp" - mock "github.com/stretchr/testify/mock" - - ocppj "github.com/lorenzodonini/ocpp-go/ocppj" - - time "time" - - ws "github.com/lorenzodonini/ocpp-go/ws" -) - -// MockClientDispatcher is an autogenerated mock type for the ClientDispatcher type -type MockClientDispatcher struct { - mock.Mock -} - -type MockClientDispatcher_Expecter struct { - mock *mock.Mock -} - -func (_m *MockClientDispatcher) EXPECT() *MockClientDispatcher_Expecter { - return &MockClientDispatcher_Expecter{mock: &_m.Mock} -} - -// CompleteRequest provides a mock function with given fields: requestID -func (_m *MockClientDispatcher) CompleteRequest(requestID string) { - _m.Called(requestID) -} - -// MockClientDispatcher_CompleteRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompleteRequest' -type MockClientDispatcher_CompleteRequest_Call struct { - *mock.Call -} - -// CompleteRequest is a helper method to define mock.On call -// - requestID string -func (_e *MockClientDispatcher_Expecter) CompleteRequest(requestID interface{}) *MockClientDispatcher_CompleteRequest_Call { - return &MockClientDispatcher_CompleteRequest_Call{Call: _e.mock.On("CompleteRequest", requestID)} -} - -func (_c *MockClientDispatcher_CompleteRequest_Call) Run(run func(requestID string)) *MockClientDispatcher_CompleteRequest_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *MockClientDispatcher_CompleteRequest_Call) Return() *MockClientDispatcher_CompleteRequest_Call { - _c.Call.Return() - return _c -} - -func (_c *MockClientDispatcher_CompleteRequest_Call) RunAndReturn(run func(string)) *MockClientDispatcher_CompleteRequest_Call { - _c.Run(run) - return _c -} - -// IsPaused provides a mock function with no fields -func (_m *MockClientDispatcher) IsPaused() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for IsPaused") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// MockClientDispatcher_IsPaused_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsPaused' -type MockClientDispatcher_IsPaused_Call struct { - *mock.Call -} - -// IsPaused is a helper method to define mock.On call -func (_e *MockClientDispatcher_Expecter) IsPaused() *MockClientDispatcher_IsPaused_Call { - return &MockClientDispatcher_IsPaused_Call{Call: _e.mock.On("IsPaused")} -} - -func (_c *MockClientDispatcher_IsPaused_Call) Run(run func()) *MockClientDispatcher_IsPaused_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockClientDispatcher_IsPaused_Call) Return(_a0 bool) *MockClientDispatcher_IsPaused_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockClientDispatcher_IsPaused_Call) RunAndReturn(run func() bool) *MockClientDispatcher_IsPaused_Call { - _c.Call.Return(run) - return _c -} - -// IsRunning provides a mock function with no fields -func (_m *MockClientDispatcher) IsRunning() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for IsRunning") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// MockClientDispatcher_IsRunning_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsRunning' -type MockClientDispatcher_IsRunning_Call struct { - *mock.Call -} - -// IsRunning is a helper method to define mock.On call -func (_e *MockClientDispatcher_Expecter) IsRunning() *MockClientDispatcher_IsRunning_Call { - return &MockClientDispatcher_IsRunning_Call{Call: _e.mock.On("IsRunning")} -} - -func (_c *MockClientDispatcher_IsRunning_Call) Run(run func()) *MockClientDispatcher_IsRunning_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockClientDispatcher_IsRunning_Call) Return(_a0 bool) *MockClientDispatcher_IsRunning_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockClientDispatcher_IsRunning_Call) RunAndReturn(run func() bool) *MockClientDispatcher_IsRunning_Call { - _c.Call.Return(run) - return _c -} - -// Pause provides a mock function with no fields -func (_m *MockClientDispatcher) Pause() { - _m.Called() -} - -// MockClientDispatcher_Pause_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Pause' -type MockClientDispatcher_Pause_Call struct { - *mock.Call -} - -// Pause is a helper method to define mock.On call -func (_e *MockClientDispatcher_Expecter) Pause() *MockClientDispatcher_Pause_Call { - return &MockClientDispatcher_Pause_Call{Call: _e.mock.On("Pause")} -} - -func (_c *MockClientDispatcher_Pause_Call) Run(run func()) *MockClientDispatcher_Pause_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockClientDispatcher_Pause_Call) Return() *MockClientDispatcher_Pause_Call { - _c.Call.Return() - return _c -} - -func (_c *MockClientDispatcher_Pause_Call) RunAndReturn(run func()) *MockClientDispatcher_Pause_Call { - _c.Run(run) - return _c -} - -// Resume provides a mock function with no fields -func (_m *MockClientDispatcher) Resume() { - _m.Called() -} - -// MockClientDispatcher_Resume_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Resume' -type MockClientDispatcher_Resume_Call struct { - *mock.Call -} - -// Resume is a helper method to define mock.On call -func (_e *MockClientDispatcher_Expecter) Resume() *MockClientDispatcher_Resume_Call { - return &MockClientDispatcher_Resume_Call{Call: _e.mock.On("Resume")} -} - -func (_c *MockClientDispatcher_Resume_Call) Run(run func()) *MockClientDispatcher_Resume_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockClientDispatcher_Resume_Call) Return() *MockClientDispatcher_Resume_Call { - _c.Call.Return() - return _c -} - -func (_c *MockClientDispatcher_Resume_Call) RunAndReturn(run func()) *MockClientDispatcher_Resume_Call { - _c.Run(run) - return _c -} - -// SendRequest provides a mock function with given fields: req -func (_m *MockClientDispatcher) SendRequest(req ocppj.RequestBundle) error { - ret := _m.Called(req) - - if len(ret) == 0 { - panic("no return value specified for SendRequest") - } - - var r0 error - if rf, ok := ret.Get(0).(func(ocppj.RequestBundle) error); ok { - r0 = rf(req) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockClientDispatcher_SendRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendRequest' -type MockClientDispatcher_SendRequest_Call struct { - *mock.Call -} - -// SendRequest is a helper method to define mock.On call -// - req ocppj.RequestBundle -func (_e *MockClientDispatcher_Expecter) SendRequest(req interface{}) *MockClientDispatcher_SendRequest_Call { - return &MockClientDispatcher_SendRequest_Call{Call: _e.mock.On("SendRequest", req)} -} - -func (_c *MockClientDispatcher_SendRequest_Call) Run(run func(req ocppj.RequestBundle)) *MockClientDispatcher_SendRequest_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ocppj.RequestBundle)) - }) - return _c -} - -func (_c *MockClientDispatcher_SendRequest_Call) Return(_a0 error) *MockClientDispatcher_SendRequest_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockClientDispatcher_SendRequest_Call) RunAndReturn(run func(ocppj.RequestBundle) error) *MockClientDispatcher_SendRequest_Call { - _c.Call.Return(run) - return _c -} - -// SetNetworkClient provides a mock function with given fields: client -func (_m *MockClientDispatcher) SetNetworkClient(client ws.Client) { - _m.Called(client) -} - -// MockClientDispatcher_SetNetworkClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetNetworkClient' -type MockClientDispatcher_SetNetworkClient_Call struct { - *mock.Call -} - -// SetNetworkClient is a helper method to define mock.On call -// - client ws.Client -func (_e *MockClientDispatcher_Expecter) SetNetworkClient(client interface{}) *MockClientDispatcher_SetNetworkClient_Call { - return &MockClientDispatcher_SetNetworkClient_Call{Call: _e.mock.On("SetNetworkClient", client)} -} - -func (_c *MockClientDispatcher_SetNetworkClient_Call) Run(run func(client ws.Client)) *MockClientDispatcher_SetNetworkClient_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ws.Client)) - }) - return _c -} - -func (_c *MockClientDispatcher_SetNetworkClient_Call) Return() *MockClientDispatcher_SetNetworkClient_Call { - _c.Call.Return() - return _c -} - -func (_c *MockClientDispatcher_SetNetworkClient_Call) RunAndReturn(run func(ws.Client)) *MockClientDispatcher_SetNetworkClient_Call { - _c.Run(run) - return _c -} - -// SetOnRequestCanceled provides a mock function with given fields: cb -func (_m *MockClientDispatcher) SetOnRequestCanceled(cb func(string, ocpp.Request, *ocpp.Error)) { - _m.Called(cb) -} - -// MockClientDispatcher_SetOnRequestCanceled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetOnRequestCanceled' -type MockClientDispatcher_SetOnRequestCanceled_Call struct { - *mock.Call -} - -// SetOnRequestCanceled is a helper method to define mock.On call -// - cb func(string , ocpp.Request , *ocpp.Error) -func (_e *MockClientDispatcher_Expecter) SetOnRequestCanceled(cb interface{}) *MockClientDispatcher_SetOnRequestCanceled_Call { - return &MockClientDispatcher_SetOnRequestCanceled_Call{Call: _e.mock.On("SetOnRequestCanceled", cb)} -} - -func (_c *MockClientDispatcher_SetOnRequestCanceled_Call) Run(run func(cb func(string, ocpp.Request, *ocpp.Error))) *MockClientDispatcher_SetOnRequestCanceled_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(func(string, ocpp.Request, *ocpp.Error))) - }) - return _c -} - -func (_c *MockClientDispatcher_SetOnRequestCanceled_Call) Return() *MockClientDispatcher_SetOnRequestCanceled_Call { - _c.Call.Return() - return _c -} - -func (_c *MockClientDispatcher_SetOnRequestCanceled_Call) RunAndReturn(run func(func(string, ocpp.Request, *ocpp.Error))) *MockClientDispatcher_SetOnRequestCanceled_Call { - _c.Run(run) - return _c -} - -// SetPendingRequestState provides a mock function with given fields: stateHandler -func (_m *MockClientDispatcher) SetPendingRequestState(stateHandler ocppj.ClientState) { - _m.Called(stateHandler) -} - -// MockClientDispatcher_SetPendingRequestState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetPendingRequestState' -type MockClientDispatcher_SetPendingRequestState_Call struct { - *mock.Call -} - -// SetPendingRequestState is a helper method to define mock.On call -// - stateHandler ocppj.ClientState -func (_e *MockClientDispatcher_Expecter) SetPendingRequestState(stateHandler interface{}) *MockClientDispatcher_SetPendingRequestState_Call { - return &MockClientDispatcher_SetPendingRequestState_Call{Call: _e.mock.On("SetPendingRequestState", stateHandler)} -} - -func (_c *MockClientDispatcher_SetPendingRequestState_Call) Run(run func(stateHandler ocppj.ClientState)) *MockClientDispatcher_SetPendingRequestState_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ocppj.ClientState)) - }) - return _c -} - -func (_c *MockClientDispatcher_SetPendingRequestState_Call) Return() *MockClientDispatcher_SetPendingRequestState_Call { - _c.Call.Return() - return _c -} - -func (_c *MockClientDispatcher_SetPendingRequestState_Call) RunAndReturn(run func(ocppj.ClientState)) *MockClientDispatcher_SetPendingRequestState_Call { - _c.Run(run) - return _c -} - -// SetTimeout provides a mock function with given fields: timeout -func (_m *MockClientDispatcher) SetTimeout(timeout time.Duration) { - _m.Called(timeout) -} - -// MockClientDispatcher_SetTimeout_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetTimeout' -type MockClientDispatcher_SetTimeout_Call struct { - *mock.Call -} - -// SetTimeout is a helper method to define mock.On call -// - timeout time.Duration -func (_e *MockClientDispatcher_Expecter) SetTimeout(timeout interface{}) *MockClientDispatcher_SetTimeout_Call { - return &MockClientDispatcher_SetTimeout_Call{Call: _e.mock.On("SetTimeout", timeout)} -} - -func (_c *MockClientDispatcher_SetTimeout_Call) Run(run func(timeout time.Duration)) *MockClientDispatcher_SetTimeout_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(time.Duration)) - }) - return _c -} - -func (_c *MockClientDispatcher_SetTimeout_Call) Return() *MockClientDispatcher_SetTimeout_Call { - _c.Call.Return() - return _c -} - -func (_c *MockClientDispatcher_SetTimeout_Call) RunAndReturn(run func(time.Duration)) *MockClientDispatcher_SetTimeout_Call { - _c.Run(run) - return _c -} - -// Start provides a mock function with no fields -func (_m *MockClientDispatcher) Start() { - _m.Called() -} - -// MockClientDispatcher_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' -type MockClientDispatcher_Start_Call struct { - *mock.Call -} - -// Start is a helper method to define mock.On call -func (_e *MockClientDispatcher_Expecter) Start() *MockClientDispatcher_Start_Call { - return &MockClientDispatcher_Start_Call{Call: _e.mock.On("Start")} -} - -func (_c *MockClientDispatcher_Start_Call) Run(run func()) *MockClientDispatcher_Start_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockClientDispatcher_Start_Call) Return() *MockClientDispatcher_Start_Call { - _c.Call.Return() - return _c -} - -func (_c *MockClientDispatcher_Start_Call) RunAndReturn(run func()) *MockClientDispatcher_Start_Call { - _c.Run(run) - return _c -} - -// Stop provides a mock function with no fields -func (_m *MockClientDispatcher) Stop() { - _m.Called() -} - -// MockClientDispatcher_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop' -type MockClientDispatcher_Stop_Call struct { - *mock.Call -} - -// Stop is a helper method to define mock.On call -func (_e *MockClientDispatcher_Expecter) Stop() *MockClientDispatcher_Stop_Call { - return &MockClientDispatcher_Stop_Call{Call: _e.mock.On("Stop")} -} - -func (_c *MockClientDispatcher_Stop_Call) Run(run func()) *MockClientDispatcher_Stop_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockClientDispatcher_Stop_Call) Return() *MockClientDispatcher_Stop_Call { - _c.Call.Return() - return _c -} - -func (_c *MockClientDispatcher_Stop_Call) RunAndReturn(run func()) *MockClientDispatcher_Stop_Call { - _c.Run(run) - return _c -} - -// NewMockClientDispatcher creates a new instance of MockClientDispatcher. 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 NewMockClientDispatcher(t interface { - mock.TestingT - Cleanup(func()) -}) *MockClientDispatcher { - mock := &MockClientDispatcher{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocppj/mocks/mock_ClientHandler.go b/ocppj/mocks/mock_ClientHandler.go deleted file mode 100644 index f08a868f..00000000 --- a/ocppj/mocks/mock_ClientHandler.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - mock "github.com/stretchr/testify/mock" - - ws "github.com/lorenzodonini/ocpp-go/ws" -) - -// MockClientHandler is an autogenerated mock type for the ClientHandler type -type MockClientHandler struct { - mock.Mock -} - -type MockClientHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockClientHandler) EXPECT() *MockClientHandler_Expecter { - return &MockClientHandler_Expecter{mock: &_m.Mock} -} - -// Execute provides a mock function with given fields: client -func (_m *MockClientHandler) Execute(client ws.Channel) { - _m.Called(client) -} - -// MockClientHandler_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute' -type MockClientHandler_Execute_Call struct { - *mock.Call -} - -// Execute is a helper method to define mock.On call -// - client ws.Channel -func (_e *MockClientHandler_Expecter) Execute(client interface{}) *MockClientHandler_Execute_Call { - return &MockClientHandler_Execute_Call{Call: _e.mock.On("Execute", client)} -} - -func (_c *MockClientHandler_Execute_Call) Run(run func(client ws.Channel)) *MockClientHandler_Execute_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ws.Channel)) - }) - return _c -} - -func (_c *MockClientHandler_Execute_Call) Return() *MockClientHandler_Execute_Call { - _c.Call.Return() - return _c -} - -func (_c *MockClientHandler_Execute_Call) RunAndReturn(run func(ws.Channel)) *MockClientHandler_Execute_Call { - _c.Run(run) - return _c -} - -// NewMockClientHandler creates a new instance of MockClientHandler. 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 NewMockClientHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockClientHandler { - mock := &MockClientHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocppj/mocks/mock_ClientState.go b/ocppj/mocks/mock_ClientState.go deleted file mode 100644 index d07d228c..00000000 --- a/ocppj/mocks/mock_ClientState.go +++ /dev/null @@ -1,237 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - ocpp "github.com/lorenzodonini/ocpp-go/ocpp" - mock "github.com/stretchr/testify/mock" -) - -// MockClientState is an autogenerated mock type for the ClientState type -type MockClientState struct { - mock.Mock -} - -type MockClientState_Expecter struct { - mock *mock.Mock -} - -func (_m *MockClientState) EXPECT() *MockClientState_Expecter { - return &MockClientState_Expecter{mock: &_m.Mock} -} - -// AddPendingRequest provides a mock function with given fields: requestID, req -func (_m *MockClientState) AddPendingRequest(requestID string, req ocpp.Request) { - _m.Called(requestID, req) -} - -// MockClientState_AddPendingRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddPendingRequest' -type MockClientState_AddPendingRequest_Call struct { - *mock.Call -} - -// AddPendingRequest is a helper method to define mock.On call -// - requestID string -// - req ocpp.Request -func (_e *MockClientState_Expecter) AddPendingRequest(requestID interface{}, req interface{}) *MockClientState_AddPendingRequest_Call { - return &MockClientState_AddPendingRequest_Call{Call: _e.mock.On("AddPendingRequest", requestID, req)} -} - -func (_c *MockClientState_AddPendingRequest_Call) Run(run func(requestID string, req ocpp.Request)) *MockClientState_AddPendingRequest_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(ocpp.Request)) - }) - return _c -} - -func (_c *MockClientState_AddPendingRequest_Call) Return() *MockClientState_AddPendingRequest_Call { - _c.Call.Return() - return _c -} - -func (_c *MockClientState_AddPendingRequest_Call) RunAndReturn(run func(string, ocpp.Request)) *MockClientState_AddPendingRequest_Call { - _c.Run(run) - return _c -} - -// ClearPendingRequests provides a mock function with no fields -func (_m *MockClientState) ClearPendingRequests() { - _m.Called() -} - -// MockClientState_ClearPendingRequests_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ClearPendingRequests' -type MockClientState_ClearPendingRequests_Call struct { - *mock.Call -} - -// ClearPendingRequests is a helper method to define mock.On call -func (_e *MockClientState_Expecter) ClearPendingRequests() *MockClientState_ClearPendingRequests_Call { - return &MockClientState_ClearPendingRequests_Call{Call: _e.mock.On("ClearPendingRequests")} -} - -func (_c *MockClientState_ClearPendingRequests_Call) Run(run func()) *MockClientState_ClearPendingRequests_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockClientState_ClearPendingRequests_Call) Return() *MockClientState_ClearPendingRequests_Call { - _c.Call.Return() - return _c -} - -func (_c *MockClientState_ClearPendingRequests_Call) RunAndReturn(run func()) *MockClientState_ClearPendingRequests_Call { - _c.Run(run) - return _c -} - -// DeletePendingRequest provides a mock function with given fields: requestID -func (_m *MockClientState) DeletePendingRequest(requestID string) { - _m.Called(requestID) -} - -// MockClientState_DeletePendingRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeletePendingRequest' -type MockClientState_DeletePendingRequest_Call struct { - *mock.Call -} - -// DeletePendingRequest is a helper method to define mock.On call -// - requestID string -func (_e *MockClientState_Expecter) DeletePendingRequest(requestID interface{}) *MockClientState_DeletePendingRequest_Call { - return &MockClientState_DeletePendingRequest_Call{Call: _e.mock.On("DeletePendingRequest", requestID)} -} - -func (_c *MockClientState_DeletePendingRequest_Call) Run(run func(requestID string)) *MockClientState_DeletePendingRequest_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *MockClientState_DeletePendingRequest_Call) Return() *MockClientState_DeletePendingRequest_Call { - _c.Call.Return() - return _c -} - -func (_c *MockClientState_DeletePendingRequest_Call) RunAndReturn(run func(string)) *MockClientState_DeletePendingRequest_Call { - _c.Run(run) - return _c -} - -// GetPendingRequest provides a mock function with given fields: requestID -func (_m *MockClientState) GetPendingRequest(requestID string) (ocpp.Request, bool) { - ret := _m.Called(requestID) - - if len(ret) == 0 { - panic("no return value specified for GetPendingRequest") - } - - var r0 ocpp.Request - var r1 bool - if rf, ok := ret.Get(0).(func(string) (ocpp.Request, bool)); ok { - return rf(requestID) - } - if rf, ok := ret.Get(0).(func(string) ocpp.Request); ok { - r0 = rf(requestID) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(ocpp.Request) - } - } - - if rf, ok := ret.Get(1).(func(string) bool); ok { - r1 = rf(requestID) - } else { - r1 = ret.Get(1).(bool) - } - - return r0, r1 -} - -// MockClientState_GetPendingRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPendingRequest' -type MockClientState_GetPendingRequest_Call struct { - *mock.Call -} - -// GetPendingRequest is a helper method to define mock.On call -// - requestID string -func (_e *MockClientState_Expecter) GetPendingRequest(requestID interface{}) *MockClientState_GetPendingRequest_Call { - return &MockClientState_GetPendingRequest_Call{Call: _e.mock.On("GetPendingRequest", requestID)} -} - -func (_c *MockClientState_GetPendingRequest_Call) Run(run func(requestID string)) *MockClientState_GetPendingRequest_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *MockClientState_GetPendingRequest_Call) Return(_a0 ocpp.Request, _a1 bool) *MockClientState_GetPendingRequest_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockClientState_GetPendingRequest_Call) RunAndReturn(run func(string) (ocpp.Request, bool)) *MockClientState_GetPendingRequest_Call { - _c.Call.Return(run) - return _c -} - -// HasPendingRequest provides a mock function with no fields -func (_m *MockClientState) HasPendingRequest() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for HasPendingRequest") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// MockClientState_HasPendingRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasPendingRequest' -type MockClientState_HasPendingRequest_Call struct { - *mock.Call -} - -// HasPendingRequest is a helper method to define mock.On call -func (_e *MockClientState_Expecter) HasPendingRequest() *MockClientState_HasPendingRequest_Call { - return &MockClientState_HasPendingRequest_Call{Call: _e.mock.On("HasPendingRequest")} -} - -func (_c *MockClientState_HasPendingRequest_Call) Run(run func()) *MockClientState_HasPendingRequest_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockClientState_HasPendingRequest_Call) Return(_a0 bool) *MockClientState_HasPendingRequest_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockClientState_HasPendingRequest_Call) RunAndReturn(run func() bool) *MockClientState_HasPendingRequest_Call { - _c.Call.Return(run) - return _c -} - -// NewMockClientState creates a new instance of MockClientState. 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 NewMockClientState(t interface { - mock.TestingT - Cleanup(func()) -}) *MockClientState { - mock := &MockClientState{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocppj/mocks/mock_ErrorHandler.go b/ocppj/mocks/mock_ErrorHandler.go deleted file mode 100644 index 3d956910..00000000 --- a/ocppj/mocks/mock_ErrorHandler.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - ocpp "github.com/lorenzodonini/ocpp-go/ocpp" - mock "github.com/stretchr/testify/mock" - - ws "github.com/lorenzodonini/ocpp-go/ws" -) - -// MockErrorHandler is an autogenerated mock type for the ErrorHandler type -type MockErrorHandler struct { - mock.Mock -} - -type MockErrorHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockErrorHandler) EXPECT() *MockErrorHandler_Expecter { - return &MockErrorHandler_Expecter{mock: &_m.Mock} -} - -// Execute provides a mock function with given fields: client, err, details -func (_m *MockErrorHandler) Execute(client ws.Channel, err *ocpp.Error, details interface{}) { - _m.Called(client, err, details) -} - -// MockErrorHandler_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute' -type MockErrorHandler_Execute_Call struct { - *mock.Call -} - -// Execute is a helper method to define mock.On call -// - client ws.Channel -// - err *ocpp.Error -// - details interface{} -func (_e *MockErrorHandler_Expecter) Execute(client interface{}, err interface{}, details interface{}) *MockErrorHandler_Execute_Call { - return &MockErrorHandler_Execute_Call{Call: _e.mock.On("Execute", client, err, details)} -} - -func (_c *MockErrorHandler_Execute_Call) Run(run func(client ws.Channel, err *ocpp.Error, details interface{})) *MockErrorHandler_Execute_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ws.Channel), args[1].(*ocpp.Error), args[2].(interface{})) - }) - return _c -} - -func (_c *MockErrorHandler_Execute_Call) Return() *MockErrorHandler_Execute_Call { - _c.Call.Return() - return _c -} - -func (_c *MockErrorHandler_Execute_Call) RunAndReturn(run func(ws.Channel, *ocpp.Error, interface{})) *MockErrorHandler_Execute_Call { - _c.Run(run) - return _c -} - -// NewMockErrorHandler creates a new instance of MockErrorHandler. 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 NewMockErrorHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockErrorHandler { - mock := &MockErrorHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocppj/mocks/mock_InvalidMessageHook.go b/ocppj/mocks/mock_InvalidMessageHook.go deleted file mode 100644 index 1e82f54e..00000000 --- a/ocppj/mocks/mock_InvalidMessageHook.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - ocpp "github.com/lorenzodonini/ocpp-go/ocpp" - mock "github.com/stretchr/testify/mock" - - ws "github.com/lorenzodonini/ocpp-go/ws" -) - -// MockInvalidMessageHook is an autogenerated mock type for the InvalidMessageHook type -type MockInvalidMessageHook struct { - mock.Mock -} - -type MockInvalidMessageHook_Expecter struct { - mock *mock.Mock -} - -func (_m *MockInvalidMessageHook) EXPECT() *MockInvalidMessageHook_Expecter { - return &MockInvalidMessageHook_Expecter{mock: &_m.Mock} -} - -// Execute provides a mock function with given fields: client, err, rawJson, parsedFields -func (_m *MockInvalidMessageHook) Execute(client ws.Channel, err *ocpp.Error, rawJson string, parsedFields []interface{}) *ocpp.Error { - ret := _m.Called(client, err, rawJson, parsedFields) - - if len(ret) == 0 { - panic("no return value specified for Execute") - } - - var r0 *ocpp.Error - if rf, ok := ret.Get(0).(func(ws.Channel, *ocpp.Error, string, []interface{}) *ocpp.Error); ok { - r0 = rf(client, err, rawJson, parsedFields) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*ocpp.Error) - } - } - - return r0 -} - -// MockInvalidMessageHook_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute' -type MockInvalidMessageHook_Execute_Call struct { - *mock.Call -} - -// Execute is a helper method to define mock.On call -// - client ws.Channel -// - err *ocpp.Error -// - rawJson string -// - parsedFields []interface{} -func (_e *MockInvalidMessageHook_Expecter) Execute(client interface{}, err interface{}, rawJson interface{}, parsedFields interface{}) *MockInvalidMessageHook_Execute_Call { - return &MockInvalidMessageHook_Execute_Call{Call: _e.mock.On("Execute", client, err, rawJson, parsedFields)} -} - -func (_c *MockInvalidMessageHook_Execute_Call) Run(run func(client ws.Channel, err *ocpp.Error, rawJson string, parsedFields []interface{})) *MockInvalidMessageHook_Execute_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ws.Channel), args[1].(*ocpp.Error), args[2].(string), args[3].([]interface{})) - }) - return _c -} - -func (_c *MockInvalidMessageHook_Execute_Call) Return(_a0 *ocpp.Error) *MockInvalidMessageHook_Execute_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockInvalidMessageHook_Execute_Call) RunAndReturn(run func(ws.Channel, *ocpp.Error, string, []interface{}) *ocpp.Error) *MockInvalidMessageHook_Execute_Call { - _c.Call.Return(run) - return _c -} - -// NewMockInvalidMessageHook creates a new instance of MockInvalidMessageHook. 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 NewMockInvalidMessageHook(t interface { - mock.TestingT - Cleanup(func()) -}) *MockInvalidMessageHook { - mock := &MockInvalidMessageHook{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocppj/mocks/mock_Message.go b/ocppj/mocks/mock_Message.go deleted file mode 100644 index d741881a..00000000 --- a/ocppj/mocks/mock_Message.go +++ /dev/null @@ -1,182 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - ocppj "github.com/lorenzodonini/ocpp-go/ocppj" - mock "github.com/stretchr/testify/mock" -) - -// MockMessage is an autogenerated mock type for the Message type -type MockMessage struct { - mock.Mock -} - -type MockMessage_Expecter struct { - mock *mock.Mock -} - -func (_m *MockMessage) EXPECT() *MockMessage_Expecter { - return &MockMessage_Expecter{mock: &_m.Mock} -} - -// GetMessageTypeId provides a mock function with no fields -func (_m *MockMessage) GetMessageTypeId() ocppj.MessageType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetMessageTypeId") - } - - var r0 ocppj.MessageType - if rf, ok := ret.Get(0).(func() ocppj.MessageType); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(ocppj.MessageType) - } - - return r0 -} - -// MockMessage_GetMessageTypeId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMessageTypeId' -type MockMessage_GetMessageTypeId_Call struct { - *mock.Call -} - -// GetMessageTypeId is a helper method to define mock.On call -func (_e *MockMessage_Expecter) GetMessageTypeId() *MockMessage_GetMessageTypeId_Call { - return &MockMessage_GetMessageTypeId_Call{Call: _e.mock.On("GetMessageTypeId")} -} - -func (_c *MockMessage_GetMessageTypeId_Call) Run(run func()) *MockMessage_GetMessageTypeId_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockMessage_GetMessageTypeId_Call) Return(_a0 ocppj.MessageType) *MockMessage_GetMessageTypeId_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockMessage_GetMessageTypeId_Call) RunAndReturn(run func() ocppj.MessageType) *MockMessage_GetMessageTypeId_Call { - _c.Call.Return(run) - return _c -} - -// GetUniqueId provides a mock function with no fields -func (_m *MockMessage) GetUniqueId() string { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetUniqueId") - } - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// MockMessage_GetUniqueId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUniqueId' -type MockMessage_GetUniqueId_Call struct { - *mock.Call -} - -// GetUniqueId is a helper method to define mock.On call -func (_e *MockMessage_Expecter) GetUniqueId() *MockMessage_GetUniqueId_Call { - return &MockMessage_GetUniqueId_Call{Call: _e.mock.On("GetUniqueId")} -} - -func (_c *MockMessage_GetUniqueId_Call) Run(run func()) *MockMessage_GetUniqueId_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockMessage_GetUniqueId_Call) Return(_a0 string) *MockMessage_GetUniqueId_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockMessage_GetUniqueId_Call) RunAndReturn(run func() string) *MockMessage_GetUniqueId_Call { - _c.Call.Return(run) - return _c -} - -// MarshalJSON provides a mock function with no fields -func (_m *MockMessage) MarshalJSON() ([]byte, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for MarshalJSON") - } - - var r0 []byte - var r1 error - if rf, ok := ret.Get(0).(func() ([]byte, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() []byte); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]byte) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockMessage_MarshalJSON_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MarshalJSON' -type MockMessage_MarshalJSON_Call struct { - *mock.Call -} - -// MarshalJSON is a helper method to define mock.On call -func (_e *MockMessage_Expecter) MarshalJSON() *MockMessage_MarshalJSON_Call { - return &MockMessage_MarshalJSON_Call{Call: _e.mock.On("MarshalJSON")} -} - -func (_c *MockMessage_MarshalJSON_Call) Run(run func()) *MockMessage_MarshalJSON_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockMessage_MarshalJSON_Call) Return(_a0 []byte, _a1 error) *MockMessage_MarshalJSON_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockMessage_MarshalJSON_Call) RunAndReturn(run func() ([]byte, error)) *MockMessage_MarshalJSON_Call { - _c.Call.Return(run) - return _c -} - -// NewMockMessage creates a new instance of MockMessage. 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 NewMockMessage(t interface { - mock.TestingT - Cleanup(func()) -}) *MockMessage { - mock := &MockMessage{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocppj/mocks/mock_RequestHandler.go b/ocppj/mocks/mock_RequestHandler.go deleted file mode 100644 index 5753bfe8..00000000 --- a/ocppj/mocks/mock_RequestHandler.go +++ /dev/null @@ -1,73 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - ocpp "github.com/lorenzodonini/ocpp-go/ocpp" - mock "github.com/stretchr/testify/mock" - - ws "github.com/lorenzodonini/ocpp-go/ws" -) - -// MockRequestHandler is an autogenerated mock type for the RequestHandler type -type MockRequestHandler struct { - mock.Mock -} - -type MockRequestHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockRequestHandler) EXPECT() *MockRequestHandler_Expecter { - return &MockRequestHandler_Expecter{mock: &_m.Mock} -} - -// Execute provides a mock function with given fields: client, request, requestId, action -func (_m *MockRequestHandler) Execute(client ws.Channel, request ocpp.Request, requestId string, action string) { - _m.Called(client, request, requestId, action) -} - -// MockRequestHandler_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute' -type MockRequestHandler_Execute_Call struct { - *mock.Call -} - -// Execute is a helper method to define mock.On call -// - client ws.Channel -// - request ocpp.Request -// - requestId string -// - action string -func (_e *MockRequestHandler_Expecter) Execute(client interface{}, request interface{}, requestId interface{}, action interface{}) *MockRequestHandler_Execute_Call { - return &MockRequestHandler_Execute_Call{Call: _e.mock.On("Execute", client, request, requestId, action)} -} - -func (_c *MockRequestHandler_Execute_Call) Run(run func(client ws.Channel, request ocpp.Request, requestId string, action string)) *MockRequestHandler_Execute_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ws.Channel), args[1].(ocpp.Request), args[2].(string), args[3].(string)) - }) - return _c -} - -func (_c *MockRequestHandler_Execute_Call) Return() *MockRequestHandler_Execute_Call { - _c.Call.Return() - return _c -} - -func (_c *MockRequestHandler_Execute_Call) RunAndReturn(run func(ws.Channel, ocpp.Request, string, string)) *MockRequestHandler_Execute_Call { - _c.Run(run) - return _c -} - -// NewMockRequestHandler creates a new instance of MockRequestHandler. 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 NewMockRequestHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockRequestHandler { - mock := &MockRequestHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocppj/mocks/mock_RequestQueue.go b/ocppj/mocks/mock_RequestQueue.go deleted file mode 100644 index 298a42de..00000000 --- a/ocppj/mocks/mock_RequestQueue.go +++ /dev/null @@ -1,339 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// MockRequestQueue is an autogenerated mock type for the RequestQueue type -type MockRequestQueue struct { - mock.Mock -} - -type MockRequestQueue_Expecter struct { - mock *mock.Mock -} - -func (_m *MockRequestQueue) EXPECT() *MockRequestQueue_Expecter { - return &MockRequestQueue_Expecter{mock: &_m.Mock} -} - -// Init provides a mock function with no fields -func (_m *MockRequestQueue) Init() { - _m.Called() -} - -// MockRequestQueue_Init_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Init' -type MockRequestQueue_Init_Call struct { - *mock.Call -} - -// Init is a helper method to define mock.On call -func (_e *MockRequestQueue_Expecter) Init() *MockRequestQueue_Init_Call { - return &MockRequestQueue_Init_Call{Call: _e.mock.On("Init")} -} - -func (_c *MockRequestQueue_Init_Call) Run(run func()) *MockRequestQueue_Init_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockRequestQueue_Init_Call) Return() *MockRequestQueue_Init_Call { - _c.Call.Return() - return _c -} - -func (_c *MockRequestQueue_Init_Call) RunAndReturn(run func()) *MockRequestQueue_Init_Call { - _c.Run(run) - return _c -} - -// IsEmpty provides a mock function with no fields -func (_m *MockRequestQueue) IsEmpty() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for IsEmpty") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// MockRequestQueue_IsEmpty_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsEmpty' -type MockRequestQueue_IsEmpty_Call struct { - *mock.Call -} - -// IsEmpty is a helper method to define mock.On call -func (_e *MockRequestQueue_Expecter) IsEmpty() *MockRequestQueue_IsEmpty_Call { - return &MockRequestQueue_IsEmpty_Call{Call: _e.mock.On("IsEmpty")} -} - -func (_c *MockRequestQueue_IsEmpty_Call) Run(run func()) *MockRequestQueue_IsEmpty_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockRequestQueue_IsEmpty_Call) Return(_a0 bool) *MockRequestQueue_IsEmpty_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockRequestQueue_IsEmpty_Call) RunAndReturn(run func() bool) *MockRequestQueue_IsEmpty_Call { - _c.Call.Return(run) - return _c -} - -// IsFull provides a mock function with no fields -func (_m *MockRequestQueue) IsFull() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for IsFull") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// MockRequestQueue_IsFull_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsFull' -type MockRequestQueue_IsFull_Call struct { - *mock.Call -} - -// IsFull is a helper method to define mock.On call -func (_e *MockRequestQueue_Expecter) IsFull() *MockRequestQueue_IsFull_Call { - return &MockRequestQueue_IsFull_Call{Call: _e.mock.On("IsFull")} -} - -func (_c *MockRequestQueue_IsFull_Call) Run(run func()) *MockRequestQueue_IsFull_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockRequestQueue_IsFull_Call) Return(_a0 bool) *MockRequestQueue_IsFull_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockRequestQueue_IsFull_Call) RunAndReturn(run func() bool) *MockRequestQueue_IsFull_Call { - _c.Call.Return(run) - return _c -} - -// Peek provides a mock function with no fields -func (_m *MockRequestQueue) Peek() interface{} { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Peek") - } - - var r0 interface{} - if rf, ok := ret.Get(0).(func() interface{}); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(interface{}) - } - } - - return r0 -} - -// MockRequestQueue_Peek_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Peek' -type MockRequestQueue_Peek_Call struct { - *mock.Call -} - -// Peek is a helper method to define mock.On call -func (_e *MockRequestQueue_Expecter) Peek() *MockRequestQueue_Peek_Call { - return &MockRequestQueue_Peek_Call{Call: _e.mock.On("Peek")} -} - -func (_c *MockRequestQueue_Peek_Call) Run(run func()) *MockRequestQueue_Peek_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockRequestQueue_Peek_Call) Return(_a0 interface{}) *MockRequestQueue_Peek_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockRequestQueue_Peek_Call) RunAndReturn(run func() interface{}) *MockRequestQueue_Peek_Call { - _c.Call.Return(run) - return _c -} - -// Pop provides a mock function with no fields -func (_m *MockRequestQueue) Pop() interface{} { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Pop") - } - - var r0 interface{} - if rf, ok := ret.Get(0).(func() interface{}); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(interface{}) - } - } - - return r0 -} - -// MockRequestQueue_Pop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Pop' -type MockRequestQueue_Pop_Call struct { - *mock.Call -} - -// Pop is a helper method to define mock.On call -func (_e *MockRequestQueue_Expecter) Pop() *MockRequestQueue_Pop_Call { - return &MockRequestQueue_Pop_Call{Call: _e.mock.On("Pop")} -} - -func (_c *MockRequestQueue_Pop_Call) Run(run func()) *MockRequestQueue_Pop_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockRequestQueue_Pop_Call) Return(_a0 interface{}) *MockRequestQueue_Pop_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockRequestQueue_Pop_Call) RunAndReturn(run func() interface{}) *MockRequestQueue_Pop_Call { - _c.Call.Return(run) - return _c -} - -// Push provides a mock function with given fields: element -func (_m *MockRequestQueue) Push(element interface{}) error { - ret := _m.Called(element) - - if len(ret) == 0 { - panic("no return value specified for Push") - } - - var r0 error - if rf, ok := ret.Get(0).(func(interface{}) error); ok { - r0 = rf(element) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockRequestQueue_Push_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Push' -type MockRequestQueue_Push_Call struct { - *mock.Call -} - -// Push is a helper method to define mock.On call -// - element interface{} -func (_e *MockRequestQueue_Expecter) Push(element interface{}) *MockRequestQueue_Push_Call { - return &MockRequestQueue_Push_Call{Call: _e.mock.On("Push", element)} -} - -func (_c *MockRequestQueue_Push_Call) Run(run func(element interface{})) *MockRequestQueue_Push_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(interface{})) - }) - return _c -} - -func (_c *MockRequestQueue_Push_Call) Return(_a0 error) *MockRequestQueue_Push_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockRequestQueue_Push_Call) RunAndReturn(run func(interface{}) error) *MockRequestQueue_Push_Call { - _c.Call.Return(run) - return _c -} - -// Size provides a mock function with no fields -func (_m *MockRequestQueue) 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() - } else { - r0 = ret.Get(0).(int) - } - - return r0 -} - -// MockRequestQueue_Size_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Size' -type MockRequestQueue_Size_Call struct { - *mock.Call -} - -// Size is a helper method to define mock.On call -func (_e *MockRequestQueue_Expecter) Size() *MockRequestQueue_Size_Call { - return &MockRequestQueue_Size_Call{Call: _e.mock.On("Size")} -} - -func (_c *MockRequestQueue_Size_Call) Run(run func()) *MockRequestQueue_Size_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockRequestQueue_Size_Call) Return(_a0 int) *MockRequestQueue_Size_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockRequestQueue_Size_Call) RunAndReturn(run func() int) *MockRequestQueue_Size_Call { - _c.Call.Return(run) - return _c -} - -// NewMockRequestQueue creates a new instance of MockRequestQueue. 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 NewMockRequestQueue(t interface { - mock.TestingT - Cleanup(func()) -}) *MockRequestQueue { - mock := &MockRequestQueue{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocppj/mocks/mock_ResponseHandler.go b/ocppj/mocks/mock_ResponseHandler.go deleted file mode 100644 index 038f3a96..00000000 --- a/ocppj/mocks/mock_ResponseHandler.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - ocpp "github.com/lorenzodonini/ocpp-go/ocpp" - mock "github.com/stretchr/testify/mock" - - ws "github.com/lorenzodonini/ocpp-go/ws" -) - -// MockResponseHandler is an autogenerated mock type for the ResponseHandler type -type MockResponseHandler struct { - mock.Mock -} - -type MockResponseHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockResponseHandler) EXPECT() *MockResponseHandler_Expecter { - return &MockResponseHandler_Expecter{mock: &_m.Mock} -} - -// Execute provides a mock function with given fields: client, response, requestId -func (_m *MockResponseHandler) Execute(client ws.Channel, response ocpp.Response, requestId string) { - _m.Called(client, response, requestId) -} - -// MockResponseHandler_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute' -type MockResponseHandler_Execute_Call struct { - *mock.Call -} - -// Execute is a helper method to define mock.On call -// - client ws.Channel -// - response ocpp.Response -// - requestId string -func (_e *MockResponseHandler_Expecter) Execute(client interface{}, response interface{}, requestId interface{}) *MockResponseHandler_Execute_Call { - return &MockResponseHandler_Execute_Call{Call: _e.mock.On("Execute", client, response, requestId)} -} - -func (_c *MockResponseHandler_Execute_Call) Run(run func(client ws.Channel, response ocpp.Response, requestId string)) *MockResponseHandler_Execute_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ws.Channel), args[1].(ocpp.Response), args[2].(string)) - }) - return _c -} - -func (_c *MockResponseHandler_Execute_Call) Return() *MockResponseHandler_Execute_Call { - _c.Call.Return() - return _c -} - -func (_c *MockResponseHandler_Execute_Call) RunAndReturn(run func(ws.Channel, ocpp.Response, string)) *MockResponseHandler_Execute_Call { - _c.Run(run) - return _c -} - -// NewMockResponseHandler creates a new instance of MockResponseHandler. 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 NewMockResponseHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockResponseHandler { - mock := &MockResponseHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocppj/mocks/mock_ServerDispatcher.go b/ocppj/mocks/mock_ServerDispatcher.go deleted file mode 100644 index 85d0f206..00000000 --- a/ocppj/mocks/mock_ServerDispatcher.go +++ /dev/null @@ -1,427 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - ocppj "github.com/lorenzodonini/ocpp-go/ocppj" - mock "github.com/stretchr/testify/mock" - - time "time" - - ws "github.com/lorenzodonini/ocpp-go/ws" -) - -// MockServerDispatcher is an autogenerated mock type for the ServerDispatcher type -type MockServerDispatcher struct { - mock.Mock -} - -type MockServerDispatcher_Expecter struct { - mock *mock.Mock -} - -func (_m *MockServerDispatcher) EXPECT() *MockServerDispatcher_Expecter { - return &MockServerDispatcher_Expecter{mock: &_m.Mock} -} - -// CompleteRequest provides a mock function with given fields: clientID, requestID -func (_m *MockServerDispatcher) CompleteRequest(clientID string, requestID string) { - _m.Called(clientID, requestID) -} - -// MockServerDispatcher_CompleteRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompleteRequest' -type MockServerDispatcher_CompleteRequest_Call struct { - *mock.Call -} - -// CompleteRequest is a helper method to define mock.On call -// - clientID string -// - requestID string -func (_e *MockServerDispatcher_Expecter) CompleteRequest(clientID interface{}, requestID interface{}) *MockServerDispatcher_CompleteRequest_Call { - return &MockServerDispatcher_CompleteRequest_Call{Call: _e.mock.On("CompleteRequest", clientID, requestID)} -} - -func (_c *MockServerDispatcher_CompleteRequest_Call) Run(run func(clientID string, requestID string)) *MockServerDispatcher_CompleteRequest_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(string)) - }) - return _c -} - -func (_c *MockServerDispatcher_CompleteRequest_Call) Return() *MockServerDispatcher_CompleteRequest_Call { - _c.Call.Return() - return _c -} - -func (_c *MockServerDispatcher_CompleteRequest_Call) RunAndReturn(run func(string, string)) *MockServerDispatcher_CompleteRequest_Call { - _c.Run(run) - return _c -} - -// CreateClient provides a mock function with given fields: clientID -func (_m *MockServerDispatcher) CreateClient(clientID string) { - _m.Called(clientID) -} - -// MockServerDispatcher_CreateClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateClient' -type MockServerDispatcher_CreateClient_Call struct { - *mock.Call -} - -// CreateClient is a helper method to define mock.On call -// - clientID string -func (_e *MockServerDispatcher_Expecter) CreateClient(clientID interface{}) *MockServerDispatcher_CreateClient_Call { - return &MockServerDispatcher_CreateClient_Call{Call: _e.mock.On("CreateClient", clientID)} -} - -func (_c *MockServerDispatcher_CreateClient_Call) Run(run func(clientID string)) *MockServerDispatcher_CreateClient_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *MockServerDispatcher_CreateClient_Call) Return() *MockServerDispatcher_CreateClient_Call { - _c.Call.Return() - return _c -} - -func (_c *MockServerDispatcher_CreateClient_Call) RunAndReturn(run func(string)) *MockServerDispatcher_CreateClient_Call { - _c.Run(run) - return _c -} - -// DeleteClient provides a mock function with given fields: clientID -func (_m *MockServerDispatcher) DeleteClient(clientID string) { - _m.Called(clientID) -} - -// MockServerDispatcher_DeleteClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteClient' -type MockServerDispatcher_DeleteClient_Call struct { - *mock.Call -} - -// DeleteClient is a helper method to define mock.On call -// - clientID string -func (_e *MockServerDispatcher_Expecter) DeleteClient(clientID interface{}) *MockServerDispatcher_DeleteClient_Call { - return &MockServerDispatcher_DeleteClient_Call{Call: _e.mock.On("DeleteClient", clientID)} -} - -func (_c *MockServerDispatcher_DeleteClient_Call) Run(run func(clientID string)) *MockServerDispatcher_DeleteClient_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *MockServerDispatcher_DeleteClient_Call) Return() *MockServerDispatcher_DeleteClient_Call { - _c.Call.Return() - return _c -} - -func (_c *MockServerDispatcher_DeleteClient_Call) RunAndReturn(run func(string)) *MockServerDispatcher_DeleteClient_Call { - _c.Run(run) - return _c -} - -// IsRunning provides a mock function with no fields -func (_m *MockServerDispatcher) IsRunning() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for IsRunning") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// MockServerDispatcher_IsRunning_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsRunning' -type MockServerDispatcher_IsRunning_Call struct { - *mock.Call -} - -// IsRunning is a helper method to define mock.On call -func (_e *MockServerDispatcher_Expecter) IsRunning() *MockServerDispatcher_IsRunning_Call { - return &MockServerDispatcher_IsRunning_Call{Call: _e.mock.On("IsRunning")} -} - -func (_c *MockServerDispatcher_IsRunning_Call) Run(run func()) *MockServerDispatcher_IsRunning_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockServerDispatcher_IsRunning_Call) Return(_a0 bool) *MockServerDispatcher_IsRunning_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockServerDispatcher_IsRunning_Call) RunAndReturn(run func() bool) *MockServerDispatcher_IsRunning_Call { - _c.Call.Return(run) - return _c -} - -// SendRequest provides a mock function with given fields: clientID, req -func (_m *MockServerDispatcher) SendRequest(clientID string, req ocppj.RequestBundle) error { - ret := _m.Called(clientID, req) - - if len(ret) == 0 { - panic("no return value specified for SendRequest") - } - - var r0 error - if rf, ok := ret.Get(0).(func(string, ocppj.RequestBundle) error); ok { - r0 = rf(clientID, req) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockServerDispatcher_SendRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendRequest' -type MockServerDispatcher_SendRequest_Call struct { - *mock.Call -} - -// SendRequest is a helper method to define mock.On call -// - clientID string -// - req ocppj.RequestBundle -func (_e *MockServerDispatcher_Expecter) SendRequest(clientID interface{}, req interface{}) *MockServerDispatcher_SendRequest_Call { - return &MockServerDispatcher_SendRequest_Call{Call: _e.mock.On("SendRequest", clientID, req)} -} - -func (_c *MockServerDispatcher_SendRequest_Call) Run(run func(clientID string, req ocppj.RequestBundle)) *MockServerDispatcher_SendRequest_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(ocppj.RequestBundle)) - }) - return _c -} - -func (_c *MockServerDispatcher_SendRequest_Call) Return(_a0 error) *MockServerDispatcher_SendRequest_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockServerDispatcher_SendRequest_Call) RunAndReturn(run func(string, ocppj.RequestBundle) error) *MockServerDispatcher_SendRequest_Call { - _c.Call.Return(run) - return _c -} - -// SetNetworkServer provides a mock function with given fields: server -func (_m *MockServerDispatcher) SetNetworkServer(server ws.Server) { - _m.Called(server) -} - -// MockServerDispatcher_SetNetworkServer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetNetworkServer' -type MockServerDispatcher_SetNetworkServer_Call struct { - *mock.Call -} - -// SetNetworkServer is a helper method to define mock.On call -// - server ws.Server -func (_e *MockServerDispatcher_Expecter) SetNetworkServer(server interface{}) *MockServerDispatcher_SetNetworkServer_Call { - return &MockServerDispatcher_SetNetworkServer_Call{Call: _e.mock.On("SetNetworkServer", server)} -} - -func (_c *MockServerDispatcher_SetNetworkServer_Call) Run(run func(server ws.Server)) *MockServerDispatcher_SetNetworkServer_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ws.Server)) - }) - return _c -} - -func (_c *MockServerDispatcher_SetNetworkServer_Call) Return() *MockServerDispatcher_SetNetworkServer_Call { - _c.Call.Return() - return _c -} - -func (_c *MockServerDispatcher_SetNetworkServer_Call) RunAndReturn(run func(ws.Server)) *MockServerDispatcher_SetNetworkServer_Call { - _c.Run(run) - return _c -} - -// SetOnRequestCanceled provides a mock function with given fields: cb -func (_m *MockServerDispatcher) SetOnRequestCanceled(cb ocppj.CanceledRequestHandler) { - _m.Called(cb) -} - -// MockServerDispatcher_SetOnRequestCanceled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetOnRequestCanceled' -type MockServerDispatcher_SetOnRequestCanceled_Call struct { - *mock.Call -} - -// SetOnRequestCanceled is a helper method to define mock.On call -// - cb ocppj.CanceledRequestHandler -func (_e *MockServerDispatcher_Expecter) SetOnRequestCanceled(cb interface{}) *MockServerDispatcher_SetOnRequestCanceled_Call { - return &MockServerDispatcher_SetOnRequestCanceled_Call{Call: _e.mock.On("SetOnRequestCanceled", cb)} -} - -func (_c *MockServerDispatcher_SetOnRequestCanceled_Call) Run(run func(cb ocppj.CanceledRequestHandler)) *MockServerDispatcher_SetOnRequestCanceled_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ocppj.CanceledRequestHandler)) - }) - return _c -} - -func (_c *MockServerDispatcher_SetOnRequestCanceled_Call) Return() *MockServerDispatcher_SetOnRequestCanceled_Call { - _c.Call.Return() - return _c -} - -func (_c *MockServerDispatcher_SetOnRequestCanceled_Call) RunAndReturn(run func(ocppj.CanceledRequestHandler)) *MockServerDispatcher_SetOnRequestCanceled_Call { - _c.Run(run) - return _c -} - -// SetPendingRequestState provides a mock function with given fields: stateHandler -func (_m *MockServerDispatcher) SetPendingRequestState(stateHandler ocppj.ServerState) { - _m.Called(stateHandler) -} - -// MockServerDispatcher_SetPendingRequestState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetPendingRequestState' -type MockServerDispatcher_SetPendingRequestState_Call struct { - *mock.Call -} - -// SetPendingRequestState is a helper method to define mock.On call -// - stateHandler ocppj.ServerState -func (_e *MockServerDispatcher_Expecter) SetPendingRequestState(stateHandler interface{}) *MockServerDispatcher_SetPendingRequestState_Call { - return &MockServerDispatcher_SetPendingRequestState_Call{Call: _e.mock.On("SetPendingRequestState", stateHandler)} -} - -func (_c *MockServerDispatcher_SetPendingRequestState_Call) Run(run func(stateHandler ocppj.ServerState)) *MockServerDispatcher_SetPendingRequestState_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ocppj.ServerState)) - }) - return _c -} - -func (_c *MockServerDispatcher_SetPendingRequestState_Call) Return() *MockServerDispatcher_SetPendingRequestState_Call { - _c.Call.Return() - return _c -} - -func (_c *MockServerDispatcher_SetPendingRequestState_Call) RunAndReturn(run func(ocppj.ServerState)) *MockServerDispatcher_SetPendingRequestState_Call { - _c.Run(run) - return _c -} - -// SetTimeout provides a mock function with given fields: timeout -func (_m *MockServerDispatcher) SetTimeout(timeout time.Duration) { - _m.Called(timeout) -} - -// MockServerDispatcher_SetTimeout_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetTimeout' -type MockServerDispatcher_SetTimeout_Call struct { - *mock.Call -} - -// SetTimeout is a helper method to define mock.On call -// - timeout time.Duration -func (_e *MockServerDispatcher_Expecter) SetTimeout(timeout interface{}) *MockServerDispatcher_SetTimeout_Call { - return &MockServerDispatcher_SetTimeout_Call{Call: _e.mock.On("SetTimeout", timeout)} -} - -func (_c *MockServerDispatcher_SetTimeout_Call) Run(run func(timeout time.Duration)) *MockServerDispatcher_SetTimeout_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(time.Duration)) - }) - return _c -} - -func (_c *MockServerDispatcher_SetTimeout_Call) Return() *MockServerDispatcher_SetTimeout_Call { - _c.Call.Return() - return _c -} - -func (_c *MockServerDispatcher_SetTimeout_Call) RunAndReturn(run func(time.Duration)) *MockServerDispatcher_SetTimeout_Call { - _c.Run(run) - return _c -} - -// Start provides a mock function with no fields -func (_m *MockServerDispatcher) Start() { - _m.Called() -} - -// MockServerDispatcher_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' -type MockServerDispatcher_Start_Call struct { - *mock.Call -} - -// Start is a helper method to define mock.On call -func (_e *MockServerDispatcher_Expecter) Start() *MockServerDispatcher_Start_Call { - return &MockServerDispatcher_Start_Call{Call: _e.mock.On("Start")} -} - -func (_c *MockServerDispatcher_Start_Call) Run(run func()) *MockServerDispatcher_Start_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockServerDispatcher_Start_Call) Return() *MockServerDispatcher_Start_Call { - _c.Call.Return() - return _c -} - -func (_c *MockServerDispatcher_Start_Call) RunAndReturn(run func()) *MockServerDispatcher_Start_Call { - _c.Run(run) - return _c -} - -// Stop provides a mock function with no fields -func (_m *MockServerDispatcher) Stop() { - _m.Called() -} - -// MockServerDispatcher_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop' -type MockServerDispatcher_Stop_Call struct { - *mock.Call -} - -// Stop is a helper method to define mock.On call -func (_e *MockServerDispatcher_Expecter) Stop() *MockServerDispatcher_Stop_Call { - return &MockServerDispatcher_Stop_Call{Call: _e.mock.On("Stop")} -} - -func (_c *MockServerDispatcher_Stop_Call) Run(run func()) *MockServerDispatcher_Stop_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockServerDispatcher_Stop_Call) Return() *MockServerDispatcher_Stop_Call { - _c.Call.Return() - return _c -} - -func (_c *MockServerDispatcher_Stop_Call) RunAndReturn(run func()) *MockServerDispatcher_Stop_Call { - _c.Run(run) - return _c -} - -// NewMockServerDispatcher creates a new instance of MockServerDispatcher. 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 NewMockServerDispatcher(t interface { - mock.TestingT - Cleanup(func()) -}) *MockServerDispatcher { - mock := &MockServerDispatcher{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocppj/mocks/mock_ServerQueueMap.go b/ocppj/mocks/mock_ServerQueueMap.go deleted file mode 100644 index d44b8cf7..00000000 --- a/ocppj/mocks/mock_ServerQueueMap.go +++ /dev/null @@ -1,240 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - ocppj "github.com/lorenzodonini/ocpp-go/ocppj" - mock "github.com/stretchr/testify/mock" -) - -// MockServerQueueMap is an autogenerated mock type for the ServerQueueMap type -type MockServerQueueMap struct { - mock.Mock -} - -type MockServerQueueMap_Expecter struct { - mock *mock.Mock -} - -func (_m *MockServerQueueMap) EXPECT() *MockServerQueueMap_Expecter { - return &MockServerQueueMap_Expecter{mock: &_m.Mock} -} - -// Add provides a mock function with given fields: clientID, queue -func (_m *MockServerQueueMap) Add(clientID string, queue ocppj.RequestQueue) { - _m.Called(clientID, queue) -} - -// MockServerQueueMap_Add_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Add' -type MockServerQueueMap_Add_Call struct { - *mock.Call -} - -// Add is a helper method to define mock.On call -// - clientID string -// - queue ocppj.RequestQueue -func (_e *MockServerQueueMap_Expecter) Add(clientID interface{}, queue interface{}) *MockServerQueueMap_Add_Call { - return &MockServerQueueMap_Add_Call{Call: _e.mock.On("Add", clientID, queue)} -} - -func (_c *MockServerQueueMap_Add_Call) Run(run func(clientID string, queue ocppj.RequestQueue)) *MockServerQueueMap_Add_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(ocppj.RequestQueue)) - }) - return _c -} - -func (_c *MockServerQueueMap_Add_Call) Return() *MockServerQueueMap_Add_Call { - _c.Call.Return() - return _c -} - -func (_c *MockServerQueueMap_Add_Call) RunAndReturn(run func(string, ocppj.RequestQueue)) *MockServerQueueMap_Add_Call { - _c.Run(run) - return _c -} - -// Get provides a mock function with given fields: clientID -func (_m *MockServerQueueMap) Get(clientID string) (ocppj.RequestQueue, bool) { - ret := _m.Called(clientID) - - if len(ret) == 0 { - panic("no return value specified for Get") - } - - var r0 ocppj.RequestQueue - var r1 bool - if rf, ok := ret.Get(0).(func(string) (ocppj.RequestQueue, bool)); ok { - return rf(clientID) - } - if rf, ok := ret.Get(0).(func(string) ocppj.RequestQueue); ok { - r0 = rf(clientID) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(ocppj.RequestQueue) - } - } - - if rf, ok := ret.Get(1).(func(string) bool); ok { - r1 = rf(clientID) - } else { - r1 = ret.Get(1).(bool) - } - - return r0, r1 -} - -// MockServerQueueMap_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' -type MockServerQueueMap_Get_Call struct { - *mock.Call -} - -// Get is a helper method to define mock.On call -// - clientID string -func (_e *MockServerQueueMap_Expecter) Get(clientID interface{}) *MockServerQueueMap_Get_Call { - return &MockServerQueueMap_Get_Call{Call: _e.mock.On("Get", clientID)} -} - -func (_c *MockServerQueueMap_Get_Call) Run(run func(clientID string)) *MockServerQueueMap_Get_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *MockServerQueueMap_Get_Call) Return(_a0 ocppj.RequestQueue, _a1 bool) *MockServerQueueMap_Get_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockServerQueueMap_Get_Call) RunAndReturn(run func(string) (ocppj.RequestQueue, bool)) *MockServerQueueMap_Get_Call { - _c.Call.Return(run) - return _c -} - -// GetOrCreate provides a mock function with given fields: clientID -func (_m *MockServerQueueMap) GetOrCreate(clientID string) ocppj.RequestQueue { - ret := _m.Called(clientID) - - if len(ret) == 0 { - panic("no return value specified for GetOrCreate") - } - - var r0 ocppj.RequestQueue - if rf, ok := ret.Get(0).(func(string) ocppj.RequestQueue); ok { - r0 = rf(clientID) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(ocppj.RequestQueue) - } - } - - return r0 -} - -// MockServerQueueMap_GetOrCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetOrCreate' -type MockServerQueueMap_GetOrCreate_Call struct { - *mock.Call -} - -// GetOrCreate is a helper method to define mock.On call -// - clientID string -func (_e *MockServerQueueMap_Expecter) GetOrCreate(clientID interface{}) *MockServerQueueMap_GetOrCreate_Call { - return &MockServerQueueMap_GetOrCreate_Call{Call: _e.mock.On("GetOrCreate", clientID)} -} - -func (_c *MockServerQueueMap_GetOrCreate_Call) Run(run func(clientID string)) *MockServerQueueMap_GetOrCreate_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *MockServerQueueMap_GetOrCreate_Call) Return(_a0 ocppj.RequestQueue) *MockServerQueueMap_GetOrCreate_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockServerQueueMap_GetOrCreate_Call) RunAndReturn(run func(string) ocppj.RequestQueue) *MockServerQueueMap_GetOrCreate_Call { - _c.Call.Return(run) - return _c -} - -// Init provides a mock function with no fields -func (_m *MockServerQueueMap) Init() { - _m.Called() -} - -// MockServerQueueMap_Init_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Init' -type MockServerQueueMap_Init_Call struct { - *mock.Call -} - -// Init is a helper method to define mock.On call -func (_e *MockServerQueueMap_Expecter) Init() *MockServerQueueMap_Init_Call { - return &MockServerQueueMap_Init_Call{Call: _e.mock.On("Init")} -} - -func (_c *MockServerQueueMap_Init_Call) Run(run func()) *MockServerQueueMap_Init_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockServerQueueMap_Init_Call) Return() *MockServerQueueMap_Init_Call { - _c.Call.Return() - return _c -} - -func (_c *MockServerQueueMap_Init_Call) RunAndReturn(run func()) *MockServerQueueMap_Init_Call { - _c.Run(run) - return _c -} - -// Remove provides a mock function with given fields: clientID -func (_m *MockServerQueueMap) Remove(clientID string) { - _m.Called(clientID) -} - -// MockServerQueueMap_Remove_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Remove' -type MockServerQueueMap_Remove_Call struct { - *mock.Call -} - -// Remove is a helper method to define mock.On call -// - clientID string -func (_e *MockServerQueueMap_Expecter) Remove(clientID interface{}) *MockServerQueueMap_Remove_Call { - return &MockServerQueueMap_Remove_Call{Call: _e.mock.On("Remove", clientID)} -} - -func (_c *MockServerQueueMap_Remove_Call) Run(run func(clientID string)) *MockServerQueueMap_Remove_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *MockServerQueueMap_Remove_Call) Return() *MockServerQueueMap_Remove_Call { - _c.Call.Return() - return _c -} - -func (_c *MockServerQueueMap_Remove_Call) RunAndReturn(run func(string)) *MockServerQueueMap_Remove_Call { - _c.Run(run) - return _c -} - -// NewMockServerQueueMap creates a new instance of MockServerQueueMap. 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 NewMockServerQueueMap(t interface { - mock.TestingT - Cleanup(func()) -}) *MockServerQueueMap { - mock := &MockServerQueueMap{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocppj/mocks/mock_ServerState.go b/ocppj/mocks/mock_ServerState.go deleted file mode 100644 index db612eee..00000000 --- a/ocppj/mocks/mock_ServerState.go +++ /dev/null @@ -1,310 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - ocpp "github.com/lorenzodonini/ocpp-go/ocpp" - mock "github.com/stretchr/testify/mock" - - ocppj "github.com/lorenzodonini/ocpp-go/ocppj" -) - -// MockServerState is an autogenerated mock type for the ServerState type -type MockServerState struct { - mock.Mock -} - -type MockServerState_Expecter struct { - mock *mock.Mock -} - -func (_m *MockServerState) EXPECT() *MockServerState_Expecter { - return &MockServerState_Expecter{mock: &_m.Mock} -} - -// AddPendingRequest provides a mock function with given fields: clientID, requestID, req -func (_m *MockServerState) AddPendingRequest(clientID string, requestID string, req ocpp.Request) { - _m.Called(clientID, requestID, req) -} - -// MockServerState_AddPendingRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddPendingRequest' -type MockServerState_AddPendingRequest_Call struct { - *mock.Call -} - -// AddPendingRequest is a helper method to define mock.On call -// - clientID string -// - requestID string -// - req ocpp.Request -func (_e *MockServerState_Expecter) AddPendingRequest(clientID interface{}, requestID interface{}, req interface{}) *MockServerState_AddPendingRequest_Call { - return &MockServerState_AddPendingRequest_Call{Call: _e.mock.On("AddPendingRequest", clientID, requestID, req)} -} - -func (_c *MockServerState_AddPendingRequest_Call) Run(run func(clientID string, requestID string, req ocpp.Request)) *MockServerState_AddPendingRequest_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(string), args[2].(ocpp.Request)) - }) - return _c -} - -func (_c *MockServerState_AddPendingRequest_Call) Return() *MockServerState_AddPendingRequest_Call { - _c.Call.Return() - return _c -} - -func (_c *MockServerState_AddPendingRequest_Call) RunAndReturn(run func(string, string, ocpp.Request)) *MockServerState_AddPendingRequest_Call { - _c.Run(run) - return _c -} - -// ClearAllPendingRequests provides a mock function with no fields -func (_m *MockServerState) ClearAllPendingRequests() { - _m.Called() -} - -// MockServerState_ClearAllPendingRequests_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ClearAllPendingRequests' -type MockServerState_ClearAllPendingRequests_Call struct { - *mock.Call -} - -// ClearAllPendingRequests is a helper method to define mock.On call -func (_e *MockServerState_Expecter) ClearAllPendingRequests() *MockServerState_ClearAllPendingRequests_Call { - return &MockServerState_ClearAllPendingRequests_Call{Call: _e.mock.On("ClearAllPendingRequests")} -} - -func (_c *MockServerState_ClearAllPendingRequests_Call) Run(run func()) *MockServerState_ClearAllPendingRequests_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockServerState_ClearAllPendingRequests_Call) Return() *MockServerState_ClearAllPendingRequests_Call { - _c.Call.Return() - return _c -} - -func (_c *MockServerState_ClearAllPendingRequests_Call) RunAndReturn(run func()) *MockServerState_ClearAllPendingRequests_Call { - _c.Run(run) - return _c -} - -// ClearClientPendingRequest provides a mock function with given fields: clientID -func (_m *MockServerState) ClearClientPendingRequest(clientID string) { - _m.Called(clientID) -} - -// MockServerState_ClearClientPendingRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ClearClientPendingRequest' -type MockServerState_ClearClientPendingRequest_Call struct { - *mock.Call -} - -// ClearClientPendingRequest is a helper method to define mock.On call -// - clientID string -func (_e *MockServerState_Expecter) ClearClientPendingRequest(clientID interface{}) *MockServerState_ClearClientPendingRequest_Call { - return &MockServerState_ClearClientPendingRequest_Call{Call: _e.mock.On("ClearClientPendingRequest", clientID)} -} - -func (_c *MockServerState_ClearClientPendingRequest_Call) Run(run func(clientID string)) *MockServerState_ClearClientPendingRequest_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *MockServerState_ClearClientPendingRequest_Call) Return() *MockServerState_ClearClientPendingRequest_Call { - _c.Call.Return() - return _c -} - -func (_c *MockServerState_ClearClientPendingRequest_Call) RunAndReturn(run func(string)) *MockServerState_ClearClientPendingRequest_Call { - _c.Run(run) - return _c -} - -// DeletePendingRequest provides a mock function with given fields: clientID, requestID -func (_m *MockServerState) DeletePendingRequest(clientID string, requestID string) { - _m.Called(clientID, requestID) -} - -// MockServerState_DeletePendingRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeletePendingRequest' -type MockServerState_DeletePendingRequest_Call struct { - *mock.Call -} - -// DeletePendingRequest is a helper method to define mock.On call -// - clientID string -// - requestID string -func (_e *MockServerState_Expecter) DeletePendingRequest(clientID interface{}, requestID interface{}) *MockServerState_DeletePendingRequest_Call { - return &MockServerState_DeletePendingRequest_Call{Call: _e.mock.On("DeletePendingRequest", clientID, requestID)} -} - -func (_c *MockServerState_DeletePendingRequest_Call) Run(run func(clientID string, requestID string)) *MockServerState_DeletePendingRequest_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(string)) - }) - return _c -} - -func (_c *MockServerState_DeletePendingRequest_Call) Return() *MockServerState_DeletePendingRequest_Call { - _c.Call.Return() - return _c -} - -func (_c *MockServerState_DeletePendingRequest_Call) RunAndReturn(run func(string, string)) *MockServerState_DeletePendingRequest_Call { - _c.Run(run) - return _c -} - -// GetClientState provides a mock function with given fields: clientID -func (_m *MockServerState) GetClientState(clientID string) ocppj.ClientState { - ret := _m.Called(clientID) - - if len(ret) == 0 { - panic("no return value specified for GetClientState") - } - - var r0 ocppj.ClientState - if rf, ok := ret.Get(0).(func(string) ocppj.ClientState); ok { - r0 = rf(clientID) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(ocppj.ClientState) - } - } - - return r0 -} - -// MockServerState_GetClientState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetClientState' -type MockServerState_GetClientState_Call struct { - *mock.Call -} - -// GetClientState is a helper method to define mock.On call -// - clientID string -func (_e *MockServerState_Expecter) GetClientState(clientID interface{}) *MockServerState_GetClientState_Call { - return &MockServerState_GetClientState_Call{Call: _e.mock.On("GetClientState", clientID)} -} - -func (_c *MockServerState_GetClientState_Call) Run(run func(clientID string)) *MockServerState_GetClientState_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *MockServerState_GetClientState_Call) Return(_a0 ocppj.ClientState) *MockServerState_GetClientState_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockServerState_GetClientState_Call) RunAndReturn(run func(string) ocppj.ClientState) *MockServerState_GetClientState_Call { - _c.Call.Return(run) - return _c -} - -// HasPendingRequest provides a mock function with given fields: clientID -func (_m *MockServerState) HasPendingRequest(clientID string) bool { - ret := _m.Called(clientID) - - if len(ret) == 0 { - panic("no return value specified for HasPendingRequest") - } - - var r0 bool - if rf, ok := ret.Get(0).(func(string) bool); ok { - r0 = rf(clientID) - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// MockServerState_HasPendingRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasPendingRequest' -type MockServerState_HasPendingRequest_Call struct { - *mock.Call -} - -// HasPendingRequest is a helper method to define mock.On call -// - clientID string -func (_e *MockServerState_Expecter) HasPendingRequest(clientID interface{}) *MockServerState_HasPendingRequest_Call { - return &MockServerState_HasPendingRequest_Call{Call: _e.mock.On("HasPendingRequest", clientID)} -} - -func (_c *MockServerState_HasPendingRequest_Call) Run(run func(clientID string)) *MockServerState_HasPendingRequest_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *MockServerState_HasPendingRequest_Call) Return(_a0 bool) *MockServerState_HasPendingRequest_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockServerState_HasPendingRequest_Call) RunAndReturn(run func(string) bool) *MockServerState_HasPendingRequest_Call { - _c.Call.Return(run) - return _c -} - -// HasPendingRequests provides a mock function with no fields -func (_m *MockServerState) HasPendingRequests() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for HasPendingRequests") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// MockServerState_HasPendingRequests_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasPendingRequests' -type MockServerState_HasPendingRequests_Call struct { - *mock.Call -} - -// HasPendingRequests is a helper method to define mock.On call -func (_e *MockServerState_Expecter) HasPendingRequests() *MockServerState_HasPendingRequests_Call { - return &MockServerState_HasPendingRequests_Call{Call: _e.mock.On("HasPendingRequests")} -} - -func (_c *MockServerState_HasPendingRequests_Call) Run(run func()) *MockServerState_HasPendingRequests_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockServerState_HasPendingRequests_Call) Return(_a0 bool) *MockServerState_HasPendingRequests_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockServerState_HasPendingRequests_Call) RunAndReturn(run func() bool) *MockServerState_HasPendingRequests_Call { - _c.Call.Return(run) - return _c -} - -// NewMockServerState creates a new instance of MockServerState. 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 NewMockServerState(t interface { - mock.TestingT - Cleanup(func()) -}) *MockServerState { - mock := &MockServerState{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ocppj/mocks/mock_dialector.go b/ocppj/mocks/mock_dialector.go deleted file mode 100644 index 0d12e982..00000000 --- a/ocppj/mocks/mock_dialector.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - ocpp "github.com/lorenzodonini/ocpp-go/ocpp" - mock "github.com/stretchr/testify/mock" -) - -// Mockdialector is an autogenerated mock type for the dialector type -type Mockdialector struct { - mock.Mock -} - -type Mockdialector_Expecter struct { - mock *mock.Mock -} - -func (_m *Mockdialector) EXPECT() *Mockdialector_Expecter { - return &Mockdialector_Expecter{mock: &_m.Mock} -} - -// Dialect provides a mock function with no fields -func (_m *Mockdialector) Dialect() ocpp.Dialect { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Dialect") - } - - var r0 ocpp.Dialect - if rf, ok := ret.Get(0).(func() ocpp.Dialect); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(ocpp.Dialect) - } - - return r0 -} - -// Mockdialector_Dialect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Dialect' -type Mockdialector_Dialect_Call struct { - *mock.Call -} - -// Dialect is a helper method to define mock.On call -func (_e *Mockdialector_Expecter) Dialect() *Mockdialector_Dialect_Call { - return &Mockdialector_Dialect_Call{Call: _e.mock.On("Dialect")} -} - -func (_c *Mockdialector_Dialect_Call) Run(run func()) *Mockdialector_Dialect_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Mockdialector_Dialect_Call) Return(_a0 ocpp.Dialect) *Mockdialector_Dialect_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Mockdialector_Dialect_Call) RunAndReturn(run func() ocpp.Dialect) *Mockdialector_Dialect_Call { - _c.Call.Return(run) - return _c -} - -// NewMockdialector creates a new instance of Mockdialector. 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 NewMockdialector(t interface { - mock.TestingT - Cleanup(func()) -}) *Mockdialector { - mock := &Mockdialector{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ws/mocks/mock_Channel.go b/ws/mocks/mock_Channel.go deleted file mode 100644 index cf5d228e..00000000 --- a/ws/mocks/mock_Channel.go +++ /dev/null @@ -1,222 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - net "net" - - mock "github.com/stretchr/testify/mock" - - tls "crypto/tls" -) - -// MockChannel is an autogenerated mock type for the Channel type -type MockChannel struct { - mock.Mock -} - -type MockChannel_Expecter struct { - mock *mock.Mock -} - -func (_m *MockChannel) EXPECT() *MockChannel_Expecter { - return &MockChannel_Expecter{mock: &_m.Mock} -} - -// ID provides a mock function with no fields -func (_m *MockChannel) ID() string { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for ID") - } - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// MockChannel_ID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ID' -type MockChannel_ID_Call struct { - *mock.Call -} - -// ID is a helper method to define mock.On call -func (_e *MockChannel_Expecter) ID() *MockChannel_ID_Call { - return &MockChannel_ID_Call{Call: _e.mock.On("ID")} -} - -func (_c *MockChannel_ID_Call) Run(run func()) *MockChannel_ID_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockChannel_ID_Call) Return(_a0 string) *MockChannel_ID_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockChannel_ID_Call) RunAndReturn(run func() string) *MockChannel_ID_Call { - _c.Call.Return(run) - return _c -} - -// IsConnected provides a mock function with no fields -func (_m *MockChannel) IsConnected() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for IsConnected") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// MockChannel_IsConnected_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsConnected' -type MockChannel_IsConnected_Call struct { - *mock.Call -} - -// IsConnected is a helper method to define mock.On call -func (_e *MockChannel_Expecter) IsConnected() *MockChannel_IsConnected_Call { - return &MockChannel_IsConnected_Call{Call: _e.mock.On("IsConnected")} -} - -func (_c *MockChannel_IsConnected_Call) Run(run func()) *MockChannel_IsConnected_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockChannel_IsConnected_Call) Return(_a0 bool) *MockChannel_IsConnected_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockChannel_IsConnected_Call) RunAndReturn(run func() bool) *MockChannel_IsConnected_Call { - _c.Call.Return(run) - return _c -} - -// RemoteAddr provides a mock function with no fields -func (_m *MockChannel) RemoteAddr() net.Addr { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for RemoteAddr") - } - - var r0 net.Addr - if rf, ok := ret.Get(0).(func() net.Addr); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(net.Addr) - } - } - - return r0 -} - -// MockChannel_RemoteAddr_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoteAddr' -type MockChannel_RemoteAddr_Call struct { - *mock.Call -} - -// RemoteAddr is a helper method to define mock.On call -func (_e *MockChannel_Expecter) RemoteAddr() *MockChannel_RemoteAddr_Call { - return &MockChannel_RemoteAddr_Call{Call: _e.mock.On("RemoteAddr")} -} - -func (_c *MockChannel_RemoteAddr_Call) Run(run func()) *MockChannel_RemoteAddr_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockChannel_RemoteAddr_Call) Return(_a0 net.Addr) *MockChannel_RemoteAddr_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockChannel_RemoteAddr_Call) RunAndReturn(run func() net.Addr) *MockChannel_RemoteAddr_Call { - _c.Call.Return(run) - return _c -} - -// TLSConnectionState provides a mock function with no fields -func (_m *MockChannel) TLSConnectionState() *tls.ConnectionState { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for TLSConnectionState") - } - - var r0 *tls.ConnectionState - if rf, ok := ret.Get(0).(func() *tls.ConnectionState); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*tls.ConnectionState) - } - } - - return r0 -} - -// MockChannel_TLSConnectionState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TLSConnectionState' -type MockChannel_TLSConnectionState_Call struct { - *mock.Call -} - -// TLSConnectionState is a helper method to define mock.On call -func (_e *MockChannel_Expecter) TLSConnectionState() *MockChannel_TLSConnectionState_Call { - return &MockChannel_TLSConnectionState_Call{Call: _e.mock.On("TLSConnectionState")} -} - -func (_c *MockChannel_TLSConnectionState_Call) Run(run func()) *MockChannel_TLSConnectionState_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockChannel_TLSConnectionState_Call) Return(_a0 *tls.ConnectionState) *MockChannel_TLSConnectionState_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockChannel_TLSConnectionState_Call) RunAndReturn(run func() *tls.ConnectionState) *MockChannel_TLSConnectionState_Call { - _c.Call.Return(run) - return _c -} - -// NewMockChannel creates a new instance of MockChannel. 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 NewMockChannel(t interface { - mock.TestingT - Cleanup(func()) -}) *MockChannel { - mock := &MockChannel{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ws/mocks/mock_CheckClientHandler.go b/ws/mocks/mock_CheckClientHandler.go deleted file mode 100644 index 56e1d614..00000000 --- a/ws/mocks/mock_CheckClientHandler.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - http "net/http" - - mock "github.com/stretchr/testify/mock" -) - -// MockCheckClientHandler is an autogenerated mock type for the CheckClientHandler type -type MockCheckClientHandler struct { - mock.Mock -} - -type MockCheckClientHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockCheckClientHandler) EXPECT() *MockCheckClientHandler_Expecter { - return &MockCheckClientHandler_Expecter{mock: &_m.Mock} -} - -// Execute provides a mock function with given fields: id, r -func (_m *MockCheckClientHandler) Execute(id string, r *http.Request) bool { - ret := _m.Called(id, r) - - if len(ret) == 0 { - panic("no return value specified for Execute") - } - - var r0 bool - if rf, ok := ret.Get(0).(func(string, *http.Request) bool); ok { - r0 = rf(id, r) - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// MockCheckClientHandler_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute' -type MockCheckClientHandler_Execute_Call struct { - *mock.Call -} - -// Execute is a helper method to define mock.On call -// - id string -// - r *http.Request -func (_e *MockCheckClientHandler_Expecter) Execute(id interface{}, r interface{}) *MockCheckClientHandler_Execute_Call { - return &MockCheckClientHandler_Execute_Call{Call: _e.mock.On("Execute", id, r)} -} - -func (_c *MockCheckClientHandler_Execute_Call) Run(run func(id string, r *http.Request)) *MockCheckClientHandler_Execute_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(*http.Request)) - }) - return _c -} - -func (_c *MockCheckClientHandler_Execute_Call) Return(_a0 bool) *MockCheckClientHandler_Execute_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockCheckClientHandler_Execute_Call) RunAndReturn(run func(string, *http.Request) bool) *MockCheckClientHandler_Execute_Call { - _c.Call.Return(run) - return _c -} - -// NewMockCheckClientHandler creates a new instance of MockCheckClientHandler. 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 NewMockCheckClientHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockCheckClientHandler { - mock := &MockCheckClientHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ws/mocks/mock_Client.go b/ws/mocks/mock_Client.go deleted file mode 100644 index 3d0dc510..00000000 --- a/ws/mocks/mock_Client.go +++ /dev/null @@ -1,550 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - ws "github.com/lorenzodonini/ocpp-go/ws" - mock "github.com/stretchr/testify/mock" -) - -// MockClient is an autogenerated mock type for the Client type -type MockClient struct { - mock.Mock -} - -type MockClient_Expecter struct { - mock *mock.Mock -} - -func (_m *MockClient) EXPECT() *MockClient_Expecter { - return &MockClient_Expecter{mock: &_m.Mock} -} - -// AddOption provides a mock function with given fields: option -func (_m *MockClient) AddOption(option interface{}) { - _m.Called(option) -} - -// MockClient_AddOption_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddOption' -type MockClient_AddOption_Call struct { - *mock.Call -} - -// AddOption is a helper method to define mock.On call -// - option interface{} -func (_e *MockClient_Expecter) AddOption(option interface{}) *MockClient_AddOption_Call { - return &MockClient_AddOption_Call{Call: _e.mock.On("AddOption", option)} -} - -func (_c *MockClient_AddOption_Call) Run(run func(option interface{})) *MockClient_AddOption_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(interface{})) - }) - return _c -} - -func (_c *MockClient_AddOption_Call) Return() *MockClient_AddOption_Call { - _c.Call.Return() - return _c -} - -func (_c *MockClient_AddOption_Call) RunAndReturn(run func(interface{})) *MockClient_AddOption_Call { - _c.Run(run) - return _c -} - -// Errors provides a mock function with no fields -func (_m *MockClient) Errors() <-chan error { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Errors") - } - - var r0 <-chan error - if rf, ok := ret.Get(0).(func() <-chan error); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(<-chan error) - } - } - - return r0 -} - -// MockClient_Errors_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Errors' -type MockClient_Errors_Call struct { - *mock.Call -} - -// Errors is a helper method to define mock.On call -func (_e *MockClient_Expecter) Errors() *MockClient_Errors_Call { - return &MockClient_Errors_Call{Call: _e.mock.On("Errors")} -} - -func (_c *MockClient_Errors_Call) Run(run func()) *MockClient_Errors_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockClient_Errors_Call) Return(_a0 <-chan error) *MockClient_Errors_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockClient_Errors_Call) RunAndReturn(run func() <-chan error) *MockClient_Errors_Call { - _c.Call.Return(run) - return _c -} - -// IsConnected provides a mock function with no fields -func (_m *MockClient) IsConnected() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for IsConnected") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// MockClient_IsConnected_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsConnected' -type MockClient_IsConnected_Call struct { - *mock.Call -} - -// IsConnected is a helper method to define mock.On call -func (_e *MockClient_Expecter) IsConnected() *MockClient_IsConnected_Call { - return &MockClient_IsConnected_Call{Call: _e.mock.On("IsConnected")} -} - -func (_c *MockClient_IsConnected_Call) Run(run func()) *MockClient_IsConnected_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockClient_IsConnected_Call) Return(_a0 bool) *MockClient_IsConnected_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockClient_IsConnected_Call) RunAndReturn(run func() bool) *MockClient_IsConnected_Call { - _c.Call.Return(run) - return _c -} - -// SetBasicAuth provides a mock function with given fields: username, password -func (_m *MockClient) SetBasicAuth(username string, password string) { - _m.Called(username, password) -} - -// MockClient_SetBasicAuth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetBasicAuth' -type MockClient_SetBasicAuth_Call struct { - *mock.Call -} - -// SetBasicAuth is a helper method to define mock.On call -// - username string -// - password string -func (_e *MockClient_Expecter) SetBasicAuth(username interface{}, password interface{}) *MockClient_SetBasicAuth_Call { - return &MockClient_SetBasicAuth_Call{Call: _e.mock.On("SetBasicAuth", username, password)} -} - -func (_c *MockClient_SetBasicAuth_Call) Run(run func(username string, password string)) *MockClient_SetBasicAuth_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(string)) - }) - return _c -} - -func (_c *MockClient_SetBasicAuth_Call) Return() *MockClient_SetBasicAuth_Call { - _c.Call.Return() - return _c -} - -func (_c *MockClient_SetBasicAuth_Call) RunAndReturn(run func(string, string)) *MockClient_SetBasicAuth_Call { - _c.Run(run) - return _c -} - -// SetDisconnectedHandler provides a mock function with given fields: handler -func (_m *MockClient) SetDisconnectedHandler(handler func(error)) { - _m.Called(handler) -} - -// MockClient_SetDisconnectedHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDisconnectedHandler' -type MockClient_SetDisconnectedHandler_Call struct { - *mock.Call -} - -// SetDisconnectedHandler is a helper method to define mock.On call -// - handler func(error) -func (_e *MockClient_Expecter) SetDisconnectedHandler(handler interface{}) *MockClient_SetDisconnectedHandler_Call { - return &MockClient_SetDisconnectedHandler_Call{Call: _e.mock.On("SetDisconnectedHandler", handler)} -} - -func (_c *MockClient_SetDisconnectedHandler_Call) Run(run func(handler func(error))) *MockClient_SetDisconnectedHandler_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(func(error))) - }) - return _c -} - -func (_c *MockClient_SetDisconnectedHandler_Call) Return() *MockClient_SetDisconnectedHandler_Call { - _c.Call.Return() - return _c -} - -func (_c *MockClient_SetDisconnectedHandler_Call) RunAndReturn(run func(func(error))) *MockClient_SetDisconnectedHandler_Call { - _c.Run(run) - return _c -} - -// SetHeaderValue provides a mock function with given fields: key, value -func (_m *MockClient) SetHeaderValue(key string, value string) { - _m.Called(key, value) -} - -// MockClient_SetHeaderValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetHeaderValue' -type MockClient_SetHeaderValue_Call struct { - *mock.Call -} - -// SetHeaderValue is a helper method to define mock.On call -// - key string -// - value string -func (_e *MockClient_Expecter) SetHeaderValue(key interface{}, value interface{}) *MockClient_SetHeaderValue_Call { - return &MockClient_SetHeaderValue_Call{Call: _e.mock.On("SetHeaderValue", key, value)} -} - -func (_c *MockClient_SetHeaderValue_Call) Run(run func(key string, value string)) *MockClient_SetHeaderValue_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(string)) - }) - return _c -} - -func (_c *MockClient_SetHeaderValue_Call) Return() *MockClient_SetHeaderValue_Call { - _c.Call.Return() - return _c -} - -func (_c *MockClient_SetHeaderValue_Call) RunAndReturn(run func(string, string)) *MockClient_SetHeaderValue_Call { - _c.Run(run) - return _c -} - -// SetMessageHandler provides a mock function with given fields: handler -func (_m *MockClient) SetMessageHandler(handler func([]byte) error) { - _m.Called(handler) -} - -// MockClient_SetMessageHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetMessageHandler' -type MockClient_SetMessageHandler_Call struct { - *mock.Call -} - -// SetMessageHandler is a helper method to define mock.On call -// - handler func([]byte) error -func (_e *MockClient_Expecter) SetMessageHandler(handler interface{}) *MockClient_SetMessageHandler_Call { - return &MockClient_SetMessageHandler_Call{Call: _e.mock.On("SetMessageHandler", handler)} -} - -func (_c *MockClient_SetMessageHandler_Call) Run(run func(handler func([]byte) error)) *MockClient_SetMessageHandler_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(func([]byte) error)) - }) - return _c -} - -func (_c *MockClient_SetMessageHandler_Call) Return() *MockClient_SetMessageHandler_Call { - _c.Call.Return() - return _c -} - -func (_c *MockClient_SetMessageHandler_Call) RunAndReturn(run func(func([]byte) error)) *MockClient_SetMessageHandler_Call { - _c.Run(run) - return _c -} - -// SetReconnectedHandler provides a mock function with given fields: handler -func (_m *MockClient) SetReconnectedHandler(handler func()) { - _m.Called(handler) -} - -// MockClient_SetReconnectedHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetReconnectedHandler' -type MockClient_SetReconnectedHandler_Call struct { - *mock.Call -} - -// SetReconnectedHandler is a helper method to define mock.On call -// - handler func() -func (_e *MockClient_Expecter) SetReconnectedHandler(handler interface{}) *MockClient_SetReconnectedHandler_Call { - return &MockClient_SetReconnectedHandler_Call{Call: _e.mock.On("SetReconnectedHandler", handler)} -} - -func (_c *MockClient_SetReconnectedHandler_Call) Run(run func(handler func())) *MockClient_SetReconnectedHandler_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(func())) - }) - return _c -} - -func (_c *MockClient_SetReconnectedHandler_Call) Return() *MockClient_SetReconnectedHandler_Call { - _c.Call.Return() - return _c -} - -func (_c *MockClient_SetReconnectedHandler_Call) RunAndReturn(run func(func())) *MockClient_SetReconnectedHandler_Call { - _c.Run(run) - return _c -} - -// SetRequestedSubProtocol provides a mock function with given fields: subProto -func (_m *MockClient) SetRequestedSubProtocol(subProto string) { - _m.Called(subProto) -} - -// MockClient_SetRequestedSubProtocol_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetRequestedSubProtocol' -type MockClient_SetRequestedSubProtocol_Call struct { - *mock.Call -} - -// SetRequestedSubProtocol is a helper method to define mock.On call -// - subProto string -func (_e *MockClient_Expecter) SetRequestedSubProtocol(subProto interface{}) *MockClient_SetRequestedSubProtocol_Call { - return &MockClient_SetRequestedSubProtocol_Call{Call: _e.mock.On("SetRequestedSubProtocol", subProto)} -} - -func (_c *MockClient_SetRequestedSubProtocol_Call) Run(run func(subProto string)) *MockClient_SetRequestedSubProtocol_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *MockClient_SetRequestedSubProtocol_Call) Return() *MockClient_SetRequestedSubProtocol_Call { - _c.Call.Return() - return _c -} - -func (_c *MockClient_SetRequestedSubProtocol_Call) RunAndReturn(run func(string)) *MockClient_SetRequestedSubProtocol_Call { - _c.Run(run) - return _c -} - -// SetTimeoutConfig provides a mock function with given fields: config -func (_m *MockClient) SetTimeoutConfig(config ws.ClientTimeoutConfig) { - _m.Called(config) -} - -// MockClient_SetTimeoutConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetTimeoutConfig' -type MockClient_SetTimeoutConfig_Call struct { - *mock.Call -} - -// SetTimeoutConfig is a helper method to define mock.On call -// - config ws.ClientTimeoutConfig -func (_e *MockClient_Expecter) SetTimeoutConfig(config interface{}) *MockClient_SetTimeoutConfig_Call { - return &MockClient_SetTimeoutConfig_Call{Call: _e.mock.On("SetTimeoutConfig", config)} -} - -func (_c *MockClient_SetTimeoutConfig_Call) Run(run func(config ws.ClientTimeoutConfig)) *MockClient_SetTimeoutConfig_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ws.ClientTimeoutConfig)) - }) - return _c -} - -func (_c *MockClient_SetTimeoutConfig_Call) Return() *MockClient_SetTimeoutConfig_Call { - _c.Call.Return() - return _c -} - -func (_c *MockClient_SetTimeoutConfig_Call) RunAndReturn(run func(ws.ClientTimeoutConfig)) *MockClient_SetTimeoutConfig_Call { - _c.Run(run) - return _c -} - -// Start provides a mock function with given fields: url -func (_m *MockClient) Start(url string) error { - ret := _m.Called(url) - - if len(ret) == 0 { - panic("no return value specified for Start") - } - - var r0 error - if rf, ok := ret.Get(0).(func(string) error); ok { - r0 = rf(url) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockClient_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' -type MockClient_Start_Call struct { - *mock.Call -} - -// Start is a helper method to define mock.On call -// - url string -func (_e *MockClient_Expecter) Start(url interface{}) *MockClient_Start_Call { - return &MockClient_Start_Call{Call: _e.mock.On("Start", url)} -} - -func (_c *MockClient_Start_Call) Run(run func(url string)) *MockClient_Start_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *MockClient_Start_Call) Return(_a0 error) *MockClient_Start_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockClient_Start_Call) RunAndReturn(run func(string) error) *MockClient_Start_Call { - _c.Call.Return(run) - return _c -} - -// StartWithRetries provides a mock function with given fields: url -func (_m *MockClient) StartWithRetries(url string) { - _m.Called(url) -} - -// MockClient_StartWithRetries_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartWithRetries' -type MockClient_StartWithRetries_Call struct { - *mock.Call -} - -// StartWithRetries is a helper method to define mock.On call -// - url string -func (_e *MockClient_Expecter) StartWithRetries(url interface{}) *MockClient_StartWithRetries_Call { - return &MockClient_StartWithRetries_Call{Call: _e.mock.On("StartWithRetries", url)} -} - -func (_c *MockClient_StartWithRetries_Call) Run(run func(url string)) *MockClient_StartWithRetries_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *MockClient_StartWithRetries_Call) Return() *MockClient_StartWithRetries_Call { - _c.Call.Return() - return _c -} - -func (_c *MockClient_StartWithRetries_Call) RunAndReturn(run func(string)) *MockClient_StartWithRetries_Call { - _c.Run(run) - return _c -} - -// Stop provides a mock function with no fields -func (_m *MockClient) Stop() { - _m.Called() -} - -// MockClient_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop' -type MockClient_Stop_Call struct { - *mock.Call -} - -// Stop is a helper method to define mock.On call -func (_e *MockClient_Expecter) Stop() *MockClient_Stop_Call { - return &MockClient_Stop_Call{Call: _e.mock.On("Stop")} -} - -func (_c *MockClient_Stop_Call) Run(run func()) *MockClient_Stop_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockClient_Stop_Call) Return() *MockClient_Stop_Call { - _c.Call.Return() - return _c -} - -func (_c *MockClient_Stop_Call) RunAndReturn(run func()) *MockClient_Stop_Call { - _c.Run(run) - return _c -} - -// Write provides a mock function with given fields: data -func (_m *MockClient) Write(data []byte) error { - ret := _m.Called(data) - - if len(ret) == 0 { - panic("no return value specified for Write") - } - - var r0 error - if rf, ok := ret.Get(0).(func([]byte) error); ok { - r0 = rf(data) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockClient_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write' -type MockClient_Write_Call struct { - *mock.Call -} - -// Write is a helper method to define mock.On call -// - data []byte -func (_e *MockClient_Expecter) Write(data interface{}) *MockClient_Write_Call { - return &MockClient_Write_Call{Call: _e.mock.On("Write", data)} -} - -func (_c *MockClient_Write_Call) Run(run func(data []byte)) *MockClient_Write_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].([]byte)) - }) - return _c -} - -func (_c *MockClient_Write_Call) Return(_a0 error) *MockClient_Write_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockClient_Write_Call) RunAndReturn(run func([]byte) error) *MockClient_Write_Call { - _c.Call.Return(run) - return _c -} - -// NewMockClient creates a new instance of MockClient. 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 NewMockClient(t interface { - mock.TestingT - Cleanup(func()) -}) *MockClient { - mock := &MockClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ws/mocks/mock_ClientOpt.go b/ws/mocks/mock_ClientOpt.go deleted file mode 100644 index 2272797c..00000000 --- a/ws/mocks/mock_ClientOpt.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// MockClientOpt is an autogenerated mock type for the ClientOpt type -type MockClientOpt struct { - mock.Mock -} - -type MockClientOpt_Expecter struct { - mock *mock.Mock -} - -func (_m *MockClientOpt) EXPECT() *MockClientOpt_Expecter { - return &MockClientOpt_Expecter{mock: &_m.Mock} -} - -// Execute provides a mock function with given fields: c -func (_m *MockClientOpt) Execute(c *ws.client) { - _m.Called(c) -} - -// MockClientOpt_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute' -type MockClientOpt_Execute_Call struct { - *mock.Call -} - -// Execute is a helper method to define mock.On call -// - c *ws.client -func (_e *MockClientOpt_Expecter) Execute(c interface{}) *MockClientOpt_Execute_Call { - return &MockClientOpt_Execute_Call{Call: _e.mock.On("Execute", c)} -} - -func (_c *MockClientOpt_Execute_Call) Run(run func(c *ws.client)) *MockClientOpt_Execute_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*ws.client)) - }) - return _c -} - -func (_c *MockClientOpt_Execute_Call) Return() *MockClientOpt_Execute_Call { - _c.Call.Return() - return _c -} - -func (_c *MockClientOpt_Execute_Call) RunAndReturn(run func(*ws.client)) *MockClientOpt_Execute_Call { - _c.Run(run) - return _c -} - -// NewMockClientOpt creates a new instance of MockClientOpt. 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 NewMockClientOpt(t interface { - mock.TestingT - Cleanup(func()) -}) *MockClientOpt { - mock := &MockClientOpt{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ws/mocks/mock_ConnectedHandler.go b/ws/mocks/mock_ConnectedHandler.go deleted file mode 100644 index 51c89a66..00000000 --- a/ws/mocks/mock_ConnectedHandler.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - ws "github.com/lorenzodonini/ocpp-go/ws" - mock "github.com/stretchr/testify/mock" -) - -// MockConnectedHandler is an autogenerated mock type for the ConnectedHandler type -type MockConnectedHandler struct { - mock.Mock -} - -type MockConnectedHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockConnectedHandler) EXPECT() *MockConnectedHandler_Expecter { - return &MockConnectedHandler_Expecter{mock: &_m.Mock} -} - -// Execute provides a mock function with given fields: c -func (_m *MockConnectedHandler) Execute(c ws.Channel) { - _m.Called(c) -} - -// MockConnectedHandler_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute' -type MockConnectedHandler_Execute_Call struct { - *mock.Call -} - -// Execute is a helper method to define mock.On call -// - c ws.Channel -func (_e *MockConnectedHandler_Expecter) Execute(c interface{}) *MockConnectedHandler_Execute_Call { - return &MockConnectedHandler_Execute_Call{Call: _e.mock.On("Execute", c)} -} - -func (_c *MockConnectedHandler_Execute_Call) Run(run func(c ws.Channel)) *MockConnectedHandler_Execute_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ws.Channel)) - }) - return _c -} - -func (_c *MockConnectedHandler_Execute_Call) Return() *MockConnectedHandler_Execute_Call { - _c.Call.Return() - return _c -} - -func (_c *MockConnectedHandler_Execute_Call) RunAndReturn(run func(ws.Channel)) *MockConnectedHandler_Execute_Call { - _c.Run(run) - return _c -} - -// NewMockConnectedHandler creates a new instance of MockConnectedHandler. 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 NewMockConnectedHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockConnectedHandler { - mock := &MockConnectedHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ws/mocks/mock_DisconnectedHandler.go b/ws/mocks/mock_DisconnectedHandler.go deleted file mode 100644 index a2026741..00000000 --- a/ws/mocks/mock_DisconnectedHandler.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - ws "github.com/lorenzodonini/ocpp-go/ws" - mock "github.com/stretchr/testify/mock" -) - -// MockDisconnectedHandler is an autogenerated mock type for the DisconnectedHandler type -type MockDisconnectedHandler struct { - mock.Mock -} - -type MockDisconnectedHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockDisconnectedHandler) EXPECT() *MockDisconnectedHandler_Expecter { - return &MockDisconnectedHandler_Expecter{mock: &_m.Mock} -} - -// Execute provides a mock function with given fields: c, err -func (_m *MockDisconnectedHandler) Execute(c ws.Channel, err error) { - _m.Called(c, err) -} - -// MockDisconnectedHandler_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute' -type MockDisconnectedHandler_Execute_Call struct { - *mock.Call -} - -// Execute is a helper method to define mock.On call -// - c ws.Channel -// - err error -func (_e *MockDisconnectedHandler_Expecter) Execute(c interface{}, err interface{}) *MockDisconnectedHandler_Execute_Call { - return &MockDisconnectedHandler_Execute_Call{Call: _e.mock.On("Execute", c, err)} -} - -func (_c *MockDisconnectedHandler_Execute_Call) Run(run func(c ws.Channel, err error)) *MockDisconnectedHandler_Execute_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ws.Channel), args[1].(error)) - }) - return _c -} - -func (_c *MockDisconnectedHandler_Execute_Call) Return() *MockDisconnectedHandler_Execute_Call { - _c.Call.Return() - return _c -} - -func (_c *MockDisconnectedHandler_Execute_Call) RunAndReturn(run func(ws.Channel, error)) *MockDisconnectedHandler_Execute_Call { - _c.Run(run) - return _c -} - -// NewMockDisconnectedHandler creates a new instance of MockDisconnectedHandler. 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 NewMockDisconnectedHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockDisconnectedHandler { - mock := &MockDisconnectedHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ws/mocks/mock_ErrorHandler.go b/ws/mocks/mock_ErrorHandler.go deleted file mode 100644 index 2f289861..00000000 --- a/ws/mocks/mock_ErrorHandler.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - ws "github.com/lorenzodonini/ocpp-go/ws" - mock "github.com/stretchr/testify/mock" -) - -// MockErrorHandler is an autogenerated mock type for the ErrorHandler type -type MockErrorHandler struct { - mock.Mock -} - -type MockErrorHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockErrorHandler) EXPECT() *MockErrorHandler_Expecter { - return &MockErrorHandler_Expecter{mock: &_m.Mock} -} - -// Execute provides a mock function with given fields: c, err -func (_m *MockErrorHandler) Execute(c ws.Channel, err error) { - _m.Called(c, err) -} - -// MockErrorHandler_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute' -type MockErrorHandler_Execute_Call struct { - *mock.Call -} - -// Execute is a helper method to define mock.On call -// - c ws.Channel -// - err error -func (_e *MockErrorHandler_Expecter) Execute(c interface{}, err interface{}) *MockErrorHandler_Execute_Call { - return &MockErrorHandler_Execute_Call{Call: _e.mock.On("Execute", c, err)} -} - -func (_c *MockErrorHandler_Execute_Call) Run(run func(c ws.Channel, err error)) *MockErrorHandler_Execute_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ws.Channel), args[1].(error)) - }) - return _c -} - -func (_c *MockErrorHandler_Execute_Call) Return() *MockErrorHandler_Execute_Call { - _c.Call.Return() - return _c -} - -func (_c *MockErrorHandler_Execute_Call) RunAndReturn(run func(ws.Channel, error)) *MockErrorHandler_Execute_Call { - _c.Run(run) - return _c -} - -// NewMockErrorHandler creates a new instance of MockErrorHandler. 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 NewMockErrorHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockErrorHandler { - mock := &MockErrorHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ws/mocks/mock_MessageHandler.go b/ws/mocks/mock_MessageHandler.go deleted file mode 100644 index 7f1000c5..00000000 --- a/ws/mocks/mock_MessageHandler.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - ws "github.com/lorenzodonini/ocpp-go/ws" - mock "github.com/stretchr/testify/mock" -) - -// MockMessageHandler is an autogenerated mock type for the MessageHandler type -type MockMessageHandler struct { - mock.Mock -} - -type MockMessageHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MockMessageHandler) EXPECT() *MockMessageHandler_Expecter { - return &MockMessageHandler_Expecter{mock: &_m.Mock} -} - -// Execute provides a mock function with given fields: c, data -func (_m *MockMessageHandler) Execute(c ws.Channel, data []byte) error { - ret := _m.Called(c, data) - - if len(ret) == 0 { - panic("no return value specified for Execute") - } - - var r0 error - if rf, ok := ret.Get(0).(func(ws.Channel, []byte) error); ok { - r0 = rf(c, data) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockMessageHandler_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute' -type MockMessageHandler_Execute_Call struct { - *mock.Call -} - -// Execute is a helper method to define mock.On call -// - c ws.Channel -// - data []byte -func (_e *MockMessageHandler_Expecter) Execute(c interface{}, data interface{}) *MockMessageHandler_Execute_Call { - return &MockMessageHandler_Execute_Call{Call: _e.mock.On("Execute", c, data)} -} - -func (_c *MockMessageHandler_Execute_Call) Run(run func(c ws.Channel, data []byte)) *MockMessageHandler_Execute_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ws.Channel), args[1].([]byte)) - }) - return _c -} - -func (_c *MockMessageHandler_Execute_Call) Return(_a0 error) *MockMessageHandler_Execute_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockMessageHandler_Execute_Call) RunAndReturn(run func(ws.Channel, []byte) error) *MockMessageHandler_Execute_Call { - _c.Call.Return(run) - return _c -} - -// NewMockMessageHandler creates a new instance of MockMessageHandler. 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 NewMockMessageHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MockMessageHandler { - mock := &MockMessageHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ws/mocks/mock_Server.go b/ws/mocks/mock_Server.go deleted file mode 100644 index f8ffe9aa..00000000 --- a/ws/mocks/mock_Server.go +++ /dev/null @@ -1,650 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - net "net" - http "net/http" - - mock "github.com/stretchr/testify/mock" - - websocket "github.com/gorilla/websocket" - - ws "github.com/lorenzodonini/ocpp-go/ws" -) - -// MockServer is an autogenerated mock type for the Server type -type MockServer struct { - mock.Mock -} - -type MockServer_Expecter struct { - mock *mock.Mock -} - -func (_m *MockServer) EXPECT() *MockServer_Expecter { - return &MockServer_Expecter{mock: &_m.Mock} -} - -// AddSupportedSubprotocol provides a mock function with given fields: subProto -func (_m *MockServer) AddSupportedSubprotocol(subProto string) { - _m.Called(subProto) -} - -// MockServer_AddSupportedSubprotocol_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddSupportedSubprotocol' -type MockServer_AddSupportedSubprotocol_Call struct { - *mock.Call -} - -// AddSupportedSubprotocol is a helper method to define mock.On call -// - subProto string -func (_e *MockServer_Expecter) AddSupportedSubprotocol(subProto interface{}) *MockServer_AddSupportedSubprotocol_Call { - return &MockServer_AddSupportedSubprotocol_Call{Call: _e.mock.On("AddSupportedSubprotocol", subProto)} -} - -func (_c *MockServer_AddSupportedSubprotocol_Call) Run(run func(subProto string)) *MockServer_AddSupportedSubprotocol_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *MockServer_AddSupportedSubprotocol_Call) Return() *MockServer_AddSupportedSubprotocol_Call { - _c.Call.Return() - return _c -} - -func (_c *MockServer_AddSupportedSubprotocol_Call) RunAndReturn(run func(string)) *MockServer_AddSupportedSubprotocol_Call { - _c.Run(run) - return _c -} - -// Addr provides a mock function with no fields -func (_m *MockServer) Addr() *net.TCPAddr { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Addr") - } - - var r0 *net.TCPAddr - if rf, ok := ret.Get(0).(func() *net.TCPAddr); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*net.TCPAddr) - } - } - - return r0 -} - -// MockServer_Addr_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Addr' -type MockServer_Addr_Call struct { - *mock.Call -} - -// Addr is a helper method to define mock.On call -func (_e *MockServer_Expecter) Addr() *MockServer_Addr_Call { - return &MockServer_Addr_Call{Call: _e.mock.On("Addr")} -} - -func (_c *MockServer_Addr_Call) Run(run func()) *MockServer_Addr_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockServer_Addr_Call) Return(_a0 *net.TCPAddr) *MockServer_Addr_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockServer_Addr_Call) RunAndReturn(run func() *net.TCPAddr) *MockServer_Addr_Call { - _c.Call.Return(run) - return _c -} - -// Errors provides a mock function with no fields -func (_m *MockServer) Errors() <-chan error { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Errors") - } - - var r0 <-chan error - if rf, ok := ret.Get(0).(func() <-chan error); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(<-chan error) - } - } - - return r0 -} - -// MockServer_Errors_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Errors' -type MockServer_Errors_Call struct { - *mock.Call -} - -// Errors is a helper method to define mock.On call -func (_e *MockServer_Expecter) Errors() *MockServer_Errors_Call { - return &MockServer_Errors_Call{Call: _e.mock.On("Errors")} -} - -func (_c *MockServer_Errors_Call) Run(run func()) *MockServer_Errors_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockServer_Errors_Call) Return(_a0 <-chan error) *MockServer_Errors_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockServer_Errors_Call) RunAndReturn(run func() <-chan error) *MockServer_Errors_Call { - _c.Call.Return(run) - return _c -} - -// GetChannel provides a mock function with given fields: websocketId -func (_m *MockServer) GetChannel(websocketId string) (ws.Channel, bool) { - ret := _m.Called(websocketId) - - if len(ret) == 0 { - panic("no return value specified for GetChannel") - } - - var r0 ws.Channel - var r1 bool - if rf, ok := ret.Get(0).(func(string) (ws.Channel, bool)); ok { - return rf(websocketId) - } - if rf, ok := ret.Get(0).(func(string) ws.Channel); ok { - r0 = rf(websocketId) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(ws.Channel) - } - } - - if rf, ok := ret.Get(1).(func(string) bool); ok { - r1 = rf(websocketId) - } else { - r1 = ret.Get(1).(bool) - } - - return r0, r1 -} - -// MockServer_GetChannel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetChannel' -type MockServer_GetChannel_Call struct { - *mock.Call -} - -// GetChannel is a helper method to define mock.On call -// - websocketId string -func (_e *MockServer_Expecter) GetChannel(websocketId interface{}) *MockServer_GetChannel_Call { - return &MockServer_GetChannel_Call{Call: _e.mock.On("GetChannel", websocketId)} -} - -func (_c *MockServer_GetChannel_Call) Run(run func(websocketId string)) *MockServer_GetChannel_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *MockServer_GetChannel_Call) Return(_a0 ws.Channel, _a1 bool) *MockServer_GetChannel_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockServer_GetChannel_Call) RunAndReturn(run func(string) (ws.Channel, bool)) *MockServer_GetChannel_Call { - _c.Call.Return(run) - return _c -} - -// SetBasicAuthHandler provides a mock function with given fields: handler -func (_m *MockServer) SetBasicAuthHandler(handler func(string, string) bool) { - _m.Called(handler) -} - -// MockServer_SetBasicAuthHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetBasicAuthHandler' -type MockServer_SetBasicAuthHandler_Call struct { - *mock.Call -} - -// SetBasicAuthHandler is a helper method to define mock.On call -// - handler func(string , string) bool -func (_e *MockServer_Expecter) SetBasicAuthHandler(handler interface{}) *MockServer_SetBasicAuthHandler_Call { - return &MockServer_SetBasicAuthHandler_Call{Call: _e.mock.On("SetBasicAuthHandler", handler)} -} - -func (_c *MockServer_SetBasicAuthHandler_Call) Run(run func(handler func(string, string) bool)) *MockServer_SetBasicAuthHandler_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(func(string, string) bool)) - }) - return _c -} - -func (_c *MockServer_SetBasicAuthHandler_Call) Return() *MockServer_SetBasicAuthHandler_Call { - _c.Call.Return() - return _c -} - -func (_c *MockServer_SetBasicAuthHandler_Call) RunAndReturn(run func(func(string, string) bool)) *MockServer_SetBasicAuthHandler_Call { - _c.Run(run) - return _c -} - -// SetChargePointIdResolver provides a mock function with given fields: resolver -func (_m *MockServer) SetChargePointIdResolver(resolver func(*http.Request) (string, error)) { - _m.Called(resolver) -} - -// MockServer_SetChargePointIdResolver_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetChargePointIdResolver' -type MockServer_SetChargePointIdResolver_Call struct { - *mock.Call -} - -// SetChargePointIdResolver is a helper method to define mock.On call -// - resolver func(*http.Request)(string , error) -func (_e *MockServer_Expecter) SetChargePointIdResolver(resolver interface{}) *MockServer_SetChargePointIdResolver_Call { - return &MockServer_SetChargePointIdResolver_Call{Call: _e.mock.On("SetChargePointIdResolver", resolver)} -} - -func (_c *MockServer_SetChargePointIdResolver_Call) Run(run func(resolver func(*http.Request) (string, error))) *MockServer_SetChargePointIdResolver_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(func(*http.Request) (string, error))) - }) - return _c -} - -func (_c *MockServer_SetChargePointIdResolver_Call) Return() *MockServer_SetChargePointIdResolver_Call { - _c.Call.Return() - return _c -} - -func (_c *MockServer_SetChargePointIdResolver_Call) RunAndReturn(run func(func(*http.Request) (string, error))) *MockServer_SetChargePointIdResolver_Call { - _c.Run(run) - return _c -} - -// SetCheckClientHandler provides a mock function with given fields: handler -func (_m *MockServer) SetCheckClientHandler(handler ws.CheckClientHandler) { - _m.Called(handler) -} - -// MockServer_SetCheckClientHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCheckClientHandler' -type MockServer_SetCheckClientHandler_Call struct { - *mock.Call -} - -// SetCheckClientHandler is a helper method to define mock.On call -// - handler ws.CheckClientHandler -func (_e *MockServer_Expecter) SetCheckClientHandler(handler interface{}) *MockServer_SetCheckClientHandler_Call { - return &MockServer_SetCheckClientHandler_Call{Call: _e.mock.On("SetCheckClientHandler", handler)} -} - -func (_c *MockServer_SetCheckClientHandler_Call) Run(run func(handler ws.CheckClientHandler)) *MockServer_SetCheckClientHandler_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ws.CheckClientHandler)) - }) - return _c -} - -func (_c *MockServer_SetCheckClientHandler_Call) Return() *MockServer_SetCheckClientHandler_Call { - _c.Call.Return() - return _c -} - -func (_c *MockServer_SetCheckClientHandler_Call) RunAndReturn(run func(ws.CheckClientHandler)) *MockServer_SetCheckClientHandler_Call { - _c.Run(run) - return _c -} - -// SetCheckOriginHandler provides a mock function with given fields: handler -func (_m *MockServer) SetCheckOriginHandler(handler func(*http.Request) bool) { - _m.Called(handler) -} - -// MockServer_SetCheckOriginHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCheckOriginHandler' -type MockServer_SetCheckOriginHandler_Call struct { - *mock.Call -} - -// SetCheckOriginHandler is a helper method to define mock.On call -// - handler func(*http.Request) bool -func (_e *MockServer_Expecter) SetCheckOriginHandler(handler interface{}) *MockServer_SetCheckOriginHandler_Call { - return &MockServer_SetCheckOriginHandler_Call{Call: _e.mock.On("SetCheckOriginHandler", handler)} -} - -func (_c *MockServer_SetCheckOriginHandler_Call) Run(run func(handler func(*http.Request) bool)) *MockServer_SetCheckOriginHandler_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(func(*http.Request) bool)) - }) - return _c -} - -func (_c *MockServer_SetCheckOriginHandler_Call) Return() *MockServer_SetCheckOriginHandler_Call { - _c.Call.Return() - return _c -} - -func (_c *MockServer_SetCheckOriginHandler_Call) RunAndReturn(run func(func(*http.Request) bool)) *MockServer_SetCheckOriginHandler_Call { - _c.Run(run) - return _c -} - -// SetDisconnectedClientHandler provides a mock function with given fields: handler -func (_m *MockServer) SetDisconnectedClientHandler(handler func(ws.Channel)) { - _m.Called(handler) -} - -// MockServer_SetDisconnectedClientHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDisconnectedClientHandler' -type MockServer_SetDisconnectedClientHandler_Call struct { - *mock.Call -} - -// SetDisconnectedClientHandler is a helper method to define mock.On call -// - handler func(ws.Channel) -func (_e *MockServer_Expecter) SetDisconnectedClientHandler(handler interface{}) *MockServer_SetDisconnectedClientHandler_Call { - return &MockServer_SetDisconnectedClientHandler_Call{Call: _e.mock.On("SetDisconnectedClientHandler", handler)} -} - -func (_c *MockServer_SetDisconnectedClientHandler_Call) Run(run func(handler func(ws.Channel))) *MockServer_SetDisconnectedClientHandler_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(func(ws.Channel))) - }) - return _c -} - -func (_c *MockServer_SetDisconnectedClientHandler_Call) Return() *MockServer_SetDisconnectedClientHandler_Call { - _c.Call.Return() - return _c -} - -func (_c *MockServer_SetDisconnectedClientHandler_Call) RunAndReturn(run func(func(ws.Channel))) *MockServer_SetDisconnectedClientHandler_Call { - _c.Run(run) - return _c -} - -// SetMessageHandler provides a mock function with given fields: handler -func (_m *MockServer) SetMessageHandler(handler ws.MessageHandler) { - _m.Called(handler) -} - -// MockServer_SetMessageHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetMessageHandler' -type MockServer_SetMessageHandler_Call struct { - *mock.Call -} - -// SetMessageHandler is a helper method to define mock.On call -// - handler ws.MessageHandler -func (_e *MockServer_Expecter) SetMessageHandler(handler interface{}) *MockServer_SetMessageHandler_Call { - return &MockServer_SetMessageHandler_Call{Call: _e.mock.On("SetMessageHandler", handler)} -} - -func (_c *MockServer_SetMessageHandler_Call) Run(run func(handler ws.MessageHandler)) *MockServer_SetMessageHandler_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ws.MessageHandler)) - }) - return _c -} - -func (_c *MockServer_SetMessageHandler_Call) Return() *MockServer_SetMessageHandler_Call { - _c.Call.Return() - return _c -} - -func (_c *MockServer_SetMessageHandler_Call) RunAndReturn(run func(ws.MessageHandler)) *MockServer_SetMessageHandler_Call { - _c.Run(run) - return _c -} - -// SetNewClientHandler provides a mock function with given fields: handler -func (_m *MockServer) SetNewClientHandler(handler ws.ConnectedHandler) { - _m.Called(handler) -} - -// MockServer_SetNewClientHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetNewClientHandler' -type MockServer_SetNewClientHandler_Call struct { - *mock.Call -} - -// SetNewClientHandler is a helper method to define mock.On call -// - handler ws.ConnectedHandler -func (_e *MockServer_Expecter) SetNewClientHandler(handler interface{}) *MockServer_SetNewClientHandler_Call { - return &MockServer_SetNewClientHandler_Call{Call: _e.mock.On("SetNewClientHandler", handler)} -} - -func (_c *MockServer_SetNewClientHandler_Call) Run(run func(handler ws.ConnectedHandler)) *MockServer_SetNewClientHandler_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ws.ConnectedHandler)) - }) - return _c -} - -func (_c *MockServer_SetNewClientHandler_Call) Return() *MockServer_SetNewClientHandler_Call { - _c.Call.Return() - return _c -} - -func (_c *MockServer_SetNewClientHandler_Call) RunAndReturn(run func(ws.ConnectedHandler)) *MockServer_SetNewClientHandler_Call { - _c.Run(run) - return _c -} - -// SetTimeoutConfig provides a mock function with given fields: config -func (_m *MockServer) SetTimeoutConfig(config ws.ServerTimeoutConfig) { - _m.Called(config) -} - -// MockServer_SetTimeoutConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetTimeoutConfig' -type MockServer_SetTimeoutConfig_Call struct { - *mock.Call -} - -// SetTimeoutConfig is a helper method to define mock.On call -// - config ws.ServerTimeoutConfig -func (_e *MockServer_Expecter) SetTimeoutConfig(config interface{}) *MockServer_SetTimeoutConfig_Call { - return &MockServer_SetTimeoutConfig_Call{Call: _e.mock.On("SetTimeoutConfig", config)} -} - -func (_c *MockServer_SetTimeoutConfig_Call) Run(run func(config ws.ServerTimeoutConfig)) *MockServer_SetTimeoutConfig_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ws.ServerTimeoutConfig)) - }) - return _c -} - -func (_c *MockServer_SetTimeoutConfig_Call) Return() *MockServer_SetTimeoutConfig_Call { - _c.Call.Return() - return _c -} - -func (_c *MockServer_SetTimeoutConfig_Call) RunAndReturn(run func(ws.ServerTimeoutConfig)) *MockServer_SetTimeoutConfig_Call { - _c.Run(run) - return _c -} - -// Start provides a mock function with given fields: port, listenPath -func (_m *MockServer) Start(port int, listenPath string) { - _m.Called(port, listenPath) -} - -// MockServer_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' -type MockServer_Start_Call struct { - *mock.Call -} - -// Start is a helper method to define mock.On call -// - port int -// - listenPath string -func (_e *MockServer_Expecter) Start(port interface{}, listenPath interface{}) *MockServer_Start_Call { - return &MockServer_Start_Call{Call: _e.mock.On("Start", port, listenPath)} -} - -func (_c *MockServer_Start_Call) Run(run func(port int, listenPath string)) *MockServer_Start_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(int), args[1].(string)) - }) - return _c -} - -func (_c *MockServer_Start_Call) Return() *MockServer_Start_Call { - _c.Call.Return() - return _c -} - -func (_c *MockServer_Start_Call) RunAndReturn(run func(int, string)) *MockServer_Start_Call { - _c.Run(run) - return _c -} - -// Stop provides a mock function with no fields -func (_m *MockServer) Stop() { - _m.Called() -} - -// MockServer_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop' -type MockServer_Stop_Call struct { - *mock.Call -} - -// Stop is a helper method to define mock.On call -func (_e *MockServer_Expecter) Stop() *MockServer_Stop_Call { - return &MockServer_Stop_Call{Call: _e.mock.On("Stop")} -} - -func (_c *MockServer_Stop_Call) Run(run func()) *MockServer_Stop_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockServer_Stop_Call) Return() *MockServer_Stop_Call { - _c.Call.Return() - return _c -} - -func (_c *MockServer_Stop_Call) RunAndReturn(run func()) *MockServer_Stop_Call { - _c.Run(run) - return _c -} - -// StopConnection provides a mock function with given fields: id, closeError -func (_m *MockServer) StopConnection(id string, closeError websocket.CloseError) error { - ret := _m.Called(id, closeError) - - if len(ret) == 0 { - panic("no return value specified for StopConnection") - } - - var r0 error - if rf, ok := ret.Get(0).(func(string, websocket.CloseError) error); ok { - r0 = rf(id, closeError) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockServer_StopConnection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StopConnection' -type MockServer_StopConnection_Call struct { - *mock.Call -} - -// StopConnection is a helper method to define mock.On call -// - id string -// - closeError websocket.CloseError -func (_e *MockServer_Expecter) StopConnection(id interface{}, closeError interface{}) *MockServer_StopConnection_Call { - return &MockServer_StopConnection_Call{Call: _e.mock.On("StopConnection", id, closeError)} -} - -func (_c *MockServer_StopConnection_Call) Run(run func(id string, closeError websocket.CloseError)) *MockServer_StopConnection_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(websocket.CloseError)) - }) - return _c -} - -func (_c *MockServer_StopConnection_Call) Return(_a0 error) *MockServer_StopConnection_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockServer_StopConnection_Call) RunAndReturn(run func(string, websocket.CloseError) error) *MockServer_StopConnection_Call { - _c.Call.Return(run) - return _c -} - -// Write provides a mock function with given fields: webSocketId, data -func (_m *MockServer) Write(webSocketId string, data []byte) error { - ret := _m.Called(webSocketId, data) - - if len(ret) == 0 { - panic("no return value specified for Write") - } - - var r0 error - if rf, ok := ret.Get(0).(func(string, []byte) error); ok { - r0 = rf(webSocketId, data) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockServer_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write' -type MockServer_Write_Call struct { - *mock.Call -} - -// Write is a helper method to define mock.On call -// - webSocketId string -// - data []byte -func (_e *MockServer_Expecter) Write(webSocketId interface{}, data interface{}) *MockServer_Write_Call { - return &MockServer_Write_Call{Call: _e.mock.On("Write", webSocketId, data)} -} - -func (_c *MockServer_Write_Call) Run(run func(webSocketId string, data []byte)) *MockServer_Write_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].([]byte)) - }) - return _c -} - -func (_c *MockServer_Write_Call) Return(_a0 error) *MockServer_Write_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockServer_Write_Call) RunAndReturn(run func(string, []byte) error) *MockServer_Write_Call { - _c.Call.Return(run) - return _c -} - -// NewMockServer creates a new instance of MockServer. 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 NewMockServer(t interface { - mock.TestingT - Cleanup(func()) -}) *MockServer { - mock := &MockServer{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ws/mocks/mock_ServerOpt.go b/ws/mocks/mock_ServerOpt.go deleted file mode 100644 index 8c1ce686..00000000 --- a/ws/mocks/mock_ServerOpt.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// MockServerOpt is an autogenerated mock type for the ServerOpt type -type MockServerOpt struct { - mock.Mock -} - -type MockServerOpt_Expecter struct { - mock *mock.Mock -} - -func (_m *MockServerOpt) EXPECT() *MockServerOpt_Expecter { - return &MockServerOpt_Expecter{mock: &_m.Mock} -} - -// Execute provides a mock function with given fields: s -func (_m *MockServerOpt) Execute(s *ws.server) { - _m.Called(s) -} - -// MockServerOpt_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute' -type MockServerOpt_Execute_Call struct { - *mock.Call -} - -// Execute is a helper method to define mock.On call -// - s *ws.server -func (_e *MockServerOpt_Expecter) Execute(s interface{}) *MockServerOpt_Execute_Call { - return &MockServerOpt_Execute_Call{Call: _e.mock.On("Execute", s)} -} - -func (_c *MockServerOpt_Execute_Call) Run(run func(s *ws.server)) *MockServerOpt_Execute_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*ws.server)) - }) - return _c -} - -func (_c *MockServerOpt_Execute_Call) Return() *MockServerOpt_Execute_Call { - _c.Call.Return() - return _c -} - -func (_c *MockServerOpt_Execute_Call) RunAndReturn(run func(*ws.server)) *MockServerOpt_Execute_Call { - _c.Run(run) - return _c -} - -// NewMockServerOpt creates a new instance of MockServerOpt. 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 NewMockServerOpt(t interface { - mock.TestingT - Cleanup(func()) -}) *MockServerOpt { - mock := &MockServerOpt{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ws/mocks/mock_WsClient.go b/ws/mocks/mock_WsClient.go deleted file mode 100644 index 40a32fb9..00000000 --- a/ws/mocks/mock_WsClient.go +++ /dev/null @@ -1,550 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - ws "github.com/lorenzodonini/ocpp-go/ws" - mock "github.com/stretchr/testify/mock" -) - -// MockWsClient is an autogenerated mock type for the WsClient type -type MockWsClient struct { - mock.Mock -} - -type MockWsClient_Expecter struct { - mock *mock.Mock -} - -func (_m *MockWsClient) EXPECT() *MockWsClient_Expecter { - return &MockWsClient_Expecter{mock: &_m.Mock} -} - -// AddOption provides a mock function with given fields: option -func (_m *MockWsClient) AddOption(option interface{}) { - _m.Called(option) -} - -// MockWsClient_AddOption_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddOption' -type MockWsClient_AddOption_Call struct { - *mock.Call -} - -// AddOption is a helper method to define mock.On call -// - option interface{} -func (_e *MockWsClient_Expecter) AddOption(option interface{}) *MockWsClient_AddOption_Call { - return &MockWsClient_AddOption_Call{Call: _e.mock.On("AddOption", option)} -} - -func (_c *MockWsClient_AddOption_Call) Run(run func(option interface{})) *MockWsClient_AddOption_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(interface{})) - }) - return _c -} - -func (_c *MockWsClient_AddOption_Call) Return() *MockWsClient_AddOption_Call { - _c.Call.Return() - return _c -} - -func (_c *MockWsClient_AddOption_Call) RunAndReturn(run func(interface{})) *MockWsClient_AddOption_Call { - _c.Run(run) - return _c -} - -// Errors provides a mock function with no fields -func (_m *MockWsClient) Errors() <-chan error { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Errors") - } - - var r0 <-chan error - if rf, ok := ret.Get(0).(func() <-chan error); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(<-chan error) - } - } - - return r0 -} - -// MockWsClient_Errors_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Errors' -type MockWsClient_Errors_Call struct { - *mock.Call -} - -// Errors is a helper method to define mock.On call -func (_e *MockWsClient_Expecter) Errors() *MockWsClient_Errors_Call { - return &MockWsClient_Errors_Call{Call: _e.mock.On("Errors")} -} - -func (_c *MockWsClient_Errors_Call) Run(run func()) *MockWsClient_Errors_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockWsClient_Errors_Call) Return(_a0 <-chan error) *MockWsClient_Errors_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockWsClient_Errors_Call) RunAndReturn(run func() <-chan error) *MockWsClient_Errors_Call { - _c.Call.Return(run) - return _c -} - -// IsConnected provides a mock function with no fields -func (_m *MockWsClient) IsConnected() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for IsConnected") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// MockWsClient_IsConnected_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsConnected' -type MockWsClient_IsConnected_Call struct { - *mock.Call -} - -// IsConnected is a helper method to define mock.On call -func (_e *MockWsClient_Expecter) IsConnected() *MockWsClient_IsConnected_Call { - return &MockWsClient_IsConnected_Call{Call: _e.mock.On("IsConnected")} -} - -func (_c *MockWsClient_IsConnected_Call) Run(run func()) *MockWsClient_IsConnected_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockWsClient_IsConnected_Call) Return(_a0 bool) *MockWsClient_IsConnected_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockWsClient_IsConnected_Call) RunAndReturn(run func() bool) *MockWsClient_IsConnected_Call { - _c.Call.Return(run) - return _c -} - -// SetBasicAuth provides a mock function with given fields: username, password -func (_m *MockWsClient) SetBasicAuth(username string, password string) { - _m.Called(username, password) -} - -// MockWsClient_SetBasicAuth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetBasicAuth' -type MockWsClient_SetBasicAuth_Call struct { - *mock.Call -} - -// SetBasicAuth is a helper method to define mock.On call -// - username string -// - password string -func (_e *MockWsClient_Expecter) SetBasicAuth(username interface{}, password interface{}) *MockWsClient_SetBasicAuth_Call { - return &MockWsClient_SetBasicAuth_Call{Call: _e.mock.On("SetBasicAuth", username, password)} -} - -func (_c *MockWsClient_SetBasicAuth_Call) Run(run func(username string, password string)) *MockWsClient_SetBasicAuth_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(string)) - }) - return _c -} - -func (_c *MockWsClient_SetBasicAuth_Call) Return() *MockWsClient_SetBasicAuth_Call { - _c.Call.Return() - return _c -} - -func (_c *MockWsClient_SetBasicAuth_Call) RunAndReturn(run func(string, string)) *MockWsClient_SetBasicAuth_Call { - _c.Run(run) - return _c -} - -// SetDisconnectedHandler provides a mock function with given fields: handler -func (_m *MockWsClient) SetDisconnectedHandler(handler func(error)) { - _m.Called(handler) -} - -// MockWsClient_SetDisconnectedHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDisconnectedHandler' -type MockWsClient_SetDisconnectedHandler_Call struct { - *mock.Call -} - -// SetDisconnectedHandler is a helper method to define mock.On call -// - handler func(error) -func (_e *MockWsClient_Expecter) SetDisconnectedHandler(handler interface{}) *MockWsClient_SetDisconnectedHandler_Call { - return &MockWsClient_SetDisconnectedHandler_Call{Call: _e.mock.On("SetDisconnectedHandler", handler)} -} - -func (_c *MockWsClient_SetDisconnectedHandler_Call) Run(run func(handler func(error))) *MockWsClient_SetDisconnectedHandler_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(func(error))) - }) - return _c -} - -func (_c *MockWsClient_SetDisconnectedHandler_Call) Return() *MockWsClient_SetDisconnectedHandler_Call { - _c.Call.Return() - return _c -} - -func (_c *MockWsClient_SetDisconnectedHandler_Call) RunAndReturn(run func(func(error))) *MockWsClient_SetDisconnectedHandler_Call { - _c.Run(run) - return _c -} - -// SetHeaderValue provides a mock function with given fields: key, value -func (_m *MockWsClient) SetHeaderValue(key string, value string) { - _m.Called(key, value) -} - -// MockWsClient_SetHeaderValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetHeaderValue' -type MockWsClient_SetHeaderValue_Call struct { - *mock.Call -} - -// SetHeaderValue is a helper method to define mock.On call -// - key string -// - value string -func (_e *MockWsClient_Expecter) SetHeaderValue(key interface{}, value interface{}) *MockWsClient_SetHeaderValue_Call { - return &MockWsClient_SetHeaderValue_Call{Call: _e.mock.On("SetHeaderValue", key, value)} -} - -func (_c *MockWsClient_SetHeaderValue_Call) Run(run func(key string, value string)) *MockWsClient_SetHeaderValue_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(string)) - }) - return _c -} - -func (_c *MockWsClient_SetHeaderValue_Call) Return() *MockWsClient_SetHeaderValue_Call { - _c.Call.Return() - return _c -} - -func (_c *MockWsClient_SetHeaderValue_Call) RunAndReturn(run func(string, string)) *MockWsClient_SetHeaderValue_Call { - _c.Run(run) - return _c -} - -// SetMessageHandler provides a mock function with given fields: handler -func (_m *MockWsClient) SetMessageHandler(handler func([]byte) error) { - _m.Called(handler) -} - -// MockWsClient_SetMessageHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetMessageHandler' -type MockWsClient_SetMessageHandler_Call struct { - *mock.Call -} - -// SetMessageHandler is a helper method to define mock.On call -// - handler func([]byte) error -func (_e *MockWsClient_Expecter) SetMessageHandler(handler interface{}) *MockWsClient_SetMessageHandler_Call { - return &MockWsClient_SetMessageHandler_Call{Call: _e.mock.On("SetMessageHandler", handler)} -} - -func (_c *MockWsClient_SetMessageHandler_Call) Run(run func(handler func([]byte) error)) *MockWsClient_SetMessageHandler_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(func([]byte) error)) - }) - return _c -} - -func (_c *MockWsClient_SetMessageHandler_Call) Return() *MockWsClient_SetMessageHandler_Call { - _c.Call.Return() - return _c -} - -func (_c *MockWsClient_SetMessageHandler_Call) RunAndReturn(run func(func([]byte) error)) *MockWsClient_SetMessageHandler_Call { - _c.Run(run) - return _c -} - -// SetReconnectedHandler provides a mock function with given fields: handler -func (_m *MockWsClient) SetReconnectedHandler(handler func()) { - _m.Called(handler) -} - -// MockWsClient_SetReconnectedHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetReconnectedHandler' -type MockWsClient_SetReconnectedHandler_Call struct { - *mock.Call -} - -// SetReconnectedHandler is a helper method to define mock.On call -// - handler func() -func (_e *MockWsClient_Expecter) SetReconnectedHandler(handler interface{}) *MockWsClient_SetReconnectedHandler_Call { - return &MockWsClient_SetReconnectedHandler_Call{Call: _e.mock.On("SetReconnectedHandler", handler)} -} - -func (_c *MockWsClient_SetReconnectedHandler_Call) Run(run func(handler func())) *MockWsClient_SetReconnectedHandler_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(func())) - }) - return _c -} - -func (_c *MockWsClient_SetReconnectedHandler_Call) Return() *MockWsClient_SetReconnectedHandler_Call { - _c.Call.Return() - return _c -} - -func (_c *MockWsClient_SetReconnectedHandler_Call) RunAndReturn(run func(func())) *MockWsClient_SetReconnectedHandler_Call { - _c.Run(run) - return _c -} - -// SetRequestedSubProtocol provides a mock function with given fields: subProto -func (_m *MockWsClient) SetRequestedSubProtocol(subProto string) { - _m.Called(subProto) -} - -// MockWsClient_SetRequestedSubProtocol_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetRequestedSubProtocol' -type MockWsClient_SetRequestedSubProtocol_Call struct { - *mock.Call -} - -// SetRequestedSubProtocol is a helper method to define mock.On call -// - subProto string -func (_e *MockWsClient_Expecter) SetRequestedSubProtocol(subProto interface{}) *MockWsClient_SetRequestedSubProtocol_Call { - return &MockWsClient_SetRequestedSubProtocol_Call{Call: _e.mock.On("SetRequestedSubProtocol", subProto)} -} - -func (_c *MockWsClient_SetRequestedSubProtocol_Call) Run(run func(subProto string)) *MockWsClient_SetRequestedSubProtocol_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *MockWsClient_SetRequestedSubProtocol_Call) Return() *MockWsClient_SetRequestedSubProtocol_Call { - _c.Call.Return() - return _c -} - -func (_c *MockWsClient_SetRequestedSubProtocol_Call) RunAndReturn(run func(string)) *MockWsClient_SetRequestedSubProtocol_Call { - _c.Run(run) - return _c -} - -// SetTimeoutConfig provides a mock function with given fields: config -func (_m *MockWsClient) SetTimeoutConfig(config ws.ClientTimeoutConfig) { - _m.Called(config) -} - -// MockWsClient_SetTimeoutConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetTimeoutConfig' -type MockWsClient_SetTimeoutConfig_Call struct { - *mock.Call -} - -// SetTimeoutConfig is a helper method to define mock.On call -// - config ws.ClientTimeoutConfig -func (_e *MockWsClient_Expecter) SetTimeoutConfig(config interface{}) *MockWsClient_SetTimeoutConfig_Call { - return &MockWsClient_SetTimeoutConfig_Call{Call: _e.mock.On("SetTimeoutConfig", config)} -} - -func (_c *MockWsClient_SetTimeoutConfig_Call) Run(run func(config ws.ClientTimeoutConfig)) *MockWsClient_SetTimeoutConfig_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ws.ClientTimeoutConfig)) - }) - return _c -} - -func (_c *MockWsClient_SetTimeoutConfig_Call) Return() *MockWsClient_SetTimeoutConfig_Call { - _c.Call.Return() - return _c -} - -func (_c *MockWsClient_SetTimeoutConfig_Call) RunAndReturn(run func(ws.ClientTimeoutConfig)) *MockWsClient_SetTimeoutConfig_Call { - _c.Run(run) - return _c -} - -// Start provides a mock function with given fields: url -func (_m *MockWsClient) Start(url string) error { - ret := _m.Called(url) - - if len(ret) == 0 { - panic("no return value specified for Start") - } - - var r0 error - if rf, ok := ret.Get(0).(func(string) error); ok { - r0 = rf(url) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockWsClient_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' -type MockWsClient_Start_Call struct { - *mock.Call -} - -// Start is a helper method to define mock.On call -// - url string -func (_e *MockWsClient_Expecter) Start(url interface{}) *MockWsClient_Start_Call { - return &MockWsClient_Start_Call{Call: _e.mock.On("Start", url)} -} - -func (_c *MockWsClient_Start_Call) Run(run func(url string)) *MockWsClient_Start_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *MockWsClient_Start_Call) Return(_a0 error) *MockWsClient_Start_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockWsClient_Start_Call) RunAndReturn(run func(string) error) *MockWsClient_Start_Call { - _c.Call.Return(run) - return _c -} - -// StartWithRetries provides a mock function with given fields: url -func (_m *MockWsClient) StartWithRetries(url string) { - _m.Called(url) -} - -// MockWsClient_StartWithRetries_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartWithRetries' -type MockWsClient_StartWithRetries_Call struct { - *mock.Call -} - -// StartWithRetries is a helper method to define mock.On call -// - url string -func (_e *MockWsClient_Expecter) StartWithRetries(url interface{}) *MockWsClient_StartWithRetries_Call { - return &MockWsClient_StartWithRetries_Call{Call: _e.mock.On("StartWithRetries", url)} -} - -func (_c *MockWsClient_StartWithRetries_Call) Run(run func(url string)) *MockWsClient_StartWithRetries_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *MockWsClient_StartWithRetries_Call) Return() *MockWsClient_StartWithRetries_Call { - _c.Call.Return() - return _c -} - -func (_c *MockWsClient_StartWithRetries_Call) RunAndReturn(run func(string)) *MockWsClient_StartWithRetries_Call { - _c.Run(run) - return _c -} - -// Stop provides a mock function with no fields -func (_m *MockWsClient) Stop() { - _m.Called() -} - -// MockWsClient_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop' -type MockWsClient_Stop_Call struct { - *mock.Call -} - -// Stop is a helper method to define mock.On call -func (_e *MockWsClient_Expecter) Stop() *MockWsClient_Stop_Call { - return &MockWsClient_Stop_Call{Call: _e.mock.On("Stop")} -} - -func (_c *MockWsClient_Stop_Call) Run(run func()) *MockWsClient_Stop_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockWsClient_Stop_Call) Return() *MockWsClient_Stop_Call { - _c.Call.Return() - return _c -} - -func (_c *MockWsClient_Stop_Call) RunAndReturn(run func()) *MockWsClient_Stop_Call { - _c.Run(run) - return _c -} - -// Write provides a mock function with given fields: data -func (_m *MockWsClient) Write(data []byte) error { - ret := _m.Called(data) - - if len(ret) == 0 { - panic("no return value specified for Write") - } - - var r0 error - if rf, ok := ret.Get(0).(func([]byte) error); ok { - r0 = rf(data) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockWsClient_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write' -type MockWsClient_Write_Call struct { - *mock.Call -} - -// Write is a helper method to define mock.On call -// - data []byte -func (_e *MockWsClient_Expecter) Write(data interface{}) *MockWsClient_Write_Call { - return &MockWsClient_Write_Call{Call: _e.mock.On("Write", data)} -} - -func (_c *MockWsClient_Write_Call) Run(run func(data []byte)) *MockWsClient_Write_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].([]byte)) - }) - return _c -} - -func (_c *MockWsClient_Write_Call) Return(_a0 error) *MockWsClient_Write_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockWsClient_Write_Call) RunAndReturn(run func([]byte) error) *MockWsClient_Write_Call { - _c.Call.Return(run) - return _c -} - -// NewMockWsClient creates a new instance of MockWsClient. 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 NewMockWsClient(t interface { - mock.TestingT - Cleanup(func()) -}) *MockWsClient { - mock := &MockWsClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ws/mocks/mock_WsServer.go b/ws/mocks/mock_WsServer.go deleted file mode 100644 index c382b211..00000000 --- a/ws/mocks/mock_WsServer.go +++ /dev/null @@ -1,607 +0,0 @@ -// Code generated by mockery v2.51.0. DO NOT EDIT. - -package mocks - -import ( - net "net" - http "net/http" - - mock "github.com/stretchr/testify/mock" - - websocket "github.com/gorilla/websocket" - - ws "github.com/lorenzodonini/ocpp-go/ws" -) - -// MockWsServer is an autogenerated mock type for the WsServer type -type MockWsServer struct { - mock.Mock -} - -type MockWsServer_Expecter struct { - mock *mock.Mock -} - -func (_m *MockWsServer) EXPECT() *MockWsServer_Expecter { - return &MockWsServer_Expecter{mock: &_m.Mock} -} - -// AddSupportedSubprotocol provides a mock function with given fields: subProto -func (_m *MockWsServer) AddSupportedSubprotocol(subProto string) { - _m.Called(subProto) -} - -// MockWsServer_AddSupportedSubprotocol_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddSupportedSubprotocol' -type MockWsServer_AddSupportedSubprotocol_Call struct { - *mock.Call -} - -// AddSupportedSubprotocol is a helper method to define mock.On call -// - subProto string -func (_e *MockWsServer_Expecter) AddSupportedSubprotocol(subProto interface{}) *MockWsServer_AddSupportedSubprotocol_Call { - return &MockWsServer_AddSupportedSubprotocol_Call{Call: _e.mock.On("AddSupportedSubprotocol", subProto)} -} - -func (_c *MockWsServer_AddSupportedSubprotocol_Call) Run(run func(subProto string)) *MockWsServer_AddSupportedSubprotocol_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *MockWsServer_AddSupportedSubprotocol_Call) Return() *MockWsServer_AddSupportedSubprotocol_Call { - _c.Call.Return() - return _c -} - -func (_c *MockWsServer_AddSupportedSubprotocol_Call) RunAndReturn(run func(string)) *MockWsServer_AddSupportedSubprotocol_Call { - _c.Run(run) - return _c -} - -// Addr provides a mock function with no fields -func (_m *MockWsServer) Addr() *net.TCPAddr { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Addr") - } - - var r0 *net.TCPAddr - if rf, ok := ret.Get(0).(func() *net.TCPAddr); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*net.TCPAddr) - } - } - - return r0 -} - -// MockWsServer_Addr_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Addr' -type MockWsServer_Addr_Call struct { - *mock.Call -} - -// Addr is a helper method to define mock.On call -func (_e *MockWsServer_Expecter) Addr() *MockWsServer_Addr_Call { - return &MockWsServer_Addr_Call{Call: _e.mock.On("Addr")} -} - -func (_c *MockWsServer_Addr_Call) Run(run func()) *MockWsServer_Addr_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockWsServer_Addr_Call) Return(_a0 *net.TCPAddr) *MockWsServer_Addr_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockWsServer_Addr_Call) RunAndReturn(run func() *net.TCPAddr) *MockWsServer_Addr_Call { - _c.Call.Return(run) - return _c -} - -// Connections provides a mock function with given fields: websocketId -func (_m *MockWsServer) Connections(websocketId string) *ws.WebSocket { - ret := _m.Called(websocketId) - - if len(ret) == 0 { - panic("no return value specified for Connections") - } - - var r0 *ws.WebSocket - if rf, ok := ret.Get(0).(func(string) *ws.WebSocket); ok { - r0 = rf(websocketId) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*ws.WebSocket) - } - } - - return r0 -} - -// MockWsServer_Connections_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Connections' -type MockWsServer_Connections_Call struct { - *mock.Call -} - -// Connections is a helper method to define mock.On call -// - websocketId string -func (_e *MockWsServer_Expecter) Connections(websocketId interface{}) *MockWsServer_Connections_Call { - return &MockWsServer_Connections_Call{Call: _e.mock.On("Connections", websocketId)} -} - -func (_c *MockWsServer_Connections_Call) Run(run func(websocketId string)) *MockWsServer_Connections_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *MockWsServer_Connections_Call) Return(_a0 *ws.WebSocket) *MockWsServer_Connections_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockWsServer_Connections_Call) RunAndReturn(run func(string) *ws.WebSocket) *MockWsServer_Connections_Call { - _c.Call.Return(run) - return _c -} - -// Errors provides a mock function with no fields -func (_m *MockWsServer) Errors() <-chan error { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Errors") - } - - var r0 <-chan error - if rf, ok := ret.Get(0).(func() <-chan error); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(<-chan error) - } - } - - return r0 -} - -// MockWsServer_Errors_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Errors' -type MockWsServer_Errors_Call struct { - *mock.Call -} - -// Errors is a helper method to define mock.On call -func (_e *MockWsServer_Expecter) Errors() *MockWsServer_Errors_Call { - return &MockWsServer_Errors_Call{Call: _e.mock.On("Errors")} -} - -func (_c *MockWsServer_Errors_Call) Run(run func()) *MockWsServer_Errors_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockWsServer_Errors_Call) Return(_a0 <-chan error) *MockWsServer_Errors_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockWsServer_Errors_Call) RunAndReturn(run func() <-chan error) *MockWsServer_Errors_Call { - _c.Call.Return(run) - return _c -} - -// SetBasicAuthHandler provides a mock function with given fields: handler -func (_m *MockWsServer) SetBasicAuthHandler(handler func(string, string) bool) { - _m.Called(handler) -} - -// MockWsServer_SetBasicAuthHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetBasicAuthHandler' -type MockWsServer_SetBasicAuthHandler_Call struct { - *mock.Call -} - -// SetBasicAuthHandler is a helper method to define mock.On call -// - handler func(string , string) bool -func (_e *MockWsServer_Expecter) SetBasicAuthHandler(handler interface{}) *MockWsServer_SetBasicAuthHandler_Call { - return &MockWsServer_SetBasicAuthHandler_Call{Call: _e.mock.On("SetBasicAuthHandler", handler)} -} - -func (_c *MockWsServer_SetBasicAuthHandler_Call) Run(run func(handler func(string, string) bool)) *MockWsServer_SetBasicAuthHandler_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(func(string, string) bool)) - }) - return _c -} - -func (_c *MockWsServer_SetBasicAuthHandler_Call) Return() *MockWsServer_SetBasicAuthHandler_Call { - _c.Call.Return() - return _c -} - -func (_c *MockWsServer_SetBasicAuthHandler_Call) RunAndReturn(run func(func(string, string) bool)) *MockWsServer_SetBasicAuthHandler_Call { - _c.Run(run) - return _c -} - -// SetCheckClientHandler provides a mock function with given fields: handler -func (_m *MockWsServer) SetCheckClientHandler(handler func(string, *http.Request) bool) { - _m.Called(handler) -} - -// MockWsServer_SetCheckClientHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCheckClientHandler' -type MockWsServer_SetCheckClientHandler_Call struct { - *mock.Call -} - -// SetCheckClientHandler is a helper method to define mock.On call -// - handler func(string , *http.Request) bool -func (_e *MockWsServer_Expecter) SetCheckClientHandler(handler interface{}) *MockWsServer_SetCheckClientHandler_Call { - return &MockWsServer_SetCheckClientHandler_Call{Call: _e.mock.On("SetCheckClientHandler", handler)} -} - -func (_c *MockWsServer_SetCheckClientHandler_Call) Run(run func(handler func(string, *http.Request) bool)) *MockWsServer_SetCheckClientHandler_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(func(string, *http.Request) bool)) - }) - return _c -} - -func (_c *MockWsServer_SetCheckClientHandler_Call) Return() *MockWsServer_SetCheckClientHandler_Call { - _c.Call.Return() - return _c -} - -func (_c *MockWsServer_SetCheckClientHandler_Call) RunAndReturn(run func(func(string, *http.Request) bool)) *MockWsServer_SetCheckClientHandler_Call { - _c.Run(run) - return _c -} - -// SetCheckOriginHandler provides a mock function with given fields: handler -func (_m *MockWsServer) SetCheckOriginHandler(handler func(*http.Request) bool) { - _m.Called(handler) -} - -// MockWsServer_SetCheckOriginHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCheckOriginHandler' -type MockWsServer_SetCheckOriginHandler_Call struct { - *mock.Call -} - -// SetCheckOriginHandler is a helper method to define mock.On call -// - handler func(*http.Request) bool -func (_e *MockWsServer_Expecter) SetCheckOriginHandler(handler interface{}) *MockWsServer_SetCheckOriginHandler_Call { - return &MockWsServer_SetCheckOriginHandler_Call{Call: _e.mock.On("SetCheckOriginHandler", handler)} -} - -func (_c *MockWsServer_SetCheckOriginHandler_Call) Run(run func(handler func(*http.Request) bool)) *MockWsServer_SetCheckOriginHandler_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(func(*http.Request) bool)) - }) - return _c -} - -func (_c *MockWsServer_SetCheckOriginHandler_Call) Return() *MockWsServer_SetCheckOriginHandler_Call { - _c.Call.Return() - return _c -} - -func (_c *MockWsServer_SetCheckOriginHandler_Call) RunAndReturn(run func(func(*http.Request) bool)) *MockWsServer_SetCheckOriginHandler_Call { - _c.Run(run) - return _c -} - -// SetDisconnectedClientHandler provides a mock function with given fields: handler -func (_m *MockWsServer) SetDisconnectedClientHandler(handler func(ws.Channel)) { - _m.Called(handler) -} - -// MockWsServer_SetDisconnectedClientHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDisconnectedClientHandler' -type MockWsServer_SetDisconnectedClientHandler_Call struct { - *mock.Call -} - -// SetDisconnectedClientHandler is a helper method to define mock.On call -// - handler func(ws.Channel) -func (_e *MockWsServer_Expecter) SetDisconnectedClientHandler(handler interface{}) *MockWsServer_SetDisconnectedClientHandler_Call { - return &MockWsServer_SetDisconnectedClientHandler_Call{Call: _e.mock.On("SetDisconnectedClientHandler", handler)} -} - -func (_c *MockWsServer_SetDisconnectedClientHandler_Call) Run(run func(handler func(ws.Channel))) *MockWsServer_SetDisconnectedClientHandler_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(func(ws.Channel))) - }) - return _c -} - -func (_c *MockWsServer_SetDisconnectedClientHandler_Call) Return() *MockWsServer_SetDisconnectedClientHandler_Call { - _c.Call.Return() - return _c -} - -func (_c *MockWsServer_SetDisconnectedClientHandler_Call) RunAndReturn(run func(func(ws.Channel))) *MockWsServer_SetDisconnectedClientHandler_Call { - _c.Run(run) - return _c -} - -// SetMessageHandler provides a mock function with given fields: handler -func (_m *MockWsServer) SetMessageHandler(handler func(ws.Channel, []byte) error) { - _m.Called(handler) -} - -// MockWsServer_SetMessageHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetMessageHandler' -type MockWsServer_SetMessageHandler_Call struct { - *mock.Call -} - -// SetMessageHandler is a helper method to define mock.On call -// - handler func(ws.Channel , []byte) error -func (_e *MockWsServer_Expecter) SetMessageHandler(handler interface{}) *MockWsServer_SetMessageHandler_Call { - return &MockWsServer_SetMessageHandler_Call{Call: _e.mock.On("SetMessageHandler", handler)} -} - -func (_c *MockWsServer_SetMessageHandler_Call) Run(run func(handler func(ws.Channel, []byte) error)) *MockWsServer_SetMessageHandler_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(func(ws.Channel, []byte) error)) - }) - return _c -} - -func (_c *MockWsServer_SetMessageHandler_Call) Return() *MockWsServer_SetMessageHandler_Call { - _c.Call.Return() - return _c -} - -func (_c *MockWsServer_SetMessageHandler_Call) RunAndReturn(run func(func(ws.Channel, []byte) error)) *MockWsServer_SetMessageHandler_Call { - _c.Run(run) - return _c -} - -// SetNewClientHandler provides a mock function with given fields: handler -func (_m *MockWsServer) SetNewClientHandler(handler func(ws.Channel)) { - _m.Called(handler) -} - -// MockWsServer_SetNewClientHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetNewClientHandler' -type MockWsServer_SetNewClientHandler_Call struct { - *mock.Call -} - -// SetNewClientHandler is a helper method to define mock.On call -// - handler func(ws.Channel) -func (_e *MockWsServer_Expecter) SetNewClientHandler(handler interface{}) *MockWsServer_SetNewClientHandler_Call { - return &MockWsServer_SetNewClientHandler_Call{Call: _e.mock.On("SetNewClientHandler", handler)} -} - -func (_c *MockWsServer_SetNewClientHandler_Call) Run(run func(handler func(ws.Channel))) *MockWsServer_SetNewClientHandler_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(func(ws.Channel))) - }) - return _c -} - -func (_c *MockWsServer_SetNewClientHandler_Call) Return() *MockWsServer_SetNewClientHandler_Call { - _c.Call.Return() - return _c -} - -func (_c *MockWsServer_SetNewClientHandler_Call) RunAndReturn(run func(func(ws.Channel))) *MockWsServer_SetNewClientHandler_Call { - _c.Run(run) - return _c -} - -// SetTimeoutConfig provides a mock function with given fields: config -func (_m *MockWsServer) SetTimeoutConfig(config ws.ServerTimeoutConfig) { - _m.Called(config) -} - -// MockWsServer_SetTimeoutConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetTimeoutConfig' -type MockWsServer_SetTimeoutConfig_Call struct { - *mock.Call -} - -// SetTimeoutConfig is a helper method to define mock.On call -// - config ws.ServerTimeoutConfig -func (_e *MockWsServer_Expecter) SetTimeoutConfig(config interface{}) *MockWsServer_SetTimeoutConfig_Call { - return &MockWsServer_SetTimeoutConfig_Call{Call: _e.mock.On("SetTimeoutConfig", config)} -} - -func (_c *MockWsServer_SetTimeoutConfig_Call) Run(run func(config ws.ServerTimeoutConfig)) *MockWsServer_SetTimeoutConfig_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ws.ServerTimeoutConfig)) - }) - return _c -} - -func (_c *MockWsServer_SetTimeoutConfig_Call) Return() *MockWsServer_SetTimeoutConfig_Call { - _c.Call.Return() - return _c -} - -func (_c *MockWsServer_SetTimeoutConfig_Call) RunAndReturn(run func(ws.ServerTimeoutConfig)) *MockWsServer_SetTimeoutConfig_Call { - _c.Run(run) - return _c -} - -// Start provides a mock function with given fields: port, listenPath -func (_m *MockWsServer) Start(port int, listenPath string) { - _m.Called(port, listenPath) -} - -// MockWsServer_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' -type MockWsServer_Start_Call struct { - *mock.Call -} - -// Start is a helper method to define mock.On call -// - port int -// - listenPath string -func (_e *MockWsServer_Expecter) Start(port interface{}, listenPath interface{}) *MockWsServer_Start_Call { - return &MockWsServer_Start_Call{Call: _e.mock.On("Start", port, listenPath)} -} - -func (_c *MockWsServer_Start_Call) Run(run func(port int, listenPath string)) *MockWsServer_Start_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(int), args[1].(string)) - }) - return _c -} - -func (_c *MockWsServer_Start_Call) Return() *MockWsServer_Start_Call { - _c.Call.Return() - return _c -} - -func (_c *MockWsServer_Start_Call) RunAndReturn(run func(int, string)) *MockWsServer_Start_Call { - _c.Run(run) - return _c -} - -// Stop provides a mock function with no fields -func (_m *MockWsServer) Stop() { - _m.Called() -} - -// MockWsServer_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop' -type MockWsServer_Stop_Call struct { - *mock.Call -} - -// Stop is a helper method to define mock.On call -func (_e *MockWsServer_Expecter) Stop() *MockWsServer_Stop_Call { - return &MockWsServer_Stop_Call{Call: _e.mock.On("Stop")} -} - -func (_c *MockWsServer_Stop_Call) Run(run func()) *MockWsServer_Stop_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockWsServer_Stop_Call) Return() *MockWsServer_Stop_Call { - _c.Call.Return() - return _c -} - -func (_c *MockWsServer_Stop_Call) RunAndReturn(run func()) *MockWsServer_Stop_Call { - _c.Run(run) - return _c -} - -// StopConnection provides a mock function with given fields: id, closeError -func (_m *MockWsServer) StopConnection(id string, closeError websocket.CloseError) error { - ret := _m.Called(id, closeError) - - if len(ret) == 0 { - panic("no return value specified for StopConnection") - } - - var r0 error - if rf, ok := ret.Get(0).(func(string, websocket.CloseError) error); ok { - r0 = rf(id, closeError) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockWsServer_StopConnection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StopConnection' -type MockWsServer_StopConnection_Call struct { - *mock.Call -} - -// StopConnection is a helper method to define mock.On call -// - id string -// - closeError websocket.CloseError -func (_e *MockWsServer_Expecter) StopConnection(id interface{}, closeError interface{}) *MockWsServer_StopConnection_Call { - return &MockWsServer_StopConnection_Call{Call: _e.mock.On("StopConnection", id, closeError)} -} - -func (_c *MockWsServer_StopConnection_Call) Run(run func(id string, closeError websocket.CloseError)) *MockWsServer_StopConnection_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(websocket.CloseError)) - }) - return _c -} - -func (_c *MockWsServer_StopConnection_Call) Return(_a0 error) *MockWsServer_StopConnection_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockWsServer_StopConnection_Call) RunAndReturn(run func(string, websocket.CloseError) error) *MockWsServer_StopConnection_Call { - _c.Call.Return(run) - return _c -} - -// Write provides a mock function with given fields: webSocketId, data -func (_m *MockWsServer) Write(webSocketId string, data []byte) error { - ret := _m.Called(webSocketId, data) - - if len(ret) == 0 { - panic("no return value specified for Write") - } - - var r0 error - if rf, ok := ret.Get(0).(func(string, []byte) error); ok { - r0 = rf(webSocketId, data) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockWsServer_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write' -type MockWsServer_Write_Call struct { - *mock.Call -} - -// Write is a helper method to define mock.On call -// - webSocketId string -// - data []byte -func (_e *MockWsServer_Expecter) Write(webSocketId interface{}, data interface{}) *MockWsServer_Write_Call { - return &MockWsServer_Write_Call{Call: _e.mock.On("Write", webSocketId, data)} -} - -func (_c *MockWsServer_Write_Call) Run(run func(webSocketId string, data []byte)) *MockWsServer_Write_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].([]byte)) - }) - return _c -} - -func (_c *MockWsServer_Write_Call) Return(_a0 error) *MockWsServer_Write_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockWsServer_Write_Call) RunAndReturn(run func(string, []byte) error) *MockWsServer_Write_Call { - _c.Call.Return(run) - return _c -} - -// NewMockWsServer creates a new instance of MockWsServer. 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 NewMockWsServer(t interface { - mock.TestingT - Cleanup(func()) -}) *MockWsServer { - mock := &MockWsServer{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -}