Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCPP 1.6j Security extension tests #311

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/autogen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
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' }}
139 changes: 139 additions & 0 deletions .mockery.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
with-expecter: true
dir: "{{.InterfaceDir}}/mocks"
outpkg: mocks
filename: "mock_{{.InterfaceName}}.go"
mockname: "Mock{{.InterfaceName}}"
all: true

packages:
github.com/lorenzodonini/ocpp-go/ocpp1.6/core:
config:
dir: "ocpp1.6_test/mocks"
filename: "mock_core_{{.InterfaceName|snakecase}}.go"
mockname: "MockCore{{.InterfaceName}}"
interfaces:
CentralSystemHandler:
ChargePointHandler:

github.com/lorenzodonini/ocpp-go/ocpp1.6/certificates:
config:
dir: "ocpp1.6_test/mocks"
filename: "mock_certificates_{{.InterfaceName|snakecase}}.go"
mockname: "MockCertificates{{.InterfaceName}}"

interfaces:
ChargePointHandler:

github.com/lorenzodonini/ocpp-go/ocpp1.6/logging:
config:
dir: "ocpp1.6_test/mocks"
filename: "mock_logging_{{.InterfaceName|snakecase}}.go"
mockname: "MockLog{{.InterfaceName}}"

interfaces:
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}}"

interfaces:
ChargePointHandler:

github.com/lorenzodonini/ocpp-go/ocpp1.6/firmware:
config:
dir: "ocpp1.6_test/mocks"
filename: "mock_firmware_{{.InterfaceName|snakecase}}.go"
mockname: "MockFirmware{{.InterfaceName}}"

interfaces:
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}}"

interfaces:
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}}"

interfaces:
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}}"

interfaces:
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}}"

interfaces:
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}}"

interfaces:
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"

interfaces:
ChargePointConnection:
ChargePoint:
CentralSystem:

github.com/lorenzodonini/ocpp-go/ocppj:
interfaces:
ServerQueueMap:
RequestQueue:

github.com/lorenzodonini/ocpp-go/ws:
interfaces:
WsClient:
WsServer:
Channel:
Loading
Loading