diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d25ed566..9d0a9682 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,7 +25,7 @@ jobs: run: | go test ./ws ./ocppj -v -covermode=count -coverprofile=coverage.out go test -v -covermode=count -coverprofile=ocpp16.out -coverpkg=github.com/lorenzodonini/ocpp-go/ocpp1.6/... github.com/lorenzodonini/ocpp-go/ocpp1.6_test - go test -v -covermode=count -coverprofile=ocpp20.out -coverpkg=github.com/lorenzodonini/ocpp-go/ocpp2.0/... github.com/lorenzodonini/ocpp-go/ocpp2.0_test + go test -v -covermode=count -coverprofile=ocpp20.out -coverpkg=github.com/lorenzodonini/ocpp-go/ocpp2.0.1/... github.com/lorenzodonini/ocpp-go/ocpp2.0.1_test sed '1d;$d' ocpp16.out >> coverage.out sed '1d;$d' ocpp20.out >> coverage.out - name: Publish coverage diff --git a/.gitignore b/.gitignore index f8947ca0..238f1b8e 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,6 @@ # Project-specific certs/ + +central_system_sim +charge_point_sim \ No newline at end of file diff --git a/central_system_sim b/central_system_sim deleted file mode 100755 index e7d91a37..00000000 Binary files a/central_system_sim and /dev/null differ diff --git a/charge_point_sim b/charge_point_sim deleted file mode 100755 index 7e3a2544..00000000 Binary files a/charge_point_sim and /dev/null differ diff --git a/ocpp2.0/authorization/authorization.go b/ocpp2.0.1/authorization/authorization.go similarity index 100% rename from ocpp2.0/authorization/authorization.go rename to ocpp2.0.1/authorization/authorization.go diff --git a/ocpp2.0/authorization/authorize.go b/ocpp2.0.1/authorization/authorize.go similarity index 98% rename from ocpp2.0/authorization/authorize.go rename to ocpp2.0.1/authorization/authorize.go index 63f0b824..6ba8764f 100644 --- a/ocpp2.0/authorization/authorize.go +++ b/ocpp2.0.1/authorization/authorize.go @@ -5,7 +5,7 @@ import ( "gopkg.in/go-playground/validator.v9" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Authorize (CS -> CSMS) -------------------- diff --git a/ocpp2.0/authorization/clear_cache.go b/ocpp2.0.1/authorization/clear_cache.go similarity index 98% rename from ocpp2.0/authorization/clear_cache.go rename to ocpp2.0.1/authorization/clear_cache.go index ad753445..6d839520 100644 --- a/ocpp2.0/authorization/clear_cache.go +++ b/ocpp2.0.1/authorization/clear_cache.go @@ -5,7 +5,7 @@ import ( "gopkg.in/go-playground/validator.v9" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Clear Cache (CSMS -> CS) -------------------- diff --git a/ocpp2.0/availability/availability.go b/ocpp2.0.1/availability/availability.go similarity index 100% rename from ocpp2.0/availability/availability.go rename to ocpp2.0.1/availability/availability.go diff --git a/ocpp2.0/availability/change_availability.go b/ocpp2.0.1/availability/change_availability.go similarity index 98% rename from ocpp2.0/availability/change_availability.go rename to ocpp2.0.1/availability/change_availability.go index 4c7dcd78..997434c1 100644 --- a/ocpp2.0/availability/change_availability.go +++ b/ocpp2.0.1/availability/change_availability.go @@ -5,7 +5,7 @@ import ( "gopkg.in/go-playground/validator.v9" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Change Availability (CSMS -> CS) -------------------- diff --git a/ocpp2.0/availability/heartbeat.go b/ocpp2.0.1/availability/heartbeat.go similarity index 97% rename from ocpp2.0/availability/heartbeat.go rename to ocpp2.0.1/availability/heartbeat.go index 7c605ea1..f372478d 100644 --- a/ocpp2.0/availability/heartbeat.go +++ b/ocpp2.0.1/availability/heartbeat.go @@ -1,9 +1,10 @@ package availability import ( - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" - "gopkg.in/go-playground/validator.v9" "reflect" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" + "gopkg.in/go-playground/validator.v9" ) // -------------------- Heartbeat (CS -> CSMS) -------------------- diff --git a/ocpp2.0/availability/status_notification.go b/ocpp2.0.1/availability/status_notification.go similarity index 98% rename from ocpp2.0/availability/status_notification.go rename to ocpp2.0.1/availability/status_notification.go index 113be176..6a70f855 100644 --- a/ocpp2.0/availability/status_notification.go +++ b/ocpp2.0.1/availability/status_notification.go @@ -3,7 +3,7 @@ package availability import ( "reflect" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "gopkg.in/go-playground/validator.v9" ) diff --git a/ocpp2.0/charging_station.go b/ocpp2.0.1/charging_station.go similarity index 96% rename from ocpp2.0/charging_station.go rename to ocpp2.0.1/charging_station.go index f6ce95f8..fd118df0 100644 --- a/ocpp2.0/charging_station.go +++ b/ocpp2.0.1/charging_station.go @@ -5,23 +5,23 @@ import ( "github.com/lorenzodonini/ocpp-go/internal/callbackqueue" "github.com/lorenzodonini/ocpp-go/ocpp" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/authorization" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/availability" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/data" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/diagnostics" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/display" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/firmware" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/iso15118" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/localauth" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/meter" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/provisioning" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/remotecontrol" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/reservation" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/security" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/smartcharging" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/tariffcost" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/transactions" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/authorization" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/availability" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/data" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/diagnostics" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/display" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/firmware" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/iso15118" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/localauth" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/meter" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/provisioning" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/remotecontrol" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/reservation" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/security" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/smartcharging" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/tariffcost" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/transactions" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "github.com/lorenzodonini/ocpp-go/ocppj" ) diff --git a/ocpp2.0/csms.go b/ocpp2.0.1/csms.go similarity index 97% rename from ocpp2.0/csms.go rename to ocpp2.0.1/csms.go index 20ecbaca..0bc859a0 100644 --- a/ocpp2.0/csms.go +++ b/ocpp2.0.1/csms.go @@ -5,23 +5,23 @@ import ( "github.com/lorenzodonini/ocpp-go/internal/callbackqueue" "github.com/lorenzodonini/ocpp-go/ocpp" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/authorization" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/availability" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/data" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/diagnostics" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/display" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/firmware" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/iso15118" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/localauth" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/meter" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/provisioning" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/remotecontrol" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/reservation" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/security" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/smartcharging" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/tariffcost" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/transactions" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/authorization" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/availability" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/data" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/diagnostics" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/display" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/firmware" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/iso15118" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/localauth" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/meter" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/provisioning" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/remotecontrol" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/reservation" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/security" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/smartcharging" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/tariffcost" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/transactions" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "github.com/lorenzodonini/ocpp-go/ocppj" "github.com/lorenzodonini/ocpp-go/ws" ) diff --git a/ocpp2.0/data/data.go b/ocpp2.0.1/data/data.go similarity index 100% rename from ocpp2.0/data/data.go rename to ocpp2.0.1/data/data.go diff --git a/ocpp2.0/data/data_transfer.go b/ocpp2.0.1/data/data_transfer.go similarity index 98% rename from ocpp2.0/data/data_transfer.go rename to ocpp2.0.1/data/data_transfer.go index 440a0ec2..76986371 100644 --- a/ocpp2.0/data/data_transfer.go +++ b/ocpp2.0.1/data/data_transfer.go @@ -5,7 +5,7 @@ import ( "gopkg.in/go-playground/validator.v9" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Data Transfer (CS -> CSMS / CSMS -> CS) -------------------- diff --git a/ocpp2.0/diagnostics/clear_variable_monitoring.go b/ocpp2.0.1/diagnostics/clear_variable_monitoring.go similarity index 98% rename from ocpp2.0/diagnostics/clear_variable_monitoring.go rename to ocpp2.0.1/diagnostics/clear_variable_monitoring.go index 97162f91..4130a2b5 100644 --- a/ocpp2.0/diagnostics/clear_variable_monitoring.go +++ b/ocpp2.0.1/diagnostics/clear_variable_monitoring.go @@ -1,9 +1,10 @@ package diagnostics import ( - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" - "gopkg.in/go-playground/validator.v9" "reflect" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" + "gopkg.in/go-playground/validator.v9" ) // -------------------- Clear Variable Monitoring (CSMS -> CS) -------------------- diff --git a/ocpp2.0/diagnostics/customer_information.go b/ocpp2.0.1/diagnostics/customer_information.go similarity index 98% rename from ocpp2.0/diagnostics/customer_information.go rename to ocpp2.0.1/diagnostics/customer_information.go index 19cc86a0..97e3cc56 100644 --- a/ocpp2.0/diagnostics/customer_information.go +++ b/ocpp2.0.1/diagnostics/customer_information.go @@ -5,7 +5,7 @@ import ( "gopkg.in/go-playground/validator.v9" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Customer Information (CSMS -> CS) -------------------- diff --git a/ocpp2.0/diagnostics/diagnostics.go b/ocpp2.0.1/diagnostics/diagnostics.go similarity index 100% rename from ocpp2.0/diagnostics/diagnostics.go rename to ocpp2.0.1/diagnostics/diagnostics.go diff --git a/ocpp2.0/diagnostics/get_log.go b/ocpp2.0.1/diagnostics/get_log.go similarity index 98% rename from ocpp2.0/diagnostics/get_log.go rename to ocpp2.0.1/diagnostics/get_log.go index 6bc30c1a..5b9fc4ea 100644 --- a/ocpp2.0/diagnostics/get_log.go +++ b/ocpp2.0.1/diagnostics/get_log.go @@ -1,9 +1,10 @@ package diagnostics import ( - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" - "gopkg.in/go-playground/validator.v9" "reflect" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" + "gopkg.in/go-playground/validator.v9" ) // -------------------- Get Log (CSMS -> CS) -------------------- diff --git a/ocpp2.0/diagnostics/get_monitoring_report.go b/ocpp2.0.1/diagnostics/get_monitoring_report.go similarity index 98% rename from ocpp2.0/diagnostics/get_monitoring_report.go rename to ocpp2.0.1/diagnostics/get_monitoring_report.go index 9a9cec90..98379b96 100644 --- a/ocpp2.0/diagnostics/get_monitoring_report.go +++ b/ocpp2.0.1/diagnostics/get_monitoring_report.go @@ -1,9 +1,10 @@ package diagnostics import ( - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" - "gopkg.in/go-playground/validator.v9" "reflect" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" + "gopkg.in/go-playground/validator.v9" ) // -------------------- Get Monitoring Report (CSMS -> CS) -------------------- diff --git a/ocpp2.0/diagnostics/log_status_notification.go b/ocpp2.0.1/diagnostics/log_status_notification.go similarity index 98% rename from ocpp2.0/diagnostics/log_status_notification.go rename to ocpp2.0.1/diagnostics/log_status_notification.go index a8add795..d3a949d0 100644 --- a/ocpp2.0/diagnostics/log_status_notification.go +++ b/ocpp2.0.1/diagnostics/log_status_notification.go @@ -1,9 +1,10 @@ package diagnostics import ( - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" - "gopkg.in/go-playground/validator.v9" "reflect" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" + "gopkg.in/go-playground/validator.v9" ) // -------------------- Log Status Notification (CS -> CSMS) -------------------- diff --git a/ocpp2.0/diagnostics/notify_customer_information.go b/ocpp2.0.1/diagnostics/notify_customer_information.go similarity index 98% rename from ocpp2.0/diagnostics/notify_customer_information.go rename to ocpp2.0.1/diagnostics/notify_customer_information.go index 706a3f60..3c09908c 100644 --- a/ocpp2.0/diagnostics/notify_customer_information.go +++ b/ocpp2.0.1/diagnostics/notify_customer_information.go @@ -1,8 +1,9 @@ package diagnostics import ( - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" "reflect" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Notify Customer Information (CS -> CSMS) -------------------- diff --git a/ocpp2.0/diagnostics/notify_event.go b/ocpp2.0.1/diagnostics/notify_event.go similarity index 99% rename from ocpp2.0/diagnostics/notify_event.go rename to ocpp2.0.1/diagnostics/notify_event.go index 315ee620..3e9127d5 100644 --- a/ocpp2.0/diagnostics/notify_event.go +++ b/ocpp2.0.1/diagnostics/notify_event.go @@ -1,9 +1,10 @@ package diagnostics import ( - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" - "gopkg.in/go-playground/validator.v9" "reflect" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" + "gopkg.in/go-playground/validator.v9" ) // -------------------- Notify Event (CS -> CSMS) -------------------- diff --git a/ocpp2.0/diagnostics/notify_monitoring_report.go b/ocpp2.0.1/diagnostics/notify_monitoring_report.go similarity index 98% rename from ocpp2.0/diagnostics/notify_monitoring_report.go rename to ocpp2.0.1/diagnostics/notify_monitoring_report.go index 64971b84..1820604e 100644 --- a/ocpp2.0/diagnostics/notify_monitoring_report.go +++ b/ocpp2.0.1/diagnostics/notify_monitoring_report.go @@ -1,8 +1,9 @@ package diagnostics import ( - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" "reflect" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Notify Monitoring Report (CS -> CSMS) -------------------- diff --git a/ocpp2.0/diagnostics/set_monitoring_base.go b/ocpp2.0.1/diagnostics/set_monitoring_base.go similarity index 98% rename from ocpp2.0/diagnostics/set_monitoring_base.go rename to ocpp2.0.1/diagnostics/set_monitoring_base.go index e21998ae..49096bbd 100644 --- a/ocpp2.0/diagnostics/set_monitoring_base.go +++ b/ocpp2.0.1/diagnostics/set_monitoring_base.go @@ -3,7 +3,7 @@ package diagnostics import ( "reflect" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "gopkg.in/go-playground/validator.v9" ) diff --git a/ocpp2.0/diagnostics/set_monitoring_level.go b/ocpp2.0.1/diagnostics/set_monitoring_level.go similarity index 98% rename from ocpp2.0/diagnostics/set_monitoring_level.go rename to ocpp2.0.1/diagnostics/set_monitoring_level.go index efcd588d..110ace67 100644 --- a/ocpp2.0/diagnostics/set_monitoring_level.go +++ b/ocpp2.0.1/diagnostics/set_monitoring_level.go @@ -3,7 +3,7 @@ package diagnostics import ( "reflect" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Set Monitoring Level (CSMS -> CS) -------------------- diff --git a/ocpp2.0/diagnostics/set_variable_monitoring.go b/ocpp2.0.1/diagnostics/set_variable_monitoring.go similarity index 99% rename from ocpp2.0/diagnostics/set_variable_monitoring.go rename to ocpp2.0.1/diagnostics/set_variable_monitoring.go index ac63949b..14acf9c2 100644 --- a/ocpp2.0/diagnostics/set_variable_monitoring.go +++ b/ocpp2.0.1/diagnostics/set_variable_monitoring.go @@ -3,7 +3,7 @@ package diagnostics import ( "reflect" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "gopkg.in/go-playground/validator.v9" ) diff --git a/ocpp2.0/diagnostics/types.go b/ocpp2.0.1/diagnostics/types.go similarity index 96% rename from ocpp2.0/diagnostics/types.go rename to ocpp2.0.1/diagnostics/types.go index a088838b..3d94fb1a 100644 --- a/ocpp2.0/diagnostics/types.go +++ b/ocpp2.0.1/diagnostics/types.go @@ -1,7 +1,7 @@ package diagnostics import ( - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "gopkg.in/go-playground/validator.v9" ) diff --git a/ocpp2.0/display/clear_display_message.go b/ocpp2.0.1/display/clear_display_message.go similarity index 98% rename from ocpp2.0/display/clear_display_message.go rename to ocpp2.0.1/display/clear_display_message.go index 04bdc699..f0057122 100644 --- a/ocpp2.0/display/clear_display_message.go +++ b/ocpp2.0.1/display/clear_display_message.go @@ -5,7 +5,7 @@ import ( "gopkg.in/go-playground/validator.v9" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Clear Display Message (CSMS -> CS) -------------------- diff --git a/ocpp2.0/display/display.go b/ocpp2.0.1/display/display.go similarity index 100% rename from ocpp2.0/display/display.go rename to ocpp2.0.1/display/display.go diff --git a/ocpp2.0/display/get_display_messages.go b/ocpp2.0.1/display/get_display_messages.go similarity index 100% rename from ocpp2.0/display/get_display_messages.go rename to ocpp2.0.1/display/get_display_messages.go diff --git a/ocpp2.0/display/notify_display_messages.go b/ocpp2.0.1/display/notify_display_messages.go similarity index 100% rename from ocpp2.0/display/notify_display_messages.go rename to ocpp2.0.1/display/notify_display_messages.go diff --git a/ocpp2.0/display/set_display_message.go b/ocpp2.0.1/display/set_display_message.go similarity index 98% rename from ocpp2.0/display/set_display_message.go rename to ocpp2.0.1/display/set_display_message.go index 34a229e8..8f78510e 100644 --- a/ocpp2.0/display/set_display_message.go +++ b/ocpp2.0.1/display/set_display_message.go @@ -3,7 +3,7 @@ package display import ( "reflect" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "gopkg.in/go-playground/validator.v9" ) diff --git a/ocpp2.0/display/types.go b/ocpp2.0.1/display/types.go similarity index 98% rename from ocpp2.0/display/types.go rename to ocpp2.0.1/display/types.go index 465757b3..250fa1c8 100644 --- a/ocpp2.0/display/types.go +++ b/ocpp2.0.1/display/types.go @@ -1,7 +1,7 @@ package display import ( - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "gopkg.in/go-playground/validator.v9" ) diff --git a/ocpp2.0/firmware/firmware.go b/ocpp2.0.1/firmware/firmware.go similarity index 100% rename from ocpp2.0/firmware/firmware.go rename to ocpp2.0.1/firmware/firmware.go diff --git a/ocpp2.0/firmware/firmware_status_notification.go b/ocpp2.0.1/firmware/firmware_status_notification.go similarity index 98% rename from ocpp2.0/firmware/firmware_status_notification.go rename to ocpp2.0.1/firmware/firmware_status_notification.go index ead73c1b..5fbbca72 100644 --- a/ocpp2.0/firmware/firmware_status_notification.go +++ b/ocpp2.0.1/firmware/firmware_status_notification.go @@ -5,7 +5,7 @@ import ( "gopkg.in/go-playground/validator.v9" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Firmware Status Notification (CS -> CSMS) -------------------- diff --git a/ocpp2.0/firmware/publish_firmware.go b/ocpp2.0.1/firmware/publish_firmware.go similarity index 98% rename from ocpp2.0/firmware/publish_firmware.go rename to ocpp2.0.1/firmware/publish_firmware.go index 6f4109b0..56825cab 100644 --- a/ocpp2.0/firmware/publish_firmware.go +++ b/ocpp2.0.1/firmware/publish_firmware.go @@ -1,8 +1,9 @@ package firmware import ( - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" "reflect" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Publish Firmware (CSMS -> CS) -------------------- diff --git a/ocpp2.0/firmware/publish_firmware_status_notification.go b/ocpp2.0.1/firmware/publish_firmware_status_notification.go similarity index 98% rename from ocpp2.0/firmware/publish_firmware_status_notification.go rename to ocpp2.0.1/firmware/publish_firmware_status_notification.go index 6304b42d..3535dbf7 100644 --- a/ocpp2.0/firmware/publish_firmware_status_notification.go +++ b/ocpp2.0.1/firmware/publish_firmware_status_notification.go @@ -1,9 +1,10 @@ package firmware import ( - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" - "gopkg.in/go-playground/validator.v9" "reflect" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" + "gopkg.in/go-playground/validator.v9" ) // -------------------- Publish Firmware Status Notification (CS -> CSMS) -------------------- diff --git a/ocpp2.0/firmware/unpublish_firmware.go b/ocpp2.0.1/firmware/unpublish_firmware.go similarity index 98% rename from ocpp2.0/firmware/unpublish_firmware.go rename to ocpp2.0.1/firmware/unpublish_firmware.go index 76957c2b..b4820814 100644 --- a/ocpp2.0/firmware/unpublish_firmware.go +++ b/ocpp2.0.1/firmware/unpublish_firmware.go @@ -5,7 +5,7 @@ import ( "gopkg.in/go-playground/validator.v9" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Publish Firmware (CSMS -> CS) -------------------- diff --git a/ocpp2.0/firmware/update_firmware.go b/ocpp2.0.1/firmware/update_firmware.go similarity index 99% rename from ocpp2.0/firmware/update_firmware.go rename to ocpp2.0.1/firmware/update_firmware.go index e2e679f1..eedea312 100644 --- a/ocpp2.0/firmware/update_firmware.go +++ b/ocpp2.0.1/firmware/update_firmware.go @@ -5,7 +5,7 @@ import ( "gopkg.in/go-playground/validator.v9" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Publish Firmware (CSMS -> CS) -------------------- diff --git a/ocpp2.0/iso15118/delete_certificate.go b/ocpp2.0.1/iso15118/delete_certificate.go similarity index 98% rename from ocpp2.0/iso15118/delete_certificate.go rename to ocpp2.0.1/iso15118/delete_certificate.go index 2a00f3e7..f2de20af 100644 --- a/ocpp2.0/iso15118/delete_certificate.go +++ b/ocpp2.0.1/iso15118/delete_certificate.go @@ -5,7 +5,7 @@ import ( "gopkg.in/go-playground/validator.v9" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Delete Certificate (CSMS -> CS) -------------------- diff --git a/ocpp2.0/iso15118/get_15118ev_certificate.go b/ocpp2.0.1/iso15118/get_15118ev_certificate.go similarity index 98% rename from ocpp2.0/iso15118/get_15118ev_certificate.go rename to ocpp2.0.1/iso15118/get_15118ev_certificate.go index 468c2ea8..9eb53c37 100644 --- a/ocpp2.0/iso15118/get_15118ev_certificate.go +++ b/ocpp2.0.1/iso15118/get_15118ev_certificate.go @@ -5,7 +5,7 @@ import ( "gopkg.in/go-playground/validator.v9" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Get 15118EV Certificate (CS -> CSMS) -------------------- diff --git a/ocpp2.0/iso15118/get_certificate_status.go b/ocpp2.0.1/iso15118/get_certificate_status.go similarity index 98% rename from ocpp2.0/iso15118/get_certificate_status.go rename to ocpp2.0.1/iso15118/get_certificate_status.go index 70507acf..093832f0 100644 --- a/ocpp2.0/iso15118/get_certificate_status.go +++ b/ocpp2.0.1/iso15118/get_certificate_status.go @@ -3,7 +3,7 @@ package iso15118 import ( "reflect" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Get Certificate Status (CS -> CSMS) -------------------- diff --git a/ocpp2.0/iso15118/get_installed_certificate_ids.go b/ocpp2.0.1/iso15118/get_installed_certificate_ids.go similarity index 98% rename from ocpp2.0/iso15118/get_installed_certificate_ids.go rename to ocpp2.0.1/iso15118/get_installed_certificate_ids.go index 9c170b60..7f8a549a 100644 --- a/ocpp2.0/iso15118/get_installed_certificate_ids.go +++ b/ocpp2.0.1/iso15118/get_installed_certificate_ids.go @@ -1,9 +1,10 @@ package iso15118 import ( - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" - "gopkg.in/go-playground/validator.v9" "reflect" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" + "gopkg.in/go-playground/validator.v9" ) // -------------------- Get Installed Certificate IDs (CSMS -> CS) -------------------- diff --git a/ocpp2.0/iso15118/install_certificate.go b/ocpp2.0.1/iso15118/install_certificate.go similarity index 98% rename from ocpp2.0/iso15118/install_certificate.go rename to ocpp2.0.1/iso15118/install_certificate.go index 0d3bae95..7ce446b6 100644 --- a/ocpp2.0/iso15118/install_certificate.go +++ b/ocpp2.0.1/iso15118/install_certificate.go @@ -5,7 +5,7 @@ import ( "gopkg.in/go-playground/validator.v9" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Clear Display (CSMS -> CS) -------------------- diff --git a/ocpp2.0/iso15118/iso_15118.go b/ocpp2.0.1/iso15118/iso_15118.go similarity index 100% rename from ocpp2.0/iso15118/iso_15118.go rename to ocpp2.0.1/iso15118/iso_15118.go diff --git a/ocpp2.0/localauth/get_local_list_version.go b/ocpp2.0.1/localauth/get_local_list_version.go similarity index 100% rename from ocpp2.0/localauth/get_local_list_version.go rename to ocpp2.0.1/localauth/get_local_list_version.go diff --git a/ocpp2.0/localauth/local_auth_list.go b/ocpp2.0.1/localauth/local_auth_list.go similarity index 100% rename from ocpp2.0/localauth/local_auth_list.go rename to ocpp2.0.1/localauth/local_auth_list.go diff --git a/ocpp2.0/localauth/send_local_list.go b/ocpp2.0.1/localauth/send_local_list.go similarity index 98% rename from ocpp2.0/localauth/send_local_list.go rename to ocpp2.0.1/localauth/send_local_list.go index e5593ce3..353303cb 100644 --- a/ocpp2.0/localauth/send_local_list.go +++ b/ocpp2.0.1/localauth/send_local_list.go @@ -3,7 +3,7 @@ package localauth import ( "reflect" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "gopkg.in/go-playground/validator.v9" ) diff --git a/ocpp2.0/meter/meter.go b/ocpp2.0.1/meter/meter.go similarity index 99% rename from ocpp2.0/meter/meter.go rename to ocpp2.0.1/meter/meter.go index 6f9a49b2..5656ef02 100644 --- a/ocpp2.0/meter/meter.go +++ b/ocpp2.0.1/meter/meter.go @@ -18,4 +18,4 @@ const ProfileName = "meter" var Profile = ocpp.NewProfile( ProfileName, MeterValuesFeature{}, - ) +) diff --git a/ocpp2.0/meter/meter_values.go b/ocpp2.0.1/meter/meter_values.go similarity index 98% rename from ocpp2.0/meter/meter_values.go rename to ocpp2.0.1/meter/meter_values.go index ca31b1de..09500dc3 100644 --- a/ocpp2.0/meter/meter_values.go +++ b/ocpp2.0.1/meter/meter_values.go @@ -1,8 +1,9 @@ package meter import ( - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" "reflect" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Meter Values (CS -> CSMS) -------------------- @@ -20,7 +21,6 @@ type MeterValuesRequest struct { type MeterValuesResponse struct { } - // The message is used to sample the electrical meter or other sensor/transducer hardware to provide information about the Charging Stations' Meter Values, outside of a transaction. // The Charging Station is configured to send Meter values every XX seconds. // diff --git a/ocpp2.0/provisioning/boot_notification.go b/ocpp2.0.1/provisioning/boot_notification.go similarity index 99% rename from ocpp2.0/provisioning/boot_notification.go rename to ocpp2.0.1/provisioning/boot_notification.go index 5037dfcd..b2d0c3cd 100644 --- a/ocpp2.0/provisioning/boot_notification.go +++ b/ocpp2.0.1/provisioning/boot_notification.go @@ -5,7 +5,7 @@ import ( "gopkg.in/go-playground/validator.v9" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Boot Notification (CS -> CSMS) -------------------- diff --git a/ocpp2.0/provisioning/get_base_report.go b/ocpp2.0.1/provisioning/get_base_report.go similarity index 98% rename from ocpp2.0/provisioning/get_base_report.go rename to ocpp2.0.1/provisioning/get_base_report.go index 670a1d77..3217ca33 100644 --- a/ocpp2.0/provisioning/get_base_report.go +++ b/ocpp2.0.1/provisioning/get_base_report.go @@ -5,7 +5,7 @@ import ( "gopkg.in/go-playground/validator.v9" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Get Base Report (CSMS -> CS) -------------------- diff --git a/ocpp2.0/provisioning/get_report.go b/ocpp2.0.1/provisioning/get_report.go similarity index 98% rename from ocpp2.0/provisioning/get_report.go rename to ocpp2.0.1/provisioning/get_report.go index 9ba8ffa2..873334ac 100644 --- a/ocpp2.0/provisioning/get_report.go +++ b/ocpp2.0.1/provisioning/get_report.go @@ -1,9 +1,10 @@ package provisioning import ( - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" - "gopkg.in/go-playground/validator.v9" "reflect" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" + "gopkg.in/go-playground/validator.v9" ) // -------------------- Get Report (CSMS -> CS) -------------------- diff --git a/ocpp2.0/provisioning/get_variables.go b/ocpp2.0.1/provisioning/get_variables.go similarity index 98% rename from ocpp2.0/provisioning/get_variables.go rename to ocpp2.0.1/provisioning/get_variables.go index bb711d05..26df1c2c 100644 --- a/ocpp2.0/provisioning/get_variables.go +++ b/ocpp2.0.1/provisioning/get_variables.go @@ -3,7 +3,7 @@ package provisioning import ( "reflect" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "gopkg.in/go-playground/validator.v9" ) diff --git a/ocpp2.0/provisioning/notify_report.go b/ocpp2.0.1/provisioning/notify_report.go similarity index 99% rename from ocpp2.0/provisioning/notify_report.go rename to ocpp2.0.1/provisioning/notify_report.go index 7f912139..665160e5 100644 --- a/ocpp2.0/provisioning/notify_report.go +++ b/ocpp2.0.1/provisioning/notify_report.go @@ -1,9 +1,10 @@ package provisioning import ( - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" - "gopkg.in/go-playground/validator.v9" "reflect" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" + "gopkg.in/go-playground/validator.v9" ) // -------------------- Notify Report (CS -> CSMS) -------------------- diff --git a/ocpp2.0/provisioning/provisioning.go b/ocpp2.0.1/provisioning/provisioning.go similarity index 100% rename from ocpp2.0/provisioning/provisioning.go rename to ocpp2.0.1/provisioning/provisioning.go diff --git a/ocpp2.0/provisioning/reset.go b/ocpp2.0.1/provisioning/reset.go similarity index 98% rename from ocpp2.0/provisioning/reset.go rename to ocpp2.0.1/provisioning/reset.go index 26e41d7d..0846241e 100644 --- a/ocpp2.0/provisioning/reset.go +++ b/ocpp2.0.1/provisioning/reset.go @@ -3,7 +3,7 @@ package provisioning import ( "reflect" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "gopkg.in/go-playground/validator.v9" ) diff --git a/ocpp2.0/provisioning/set_network_profile.go b/ocpp2.0.1/provisioning/set_network_profile.go similarity index 99% rename from ocpp2.0/provisioning/set_network_profile.go rename to ocpp2.0.1/provisioning/set_network_profile.go index ae93d30d..7f1cda16 100644 --- a/ocpp2.0/provisioning/set_network_profile.go +++ b/ocpp2.0.1/provisioning/set_network_profile.go @@ -3,7 +3,7 @@ package provisioning import ( "reflect" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "gopkg.in/go-playground/validator.v9" ) diff --git a/ocpp2.0/provisioning/set_variables.go b/ocpp2.0.1/provisioning/set_variables.go similarity index 98% rename from ocpp2.0/provisioning/set_variables.go rename to ocpp2.0.1/provisioning/set_variables.go index 071b4242..4f75be23 100644 --- a/ocpp2.0/provisioning/set_variables.go +++ b/ocpp2.0.1/provisioning/set_variables.go @@ -3,7 +3,7 @@ package provisioning import ( "reflect" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "gopkg.in/go-playground/validator.v9" ) diff --git a/ocpp2.0/remotecontrol/remote_control.go b/ocpp2.0.1/remotecontrol/remote_control.go similarity index 100% rename from ocpp2.0/remotecontrol/remote_control.go rename to ocpp2.0.1/remotecontrol/remote_control.go diff --git a/ocpp2.0/remotecontrol/request_start_transaction.go b/ocpp2.0.1/remotecontrol/request_start_transaction.go similarity index 98% rename from ocpp2.0/remotecontrol/request_start_transaction.go rename to ocpp2.0.1/remotecontrol/request_start_transaction.go index 58939825..e63d839a 100644 --- a/ocpp2.0/remotecontrol/request_start_transaction.go +++ b/ocpp2.0.1/remotecontrol/request_start_transaction.go @@ -3,7 +3,7 @@ package remotecontrol import ( "reflect" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "gopkg.in/go-playground/validator.v9" ) diff --git a/ocpp2.0/remotecontrol/request_stop_transaction.go b/ocpp2.0.1/remotecontrol/request_stop_transaction.go similarity index 97% rename from ocpp2.0/remotecontrol/request_stop_transaction.go rename to ocpp2.0.1/remotecontrol/request_stop_transaction.go index 9803f0d6..d805967c 100644 --- a/ocpp2.0/remotecontrol/request_stop_transaction.go +++ b/ocpp2.0.1/remotecontrol/request_stop_transaction.go @@ -3,7 +3,7 @@ package remotecontrol import ( "reflect" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Request Start Transaction (CSMS -> CS) -------------------- diff --git a/ocpp2.0/remotecontrol/trigger_message.go b/ocpp2.0.1/remotecontrol/trigger_message.go similarity index 98% rename from ocpp2.0/remotecontrol/trigger_message.go rename to ocpp2.0.1/remotecontrol/trigger_message.go index 86acfd8f..b81bb032 100644 --- a/ocpp2.0/remotecontrol/trigger_message.go +++ b/ocpp2.0.1/remotecontrol/trigger_message.go @@ -3,7 +3,7 @@ package remotecontrol import ( "reflect" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "gopkg.in/go-playground/validator.v9" ) diff --git a/ocpp2.0/remotecontrol/unlock_connector.go b/ocpp2.0.1/remotecontrol/unlock_connector.go similarity index 98% rename from ocpp2.0/remotecontrol/unlock_connector.go rename to ocpp2.0.1/remotecontrol/unlock_connector.go index 080ff34a..9cbadc6d 100644 --- a/ocpp2.0/remotecontrol/unlock_connector.go +++ b/ocpp2.0.1/remotecontrol/unlock_connector.go @@ -5,7 +5,7 @@ import ( "gopkg.in/go-playground/validator.v9" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Trigger Message (CSMS -> CS) -------------------- diff --git a/ocpp2.0/reservation/cancel_reservation.go b/ocpp2.0.1/reservation/cancel_reservation.go similarity index 98% rename from ocpp2.0/reservation/cancel_reservation.go rename to ocpp2.0.1/reservation/cancel_reservation.go index 1ba984ac..c559539c 100644 --- a/ocpp2.0/reservation/cancel_reservation.go +++ b/ocpp2.0.1/reservation/cancel_reservation.go @@ -5,7 +5,7 @@ import ( "gopkg.in/go-playground/validator.v9" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Cancel Reservation (CSMS -> CS) -------------------- diff --git a/ocpp2.0/reservation/reservation.go b/ocpp2.0.1/reservation/reservation.go similarity index 100% rename from ocpp2.0/reservation/reservation.go rename to ocpp2.0.1/reservation/reservation.go diff --git a/ocpp2.0/reservation/reservation_status_update.go b/ocpp2.0.1/reservation/reservation_status_update.go similarity index 98% rename from ocpp2.0/reservation/reservation_status_update.go rename to ocpp2.0.1/reservation/reservation_status_update.go index fac2d3ca..c2a9b4ec 100644 --- a/ocpp2.0/reservation/reservation_status_update.go +++ b/ocpp2.0.1/reservation/reservation_status_update.go @@ -3,7 +3,7 @@ package reservation import ( "reflect" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "gopkg.in/go-playground/validator.v9" ) diff --git a/ocpp2.0/reservation/reserve_now.go b/ocpp2.0.1/reservation/reserve_now.go similarity index 99% rename from ocpp2.0/reservation/reserve_now.go rename to ocpp2.0.1/reservation/reserve_now.go index df70ec12..a5f916f9 100644 --- a/ocpp2.0/reservation/reserve_now.go +++ b/ocpp2.0.1/reservation/reserve_now.go @@ -3,7 +3,7 @@ package reservation import ( "reflect" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "gopkg.in/go-playground/validator.v9" ) diff --git a/ocpp2.0/security/certificate_signed.go b/ocpp2.0.1/security/certificate_signed.go similarity index 98% rename from ocpp2.0/security/certificate_signed.go rename to ocpp2.0.1/security/certificate_signed.go index dc2376dd..9c84d82b 100644 --- a/ocpp2.0/security/certificate_signed.go +++ b/ocpp2.0.1/security/certificate_signed.go @@ -5,7 +5,7 @@ import ( "gopkg.in/go-playground/validator.v9" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Certificate Signed (CSMS -> CS) -------------------- diff --git a/ocpp2.0/security/security.go b/ocpp2.0.1/security/security.go similarity index 100% rename from ocpp2.0/security/security.go rename to ocpp2.0.1/security/security.go diff --git a/ocpp2.0/security/security_event_notification.go b/ocpp2.0.1/security/security_event_notification.go similarity index 98% rename from ocpp2.0/security/security_event_notification.go rename to ocpp2.0.1/security/security_event_notification.go index 51af4b5e..0896beea 100644 --- a/ocpp2.0/security/security_event_notification.go +++ b/ocpp2.0.1/security/security_event_notification.go @@ -3,7 +3,7 @@ package security import ( "reflect" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Security Event Notification Status (CS -> CSMS) -------------------- diff --git a/ocpp2.0/security/sign_certificate.go b/ocpp2.0.1/security/sign_certificate.go similarity index 98% rename from ocpp2.0/security/sign_certificate.go rename to ocpp2.0.1/security/sign_certificate.go index 0a9734c3..b6c63eaa 100644 --- a/ocpp2.0/security/sign_certificate.go +++ b/ocpp2.0.1/security/sign_certificate.go @@ -3,7 +3,7 @@ package security import ( "reflect" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Sign Certificate (CS -> CSMS) -------------------- diff --git a/ocpp2.0/smartcharging/clear_charging_profile.go b/ocpp2.0.1/smartcharging/clear_charging_profile.go similarity index 98% rename from ocpp2.0/smartcharging/clear_charging_profile.go rename to ocpp2.0.1/smartcharging/clear_charging_profile.go index c95a6422..d12c4876 100644 --- a/ocpp2.0/smartcharging/clear_charging_profile.go +++ b/ocpp2.0.1/smartcharging/clear_charging_profile.go @@ -5,7 +5,7 @@ import ( "gopkg.in/go-playground/validator.v9" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Clear Charging Profile (CSMS -> CS) -------------------- diff --git a/ocpp2.0/smartcharging/cleared_charging_limit.go b/ocpp2.0.1/smartcharging/cleared_charging_limit.go similarity index 97% rename from ocpp2.0/smartcharging/cleared_charging_limit.go rename to ocpp2.0.1/smartcharging/cleared_charging_limit.go index f37561d9..a6966877 100644 --- a/ocpp2.0/smartcharging/cleared_charging_limit.go +++ b/ocpp2.0.1/smartcharging/cleared_charging_limit.go @@ -3,7 +3,7 @@ package smartcharging import ( "reflect" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Cleared Charging Limit (CS -> CSMS) -------------------- diff --git a/ocpp2.0/smartcharging/get_charging_profiles.go b/ocpp2.0.1/smartcharging/get_charging_profiles.go similarity index 98% rename from ocpp2.0/smartcharging/get_charging_profiles.go rename to ocpp2.0.1/smartcharging/get_charging_profiles.go index deb73ce0..8fa4c053 100644 --- a/ocpp2.0/smartcharging/get_charging_profiles.go +++ b/ocpp2.0.1/smartcharging/get_charging_profiles.go @@ -5,7 +5,7 @@ import ( "gopkg.in/go-playground/validator.v9" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Get Charging Profiles (CSMS -> Charging Station) -------------------- diff --git a/ocpp2.0/smartcharging/get_composite_schedule.go b/ocpp2.0.1/smartcharging/get_composite_schedule.go similarity index 98% rename from ocpp2.0/smartcharging/get_composite_schedule.go rename to ocpp2.0.1/smartcharging/get_composite_schedule.go index f101c7b3..08574b67 100644 --- a/ocpp2.0/smartcharging/get_composite_schedule.go +++ b/ocpp2.0.1/smartcharging/get_composite_schedule.go @@ -1,9 +1,10 @@ package smartcharging import ( - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" - "gopkg.in/go-playground/validator.v9" "reflect" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" + "gopkg.in/go-playground/validator.v9" ) // -------------------- Get Composite Schedule (CSMS -> CS) -------------------- diff --git a/ocpp2.0/smartcharging/notify_charging_limit.go b/ocpp2.0.1/smartcharging/notify_charging_limit.go similarity index 98% rename from ocpp2.0/smartcharging/notify_charging_limit.go rename to ocpp2.0.1/smartcharging/notify_charging_limit.go index 51c3dc05..143a2684 100644 --- a/ocpp2.0/smartcharging/notify_charging_limit.go +++ b/ocpp2.0.1/smartcharging/notify_charging_limit.go @@ -1,8 +1,9 @@ package smartcharging import ( - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" "reflect" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Notify Charging Limit (CS -> CSMS) -------------------- diff --git a/ocpp2.0/smartcharging/notify_ev_charging_needs.go b/ocpp2.0.1/smartcharging/notify_ev_charging_needs.go similarity index 99% rename from ocpp2.0/smartcharging/notify_ev_charging_needs.go rename to ocpp2.0.1/smartcharging/notify_ev_charging_needs.go index 735941e8..a83e7faf 100644 --- a/ocpp2.0/smartcharging/notify_ev_charging_needs.go +++ b/ocpp2.0.1/smartcharging/notify_ev_charging_needs.go @@ -1,9 +1,10 @@ package smartcharging import ( - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" - "gopkg.in/go-playground/validator.v9" "reflect" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" + "gopkg.in/go-playground/validator.v9" ) // -------------------- Notify EV Charging Needs (CS -> CSMS) -------------------- diff --git a/ocpp2.0/smartcharging/notify_ev_charging_schedule.go b/ocpp2.0.1/smartcharging/notify_ev_charging_schedule.go similarity index 98% rename from ocpp2.0/smartcharging/notify_ev_charging_schedule.go rename to ocpp2.0.1/smartcharging/notify_ev_charging_schedule.go index 7ed9ccac..6c8b6fdd 100644 --- a/ocpp2.0/smartcharging/notify_ev_charging_schedule.go +++ b/ocpp2.0.1/smartcharging/notify_ev_charging_schedule.go @@ -1,8 +1,9 @@ package smartcharging import ( - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" "reflect" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Notify EV Charging Schedule (CS -> CSMS) -------------------- diff --git a/ocpp2.0/smartcharging/report_charging_profiles.go b/ocpp2.0.1/smartcharging/report_charging_profiles.go similarity index 98% rename from ocpp2.0/smartcharging/report_charging_profiles.go rename to ocpp2.0.1/smartcharging/report_charging_profiles.go index 5f885c80..c1f8b998 100644 --- a/ocpp2.0/smartcharging/report_charging_profiles.go +++ b/ocpp2.0.1/smartcharging/report_charging_profiles.go @@ -1,8 +1,9 @@ package smartcharging import ( - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" "reflect" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // -------------------- Report Charging Profiles (CS -> CSMS) -------------------- diff --git a/ocpp2.0/smartcharging/set_charging_profile.go b/ocpp2.0.1/smartcharging/set_charging_profile.go similarity index 98% rename from ocpp2.0/smartcharging/set_charging_profile.go rename to ocpp2.0.1/smartcharging/set_charging_profile.go index 91610731..83be9768 100644 --- a/ocpp2.0/smartcharging/set_charging_profile.go +++ b/ocpp2.0.1/smartcharging/set_charging_profile.go @@ -3,7 +3,7 @@ package smartcharging import ( "reflect" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "gopkg.in/go-playground/validator.v9" ) diff --git a/ocpp2.0/smartcharging/smart_charging.go b/ocpp2.0.1/smartcharging/smart_charging.go similarity index 100% rename from ocpp2.0/smartcharging/smart_charging.go rename to ocpp2.0.1/smartcharging/smart_charging.go diff --git a/ocpp2.0/tariffcost/cost_updated.go b/ocpp2.0.1/tariffcost/cost_updated.go similarity index 100% rename from ocpp2.0/tariffcost/cost_updated.go rename to ocpp2.0.1/tariffcost/cost_updated.go diff --git a/ocpp2.0/tariffcost/tariff_cost.go b/ocpp2.0.1/tariffcost/tariff_cost.go similarity index 100% rename from ocpp2.0/tariffcost/tariff_cost.go rename to ocpp2.0.1/tariffcost/tariff_cost.go diff --git a/ocpp2.0/transactions/get_transaction_status.go b/ocpp2.0.1/transactions/get_transaction_status.go similarity index 93% rename from ocpp2.0/transactions/get_transaction_status.go rename to ocpp2.0.1/transactions/get_transaction_status.go index 8246e530..1582d6ad 100644 --- a/ocpp2.0/transactions/get_transaction_status.go +++ b/ocpp2.0.1/transactions/get_transaction_status.go @@ -16,8 +16,8 @@ type GetTransactionStatusRequest struct { // This field definition of the GetTransactionStatus response payload, sent by the Charging Station to the CSMS in response to a GetTransactionStatusRequest. // In case the request was invalid, or couldn't be processed, an error will be sent instead. type GetTransactionStatusResponse struct { - OngoingIndicator *bool `json:"ongoingIndicator,omitempty" validate:"omitempty"` - MessageInQueue bool `json:"messageInQueue"` + OngoingIndicator *bool `json:"ongoingIndicator,omitempty" validate:"omitempty"` + MessageInQueue bool `json:"messageInQueue"` } // In some scenarios a CSMS needs to know whether there are still messages for a transaction that need to be delivered. diff --git a/ocpp2.0/transactions/transaction_event.go b/ocpp2.0.1/transactions/transaction_event.go similarity index 99% rename from ocpp2.0/transactions/transaction_event.go rename to ocpp2.0.1/transactions/transaction_event.go index 8f00a4ea..72d9381f 100644 --- a/ocpp2.0/transactions/transaction_event.go +++ b/ocpp2.0.1/transactions/transaction_event.go @@ -3,7 +3,7 @@ package transactions import ( "reflect" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "gopkg.in/go-playground/validator.v9" ) diff --git a/ocpp2.0/transactions/transactions.go b/ocpp2.0.1/transactions/transactions.go similarity index 100% rename from ocpp2.0/transactions/transactions.go rename to ocpp2.0.1/transactions/transactions.go diff --git a/ocpp2.0/types/datetime.go b/ocpp2.0.1/types/datetime.go similarity index 100% rename from ocpp2.0/types/datetime.go rename to ocpp2.0.1/types/datetime.go diff --git a/ocpp2.0/types/types.go b/ocpp2.0.1/types/types.go similarity index 99% rename from ocpp2.0/types/types.go rename to ocpp2.0.1/types/types.go index 3655ab8f..80967775 100644 --- a/ocpp2.0/types/types.go +++ b/ocpp2.0.1/types/types.go @@ -8,8 +8,8 @@ import ( ) const ( - V2Subprotocol = "ocpp2.0" - V201Subprotocol = "ocpp2.0.1" + V2Subprotocol = "ocpp2.0.1" + V201Subprotocol = "ocpp2.0.1.1" ) type PropertyViolation struct { diff --git a/ocpp2.0/v2.go b/ocpp2.0.1/v2.go similarity index 96% rename from ocpp2.0/v2.go rename to ocpp2.0.1/v2.go index 84c82d57..6b6c30c7 100644 --- a/ocpp2.0/v2.go +++ b/ocpp2.0.1/v2.go @@ -1,4 +1,4 @@ -// The package contains an implementation of the OCPP 2.0 communication protocol between a Charging Station and an Charging Station Management System in an EV charging infrastructure. +// The package contains an implementation of the OCPP 2.0.1 communication protocol between a Charging Station and an Charging Station Management System in an EV charging infrastructure. package ocpp2 import ( @@ -8,23 +8,23 @@ import ( "github.com/lorenzodonini/ocpp-go/internal/callbackqueue" "github.com/lorenzodonini/ocpp-go/ocpp" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/authorization" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/availability" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/data" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/diagnostics" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/display" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/firmware" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/iso15118" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/localauth" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/meter" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/provisioning" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/remotecontrol" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/reservation" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/security" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/smartcharging" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/tariffcost" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/transactions" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/authorization" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/availability" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/data" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/diagnostics" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/display" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/firmware" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/iso15118" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/localauth" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/meter" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/provisioning" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/remotecontrol" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/reservation" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/security" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/smartcharging" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/tariffcost" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/transactions" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "github.com/lorenzodonini/ocpp-go/ocppj" "github.com/lorenzodonini/ocpp-go/ws" ) diff --git a/ocpp2.0_test/authorize_test.go b/ocpp2.0.1_test/authorize_test.go similarity index 98% rename from ocpp2.0_test/authorize_test.go rename to ocpp2.0.1_test/authorize_test.go index 0c64a1e7..db31dab3 100644 --- a/ocpp2.0_test/authorize_test.go +++ b/ocpp2.0.1_test/authorize_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/authorization" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/authorization" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -63,7 +63,7 @@ func (suite *OcppV2TestSuite) TestAuthorizeE2EMocked() { responseRaw := []byte(responseJson) channel := NewMockWebSocket(wsId) - handler := MockCSMSAuthorizationHandler{} + handler := &MockCSMSAuthorizationHandler{} handler.On("OnAuthorize", mock.AnythingOfType("string"), mock.Anything).Return(authorizeConfirmation, nil).Run(func(args mock.Arguments) { request := args.Get(1).(*authorization.AuthorizeRequest) assert.Equal(t, certificate, request.Certificate) diff --git a/ocpp2.0_test/boot_notification_test.go b/ocpp2.0.1_test/boot_notification_test.go similarity index 98% rename from ocpp2.0_test/boot_notification_test.go rename to ocpp2.0.1_test/boot_notification_test.go index 93bb7caa..f710c4d1 100644 --- a/ocpp2.0_test/boot_notification_test.go +++ b/ocpp2.0.1_test/boot_notification_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/provisioning" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/provisioning" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Tests @@ -67,7 +67,7 @@ func (suite *OcppV2TestSuite) TestBootNotificationE2EMocked() { bootNotificationConfirmation := provisioning.NewBootNotificationResponse(currentTime, interval, registrationStatus) channel := NewMockWebSocket(wsId) - handler := MockCSMSProvisioningHandler{} + handler := &MockCSMSProvisioningHandler{} handler.On("OnBootNotification", mock.AnythingOfType("string"), mock.Anything).Return(bootNotificationConfirmation, nil).Run(func(args mock.Arguments) { request := args.Get(1).(*provisioning.BootNotificationRequest) assert.Equal(t, reason, request.Reason) diff --git a/ocpp2.0_test/cancel_reservation_test.go b/ocpp2.0.1_test/cancel_reservation_test.go similarity index 95% rename from ocpp2.0_test/cancel_reservation_test.go rename to ocpp2.0.1_test/cancel_reservation_test.go index e30a2816..0ae852e1 100644 --- a/ocpp2.0_test/cancel_reservation_test.go +++ b/ocpp2.0.1_test/cancel_reservation_test.go @@ -3,8 +3,8 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/reservation" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/reservation" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" @@ -46,7 +46,7 @@ func (suite *OcppV2TestSuite) TestCancelReservationE2EMocked() { cancelReservationConfirmation := reservation.NewCancelReservationResponse(status) channel := NewMockWebSocket(wsId) - handler := MockChargingStationReservationHandler{} + handler := &MockChargingStationReservationHandler{} handler.On("OnCancelReservation", mock.Anything).Return(cancelReservationConfirmation, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*reservation.CancelReservationRequest) require.True(t, ok) diff --git a/ocpp2.0_test/certificate_signed_test.go b/ocpp2.0.1_test/certificate_signed_test.go similarity index 96% rename from ocpp2.0_test/certificate_signed_test.go rename to ocpp2.0.1_test/certificate_signed_test.go index ad3d57e6..573aaa15 100644 --- a/ocpp2.0_test/certificate_signed_test.go +++ b/ocpp2.0.1_test/certificate_signed_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/security" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/security" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) func (suite *OcppV2TestSuite) TestCertificateSignedRequestValidation() { @@ -52,7 +52,7 @@ func (suite *OcppV2TestSuite) TestCertificateSignedE2EMocked() { certificateSignedConfirmation := security.NewCertificateSignedResponse(status) channel := NewMockWebSocket(wsId) // Setting handlers - handler := MockChargingStationSecurityHandler{} + handler := &MockChargingStationSecurityHandler{} handler.On("OnCertificateSigned", mock.Anything).Return(certificateSignedConfirmation, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*security.CertificateSignedRequest) require.True(t, ok) diff --git a/ocpp2.0_test/change_availability_test.go b/ocpp2.0.1_test/change_availability_test.go similarity index 96% rename from ocpp2.0_test/change_availability_test.go rename to ocpp2.0.1_test/change_availability_test.go index f1d2d0d0..b4422204 100644 --- a/ocpp2.0_test/change_availability_test.go +++ b/ocpp2.0.1_test/change_availability_test.go @@ -3,8 +3,8 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/availability" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/availability" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" @@ -52,7 +52,7 @@ func (suite *OcppV2TestSuite) TestChangeAvailabilityE2EMocked() { changeAvailabilityConfirmation := availability.NewChangeAvailabilityResponse(status) channel := NewMockWebSocket(wsId) // Setting handlers - handler := MockChargingStationAvailabilityHandler{} + handler := &MockChargingStationAvailabilityHandler{} handler.On("OnChangeAvailability", mock.Anything).Return(changeAvailabilityConfirmation, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*availability.ChangeAvailabilityRequest) require.True(t, ok) diff --git a/ocpp2.0_test/clear_cache_test.go b/ocpp2.0.1_test/clear_cache_test.go similarity index 94% rename from ocpp2.0_test/clear_cache_test.go rename to ocpp2.0.1_test/clear_cache_test.go index 2a2d87bc..2b827193 100644 --- a/ocpp2.0_test/clear_cache_test.go +++ b/ocpp2.0.1_test/clear_cache_test.go @@ -3,8 +3,8 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/authorization" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/authorization" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" @@ -45,7 +45,7 @@ func (suite *OcppV2TestSuite) TestClearCacheE2EMocked() { clearCacheResponse.StatusInfo = statusInfo channel := NewMockWebSocket(wsId) - handler := MockChargingStationAuthorizationHandler{} + handler := &MockChargingStationAuthorizationHandler{} handler.On("OnClearCache", mock.Anything).Return(clearCacheResponse, nil) setupDefaultCSMSHandlers(suite, expectedCSMSOptions{clientId: wsId, rawWrittenMessage: []byte(requestJson), forwardWrittenMessage: true}) setupDefaultChargingStationHandlers(suite, expectedChargingStationOptions{serverUrl: wsUrl, clientId: wsId, createChannelOnStart: true, channel: channel, rawWrittenMessage: []byte(responseJson), forwardWrittenMessage: true}, handler) diff --git a/ocpp2.0_test/clear_charging_profile_test.go b/ocpp2.0.1_test/clear_charging_profile_test.go similarity index 97% rename from ocpp2.0_test/clear_charging_profile_test.go rename to ocpp2.0.1_test/clear_charging_profile_test.go index a6dd456e..0ea450ea 100644 --- a/ocpp2.0_test/clear_charging_profile_test.go +++ b/ocpp2.0.1_test/clear_charging_profile_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/smartcharging" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/smartcharging" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -58,7 +58,7 @@ func (suite *OcppV2TestSuite) TestClearChargingProfileE2EMocked() { clearChargingProfileConfirmation := smartcharging.NewClearChargingProfileResponse(status) channel := NewMockWebSocket(wsId) - handler := MockChargingStationSmartChargingHandler{} + handler := &MockChargingStationSmartChargingHandler{} handler.On("OnClearChargingProfile", mock.Anything).Return(clearChargingProfileConfirmation, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*smartcharging.ClearChargingProfileRequest) require.True(t, ok) diff --git a/ocpp2.0_test/clear_display_message_test.go b/ocpp2.0.1_test/clear_display_message_test.go similarity index 96% rename from ocpp2.0_test/clear_display_message_test.go rename to ocpp2.0.1_test/clear_display_message_test.go index 8e36bb1e..1d0ca826 100644 --- a/ocpp2.0_test/clear_display_message_test.go +++ b/ocpp2.0.1_test/clear_display_message_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/display" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/display" ) // Test @@ -43,7 +43,7 @@ func (suite *OcppV2TestSuite) TestClearDisplayMessageE2EMocked() { clearDisplayConfirmation := display.NewClearDisplayResponse(status) channel := NewMockWebSocket(wsId) - handler := MockChargingStationDisplayHandler{} + handler := &MockChargingStationDisplayHandler{} handler.On("OnClearDisplay", mock.Anything).Return(clearDisplayConfirmation, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*display.ClearDisplayRequest) require.True(t, ok) diff --git a/ocpp2.0_test/clear_variable_monitoring_test.go b/ocpp2.0.1_test/clear_variable_monitoring_test.go similarity index 97% rename from ocpp2.0_test/clear_variable_monitoring_test.go rename to ocpp2.0.1_test/clear_variable_monitoring_test.go index 48e7cd84..39489b05 100644 --- a/ocpp2.0_test/clear_variable_monitoring_test.go +++ b/ocpp2.0.1_test/clear_variable_monitoring_test.go @@ -2,10 +2,12 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/diagnostics" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/diagnostics" ) // Test @@ -47,7 +49,7 @@ func (suite *OcppV2TestSuite) TestClearVariableMonitoringE2EMocked() { clearVariableMonitoringConfirmation := diagnostics.NewClearVariableMonitoringResponse([]diagnostics.ClearMonitoringResult{result1, result2}) channel := NewMockWebSocket(wsId) - handler := MockChargingStationDiagnosticsHandler{} + handler := &MockChargingStationDiagnosticsHandler{} handler.On("OnClearVariableMonitoring", mock.Anything).Return(clearVariableMonitoringConfirmation, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*diagnostics.ClearVariableMonitoringRequest) require.True(t, ok) diff --git a/ocpp2.0_test/cleared_charging_limit_test.go b/ocpp2.0.1_test/cleared_charging_limit_test.go similarity index 95% rename from ocpp2.0_test/cleared_charging_limit_test.go rename to ocpp2.0.1_test/cleared_charging_limit_test.go index 8b17c3e6..c3fbbeaf 100644 --- a/ocpp2.0_test/cleared_charging_limit_test.go +++ b/ocpp2.0.1_test/cleared_charging_limit_test.go @@ -2,11 +2,13 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/smartcharging" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/smartcharging" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Tests @@ -42,7 +44,7 @@ func (suite *OcppV2TestSuite) TestClearedChargingLimitE2EMocked() { clearedChargingLimitConfirmation := smartcharging.NewClearedChargingLimitResponse() channel := NewMockWebSocket(wsId) - handler := MockCSMSSmartChargingHandler{} + handler := &MockCSMSSmartChargingHandler{} handler.On("OnClearedChargingLimit", mock.AnythingOfType("string"), mock.Anything).Return(clearedChargingLimitConfirmation, nil).Run(func(args mock.Arguments) { request, ok := args.Get(1).(*smartcharging.ClearedChargingLimitRequest) require.True(t, ok) diff --git a/ocpp2.0_test/common_test.go b/ocpp2.0.1_test/common_test.go similarity index 99% rename from ocpp2.0_test/common_test.go rename to ocpp2.0.1_test/common_test.go index b5b81e95..63e6bbb0 100644 --- a/ocpp2.0_test/common_test.go +++ b/ocpp2.0.1_test/common_test.go @@ -4,8 +4,8 @@ import ( "strings" "time" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/display" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/display" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Utility functions diff --git a/ocpp2.0_test/cost_updated_test.go b/ocpp2.0.1_test/cost_updated_test.go similarity index 96% rename from ocpp2.0_test/cost_updated_test.go rename to ocpp2.0.1_test/cost_updated_test.go index a10129d5..da837fd8 100644 --- a/ocpp2.0_test/cost_updated_test.go +++ b/ocpp2.0.1_test/cost_updated_test.go @@ -2,10 +2,12 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/tariffcost" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/tariffcost" ) // Test @@ -41,7 +43,7 @@ func (suite *OcppV2TestSuite) TestCostUpdatedE2EMocked() { costUpdatedConfirmation := tariffcost.NewCostUpdatedResponse() channel := NewMockWebSocket(wsId) - handler := MockChargingStationTariffCostHandler{} + handler := &MockChargingStationTariffCostHandler{} handler.On("OnCostUpdated", mock.Anything).Return(costUpdatedConfirmation, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*tariffcost.CostUpdatedRequest) require.True(t, ok) diff --git a/ocpp2.0_test/customer_information_test.go b/ocpp2.0.1_test/customer_information_test.go similarity index 97% rename from ocpp2.0_test/customer_information_test.go rename to ocpp2.0.1_test/customer_information_test.go index 13a36ecc..21776090 100644 --- a/ocpp2.0_test/customer_information_test.go +++ b/ocpp2.0.1_test/customer_information_test.go @@ -2,11 +2,13 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/diagnostics" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/diagnostics" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -57,7 +59,7 @@ func (suite *OcppV2TestSuite) TestCustomerInformationE2EMocked() { customerInformationConfirmation := diagnostics.NewCustomerInformationResponse(status) channel := NewMockWebSocket(wsId) - handler := MockChargingStationDiagnosticsHandler{} + handler := &MockChargingStationDiagnosticsHandler{} handler.On("OnCustomerInformation", mock.Anything).Return(customerInformationConfirmation, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*diagnostics.CustomerInformationRequest) require.True(t, ok) diff --git a/ocpp2.0_test/data_transfer_test.go b/ocpp2.0.1_test/data_transfer_test.go similarity index 97% rename from ocpp2.0_test/data_transfer_test.go rename to ocpp2.0.1_test/data_transfer_test.go index 805012e6..7b4782fa 100644 --- a/ocpp2.0_test/data_transfer_test.go +++ b/ocpp2.0.1_test/data_transfer_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/data" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/data" ) // Test @@ -49,7 +49,7 @@ func (suite *OcppV2TestSuite) TestDataTransferFromChargePointE2EMocked() { dataTransferConfirmation := data.NewDataTransferResponse(status) channel := NewMockWebSocket(wsId) - handler := MockCSMSDataHandler{} + handler := &MockCSMSDataHandler{} handler.On("OnDataTransfer", mock.AnythingOfType("string"), mock.Anything).Return(dataTransferConfirmation, nil).Run(func(args mock.Arguments) { request, ok := args.Get(1).(*data.DataTransferRequest) require.True(t, ok) @@ -80,7 +80,7 @@ func (suite *OcppV2TestSuite) TestDataTransferFromCentralSystemE2EMocked() { dataTransferConfirmation := data.NewDataTransferResponse(status) channel := NewMockWebSocket(wsId) - handler := MockChargingStationDataHandler{} + handler := &MockChargingStationDataHandler{} handler.On("OnDataTransfer", mock.Anything).Return(dataTransferConfirmation, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*data.DataTransferRequest) require.True(t, ok) diff --git a/ocpp2.0_test/delete_certificate_test.go b/ocpp2.0.1_test/delete_certificate_test.go similarity index 96% rename from ocpp2.0_test/delete_certificate_test.go rename to ocpp2.0.1_test/delete_certificate_test.go index 1d47ad27..641be98e 100644 --- a/ocpp2.0_test/delete_certificate_test.go +++ b/ocpp2.0.1_test/delete_certificate_test.go @@ -2,11 +2,13 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/iso15118" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/iso15118" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -45,7 +47,7 @@ func (suite *OcppV2TestSuite) TestDeleteCertificateE2EMocked() { deleteCertificateConfirmation := iso15118.NewDeleteCertificateResponse(status) channel := NewMockWebSocket(wsId) - handler := MockChargingStationIso15118Handler{} + handler := &MockChargingStationIso15118Handler{} handler.On("OnDeleteCertificate", mock.Anything).Return(deleteCertificateConfirmation, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*iso15118.DeleteCertificateRequest) require.True(t, ok) diff --git a/ocpp2.0_test/firmware_status_notification_test.go b/ocpp2.0.1_test/firmware_status_notification_test.go similarity index 97% rename from ocpp2.0_test/firmware_status_notification_test.go rename to ocpp2.0.1_test/firmware_status_notification_test.go index 06a369f2..9aa56f38 100644 --- a/ocpp2.0_test/firmware_status_notification_test.go +++ b/ocpp2.0.1_test/firmware_status_notification_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/firmware" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/firmware" ) // Test @@ -44,7 +44,7 @@ func (suite *OcppV2TestSuite) TestFirmwareStatusNotificationE2EMocked() { firmwareStatusNotificationConfirmation := firmware.NewFirmwareStatusNotificationResponse() channel := NewMockWebSocket(wsId) - handler := MockCSMSFirmwareHandler{} + handler := &MockCSMSFirmwareHandler{} handler.On("OnFirmwareStatusNotification", mock.AnythingOfType("string"), mock.Anything).Return(firmwareStatusNotificationConfirmation, nil).Run(func(args mock.Arguments) { request, ok := args.Get(1).(*firmware.FirmwareStatusNotificationRequest) require.True(t, ok) diff --git a/ocpp2.0_test/get_15118ev_certificate_test.go b/ocpp2.0.1_test/get_15118ev_certificate_test.go similarity index 97% rename from ocpp2.0_test/get_15118ev_certificate_test.go rename to ocpp2.0.1_test/get_15118ev_certificate_test.go index 8c5e098d..65dd4fe4 100644 --- a/ocpp2.0_test/get_15118ev_certificate_test.go +++ b/ocpp2.0.1_test/get_15118ev_certificate_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/iso15118" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/iso15118" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -61,7 +61,7 @@ func (suite *OcppV2TestSuite) TestGet15118EVCertificateE2EMocked() { get15118EVCertificateResponse.StatusInfo = statusInfo channel := NewMockWebSocket(wsId) - handler := MockCSMSIso15118Handler{} + handler := &MockCSMSIso15118Handler{} handler.On("OnGet15118EVCertificate", mock.AnythingOfType("string"), mock.Anything).Return(get15118EVCertificateResponse, nil).Run(func(args mock.Arguments) { request, ok := args.Get(1).(*iso15118.Get15118EVCertificateRequest) require.True(t, ok) diff --git a/ocpp2.0_test/get_base_report_test.go b/ocpp2.0.1_test/get_base_report_test.go similarity index 95% rename from ocpp2.0_test/get_base_report_test.go rename to ocpp2.0.1_test/get_base_report_test.go index 6938d48d..3175b684 100644 --- a/ocpp2.0_test/get_base_report_test.go +++ b/ocpp2.0.1_test/get_base_report_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/provisioning" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/provisioning" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -47,7 +47,7 @@ func (suite *OcppV2TestSuite) TestGetBaseReportE2EMocked() { getBaseReportConfirmation := provisioning.NewGetBaseReportResponse(status) channel := NewMockWebSocket(wsId) - handler := MockChargingStationProvisioningHandler{} + handler := &MockChargingStationProvisioningHandler{} handler.On("OnGetBaseReport", mock.Anything).Return(getBaseReportConfirmation, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*provisioning.GetBaseReportRequest) require.True(t, ok) diff --git a/ocpp2.0_test/get_certificate_status_test.go b/ocpp2.0.1_test/get_certificate_status_test.go similarity index 97% rename from ocpp2.0_test/get_certificate_status_test.go rename to ocpp2.0.1_test/get_certificate_status_test.go index 082e8eb7..a80ebe36 100644 --- a/ocpp2.0_test/get_certificate_status_test.go +++ b/ocpp2.0.1_test/get_certificate_status_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/iso15118" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/iso15118" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -50,7 +50,7 @@ func (suite *OcppV2TestSuite) TestGetCertificateStatusE2EMocked() { getCertificateStatusConfirmation.OcspResult = ocspResult channel := NewMockWebSocket(wsId) - handler := MockCSMSIso15118Handler{} + handler := &MockCSMSIso15118Handler{} handler.On("OnGetCertificateStatus", mock.AnythingOfType("string"), mock.Anything).Return(getCertificateStatusConfirmation, nil).Run(func(args mock.Arguments) { request, ok := args.Get(1).(*iso15118.GetCertificateStatusRequest) require.True(t, ok) diff --git a/ocpp2.0_test/get_charging_profiles_test.go b/ocpp2.0.1_test/get_charging_profiles_test.go similarity index 97% rename from ocpp2.0_test/get_charging_profiles_test.go rename to ocpp2.0.1_test/get_charging_profiles_test.go index 7b76055a..637996cf 100644 --- a/ocpp2.0_test/get_charging_profiles_test.go +++ b/ocpp2.0.1_test/get_charging_profiles_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/smartcharging" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/smartcharging" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -67,7 +67,7 @@ func (suite *OcppV2TestSuite) TestGetChargingProfilesE2EMocked() { getChargingProfilesConfirmation := smartcharging.NewGetChargingProfilesResponse(status) channel := NewMockWebSocket(wsId) - handler := MockChargingStationSmartChargingHandler{} + handler := &MockChargingStationSmartChargingHandler{} handler.On("OnGetChargingProfiles", mock.Anything).Return(getChargingProfilesConfirmation, nil).Run(func(args mock.Arguments) { // Assert request message contents request, ok := args.Get(0).(*smartcharging.GetChargingProfilesRequest) diff --git a/ocpp2.0_test/get_composite_schedule_test.go b/ocpp2.0.1_test/get_composite_schedule_test.go similarity index 98% rename from ocpp2.0_test/get_composite_schedule_test.go rename to ocpp2.0.1_test/get_composite_schedule_test.go index 4e1136e3..74a0fd56 100644 --- a/ocpp2.0_test/get_composite_schedule_test.go +++ b/ocpp2.0.1_test/get_composite_schedule_test.go @@ -4,11 +4,12 @@ import ( "fmt" "time" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/smartcharging" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/smartcharging" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -74,7 +75,7 @@ func (suite *OcppV2TestSuite) TestGetCompositeScheduleE2EMocked() { getCompositeScheduleConfirmation.Schedule = &compositeSchedule channel := NewMockWebSocket(wsId) - handler := MockChargingStationSmartChargingHandler{} + handler := &MockChargingStationSmartChargingHandler{} handler.On("OnGetCompositeSchedule", mock.Anything).Return(getCompositeScheduleConfirmation, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*smartcharging.GetCompositeScheduleRequest) assert.True(t, ok) diff --git a/ocpp2.0_test/get_display_messages_test.go b/ocpp2.0.1_test/get_display_messages_test.go similarity index 97% rename from ocpp2.0_test/get_display_messages_test.go rename to ocpp2.0.1_test/get_display_messages_test.go index 36c5e67b..267c255c 100644 --- a/ocpp2.0_test/get_display_messages_test.go +++ b/ocpp2.0.1_test/get_display_messages_test.go @@ -2,10 +2,12 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/display" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/display" ) // Test @@ -54,7 +56,7 @@ func (suite *OcppV2TestSuite) TestGetDisplayMessagesE2EMocked() { getDisplayMessagesConfirmation := display.NewGetDisplayMessagesResponse(status) channel := NewMockWebSocket(wsId) - handler := MockChargingStationDisplayHandler{} + handler := &MockChargingStationDisplayHandler{} handler.On("OnGetDisplayMessages", mock.Anything).Return(getDisplayMessagesConfirmation, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*display.GetDisplayMessagesRequest) require.True(t, ok) diff --git a/ocpp2.0_test/get_installed_certificate_ids_test.go b/ocpp2.0.1_test/get_installed_certificate_ids_test.go similarity index 97% rename from ocpp2.0_test/get_installed_certificate_ids_test.go rename to ocpp2.0.1_test/get_installed_certificate_ids_test.go index 5178f719..c419f728 100644 --- a/ocpp2.0_test/get_installed_certificate_ids_test.go +++ b/ocpp2.0.1_test/get_installed_certificate_ids_test.go @@ -2,11 +2,13 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/iso15118" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/iso15118" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) func (suite *OcppV2TestSuite) TestGetInstalledCertificateIdsRequestValidation() { @@ -56,7 +58,7 @@ func (suite *OcppV2TestSuite) TestGetInstalledCertificateIdsE2EMocked() { getInstalledCertificateIdsConfirmation.CertificateHashData = certificateHashData channel := NewMockWebSocket(wsId) // Setting handlers - handler := MockChargingStationIso15118Handler{} + handler := &MockChargingStationIso15118Handler{} handler.On("OnGetInstalledCertificateIds", mock.Anything).Return(getInstalledCertificateIdsConfirmation, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*iso15118.GetInstalledCertificateIdsRequest) require.True(t, ok) diff --git a/ocpp2.0_test/get_local_list_version_test.go b/ocpp2.0.1_test/get_local_list_version_test.go similarity index 96% rename from ocpp2.0_test/get_local_list_version_test.go rename to ocpp2.0.1_test/get_local_list_version_test.go index 9b8138f2..51d1d84b 100644 --- a/ocpp2.0_test/get_local_list_version_test.go +++ b/ocpp2.0.1_test/get_local_list_version_test.go @@ -2,10 +2,12 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/localauth" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/localauth" ) // Test @@ -39,7 +41,7 @@ func (suite *OcppV2TestSuite) TestGetLocalListVersionE2EMocked() { localListVersionConfirmation := localauth.NewGetLocalListVersionResponse(listVersion) channel := NewMockWebSocket(wsId) - handler := MockChargingStationLocalAuthHandler{} + handler := &MockChargingStationLocalAuthHandler{} handler.On("OnGetLocalListVersion", mock.Anything).Return(localListVersionConfirmation, nil) setupDefaultCSMSHandlers(suite, expectedCSMSOptions{clientId: wsId, rawWrittenMessage: []byte(requestJson), forwardWrittenMessage: true}) setupDefaultChargingStationHandlers(suite, expectedChargingStationOptions{serverUrl: wsUrl, clientId: wsId, createChannelOnStart: true, channel: channel, rawWrittenMessage: []byte(responseJson), forwardWrittenMessage: true}, handler) diff --git a/ocpp2.0_test/get_log_test.go b/ocpp2.0.1_test/get_log_test.go similarity index 97% rename from ocpp2.0_test/get_log_test.go rename to ocpp2.0.1_test/get_log_test.go index 1c48dfab..4aa5ae19 100644 --- a/ocpp2.0_test/get_log_test.go +++ b/ocpp2.0.1_test/get_log_test.go @@ -2,12 +2,14 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/diagnostics" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "time" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "time" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/diagnostics" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -72,7 +74,7 @@ func (suite *OcppV2TestSuite) TestGetLogE2EMocked() { getLogConfirmation.Filename = filename channel := NewMockWebSocket(wsId) - handler := MockChargingStationDiagnosticsHandler{} + handler := &MockChargingStationDiagnosticsHandler{} handler.On("OnGetLog", mock.Anything).Return(getLogConfirmation, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*diagnostics.GetLogRequest) require.True(t, ok) diff --git a/ocpp2.0_test/get_monitoring_report_test.go b/ocpp2.0.1_test/get_monitoring_report_test.go similarity index 97% rename from ocpp2.0_test/get_monitoring_report_test.go rename to ocpp2.0.1_test/get_monitoring_report_test.go index b4b85c17..bf9f7c69 100644 --- a/ocpp2.0_test/get_monitoring_report_test.go +++ b/ocpp2.0.1_test/get_monitoring_report_test.go @@ -2,11 +2,13 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/diagnostics" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/diagnostics" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -62,7 +64,7 @@ func (suite *OcppV2TestSuite) TestGetMonitoringReportE2EMocked() { getMonitoringReportConfirmation := diagnostics.NewGetMonitoringReportResponse(status) channel := NewMockWebSocket(wsId) - handler := MockChargingStationDiagnosticsHandler{} + handler := &MockChargingStationDiagnosticsHandler{} handler.On("OnGetMonitoringReport", mock.Anything).Return(getMonitoringReportConfirmation, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*diagnostics.GetMonitoringReportRequest) require.True(t, ok) diff --git a/ocpp2.0_test/get_report_test.go b/ocpp2.0.1_test/get_report_test.go similarity index 97% rename from ocpp2.0_test/get_report_test.go rename to ocpp2.0.1_test/get_report_test.go index 4fe01f19..2cc85ba7 100644 --- a/ocpp2.0_test/get_report_test.go +++ b/ocpp2.0.1_test/get_report_test.go @@ -2,11 +2,13 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/provisioning" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/provisioning" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -63,7 +65,7 @@ func (suite *OcppV2TestSuite) TestGetReportE2EMocked() { getReportConfirmation := provisioning.NewGetReportResponse(status) channel := NewMockWebSocket(wsId) - handler := MockChargingStationProvisioningHandler{} + handler := &MockChargingStationProvisioningHandler{} handler.On("OnGetReport", mock.Anything).Return(getReportConfirmation, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*provisioning.GetReportRequest) require.True(t, ok) diff --git a/ocpp2.0_test/get_transaction_status_test.go b/ocpp2.0.1_test/get_transaction_status_test.go similarity index 96% rename from ocpp2.0_test/get_transaction_status_test.go rename to ocpp2.0.1_test/get_transaction_status_test.go index c39bd647..222bbfee 100644 --- a/ocpp2.0_test/get_transaction_status_test.go +++ b/ocpp2.0.1_test/get_transaction_status_test.go @@ -2,10 +2,12 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/transactions" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/transactions" ) // Test @@ -43,7 +45,7 @@ func (suite *OcppV2TestSuite) TestGetTransactionStatusE2EMocked() { getTransactionStatusResponse.OngoingIndicator = ongoingIndicator channel := NewMockWebSocket(wsId) - handler := MockChargingStationTransactionHandler{} + handler := &MockChargingStationTransactionHandler{} handler.On("OnGetTransactionStatus", mock.Anything).Return(getTransactionStatusResponse, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*transactions.GetTransactionStatusRequest) require.True(t, ok) diff --git a/ocpp2.0_test/get_variables_test.go b/ocpp2.0.1_test/get_variables_test.go similarity index 98% rename from ocpp2.0_test/get_variables_test.go rename to ocpp2.0.1_test/get_variables_test.go index 13023dcb..7e202646 100644 --- a/ocpp2.0_test/get_variables_test.go +++ b/ocpp2.0.1_test/get_variables_test.go @@ -3,11 +3,12 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/provisioning" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/provisioning" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -78,7 +79,7 @@ func (suite *OcppV2TestSuite) TestGetVariablesE2EMocked() { getVariablesResponse := provisioning.NewGetVariablesResponse([]provisioning.GetVariableResult{variableResult}) channel := NewMockWebSocket(wsId) - handler := MockChargingStationProvisioningHandler{} + handler := &MockChargingStationProvisioningHandler{} handler.On("OnGetVariables", mock.Anything).Return(getVariablesResponse, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*provisioning.GetVariablesRequest) require.True(t, ok) diff --git a/ocpp2.0_test/heartbeat_test.go b/ocpp2.0.1_test/heartbeat_test.go similarity index 93% rename from ocpp2.0_test/heartbeat_test.go rename to ocpp2.0.1_test/heartbeat_test.go index 49170882..1563b85d 100644 --- a/ocpp2.0_test/heartbeat_test.go +++ b/ocpp2.0.1_test/heartbeat_test.go @@ -2,12 +2,14 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/availability" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "time" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "time" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/availability" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -39,7 +41,7 @@ func (suite *OcppV2TestSuite) TestHeartbeatE2EMocked() { heartbeatResponse := availability.NewHeartbeatResponse(*currentTime) channel := NewMockWebSocket(wsId) - handler := MockCSMSAvailabilityHandler{} + handler := &MockCSMSAvailabilityHandler{} handler.On("OnHeartbeat", mock.AnythingOfType("string"), mock.Anything).Return(heartbeatResponse, nil).Run(func(args mock.Arguments) { request, ok := args.Get(1).(*availability.HeartbeatRequest) require.True(t, ok) diff --git a/ocpp2.0_test/install_certificate_test.go b/ocpp2.0.1_test/install_certificate_test.go similarity index 96% rename from ocpp2.0_test/install_certificate_test.go rename to ocpp2.0.1_test/install_certificate_test.go index c25f6eed..d4896446 100644 --- a/ocpp2.0_test/install_certificate_test.go +++ b/ocpp2.0.1_test/install_certificate_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/iso15118" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/iso15118" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) func (suite *OcppV2TestSuite) TestInstallCertificateRequestValidation() { @@ -55,7 +55,7 @@ func (suite *OcppV2TestSuite) TestInstallCertificateE2EMocked() { installCertificateResponse := iso15118.NewInstallCertificateResponse(status) channel := NewMockWebSocket(wsId) // Setting handlers - handler := MockChargingStationIso15118Handler{} + handler := &MockChargingStationIso15118Handler{} handler.On("OnInstallCertificate", mock.Anything).Return(installCertificateResponse, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*iso15118.InstallCertificateRequest) require.True(t, ok) diff --git a/ocpp2.0_test/log_status_notification_test.go b/ocpp2.0.1_test/log_status_notification_test.go similarity index 97% rename from ocpp2.0_test/log_status_notification_test.go rename to ocpp2.0.1_test/log_status_notification_test.go index 30b083ed..917bd50a 100644 --- a/ocpp2.0_test/log_status_notification_test.go +++ b/ocpp2.0.1_test/log_status_notification_test.go @@ -2,10 +2,12 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/diagnostics" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/diagnostics" ) // Test @@ -48,7 +50,7 @@ func (suite *OcppV2TestSuite) TestLogStatusNotificationE2EMocked() { logStatusNotificationResponse := diagnostics.NewLogStatusNotificationResponse() channel := NewMockWebSocket(wsId) - handler := MockCSMSDiagnosticsHandler{} + handler := &MockCSMSDiagnosticsHandler{} handler.On("OnLogStatusNotification", mock.AnythingOfType("string"), mock.Anything).Return(logStatusNotificationResponse, nil).Run(func(args mock.Arguments) { request, ok := args.Get(1).(*diagnostics.LogStatusNotificationRequest) require.True(t, ok) diff --git a/ocpp2.0_test/meter_values_test.go b/ocpp2.0.1_test/meter_values_test.go similarity index 84% rename from ocpp2.0_test/meter_values_test.go rename to ocpp2.0.1_test/meter_values_test.go index fcec023b..0e7ae7bb 100644 --- a/ocpp2.0_test/meter_values_test.go +++ b/ocpp2.0.1_test/meter_values_test.go @@ -2,23 +2,25 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/meter" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "time" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "time" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/meter" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test func (suite *OcppV2TestSuite) TestMeterValuesRequestValidation() { var requestTable = []GenericTestEntry{ - {meter.MeterValuesRequest{EvseID: 1, MeterValue: []types.MeterValue{ {Timestamp: types.DateTime{Time: time.Now()}, SampledValue: []types.SampledValue{ {Value: 3.14, Context: types.ReadingContextTransactionEnd, Measurand: types.MeasurandPowerActiveExport, Phase: types.PhaseL2, Location: types.LocationBody}}} }}, true}, - {meter.MeterValuesRequest{MeterValue: []types.MeterValue{ {Timestamp: types.DateTime{Time: time.Now()}, SampledValue: []types.SampledValue{ {Value: 3.14, Context: types.ReadingContextTransactionEnd, Measurand: types.MeasurandPowerActiveExport, Phase: types.PhaseL2, Location: types.LocationBody}}} }}, true}, + {meter.MeterValuesRequest{EvseID: 1, MeterValue: []types.MeterValue{{Timestamp: types.DateTime{Time: time.Now()}, SampledValue: []types.SampledValue{{Value: 3.14, Context: types.ReadingContextTransactionEnd, Measurand: types.MeasurandPowerActiveExport, Phase: types.PhaseL2, Location: types.LocationBody}}}}}, true}, + {meter.MeterValuesRequest{MeterValue: []types.MeterValue{{Timestamp: types.DateTime{Time: time.Now()}, SampledValue: []types.SampledValue{{Value: 3.14, Context: types.ReadingContextTransactionEnd, Measurand: types.MeasurandPowerActiveExport, Phase: types.PhaseL2, Location: types.LocationBody}}}}}, true}, {meter.MeterValuesRequest{EvseID: 1, MeterValue: []types.MeterValue{}}, false}, {meter.MeterValuesRequest{EvseID: 1}, false}, - {meter.MeterValuesRequest{EvseID: 1, MeterValue: []types.MeterValue{ {Timestamp: types.DateTime{Time: time.Now()}, SampledValue: []types.SampledValue{ {Value: 3.14, Context: "invalidContext", Measurand: types.MeasurandPowerActiveExport, Phase: types.PhaseL2, Location: types.LocationBody}}} }}, false}, - {meter.MeterValuesRequest{EvseID: -1, MeterValue: []types.MeterValue{ {Timestamp: types.DateTime{Time: time.Now()}, SampledValue: []types.SampledValue{ {Value: 3.14, Context: types.ReadingContextTransactionEnd, Measurand: types.MeasurandPowerActiveExport, Phase: types.PhaseL2, Location: types.LocationBody}}} }}, false}, + {meter.MeterValuesRequest{EvseID: 1, MeterValue: []types.MeterValue{{Timestamp: types.DateTime{Time: time.Now()}, SampledValue: []types.SampledValue{{Value: 3.14, Context: "invalidContext", Measurand: types.MeasurandPowerActiveExport, Phase: types.PhaseL2, Location: types.LocationBody}}}}}, false}, + {meter.MeterValuesRequest{EvseID: -1, MeterValue: []types.MeterValue{{Timestamp: types.DateTime{Time: time.Now()}, SampledValue: []types.SampledValue{{Value: 3.14, Context: types.ReadingContextTransactionEnd, Measurand: types.MeasurandPowerActiveExport, Phase: types.PhaseL2, Location: types.LocationBody}}}}}, false}, } ExecuteGenericTestTable(suite.T(), requestTable) } @@ -49,7 +51,7 @@ func (suite *OcppV2TestSuite) TestMeterValuesE2EMocked() { response := meter.NewMeterValuesResponse() channel := NewMockWebSocket(wsId) - handler := MockCSMSMeterHandler{} + handler := &MockCSMSMeterHandler{} handler.On("OnMeterValues", mock.AnythingOfType("string"), mock.Anything).Return(response, nil).Run(func(args mock.Arguments) { request := args.Get(1).(*meter.MeterValuesRequest) assert.Equal(t, evseId, request.EvseID) diff --git a/ocpp2.0_test/notify_charging_limit_test.go b/ocpp2.0.1_test/notify_charging_limit_test.go similarity index 98% rename from ocpp2.0_test/notify_charging_limit_test.go rename to ocpp2.0.1_test/notify_charging_limit_test.go index 44dadeda..ab03b9d6 100644 --- a/ocpp2.0_test/notify_charging_limit_test.go +++ b/ocpp2.0.1_test/notify_charging_limit_test.go @@ -4,11 +4,12 @@ import ( "fmt" "time" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/smartcharging" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/smartcharging" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Tests @@ -67,7 +68,7 @@ func (suite *OcppV2TestSuite) TestNotifyChargingLimitE2EMocked() { response := smartcharging.NewNotifyChargingLimitResponse() channel := NewMockWebSocket(wsId) - handler := MockCSMSSmartChargingHandler{} + handler := &MockCSMSSmartChargingHandler{} handler.On("OnNotifyChargingLimit", mock.AnythingOfType("string"), mock.Anything).Return(response, nil).Run(func(args mock.Arguments) { request, ok := args.Get(1).(*smartcharging.NotifyChargingLimitRequest) require.True(t, ok) diff --git a/ocpp2.0_test/notify_customer_information_test.go b/ocpp2.0.1_test/notify_customer_information_test.go similarity index 96% rename from ocpp2.0_test/notify_customer_information_test.go rename to ocpp2.0.1_test/notify_customer_information_test.go index fef5ffd7..f012a7c6 100644 --- a/ocpp2.0_test/notify_customer_information_test.go +++ b/ocpp2.0.1_test/notify_customer_information_test.go @@ -2,12 +2,14 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/diagnostics" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "time" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "time" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/diagnostics" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -52,7 +54,7 @@ func (suite *OcppV2TestSuite) TestNotifyCustomerInformationE2EMocked() { response := diagnostics.NewNotifyCustomerInformationResponse() channel := NewMockWebSocket(wsId) - handler := MockCSMSDiagnosticsHandler{} + handler := &MockCSMSDiagnosticsHandler{} handler.On("OnNotifyCustomerInformation", mock.AnythingOfType("string"), mock.Anything).Return(response, nil).Run(func(args mock.Arguments) { request, ok := args.Get(1).(*diagnostics.NotifyCustomerInformationRequest) require.True(t, ok) diff --git a/ocpp2.0_test/notify_display_messages_test.go b/ocpp2.0.1_test/notify_display_messages_test.go similarity index 92% rename from ocpp2.0_test/notify_display_messages_test.go rename to ocpp2.0.1_test/notify_display_messages_test.go index ae876d15..a28e2070 100644 --- a/ocpp2.0_test/notify_display_messages_test.go +++ b/ocpp2.0.1_test/notify_display_messages_test.go @@ -2,12 +2,14 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/display" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "time" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "time" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/display" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -21,7 +23,7 @@ func (suite *OcppV2TestSuite) TestNotifyDisplayMessagesRequestValidation() { {display.NotifyDisplayMessagesRequest{RequestID: 42}, true}, {display.NotifyDisplayMessagesRequest{}, true}, {display.NotifyDisplayMessagesRequest{RequestID: -1}, false}, - {display.NotifyDisplayMessagesRequest{RequestID: 42, MessageInfo: []display.MessageInfo{ {ID: 42, Priority: "invalidPriority", State: display.MessageStateIdle, Message: types.MessageContent{Format: types.MessageFormatUTF8, Content: "hello world"}} }}, false}, + {display.NotifyDisplayMessagesRequest{RequestID: 42, MessageInfo: []display.MessageInfo{{ID: 42, Priority: "invalidPriority", State: display.MessageStateIdle, Message: types.MessageContent{Format: types.MessageFormatUTF8, Content: "hello world"}}}}, false}, } ExecuteGenericTestTable(t, requestTable) } @@ -48,7 +50,7 @@ func (suite *OcppV2TestSuite) TestNotifyDisplayMessagesE2EMocked() { response := display.NewNotifyDisplayMessagesResponse() channel := NewMockWebSocket(wsId) - handler := MockCSMSDisplayHandler{} + handler := &MockCSMSDisplayHandler{} handler.On("OnNotifyDisplayMessages", mock.AnythingOfType("string"), mock.Anything).Return(response, nil).Run(func(args mock.Arguments) { request, ok := args.Get(1).(*display.NotifyDisplayMessagesRequest) require.True(t, ok) @@ -70,7 +72,7 @@ func (suite *OcppV2TestSuite) TestNotifyDisplayMessagesE2EMocked() { err := suite.chargingStation.Start(wsUrl) require.Nil(t, err) r, err := suite.chargingStation.NotifyDisplayMessages(requestID, func(request *display.NotifyDisplayMessagesRequest) { - request.MessageInfo = []display.MessageInfo{ messageInfo } + request.MessageInfo = []display.MessageInfo{messageInfo} }) assert.Nil(t, err) assert.NotNil(t, r) diff --git a/ocpp2.0_test/notify_ev_charging_needs_test.go b/ocpp2.0.1_test/notify_ev_charging_needs_test.go similarity index 98% rename from ocpp2.0_test/notify_ev_charging_needs_test.go rename to ocpp2.0.1_test/notify_ev_charging_needs_test.go index 4f46b5f6..ceaeaa77 100644 --- a/ocpp2.0_test/notify_ev_charging_needs_test.go +++ b/ocpp2.0.1_test/notify_ev_charging_needs_test.go @@ -2,12 +2,14 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/smartcharging" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "time" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "time" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/smartcharging" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) func (suite *OcppV2TestSuite) TestNotifyEVChargingNeedsRequestValidation() { @@ -126,7 +128,7 @@ func (suite *OcppV2TestSuite) TestNotifyEVChargingNeedsE2EMocked() { notifyEVChargingNeedsResponse.StatusInfo = statusInfo channel := NewMockWebSocket(wsId) - handler := MockCSMSSmartChargingHandler{} + handler := &MockCSMSSmartChargingHandler{} handler.On("OnNotifyEVChargingNeeds", mock.AnythingOfType("string"), mock.Anything).Return(notifyEVChargingNeedsResponse, nil).Run(func(args mock.Arguments) { request, ok := args.Get(1).(*smartcharging.NotifyEVChargingNeedsRequest) require.True(t, ok) diff --git a/ocpp2.0_test/notify_ev_charging_schedule_test.go b/ocpp2.0.1_test/notify_ev_charging_schedule_test.go similarity index 98% rename from ocpp2.0_test/notify_ev_charging_schedule_test.go rename to ocpp2.0.1_test/notify_ev_charging_schedule_test.go index a16bb68c..2ab8dffe 100644 --- a/ocpp2.0_test/notify_ev_charging_schedule_test.go +++ b/ocpp2.0.1_test/notify_ev_charging_schedule_test.go @@ -4,11 +4,12 @@ import ( "fmt" "time" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/smartcharging" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/smartcharging" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) func (suite *OcppV2TestSuite) TestNotifyEVChargingScheduleRequestValidation() { @@ -71,7 +72,7 @@ func (suite *OcppV2TestSuite) TestNotifyEVChargingScheduleE2EMocked() { notifyEVChargingScheduleResponse.StatusInfo = statusInfo channel := NewMockWebSocket(wsId) - handler := MockCSMSSmartChargingHandler{} + handler := &MockCSMSSmartChargingHandler{} handler.On("OnNotifyEVChargingSchedule", mock.AnythingOfType("string"), mock.Anything).Return(notifyEVChargingScheduleResponse, nil).Run(func(args mock.Arguments) { request, ok := args.Get(1).(*smartcharging.NotifyEVChargingScheduleRequest) require.True(t, ok) diff --git a/ocpp2.0_test/notify_event_test.go b/ocpp2.0.1_test/notify_event_test.go similarity index 99% rename from ocpp2.0_test/notify_event_test.go rename to ocpp2.0.1_test/notify_event_test.go index aecd1b80..3c1e124d 100644 --- a/ocpp2.0_test/notify_event_test.go +++ b/ocpp2.0.1_test/notify_event_test.go @@ -2,12 +2,14 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/diagnostics" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "time" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "time" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/diagnostics" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -109,7 +111,7 @@ func (suite *OcppV2TestSuite) TestNotifyEventE2EMocked() { response := diagnostics.NewNotifyEventResponse() channel := NewMockWebSocket(wsId) - handler := MockCSMSDiagnosticsHandler{} + handler := &MockCSMSDiagnosticsHandler{} handler.On("OnNotifyEvent", mock.AnythingOfType("string"), mock.Anything).Return(response, nil).Run(func(args mock.Arguments) { request, ok := args.Get(1).(*diagnostics.NotifyEventRequest) require.True(t, ok) diff --git a/ocpp2.0_test/notify_monitoring_report_test.go b/ocpp2.0.1_test/notify_monitoring_report_test.go similarity index 98% rename from ocpp2.0_test/notify_monitoring_report_test.go rename to ocpp2.0.1_test/notify_monitoring_report_test.go index 5051283e..ddcd525e 100644 --- a/ocpp2.0_test/notify_monitoring_report_test.go +++ b/ocpp2.0.1_test/notify_monitoring_report_test.go @@ -2,12 +2,14 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/diagnostics" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "time" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "time" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/diagnostics" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -89,7 +91,7 @@ func (suite *OcppV2TestSuite) TestNotifyMonitoringReportE2EMocked() { response := diagnostics.NewNotifyMonitoringReportResponse() channel := NewMockWebSocket(wsId) - handler := MockCSMSDiagnosticsHandler{} + handler := &MockCSMSDiagnosticsHandler{} handler.On("OnNotifyMonitoringReport", mock.AnythingOfType("string"), mock.Anything).Return(response, nil).Run(func(args mock.Arguments) { request, ok := args.Get(1).(*diagnostics.NotifyMonitoringReportRequest) require.True(t, ok) diff --git a/ocpp2.0_test/notify_report_test.go b/ocpp2.0.1_test/notify_report_test.go similarity index 99% rename from ocpp2.0_test/notify_report_test.go rename to ocpp2.0.1_test/notify_report_test.go index 30b23575..f73c970a 100644 --- a/ocpp2.0_test/notify_report_test.go +++ b/ocpp2.0.1_test/notify_report_test.go @@ -2,12 +2,14 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/provisioning" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "time" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "time" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/provisioning" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Tests @@ -125,7 +127,7 @@ func (suite *OcppV2TestSuite) TestNotifyReportE2EMocked() { notifyReportResponse := provisioning.NewNotifyReportResponse() channel := NewMockWebSocket(wsId) - handler := MockCSMSProvisioningHandler{} + handler := &MockCSMSProvisioningHandler{} handler.On("OnNotifyReport", mock.AnythingOfType("string"), mock.Anything).Return(notifyReportResponse, nil).Run(func(args mock.Arguments) { request := args.Get(1).(*provisioning.NotifyReportRequest) assert.Equal(t, requestID, request.RequestID) diff --git a/ocpp2.0_test/ocpp2_test.go b/ocpp2.0.1_test/ocpp2_test.go similarity index 63% rename from ocpp2.0_test/ocpp2_test.go rename to ocpp2.0.1_test/ocpp2_test.go index 78aa471d..fc8cf317 100644 --- a/ocpp2.0_test/ocpp2_test.go +++ b/ocpp2.0.1_test/ocpp2_test.go @@ -6,32 +6,33 @@ import ( "reflect" "testing" - "github.com/lorenzodonini/ocpp-go/ocpp" - ocpp2 "github.com/lorenzodonini/ocpp-go/ocpp2.0" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/authorization" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/availability" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/data" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/diagnostics" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/display" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/firmware" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/iso15118" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/localauth" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/meter" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/provisioning" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/remotecontrol" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/reservation" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/security" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/smartcharging" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/tariffcost" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/transactions" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" - "github.com/lorenzodonini/ocpp-go/ocppj" - "github.com/lorenzodonini/ocpp-go/ws" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + + "github.com/lorenzodonini/ocpp-go/ocpp" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/authorization" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/availability" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/data" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/diagnostics" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/display" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/firmware" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/iso15118" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/localauth" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/meter" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/provisioning" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/remotecontrol" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/reservation" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/security" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/smartcharging" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/tariffcost" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/transactions" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" + "github.com/lorenzodonini/ocpp-go/ocppj" + "github.com/lorenzodonini/ocpp-go/ws" ) // ---------------------- MOCK WEBSOCKET ---------------------- @@ -160,7 +161,7 @@ type MockRequest struct { MockValue string `json:"mockValue" validate:"required,max=10"` } -type MockConfirmation struct { +type MockResponse struct { mock.Mock MockValue string `json:"mockValue" validate:"required,min=5"` } @@ -169,23 +170,23 @@ type MockFeature struct { mock.Mock } -func (f MockFeature) GetFeatureName() string { +func (f *MockFeature) GetFeatureName() string { return MockFeatureName } -func (f MockFeature) GetRequestType() reflect.Type { +func (f *MockFeature) GetRequestType() reflect.Type { return reflect.TypeOf(MockRequest{}) } -func (f MockFeature) GetResponseType() reflect.Type { - return reflect.TypeOf(MockConfirmation{}) +func (f *MockFeature) GetResponseType() reflect.Type { + return reflect.TypeOf(MockResponse{}) } -func (r MockRequest) GetFeatureName() string { +func (r *MockRequest) GetFeatureName() string { return MockFeatureName } -func (c MockConfirmation) GetFeatureName() string { +func (c *MockResponse) GetFeatureName() string { return MockFeatureName } @@ -193,8 +194,8 @@ func newMockRequest(value string) *MockRequest { return &MockRequest{MockValue: value} } -func newMockConfirmation(value string) *MockConfirmation { - return &MockConfirmation{MockValue: value} +func newMockConfirmation(value string) *MockResponse { + return &MockResponse{MockValue: value} } // ---------------------- MOCK CSMS SECURITY HANDLER ---------------------- @@ -203,13 +204,13 @@ type MockCSMSSecurityHandler struct { mock.Mock } -func (handler MockCSMSSecurityHandler) OnSecurityEventNotification(chargingStationID string, request *security.SecurityEventNotificationRequest) (response *security.SecurityEventNotificationResponse, err error) { +func (handler *MockCSMSSecurityHandler) OnSecurityEventNotification(chargingStationID string, request *security.SecurityEventNotificationRequest) (response *security.SecurityEventNotificationResponse, err error) { args := handler.MethodCalled("OnSecurityEventNotification", chargingStationID, request) response = args.Get(0).(*security.SecurityEventNotificationResponse) return response, args.Error(1) } -func (handler MockCSMSSecurityHandler) OnSignCertificate(chargingStationID string, request *security.SignCertificateRequest) (response *security.SignCertificateResponse, err error) { +func (handler *MockCSMSSecurityHandler) OnSignCertificate(chargingStationID string, request *security.SignCertificateRequest) (response *security.SignCertificateResponse, err error) { args := handler.MethodCalled("OnSignCertificate", chargingStationID, request) response = args.Get(0).(*security.SignCertificateResponse) return response, args.Error(1) @@ -221,7 +222,7 @@ type MockChargingStationSecurityHandler struct { mock.Mock } -func (handler MockChargingStationSecurityHandler) OnCertificateSigned(request *security.CertificateSignedRequest) (response *security.CertificateSignedResponse, err error) { +func (handler *MockChargingStationSecurityHandler) OnCertificateSigned(request *security.CertificateSignedRequest) (response *security.CertificateSignedResponse, err error) { args := handler.MethodCalled("OnCertificateSigned", request) conf := args.Get(0).(*security.CertificateSignedResponse) return conf, args.Error(1) @@ -233,13 +234,13 @@ type MockCSMSProvisioningHandler struct { mock.Mock } -func (handler MockCSMSProvisioningHandler) OnBootNotification(chargingStationId string, request *provisioning.BootNotificationRequest) (confirmation *provisioning.BootNotificationResponse, err error) { +func (handler *MockCSMSProvisioningHandler) OnBootNotification(chargingStationId string, request *provisioning.BootNotificationRequest) (confirmation *provisioning.BootNotificationResponse, err error) { args := handler.MethodCalled("OnBootNotification", chargingStationId, request) conf := args.Get(0).(*provisioning.BootNotificationResponse) return conf, args.Error(1) } -func (handler MockCSMSProvisioningHandler) OnNotifyReport(chargingStationID string, request *provisioning.NotifyReportRequest) (confirmation *provisioning.NotifyReportResponse, err error) { +func (handler *MockCSMSProvisioningHandler) OnNotifyReport(chargingStationID string, request *provisioning.NotifyReportRequest) (confirmation *provisioning.NotifyReportResponse, err error) { args := handler.MethodCalled("OnNotifyReport", chargingStationID, request) conf := args.Get(0).(*provisioning.NotifyReportResponse) return conf, args.Error(1) @@ -251,37 +252,37 @@ type MockChargingStationProvisioningHandler struct { mock.Mock } -func (handler MockChargingStationProvisioningHandler) OnGetBaseReport(request *provisioning.GetBaseReportRequest) (confirmation *provisioning.GetBaseReportResponse, err error) { +func (handler *MockChargingStationProvisioningHandler) OnGetBaseReport(request *provisioning.GetBaseReportRequest) (confirmation *provisioning.GetBaseReportResponse, err error) { args := handler.MethodCalled("OnGetBaseReport", request) conf := args.Get(0).(*provisioning.GetBaseReportResponse) return conf, args.Error(1) } -func (handler MockChargingStationProvisioningHandler) OnGetReport(request *provisioning.GetReportRequest) (response *provisioning.GetReportResponse, err error) { +func (handler *MockChargingStationProvisioningHandler) OnGetReport(request *provisioning.GetReportRequest) (response *provisioning.GetReportResponse, err error) { args := handler.MethodCalled("OnGetReport", request) conf := args.Get(0).(*provisioning.GetReportResponse) return conf, args.Error(1) } -func (handler MockChargingStationProvisioningHandler) OnGetVariables(request *provisioning.GetVariablesRequest) (response *provisioning.GetVariablesResponse, err error) { +func (handler *MockChargingStationProvisioningHandler) OnGetVariables(request *provisioning.GetVariablesRequest) (response *provisioning.GetVariablesResponse, err error) { args := handler.MethodCalled("OnGetVariables", request) conf := args.Get(0).(*provisioning.GetVariablesResponse) return conf, args.Error(1) } -func (handler MockChargingStationProvisioningHandler) OnReset(request *provisioning.ResetRequest) (response *provisioning.ResetResponse, err error) { +func (handler *MockChargingStationProvisioningHandler) OnReset(request *provisioning.ResetRequest) (response *provisioning.ResetResponse, err error) { args := handler.MethodCalled("OnReset", request) response = args.Get(0).(*provisioning.ResetResponse) return response, args.Error(1) } -func (handler MockChargingStationProvisioningHandler) OnSetNetworkProfile(request *provisioning.SetNetworkProfileRequest) (response *provisioning.SetNetworkProfileResponse, err error) { +func (handler *MockChargingStationProvisioningHandler) OnSetNetworkProfile(request *provisioning.SetNetworkProfileRequest) (response *provisioning.SetNetworkProfileResponse, err error) { args := handler.MethodCalled("OnSetNetworkProfile", request) response = args.Get(0).(*provisioning.SetNetworkProfileResponse) return response, args.Error(1) } -func (handler MockChargingStationProvisioningHandler) OnSetVariables(request *provisioning.SetVariablesRequest) (response *provisioning.SetVariablesResponse, err error) { +func (handler *MockChargingStationProvisioningHandler) OnSetVariables(request *provisioning.SetVariablesRequest) (response *provisioning.SetVariablesResponse, err error) { args := handler.MethodCalled("OnSetVariables", request) response = args.Get(0).(*provisioning.SetVariablesResponse) return response, args.Error(1) @@ -293,7 +294,7 @@ type MockCSMSAuthorizationHandler struct { mock.Mock } -func (handler MockCSMSAuthorizationHandler) OnAuthorize(chargingStationId string, request *authorization.AuthorizeRequest) (confirmation *authorization.AuthorizeResponse, err error) { +func (handler *MockCSMSAuthorizationHandler) OnAuthorize(chargingStationId string, request *authorization.AuthorizeRequest) (confirmation *authorization.AuthorizeResponse, err error) { args := handler.MethodCalled("OnAuthorize", chargingStationId, request) conf := args.Get(0).(*authorization.AuthorizeResponse) return conf, args.Error(1) @@ -305,7 +306,7 @@ type MockChargingStationAuthorizationHandler struct { mock.Mock } -func (handler MockChargingStationAuthorizationHandler) OnClearCache(request *authorization.ClearCacheRequest) (confirmation *authorization.ClearCacheResponse, err error) { +func (handler *MockChargingStationAuthorizationHandler) OnClearCache(request *authorization.ClearCacheRequest) (confirmation *authorization.ClearCacheResponse, err error) { args := handler.MethodCalled("OnClearCache", request) conf := args.Get(0).(*authorization.ClearCacheResponse) return conf, args.Error(1) @@ -317,13 +318,13 @@ type MockChargingStationReservationHandler struct { mock.Mock } -func (handler MockChargingStationReservationHandler) OnCancelReservation(request *reservation.CancelReservationRequest) (confirmation *reservation.CancelReservationResponse, err error) { +func (handler *MockChargingStationReservationHandler) OnCancelReservation(request *reservation.CancelReservationRequest) (confirmation *reservation.CancelReservationResponse, err error) { args := handler.MethodCalled("OnCancelReservation", request) conf := args.Get(0).(*reservation.CancelReservationResponse) return conf, args.Error(1) } -func (handler MockChargingStationReservationHandler) OnReserveNow(request *reservation.ReserveNowRequest) (resp *reservation.ReserveNowResponse, err error) { +func (handler *MockChargingStationReservationHandler) OnReserveNow(request *reservation.ReserveNowRequest) (resp *reservation.ReserveNowResponse, err error) { args := handler.MethodCalled("OnReserveNow", request) conf := args.Get(0).(*reservation.ReserveNowResponse) return conf, args.Error(1) @@ -335,7 +336,7 @@ type MockCSMSReservationHandler struct { mock.Mock } -func (handler MockCSMSReservationHandler) OnReservationStatusUpdate(chargingStationID string, request *reservation.ReservationStatusUpdateRequest) (response *reservation.ReservationStatusUpdateResponse, err error) { +func (handler *MockCSMSReservationHandler) OnReservationStatusUpdate(chargingStationID string, request *reservation.ReservationStatusUpdateRequest) (response *reservation.ReservationStatusUpdateResponse, err error) { args := handler.MethodCalled("OnReservationStatusUpdate", chargingStationID, request) resp := args.Get(0).(*reservation.ReservationStatusUpdateResponse) return resp, args.Error(1) @@ -347,7 +348,7 @@ type MockChargingStationAvailabilityHandler struct { mock.Mock } -func (handler MockChargingStationAvailabilityHandler) OnChangeAvailability(request *availability.ChangeAvailabilityRequest) (confirmation *availability.ChangeAvailabilityResponse, err error) { +func (handler *MockChargingStationAvailabilityHandler) OnChangeAvailability(request *availability.ChangeAvailabilityRequest) (confirmation *availability.ChangeAvailabilityResponse, err error) { args := handler.MethodCalled("OnChangeAvailability", request) conf := args.Get(0).(*availability.ChangeAvailabilityResponse) return conf, args.Error(1) @@ -359,13 +360,13 @@ type MockCSMSAvailabilityHandler struct { mock.Mock } -func (handler MockCSMSAvailabilityHandler) OnHeartbeat(chargingStationID string, request *availability.HeartbeatRequest) (response *availability.HeartbeatResponse, err error) { +func (handler *MockCSMSAvailabilityHandler) OnHeartbeat(chargingStationID string, request *availability.HeartbeatRequest) (response *availability.HeartbeatResponse, err error) { args := handler.MethodCalled("OnHeartbeat", chargingStationID, request) resp := args.Get(0).(*availability.HeartbeatResponse) return resp, args.Error(1) } -func (handler MockCSMSAvailabilityHandler) OnStatusNotification(chargingStationID string, request *availability.StatusNotificationRequest) (response *availability.StatusNotificationResponse, err error) { +func (handler *MockCSMSAvailabilityHandler) OnStatusNotification(chargingStationID string, request *availability.StatusNotificationRequest) (response *availability.StatusNotificationResponse, err error) { args := handler.MethodCalled("OnStatusNotification", chargingStationID, request) response = args.Get(0).(*availability.StatusNotificationResponse) return response, args.Error(1) @@ -377,7 +378,7 @@ type MockChargingStationDataHandler struct { mock.Mock } -func (handler MockChargingStationDataHandler) OnDataTransfer(request *data.DataTransferRequest) (confirmation *data.DataTransferResponse, err error) { +func (handler *MockChargingStationDataHandler) OnDataTransfer(request *data.DataTransferRequest) (confirmation *data.DataTransferResponse, err error) { args := handler.MethodCalled("OnDataTransfer", request) conf := args.Get(0).(*data.DataTransferResponse) return conf, args.Error(1) @@ -389,7 +390,7 @@ type MockCSMSDataHandler struct { mock.Mock } -func (handler MockCSMSDataHandler) OnDataTransfer(chargingStationID string, request *data.DataTransferRequest) (confirmation *data.DataTransferResponse, err error) { +func (handler *MockCSMSDataHandler) OnDataTransfer(chargingStationID string, request *data.DataTransferRequest) (confirmation *data.DataTransferResponse, err error) { args := handler.MethodCalled("OnDataTransfer", chargingStationID, request) conf := args.Get(0).(*data.DataTransferResponse) return conf, args.Error(1) @@ -401,43 +402,43 @@ type MockChargingStationDiagnosticsHandler struct { mock.Mock } -func (handler MockChargingStationDiagnosticsHandler) OnClearVariableMonitoring(request *diagnostics.ClearVariableMonitoringRequest) (confirmation *diagnostics.ClearVariableMonitoringResponse, err error) { +func (handler *MockChargingStationDiagnosticsHandler) OnClearVariableMonitoring(request *diagnostics.ClearVariableMonitoringRequest) (confirmation *diagnostics.ClearVariableMonitoringResponse, err error) { args := handler.MethodCalled("OnClearVariableMonitoring", request) conf := args.Get(0).(*diagnostics.ClearVariableMonitoringResponse) return conf, args.Error(1) } -func (handler MockChargingStationDiagnosticsHandler) OnCustomerInformation(request *diagnostics.CustomerInformationRequest) (confirmation *diagnostics.CustomerInformationResponse, err error) { +func (handler *MockChargingStationDiagnosticsHandler) OnCustomerInformation(request *diagnostics.CustomerInformationRequest) (confirmation *diagnostics.CustomerInformationResponse, err error) { args := handler.MethodCalled("OnCustomerInformation", request) conf := args.Get(0).(*diagnostics.CustomerInformationResponse) return conf, args.Error(1) } -func (handler MockChargingStationDiagnosticsHandler) OnGetLog(request *diagnostics.GetLogRequest) (confirmation *diagnostics.GetLogResponse, err error) { +func (handler *MockChargingStationDiagnosticsHandler) OnGetLog(request *diagnostics.GetLogRequest) (confirmation *diagnostics.GetLogResponse, err error) { args := handler.MethodCalled("OnGetLog", request) conf := args.Get(0).(*diagnostics.GetLogResponse) return conf, args.Error(1) } -func (handler MockChargingStationDiagnosticsHandler) OnGetMonitoringReport(request *diagnostics.GetMonitoringReportRequest) (confirmation *diagnostics.GetMonitoringReportResponse, err error) { +func (handler *MockChargingStationDiagnosticsHandler) OnGetMonitoringReport(request *diagnostics.GetMonitoringReportRequest) (confirmation *diagnostics.GetMonitoringReportResponse, err error) { args := handler.MethodCalled("OnGetMonitoringReport", request) conf := args.Get(0).(*diagnostics.GetMonitoringReportResponse) return conf, args.Error(1) } -func (handler MockChargingStationDiagnosticsHandler) OnSetMonitoringBase(request *diagnostics.SetMonitoringBaseRequest) (response *diagnostics.SetMonitoringBaseResponse, err error) { +func (handler *MockChargingStationDiagnosticsHandler) OnSetMonitoringBase(request *diagnostics.SetMonitoringBaseRequest) (response *diagnostics.SetMonitoringBaseResponse, err error) { args := handler.MethodCalled("OnSetMonitoringBase", request) response = args.Get(0).(*diagnostics.SetMonitoringBaseResponse) return response, args.Error(1) } -func (handler MockChargingStationDiagnosticsHandler) OnSetMonitoringLevel(request *diagnostics.SetMonitoringLevelRequest) (response *diagnostics.SetMonitoringLevelResponse, err error) { +func (handler *MockChargingStationDiagnosticsHandler) OnSetMonitoringLevel(request *diagnostics.SetMonitoringLevelRequest) (response *diagnostics.SetMonitoringLevelResponse, err error) { args := handler.MethodCalled("OnSetMonitoringLevel", request) response = args.Get(0).(*diagnostics.SetMonitoringLevelResponse) return response, args.Error(1) } -func (handler MockChargingStationDiagnosticsHandler) OnSetVariableMonitoring(request *diagnostics.SetVariableMonitoringRequest) (response *diagnostics.SetVariableMonitoringResponse, err error) { +func (handler *MockChargingStationDiagnosticsHandler) OnSetVariableMonitoring(request *diagnostics.SetVariableMonitoringRequest) (response *diagnostics.SetVariableMonitoringResponse, err error) { args := handler.MethodCalled("OnSetVariableMonitoring", request) response = args.Get(0).(*diagnostics.SetVariableMonitoringResponse) return response, args.Error(1) @@ -449,25 +450,25 @@ type MockCSMSDiagnosticsHandler struct { mock.Mock } -func (handler MockCSMSDiagnosticsHandler) OnLogStatusNotification(chargingStationID string, request *diagnostics.LogStatusNotificationRequest) (response *diagnostics.LogStatusNotificationResponse, err error) { +func (handler *MockCSMSDiagnosticsHandler) OnLogStatusNotification(chargingStationID string, request *diagnostics.LogStatusNotificationRequest) (response *diagnostics.LogStatusNotificationResponse, err error) { args := handler.MethodCalled("OnLogStatusNotification", chargingStationID, request) resp := args.Get(0).(*diagnostics.LogStatusNotificationResponse) return resp, args.Error(1) } -func (handler MockCSMSDiagnosticsHandler) OnNotifyCustomerInformation(chargingStationID string, request *diagnostics.NotifyCustomerInformationRequest) (response *diagnostics.NotifyCustomerInformationResponse, err error) { +func (handler *MockCSMSDiagnosticsHandler) OnNotifyCustomerInformation(chargingStationID string, request *diagnostics.NotifyCustomerInformationRequest) (response *diagnostics.NotifyCustomerInformationResponse, err error) { args := handler.MethodCalled("OnNotifyCustomerInformation", chargingStationID, request) resp := args.Get(0).(*diagnostics.NotifyCustomerInformationResponse) return resp, args.Error(1) } -func (handler MockCSMSDiagnosticsHandler) OnNotifyEvent(chargingStationID string, request *diagnostics.NotifyEventRequest) (response *diagnostics.NotifyEventResponse, err error) { +func (handler *MockCSMSDiagnosticsHandler) OnNotifyEvent(chargingStationID string, request *diagnostics.NotifyEventRequest) (response *diagnostics.NotifyEventResponse, err error) { args := handler.MethodCalled("OnNotifyEvent", chargingStationID, request) resp := args.Get(0).(*diagnostics.NotifyEventResponse) return resp, args.Error(1) } -func (handler MockCSMSDiagnosticsHandler) OnNotifyMonitoringReport(chargingStationID string, request *diagnostics.NotifyMonitoringReportRequest) (response *diagnostics.NotifyMonitoringReportResponse, err error) { +func (handler *MockCSMSDiagnosticsHandler) OnNotifyMonitoringReport(chargingStationID string, request *diagnostics.NotifyMonitoringReportRequest) (response *diagnostics.NotifyMonitoringReportResponse, err error) { args := handler.MethodCalled("OnNotifyMonitoringReport", chargingStationID, request) resp := args.Get(0).(*diagnostics.NotifyMonitoringReportResponse) return resp, args.Error(1) @@ -479,19 +480,19 @@ type MockChargingStationDisplayHandler struct { mock.Mock } -func (handler MockChargingStationDisplayHandler) OnClearDisplay(request *display.ClearDisplayRequest) (confirmation *display.ClearDisplayResponse, err error) { +func (handler *MockChargingStationDisplayHandler) OnClearDisplay(request *display.ClearDisplayRequest) (confirmation *display.ClearDisplayResponse, err error) { args := handler.MethodCalled("OnClearDisplay", request) conf := args.Get(0).(*display.ClearDisplayResponse) return conf, args.Error(1) } -func (handler MockChargingStationDisplayHandler) OnGetDisplayMessages(request *display.GetDisplayMessagesRequest) (confirmation *display.GetDisplayMessagesResponse, err error) { +func (handler *MockChargingStationDisplayHandler) OnGetDisplayMessages(request *display.GetDisplayMessagesRequest) (confirmation *display.GetDisplayMessagesResponse, err error) { args := handler.MethodCalled("OnGetDisplayMessages", request) conf := args.Get(0).(*display.GetDisplayMessagesResponse) return conf, args.Error(1) } -func (handler MockChargingStationDisplayHandler) OnSetDisplayMessage(request *display.SetDisplayMessageRequest) (response *display.SetDisplayMessageResponse, err error) { +func (handler *MockChargingStationDisplayHandler) OnSetDisplayMessage(request *display.SetDisplayMessageRequest) (response *display.SetDisplayMessageResponse, err error) { args := handler.MethodCalled("OnSetDisplayMessage", request) response = args.Get(0).(*display.SetDisplayMessageResponse) return response, args.Error(1) @@ -503,7 +504,7 @@ type MockCSMSDisplayHandler struct { mock.Mock } -func (handler MockCSMSDisplayHandler) OnNotifyDisplayMessages(chargingStationID string, request *display.NotifyDisplayMessagesRequest) (response *display.NotifyDisplayMessagesResponse, err error) { +func (handler *MockCSMSDisplayHandler) OnNotifyDisplayMessages(chargingStationID string, request *display.NotifyDisplayMessagesRequest) (response *display.NotifyDisplayMessagesResponse, err error) { args := handler.MethodCalled("OnNotifyDisplayMessages", chargingStationID, request) conf := args.Get(0).(*display.NotifyDisplayMessagesResponse) return conf, args.Error(1) @@ -515,19 +516,19 @@ type MockChargingStationFirmwareHandler struct { mock.Mock } -func (handler MockChargingStationFirmwareHandler) OnPublishFirmware(request *firmware.PublishFirmwareRequest) (response *firmware.PublishFirmwareResponse, err error) { +func (handler *MockChargingStationFirmwareHandler) OnPublishFirmware(request *firmware.PublishFirmwareRequest) (response *firmware.PublishFirmwareResponse, err error) { args := handler.MethodCalled("OnPublishFirmware", request) resp := args.Get(0).(*firmware.PublishFirmwareResponse) return resp, args.Error(1) } -func (handler MockChargingStationFirmwareHandler) OnUnpublishFirmware(request *firmware.UnpublishFirmwareRequest) (response *firmware.UnpublishFirmwareResponse, err error) { +func (handler *MockChargingStationFirmwareHandler) OnUnpublishFirmware(request *firmware.UnpublishFirmwareRequest) (response *firmware.UnpublishFirmwareResponse, err error) { args := handler.MethodCalled("OnUnpublishFirmware", request) response = args.Get(0).(*firmware.UnpublishFirmwareResponse) return response, args.Error(1) } -func (handler MockChargingStationFirmwareHandler) OnUpdateFirmware(request *firmware.UpdateFirmwareRequest) (response *firmware.UpdateFirmwareResponse, err error) { +func (handler *MockChargingStationFirmwareHandler) OnUpdateFirmware(request *firmware.UpdateFirmwareRequest) (response *firmware.UpdateFirmwareResponse, err error) { args := handler.MethodCalled("OnUpdateFirmware", request) response = args.Get(0).(*firmware.UpdateFirmwareResponse) return response, args.Error(1) @@ -539,13 +540,13 @@ type MockCSMSFirmwareHandler struct { mock.Mock } -func (handler MockCSMSFirmwareHandler) OnFirmwareStatusNotification(chargingStationID string, request *firmware.FirmwareStatusNotificationRequest) (response *firmware.FirmwareStatusNotificationResponse, err error) { +func (handler *MockCSMSFirmwareHandler) OnFirmwareStatusNotification(chargingStationID string, request *firmware.FirmwareStatusNotificationRequest) (response *firmware.FirmwareStatusNotificationResponse, err error) { args := handler.MethodCalled("OnFirmwareStatusNotification", chargingStationID, request) resp := args.Get(0).(*firmware.FirmwareStatusNotificationResponse) return resp, args.Error(1) } -func (handler MockCSMSFirmwareHandler) OnPublishFirmwareStatusNotification(chargingStationID string, request *firmware.PublishFirmwareStatusNotificationRequest) (response *firmware.PublishFirmwareStatusNotificationResponse, err error) { +func (handler *MockCSMSFirmwareHandler) OnPublishFirmwareStatusNotification(chargingStationID string, request *firmware.PublishFirmwareStatusNotificationRequest) (response *firmware.PublishFirmwareStatusNotificationResponse, err error) { args := handler.MethodCalled("OnPublishFirmwareStatusNotification", chargingStationID, request) resp := args.Get(0).(*firmware.PublishFirmwareStatusNotificationResponse) return resp, args.Error(1) @@ -557,19 +558,19 @@ type MockChargingStationIso15118Handler struct { mock.Mock } -func (handler MockChargingStationIso15118Handler) OnDeleteCertificate(request *iso15118.DeleteCertificateRequest) (response *iso15118.DeleteCertificateResponse, err error) { +func (handler *MockChargingStationIso15118Handler) OnDeleteCertificate(request *iso15118.DeleteCertificateRequest) (response *iso15118.DeleteCertificateResponse, err error) { args := handler.MethodCalled("OnDeleteCertificate", request) resp := args.Get(0).(*iso15118.DeleteCertificateResponse) return resp, args.Error(1) } -func (handler MockChargingStationIso15118Handler) OnGetInstalledCertificateIds(request *iso15118.GetInstalledCertificateIdsRequest) (response *iso15118.GetInstalledCertificateIdsResponse, err error) { +func (handler *MockChargingStationIso15118Handler) OnGetInstalledCertificateIds(request *iso15118.GetInstalledCertificateIdsRequest) (response *iso15118.GetInstalledCertificateIdsResponse, err error) { args := handler.MethodCalled("OnGetInstalledCertificateIds", request) resp := args.Get(0).(*iso15118.GetInstalledCertificateIdsResponse) return resp, args.Error(1) } -func (handler MockChargingStationIso15118Handler) OnInstallCertificate(request *iso15118.InstallCertificateRequest) (response *iso15118.InstallCertificateResponse, err error) { +func (handler *MockChargingStationIso15118Handler) OnInstallCertificate(request *iso15118.InstallCertificateRequest) (response *iso15118.InstallCertificateResponse, err error) { args := handler.MethodCalled("OnInstallCertificate", request) resp := args.Get(0).(*iso15118.InstallCertificateResponse) return resp, args.Error(1) @@ -581,13 +582,13 @@ type MockCSMSIso15118Handler struct { mock.Mock } -func (handler MockCSMSIso15118Handler) OnGet15118EVCertificate(chargingStationID string, request *iso15118.Get15118EVCertificateRequest) (confirmation *iso15118.Get15118EVCertificateResponse, err error) { +func (handler *MockCSMSIso15118Handler) OnGet15118EVCertificate(chargingStationID string, request *iso15118.Get15118EVCertificateRequest) (confirmation *iso15118.Get15118EVCertificateResponse, err error) { args := handler.MethodCalled("OnGet15118EVCertificate", chargingStationID, request) conf := args.Get(0).(*iso15118.Get15118EVCertificateResponse) return conf, args.Error(1) } -func (handler MockCSMSIso15118Handler) OnGetCertificateStatus(chargingStationID string, request *iso15118.GetCertificateStatusRequest) (confirmation *iso15118.GetCertificateStatusResponse, err error) { +func (handler *MockCSMSIso15118Handler) OnGetCertificateStatus(chargingStationID string, request *iso15118.GetCertificateStatusRequest) (confirmation *iso15118.GetCertificateStatusResponse, err error) { args := handler.MethodCalled("OnGetCertificateStatus", chargingStationID, request) conf := args.Get(0).(*iso15118.GetCertificateStatusResponse) return conf, args.Error(1) @@ -599,13 +600,13 @@ type MockChargingStationLocalAuthHandler struct { mock.Mock } -func (handler MockChargingStationLocalAuthHandler) OnGetLocalListVersion(request *localauth.GetLocalListVersionRequest) (confirmation *localauth.GetLocalListVersionResponse, err error) { +func (handler *MockChargingStationLocalAuthHandler) OnGetLocalListVersion(request *localauth.GetLocalListVersionRequest) (confirmation *localauth.GetLocalListVersionResponse, err error) { args := handler.MethodCalled("OnGetLocalListVersion", request) conf := args.Get(0).(*localauth.GetLocalListVersionResponse) return conf, args.Error(1) } -func (handler MockChargingStationLocalAuthHandler) OnSendLocalList(request *localauth.SendLocalListRequest) (response *localauth.SendLocalListResponse, err error) { +func (handler *MockChargingStationLocalAuthHandler) OnSendLocalList(request *localauth.SendLocalListRequest) (response *localauth.SendLocalListResponse, err error) { args := handler.MethodCalled("OnSendLocalList", request) response = args.Get(0).(*localauth.SendLocalListResponse) return response, args.Error(1) @@ -629,7 +630,7 @@ type MockCSMSMeterHandler struct { mock.Mock } -func (handler MockCSMSMeterHandler) OnMeterValues(chargingStationID string, request *meter.MeterValuesRequest) (response *meter.MeterValuesResponse, err error) { +func (handler *MockCSMSMeterHandler) OnMeterValues(chargingStationID string, request *meter.MeterValuesRequest) (response *meter.MeterValuesResponse, err error) { args := handler.MethodCalled("OnMeterValues", chargingStationID, request) r := args.Get(0).(*meter.MeterValuesResponse) return r, args.Error(1) @@ -641,25 +642,25 @@ type MockChargingStationRemoteControlHandler struct { mock.Mock } -func (handler MockChargingStationRemoteControlHandler) OnRequestStartTransaction(request *remotecontrol.RequestStartTransactionRequest) (response *remotecontrol.RequestStartTransactionResponse, err error) { +func (handler *MockChargingStationRemoteControlHandler) OnRequestStartTransaction(request *remotecontrol.RequestStartTransactionRequest) (response *remotecontrol.RequestStartTransactionResponse, err error) { args := handler.MethodCalled("OnRequestStartTransaction", request) conf := args.Get(0).(*remotecontrol.RequestStartTransactionResponse) return conf, args.Error(1) } -func (handler MockChargingStationRemoteControlHandler) OnRequestStopTransaction(request *remotecontrol.RequestStopTransactionRequest) (response *remotecontrol.RequestStopTransactionResponse, err error) { +func (handler *MockChargingStationRemoteControlHandler) OnRequestStopTransaction(request *remotecontrol.RequestStopTransactionRequest) (response *remotecontrol.RequestStopTransactionResponse, err error) { args := handler.MethodCalled("OnRequestStopTransaction", request) conf := args.Get(0).(*remotecontrol.RequestStopTransactionResponse) return conf, args.Error(1) } -func (handler MockChargingStationRemoteControlHandler) OnTriggerMessage(request *remotecontrol.TriggerMessageRequest) (response *remotecontrol.TriggerMessageResponse, err error) { +func (handler *MockChargingStationRemoteControlHandler) OnTriggerMessage(request *remotecontrol.TriggerMessageRequest) (response *remotecontrol.TriggerMessageResponse, err error) { args := handler.MethodCalled("OnTriggerMessage", request) response = args.Get(0).(*remotecontrol.TriggerMessageResponse) return response, args.Error(1) } -func (handler MockChargingStationRemoteControlHandler) OnUnlockConnector(request *remotecontrol.UnlockConnectorRequest) (response *remotecontrol.UnlockConnectorResponse, err error) { +func (handler *MockChargingStationRemoteControlHandler) OnUnlockConnector(request *remotecontrol.UnlockConnectorRequest) (response *remotecontrol.UnlockConnectorResponse, err error) { args := handler.MethodCalled("OnUnlockConnector", request) response = args.Get(0).(*remotecontrol.UnlockConnectorResponse) return response, args.Error(1) @@ -677,25 +678,25 @@ type MockChargingStationSmartChargingHandler struct { mock.Mock } -func (handler MockChargingStationSmartChargingHandler) OnClearChargingProfile(request *smartcharging.ClearChargingProfileRequest) (confirmation *smartcharging.ClearChargingProfileResponse, err error) { +func (handler *MockChargingStationSmartChargingHandler) OnClearChargingProfile(request *smartcharging.ClearChargingProfileRequest) (confirmation *smartcharging.ClearChargingProfileResponse, err error) { args := handler.MethodCalled("OnClearChargingProfile", request) conf := args.Get(0).(*smartcharging.ClearChargingProfileResponse) return conf, args.Error(1) } -func (handler MockChargingStationSmartChargingHandler) OnGetChargingProfiles(request *smartcharging.GetChargingProfilesRequest) (confirmation *smartcharging.GetChargingProfilesResponse, err error) { +func (handler *MockChargingStationSmartChargingHandler) OnGetChargingProfiles(request *smartcharging.GetChargingProfilesRequest) (confirmation *smartcharging.GetChargingProfilesResponse, err error) { args := handler.MethodCalled("OnGetChargingProfiles", request) conf := args.Get(0).(*smartcharging.GetChargingProfilesResponse) return conf, args.Error(1) } -func (handler MockChargingStationSmartChargingHandler) OnGetCompositeSchedule(request *smartcharging.GetCompositeScheduleRequest) (confirmation *smartcharging.GetCompositeScheduleResponse, err error) { +func (handler *MockChargingStationSmartChargingHandler) OnGetCompositeSchedule(request *smartcharging.GetCompositeScheduleRequest) (confirmation *smartcharging.GetCompositeScheduleResponse, err error) { args := handler.MethodCalled("OnGetCompositeSchedule", request) conf := args.Get(0).(*smartcharging.GetCompositeScheduleResponse) return conf, args.Error(1) } -func (handler MockChargingStationSmartChargingHandler) OnSetChargingProfile(request *smartcharging.SetChargingProfileRequest) (response *smartcharging.SetChargingProfileResponse, err error) { +func (handler *MockChargingStationSmartChargingHandler) OnSetChargingProfile(request *smartcharging.SetChargingProfileRequest) (response *smartcharging.SetChargingProfileResponse, err error) { args := handler.MethodCalled("OnSetChargingProfile", request) response = args.Get(0).(*smartcharging.SetChargingProfileResponse) return response, args.Error(1) @@ -707,31 +708,31 @@ type MockCSMSSmartChargingHandler struct { mock.Mock } -func (handler MockCSMSSmartChargingHandler) OnClearedChargingLimit(chargingStationID string, request *smartcharging.ClearedChargingLimitRequest) (confirmation *smartcharging.ClearedChargingLimitResponse, err error) { +func (handler *MockCSMSSmartChargingHandler) OnClearedChargingLimit(chargingStationID string, request *smartcharging.ClearedChargingLimitRequest) (confirmation *smartcharging.ClearedChargingLimitResponse, err error) { args := handler.MethodCalled("OnClearedChargingLimit", chargingStationID, request) r := args.Get(0).(*smartcharging.ClearedChargingLimitResponse) return r, args.Error(1) } -func (handler MockCSMSSmartChargingHandler) OnNotifyChargingLimit(chargingStationID string, request *smartcharging.NotifyChargingLimitRequest) (response *smartcharging.NotifyChargingLimitResponse, err error) { +func (handler *MockCSMSSmartChargingHandler) OnNotifyChargingLimit(chargingStationID string, request *smartcharging.NotifyChargingLimitRequest) (response *smartcharging.NotifyChargingLimitResponse, err error) { args := handler.MethodCalled("OnNotifyChargingLimit", chargingStationID, request) r := args.Get(0).(*smartcharging.NotifyChargingLimitResponse) return r, args.Error(1) } -func (handler MockCSMSSmartChargingHandler) OnNotifyEVChargingNeeds(chargingStationID string, request *smartcharging.NotifyEVChargingNeedsRequest) (response *smartcharging.NotifyEVChargingNeedsResponse, err error) { +func (handler *MockCSMSSmartChargingHandler) OnNotifyEVChargingNeeds(chargingStationID string, request *smartcharging.NotifyEVChargingNeedsRequest) (response *smartcharging.NotifyEVChargingNeedsResponse, err error) { args := handler.MethodCalled("OnNotifyEVChargingNeeds", chargingStationID, request) r := args.Get(0).(*smartcharging.NotifyEVChargingNeedsResponse) return r, args.Error(1) } -func (handler MockCSMSSmartChargingHandler) OnNotifyEVChargingSchedule(chargingStationID string, request *smartcharging.NotifyEVChargingScheduleRequest) (response *smartcharging.NotifyEVChargingScheduleResponse, err error) { +func (handler *MockCSMSSmartChargingHandler) OnNotifyEVChargingSchedule(chargingStationID string, request *smartcharging.NotifyEVChargingScheduleRequest) (response *smartcharging.NotifyEVChargingScheduleResponse, err error) { args := handler.MethodCalled("OnNotifyEVChargingSchedule", chargingStationID, request) r := args.Get(0).(*smartcharging.NotifyEVChargingScheduleResponse) return r, args.Error(1) } -func (handler MockCSMSSmartChargingHandler) OnReportChargingProfiles(chargingStationID string, request *smartcharging.ReportChargingProfilesRequest) (reponse *smartcharging.ReportChargingProfilesResponse, err error) { +func (handler *MockCSMSSmartChargingHandler) OnReportChargingProfiles(chargingStationID string, request *smartcharging.ReportChargingProfilesRequest) (reponse *smartcharging.ReportChargingProfilesResponse, err error) { args := handler.MethodCalled("OnReportChargingProfiles", chargingStationID, request) r := args.Get(0).(*smartcharging.ReportChargingProfilesResponse) return r, args.Error(1) @@ -743,7 +744,7 @@ type MockChargingStationTariffCostHandler struct { mock.Mock } -func (handler MockChargingStationTariffCostHandler) OnCostUpdated(request *tariffcost.CostUpdatedRequest) (confirmation *tariffcost.CostUpdatedResponse, err error) { +func (handler *MockChargingStationTariffCostHandler) OnCostUpdated(request *tariffcost.CostUpdatedRequest) (confirmation *tariffcost.CostUpdatedResponse, err error) { args := handler.MethodCalled("OnCostUpdated", request) conf := args.Get(0).(*tariffcost.CostUpdatedResponse) return conf, args.Error(1) @@ -761,7 +762,7 @@ type MockChargingStationTransactionHandler struct { mock.Mock } -func (handler MockChargingStationTransactionHandler) OnGetTransactionStatus(request *transactions.GetTransactionStatusRequest) (response *transactions.GetTransactionStatusResponse, err error) { +func (handler *MockChargingStationTransactionHandler) OnGetTransactionStatus(request *transactions.GetTransactionStatusRequest) (response *transactions.GetTransactionStatusResponse, err error) { args := handler.MethodCalled("OnGetTransactionStatus", request) conf := args.Get(0).(*transactions.GetTransactionStatusResponse) return conf, args.Error(1) @@ -773,7 +774,7 @@ type MockCSMSTransactionsHandler struct { mock.Mock } -func (handler MockCSMSTransactionsHandler) OnTransactionEvent(chargingStationID string, request *transactions.TransactionEventRequest) (response *transactions.TransactionEventResponse, err error) { +func (handler *MockCSMSTransactionsHandler) OnTransactionEvent(chargingStationID string, request *transactions.TransactionEventRequest) (response *transactions.TransactionEventResponse, err error) { args := handler.MethodCalled("OnTransactionEvent", chargingStationID, request) response = args.Get(0).(*transactions.TransactionEventResponse) return response, args.Error(1) @@ -839,38 +840,38 @@ func setupDefaultCSMSHandlers(suite *OcppV2TestSuite, options expectedCSMSOption t := suite.T() for _, h := range handlers { switch h.(type) { - case MockCSMSAuthorizationHandler: - suite.csms.SetAuthorizationHandler(h.(MockCSMSAuthorizationHandler)) - case MockCSMSAvailabilityHandler: - suite.csms.SetAvailabilityHandler(h.(MockCSMSAvailabilityHandler)) - case MockCSMSDataHandler: - suite.csms.SetDataHandler(h.(MockCSMSDataHandler)) - case MockCSMSDiagnosticsHandler: - suite.csms.SetDiagnosticsHandler(h.(MockCSMSDiagnosticsHandler)) - case MockCSMSDisplayHandler: - suite.csms.SetDisplayHandler(h.(MockCSMSDisplayHandler)) - case MockCSMSFirmwareHandler: - suite.csms.SetFirmwareHandler(h.(MockCSMSFirmwareHandler)) - case MockCSMSIso15118Handler: - suite.csms.SetISO15118Handler(h.(MockCSMSIso15118Handler)) - case MockCSMSLocalAuthHandler: - suite.csms.SetLocalAuthListHandler(h.(MockCSMSLocalAuthHandler)) - case MockCSMSMeterHandler: - suite.csms.SetMeterHandler(h.(MockCSMSMeterHandler)) - case MockCSMSProvisioningHandler: - suite.csms.SetProvisioningHandler(h.(MockCSMSProvisioningHandler)) - case MockCSMSRemoteControlHandler: - suite.csms.SetRemoteControlHandler(h.(MockCSMSRemoteControlHandler)) - case MockCSMSReservationHandler: - suite.csms.SetReservationHandler(h.(MockCSMSReservationHandler)) - case MockCSMSSecurityHandler: - suite.csms.SetSecurityHandler(h.(MockCSMSSecurityHandler)) - case MockCSMSSmartChargingHandler: - suite.csms.SetSmartChargingHandler(h.(MockCSMSSmartChargingHandler)) - case MockCSMSTariffCostHandler: - suite.csms.SetTariffCostHandler(h.(MockCSMSTariffCostHandler)) - case MockCSMSTransactionsHandler: - suite.csms.SetTransactionsHandler(h.(MockCSMSTransactionsHandler)) + case *MockCSMSAuthorizationHandler: + suite.csms.SetAuthorizationHandler(h.(*MockCSMSAuthorizationHandler)) + case *MockCSMSAvailabilityHandler: + suite.csms.SetAvailabilityHandler(h.(*MockCSMSAvailabilityHandler)) + case *MockCSMSDataHandler: + suite.csms.SetDataHandler(h.(*MockCSMSDataHandler)) + case *MockCSMSDiagnosticsHandler: + suite.csms.SetDiagnosticsHandler(h.(*MockCSMSDiagnosticsHandler)) + case *MockCSMSDisplayHandler: + suite.csms.SetDisplayHandler(h.(*MockCSMSDisplayHandler)) + case *MockCSMSFirmwareHandler: + suite.csms.SetFirmwareHandler(h.(*MockCSMSFirmwareHandler)) + case *MockCSMSIso15118Handler: + suite.csms.SetISO15118Handler(h.(*MockCSMSIso15118Handler)) + case *MockCSMSLocalAuthHandler: + suite.csms.SetLocalAuthListHandler(h.(*MockCSMSLocalAuthHandler)) + case *MockCSMSMeterHandler: + suite.csms.SetMeterHandler(h.(*MockCSMSMeterHandler)) + case *MockCSMSProvisioningHandler: + suite.csms.SetProvisioningHandler(h.(*MockCSMSProvisioningHandler)) + case *MockCSMSRemoteControlHandler: + suite.csms.SetRemoteControlHandler(h.(*MockCSMSRemoteControlHandler)) + case *MockCSMSReservationHandler: + suite.csms.SetReservationHandler(h.(*MockCSMSReservationHandler)) + case *MockCSMSSecurityHandler: + suite.csms.SetSecurityHandler(h.(*MockCSMSSecurityHandler)) + case *MockCSMSSmartChargingHandler: + suite.csms.SetSmartChargingHandler(h.(*MockCSMSSmartChargingHandler)) + case *MockCSMSTariffCostHandler: + suite.csms.SetTariffCostHandler(h.(*MockCSMSTariffCostHandler)) + case *MockCSMSTransactionsHandler: + suite.csms.SetTransactionsHandler(h.(*MockCSMSTransactionsHandler)) } } suite.csms.SetNewChargingStationHandler(func(chargingStation ocpp2.ChargingStationConnection) { @@ -898,38 +899,38 @@ func setupDefaultChargingStationHandlers(suite *OcppV2TestSuite, options expecte t := suite.T() for _, h := range handlers { switch h.(type) { - case MockChargingStationAuthorizationHandler: - suite.chargingStation.SetAuthorizationHandler(h.(MockChargingStationAuthorizationHandler)) - case MockChargingStationAvailabilityHandler: - suite.chargingStation.SetAvailabilityHandler(h.(MockChargingStationAvailabilityHandler)) - case MockChargingStationDataHandler: - suite.chargingStation.SetDataHandler(h.(MockChargingStationDataHandler)) - case MockChargingStationDiagnosticsHandler: - suite.chargingStation.SetDiagnosticsHandler(h.(MockChargingStationDiagnosticsHandler)) - case MockChargingStationDisplayHandler: - suite.chargingStation.SetDisplayHandler(h.(MockChargingStationDisplayHandler)) - case MockChargingStationFirmwareHandler: - suite.chargingStation.SetFirmwareHandler(h.(MockChargingStationFirmwareHandler)) - case MockChargingStationIso15118Handler: - suite.chargingStation.SetISO15118Handler(h.(MockChargingStationIso15118Handler)) - case MockChargingStationLocalAuthHandler: - suite.chargingStation.SetLocalAuthListHandler(h.(MockChargingStationLocalAuthHandler)) - case MockChargingStationMeterHandler: - suite.chargingStation.SetMeterHandler(h.(MockChargingStationMeterHandler)) - case MockChargingStationProvisioningHandler: - suite.chargingStation.SetProvisioningHandler(h.(MockChargingStationProvisioningHandler)) - case MockChargingStationRemoteControlHandler: - suite.chargingStation.SetRemoteControlHandler(h.(MockChargingStationRemoteControlHandler)) - case MockChargingStationReservationHandler: - suite.chargingStation.SetReservationHandler(h.(MockChargingStationReservationHandler)) - case MockChargingStationSecurityHandler: - suite.chargingStation.SetSecurityHandler(h.(MockChargingStationSecurityHandler)) - case MockChargingStationSmartChargingHandler: - suite.chargingStation.SetSmartChargingHandler(h.(MockChargingStationSmartChargingHandler)) - case MockChargingStationTariffCostHandler: - suite.chargingStation.SetTariffCostHandler(h.(MockChargingStationTariffCostHandler)) - case MockChargingStationTransactionHandler: - suite.chargingStation.SetTransactionsHandler(h.(MockChargingStationTransactionHandler)) + case *MockChargingStationAuthorizationHandler: + suite.chargingStation.SetAuthorizationHandler(h.(*MockChargingStationAuthorizationHandler)) + case *MockChargingStationAvailabilityHandler: + suite.chargingStation.SetAvailabilityHandler(h.(*MockChargingStationAvailabilityHandler)) + case *MockChargingStationDataHandler: + suite.chargingStation.SetDataHandler(h.(*MockChargingStationDataHandler)) + case *MockChargingStationDiagnosticsHandler: + suite.chargingStation.SetDiagnosticsHandler(h.(*MockChargingStationDiagnosticsHandler)) + case *MockChargingStationDisplayHandler: + suite.chargingStation.SetDisplayHandler(h.(*MockChargingStationDisplayHandler)) + case *MockChargingStationFirmwareHandler: + suite.chargingStation.SetFirmwareHandler(h.(*MockChargingStationFirmwareHandler)) + case *MockChargingStationIso15118Handler: + suite.chargingStation.SetISO15118Handler(h.(*MockChargingStationIso15118Handler)) + case *MockChargingStationLocalAuthHandler: + suite.chargingStation.SetLocalAuthListHandler(h.(*MockChargingStationLocalAuthHandler)) + case *MockChargingStationMeterHandler: + suite.chargingStation.SetMeterHandler(h.(*MockChargingStationMeterHandler)) + case *MockChargingStationProvisioningHandler: + suite.chargingStation.SetProvisioningHandler(h.(*MockChargingStationProvisioningHandler)) + case *MockChargingStationRemoteControlHandler: + suite.chargingStation.SetRemoteControlHandler(h.(*MockChargingStationRemoteControlHandler)) + case *MockChargingStationReservationHandler: + suite.chargingStation.SetReservationHandler(h.(*MockChargingStationReservationHandler)) + case *MockChargingStationSecurityHandler: + suite.chargingStation.SetSecurityHandler(h.(*MockChargingStationSecurityHandler)) + case *MockChargingStationSmartChargingHandler: + suite.chargingStation.SetSmartChargingHandler(h.(*MockChargingStationSmartChargingHandler)) + case *MockChargingStationTariffCostHandler: + suite.chargingStation.SetTariffCostHandler(h.(*MockChargingStationTariffCostHandler)) + case *MockChargingStationTransactionHandler: + suite.chargingStation.SetTransactionsHandler(h.(*MockChargingStationTransactionHandler)) } } suite.mockWsClient.On("Start", mock.AnythingOfType("string")).Return(options.startReturnArgument).Run(func(args mock.Arguments) { diff --git a/ocpp2.0_test/publish_firmware_status_notification_test.go b/ocpp2.0.1_test/publish_firmware_status_notification_test.go similarity index 98% rename from ocpp2.0_test/publish_firmware_status_notification_test.go rename to ocpp2.0.1_test/publish_firmware_status_notification_test.go index 2aa084c7..a7e30c61 100644 --- a/ocpp2.0_test/publish_firmware_status_notification_test.go +++ b/ocpp2.0.1_test/publish_firmware_status_notification_test.go @@ -2,10 +2,12 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/firmware" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/firmware" ) // Test @@ -55,7 +57,7 @@ func (suite *OcppV2TestSuite) TestPublishFirmwareStatusNotificationE2EMocked() { publishFirmwareStatusNotificationResponse := firmware.NewPublishFirmwareStatusNotificationResponse() channel := NewMockWebSocket(wsId) - handler := MockCSMSFirmwareHandler{} + handler := &MockCSMSFirmwareHandler{} handler.On("OnPublishFirmwareStatusNotification", mock.AnythingOfType("string"), mock.Anything).Return(publishFirmwareStatusNotificationResponse, nil).Run(func(args mock.Arguments) { request, ok := args.Get(1).(*firmware.PublishFirmwareStatusNotificationRequest) require.True(t, ok) diff --git a/ocpp2.0_test/publish_firmware_test.go b/ocpp2.0.1_test/publish_firmware_test.go similarity index 97% rename from ocpp2.0_test/publish_firmware_test.go rename to ocpp2.0.1_test/publish_firmware_test.go index 9c2dfd5a..9762c7b4 100644 --- a/ocpp2.0_test/publish_firmware_test.go +++ b/ocpp2.0.1_test/publish_firmware_test.go @@ -2,11 +2,13 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/firmware" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/firmware" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -62,7 +64,7 @@ func (suite *OcppV2TestSuite) TestPublishFirmwareE2EMocked() { publishFirmwareResponse.StatusInfo = &statusInfo channel := NewMockWebSocket(wsId) - handler := MockChargingStationFirmwareHandler{} + handler := &MockChargingStationFirmwareHandler{} handler.On("OnPublishFirmware", mock.Anything).Return(publishFirmwareResponse, nil).Run(func(args mock.Arguments) { request := args.Get(0).(*firmware.PublishFirmwareRequest) assert.Equal(t, location, request.Location) diff --git a/ocpp2.0_test/report_charging_profiles_test.go b/ocpp2.0.1_test/report_charging_profiles_test.go similarity index 98% rename from ocpp2.0_test/report_charging_profiles_test.go rename to ocpp2.0.1_test/report_charging_profiles_test.go index 9c604c63..a517db24 100644 --- a/ocpp2.0_test/report_charging_profiles_test.go +++ b/ocpp2.0.1_test/report_charging_profiles_test.go @@ -4,11 +4,12 @@ import ( "fmt" "time" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/smartcharging" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/smartcharging" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Tests @@ -79,7 +80,7 @@ func (suite *OcppV2TestSuite) TestReportChargingProfilesE2EMocked() { response := smartcharging.NewReportChargingProfilesResponse() channel := NewMockWebSocket(wsId) - handler := MockCSMSSmartChargingHandler{} + handler := &MockCSMSSmartChargingHandler{} handler.On("OnReportChargingProfiles", mock.AnythingOfType("string"), mock.Anything).Return(response, nil).Run(func(args mock.Arguments) { request, ok := args.Get(1).(*smartcharging.ReportChargingProfilesRequest) require.True(t, ok) diff --git a/ocpp2.0_test/request_start_transaction_test.go b/ocpp2.0.1_test/request_start_transaction_test.go similarity index 98% rename from ocpp2.0_test/request_start_transaction_test.go rename to ocpp2.0.1_test/request_start_transaction_test.go index ca143670..13388a2f 100644 --- a/ocpp2.0_test/request_start_transaction_test.go +++ b/ocpp2.0.1_test/request_start_transaction_test.go @@ -3,8 +3,8 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/remotecontrol" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/remotecontrol" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" @@ -102,7 +102,7 @@ func (suite *OcppV2TestSuite) TestRequestStartTransactionE2EMocked() { requestStartTransactionResponse.StatusInfo = &statusInfo channel := NewMockWebSocket(wsId) - handler := MockChargingStationRemoteControlHandler{} + handler := &MockChargingStationRemoteControlHandler{} handler.On("OnRequestStartTransaction", mock.Anything).Return(requestStartTransactionResponse, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*remotecontrol.RequestStartTransactionRequest) require.True(t, ok) diff --git a/ocpp2.0_test/request_stop_transaction_test.go b/ocpp2.0.1_test/request_stop_transaction_test.go similarity index 95% rename from ocpp2.0_test/request_stop_transaction_test.go rename to ocpp2.0.1_test/request_stop_transaction_test.go index c955839c..889bc665 100644 --- a/ocpp2.0_test/request_stop_transaction_test.go +++ b/ocpp2.0.1_test/request_stop_transaction_test.go @@ -3,8 +3,8 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/remotecontrol" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/remotecontrol" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" @@ -51,7 +51,7 @@ func (suite *OcppV2TestSuite) TestRequestStopTransactionE2EMocked() { RequestStopTransactionResponse.StatusInfo = &statusInfo channel := NewMockWebSocket(wsId) - handler := MockChargingStationRemoteControlHandler{} + handler := &MockChargingStationRemoteControlHandler{} handler.On("OnRequestStopTransaction", mock.Anything).Return(RequestStopTransactionResponse, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*remotecontrol.RequestStopTransactionRequest) require.True(t, ok) diff --git a/ocpp2.0_test/reservation_status_update_test.go b/ocpp2.0.1_test/reservation_status_update_test.go similarity index 97% rename from ocpp2.0_test/reservation_status_update_test.go rename to ocpp2.0.1_test/reservation_status_update_test.go index bb043e07..950d2914 100644 --- a/ocpp2.0_test/reservation_status_update_test.go +++ b/ocpp2.0.1_test/reservation_status_update_test.go @@ -3,7 +3,7 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/reservation" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/reservation" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" @@ -46,7 +46,7 @@ func (suite *OcppV2TestSuite) TestReservationStatusUpdateE2EMocked() { dummyResponse := reservation.NewReservationStatusUpdateResponse() channel := NewMockWebSocket(wsId) - handler := MockCSMSReservationHandler{} + handler := &MockCSMSReservationHandler{} handler.On("OnReservationStatusUpdate", mock.AnythingOfType("string"), mock.Anything).Return(dummyResponse, nil).Run(func(args mock.Arguments) { request, ok := args.Get(1).(*reservation.ReservationStatusUpdateRequest) require.True(t, ok) diff --git a/ocpp2.0_test/reserve_now_test.go b/ocpp2.0.1_test/reserve_now_test.go similarity index 97% rename from ocpp2.0_test/reserve_now_test.go rename to ocpp2.0.1_test/reserve_now_test.go index 53b46b3d..fd82e82f 100644 --- a/ocpp2.0_test/reserve_now_test.go +++ b/ocpp2.0.1_test/reserve_now_test.go @@ -4,8 +4,8 @@ import ( "fmt" "time" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/reservation" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/reservation" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" @@ -66,7 +66,7 @@ func (suite *OcppV2TestSuite) TestReserveNowE2EMocked() { reserveNowResponse.StatusInfo = &statusInfo channel := NewMockWebSocket(wsId) - handler := MockChargingStationReservationHandler{} + handler := &MockChargingStationReservationHandler{} handler.On("OnReserveNow", mock.Anything).Return(reserveNowResponse, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*reservation.ReserveNowRequest) require.True(t, ok) diff --git a/ocpp2.0_test/reset_test.go b/ocpp2.0.1_test/reset_test.go similarity index 96% rename from ocpp2.0_test/reset_test.go rename to ocpp2.0.1_test/reset_test.go index 3450a547..b852a66c 100644 --- a/ocpp2.0_test/reset_test.go +++ b/ocpp2.0.1_test/reset_test.go @@ -3,11 +3,12 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/provisioning" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/provisioning" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -54,7 +55,7 @@ func (suite *OcppV2TestSuite) TestResetE2EMocked() { resetResponse.StatusInfo = statusInfo channel := NewMockWebSocket(wsId) - handler := MockChargingStationProvisioningHandler{} + handler := &MockChargingStationProvisioningHandler{} handler.On("OnReset", mock.Anything).Return(resetResponse, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*provisioning.ResetRequest) require.True(t, ok) diff --git a/ocpp2.0_test/security_event_notification_test.go b/ocpp2.0.1_test/security_event_notification_test.go similarity index 96% rename from ocpp2.0_test/security_event_notification_test.go rename to ocpp2.0.1_test/security_event_notification_test.go index 7e9c6984..ab8bc4f5 100644 --- a/ocpp2.0_test/security_event_notification_test.go +++ b/ocpp2.0.1_test/security_event_notification_test.go @@ -4,11 +4,12 @@ import ( "fmt" "time" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/security" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/security" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -48,7 +49,7 @@ func (suite *OcppV2TestSuite) TestSecurityEventNotificationE2EMocked() { securityEventNotificationResponse := security.NewSecurityEventNotificationResponse() channel := NewMockWebSocket(wsId) - handler := MockCSMSSecurityHandler{} + handler := &MockCSMSSecurityHandler{} handler.On("OnSecurityEventNotification", mock.AnythingOfType("string"), mock.Anything).Return(securityEventNotificationResponse, nil).Run(func(args mock.Arguments) { request, ok := args.Get(1).(*security.SecurityEventNotificationRequest) require.True(t, ok) diff --git a/ocpp2.0_test/send_local_list_test.go b/ocpp2.0.1_test/send_local_list_test.go similarity index 97% rename from ocpp2.0_test/send_local_list_test.go rename to ocpp2.0.1_test/send_local_list_test.go index 2a2eb452..30f13e10 100644 --- a/ocpp2.0_test/send_local_list_test.go +++ b/ocpp2.0.1_test/send_local_list_test.go @@ -3,8 +3,8 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/localauth" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/localauth" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" @@ -72,7 +72,7 @@ func (suite *OcppV2TestSuite) TestSendLocalListE2EMocked() { sendLocalListResponse.StatusInfo = statusInfo channel := NewMockWebSocket(wsId) - handler := MockChargingStationLocalAuthHandler{} + handler := &MockChargingStationLocalAuthHandler{} handler.On("OnSendLocalList", mock.Anything).Return(sendLocalListResponse, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*localauth.SendLocalListRequest) require.True(t, ok) diff --git a/ocpp2.0_test/set_charging_profile_test.go b/ocpp2.0.1_test/set_charging_profile_test.go similarity index 97% rename from ocpp2.0_test/set_charging_profile_test.go rename to ocpp2.0.1_test/set_charging_profile_test.go index 150a9dea..d20d21e4 100644 --- a/ocpp2.0_test/set_charging_profile_test.go +++ b/ocpp2.0.1_test/set_charging_profile_test.go @@ -4,11 +4,12 @@ import ( "fmt" "time" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/smartcharging" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/smartcharging" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -69,7 +70,7 @@ func (suite *OcppV2TestSuite) TestSetChargingProfileE2EMocked() { setChargingProfileResponse.StatusInfo = statusInfo channel := NewMockWebSocket(wsId) - handler := MockChargingStationSmartChargingHandler{} + handler := &MockChargingStationSmartChargingHandler{} handler.On("OnSetChargingProfile", mock.Anything).Return(setChargingProfileResponse, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*smartcharging.SetChargingProfileRequest) require.True(t, ok) diff --git a/ocpp2.0_test/set_display_message_test.go b/ocpp2.0.1_test/set_display_message_test.go similarity index 97% rename from ocpp2.0_test/set_display_message_test.go rename to ocpp2.0.1_test/set_display_message_test.go index 807a020d..da55bd9a 100644 --- a/ocpp2.0_test/set_display_message_test.go +++ b/ocpp2.0.1_test/set_display_message_test.go @@ -4,8 +4,8 @@ import ( "fmt" "time" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/display" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/display" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" @@ -64,7 +64,7 @@ func (suite *OcppV2TestSuite) TestSetDisplayMessageE2EMocked() { setDisplayResponse.StatusInfo = statusInfo channel := NewMockWebSocket(wsId) - handler := MockChargingStationDisplayHandler{} + handler := &MockChargingStationDisplayHandler{} handler.On("OnSetDisplayMessage", mock.Anything).Return(setDisplayResponse, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*display.SetDisplayMessageRequest) require.True(t, ok) diff --git a/ocpp2.0_test/set_monitoring_base_test.go b/ocpp2.0.1_test/set_monitoring_base_test.go similarity index 95% rename from ocpp2.0_test/set_monitoring_base_test.go rename to ocpp2.0.1_test/set_monitoring_base_test.go index ac95c2f9..11889c9c 100644 --- a/ocpp2.0_test/set_monitoring_base_test.go +++ b/ocpp2.0.1_test/set_monitoring_base_test.go @@ -3,11 +3,12 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/diagnostics" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/diagnostics" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -50,7 +51,7 @@ func (suite *OcppV2TestSuite) TestSetMonitoringBaseE2EMocked() { setMonitoringBaseResponse.StatusInfo = statusInfo channel := NewMockWebSocket(wsId) - handler := MockChargingStationDiagnosticsHandler{} + handler := &MockChargingStationDiagnosticsHandler{} handler.On("OnSetMonitoringBase", mock.Anything).Return(setMonitoringBaseResponse, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*diagnostics.SetMonitoringBaseRequest) require.True(t, ok) diff --git a/ocpp2.0_test/set_monitoring_level_test.go b/ocpp2.0.1_test/set_monitoring_level_test.go similarity index 96% rename from ocpp2.0_test/set_monitoring_level_test.go rename to ocpp2.0.1_test/set_monitoring_level_test.go index fe76b299..bda8ea5b 100644 --- a/ocpp2.0_test/set_monitoring_level_test.go +++ b/ocpp2.0.1_test/set_monitoring_level_test.go @@ -3,11 +3,12 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/diagnostics" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/diagnostics" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -58,7 +59,7 @@ func (suite *OcppV2TestSuite) TestSetMonitoringLevelE2EMocked() { setMonitoringLevelResponse.StatusInfo = statusInfo channel := NewMockWebSocket(wsId) - handler := MockChargingStationDiagnosticsHandler{} + handler := &MockChargingStationDiagnosticsHandler{} handler.On("OnSetMonitoringLevel", mock.Anything).Return(setMonitoringLevelResponse, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*diagnostics.SetMonitoringLevelRequest) require.True(t, ok) diff --git a/ocpp2.0_test/set_network_profile_test.go b/ocpp2.0.1_test/set_network_profile_test.go similarity index 99% rename from ocpp2.0_test/set_network_profile_test.go rename to ocpp2.0.1_test/set_network_profile_test.go index fb3a9831..6e61e9c2 100644 --- a/ocpp2.0_test/set_network_profile_test.go +++ b/ocpp2.0.1_test/set_network_profile_test.go @@ -3,11 +3,12 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/provisioning" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/provisioning" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -112,7 +113,7 @@ func (suite *OcppV2TestSuite) TestSetNetworkProfileE2EMocked() { resetResponse.StatusInfo = statusInfo channel := NewMockWebSocket(wsId) - handler := MockChargingStationProvisioningHandler{} + handler := &MockChargingStationProvisioningHandler{} handler.On("OnSetNetworkProfile", mock.Anything).Return(resetResponse, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*provisioning.SetNetworkProfileRequest) require.True(t, ok) diff --git a/ocpp2.0_test/set_variable_monitoring_test.go b/ocpp2.0.1_test/set_variable_monitoring_test.go similarity index 98% rename from ocpp2.0_test/set_variable_monitoring_test.go rename to ocpp2.0.1_test/set_variable_monitoring_test.go index 3c9753b2..c356256d 100644 --- a/ocpp2.0_test/set_variable_monitoring_test.go +++ b/ocpp2.0.1_test/set_variable_monitoring_test.go @@ -3,8 +3,8 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/diagnostics" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/diagnostics" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" @@ -71,7 +71,7 @@ func (suite *OcppV2TestSuite) TestSetVariableMonitoringE2EMocked() { setMonitoringVariableResponse := diagnostics.NewSetVariableMonitoringResponse([]diagnostics.SetMonitoringResult{monitoringResult}) channel := NewMockWebSocket(wsId) - handler := MockChargingStationDiagnosticsHandler{} + handler := &MockChargingStationDiagnosticsHandler{} handler.On("OnSetVariableMonitoring", mock.Anything).Return(setMonitoringVariableResponse, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*diagnostics.SetVariableMonitoringRequest) require.True(t, ok) diff --git a/ocpp2.0_test/set_variables_test.go b/ocpp2.0.1_test/set_variables_test.go similarity index 98% rename from ocpp2.0_test/set_variables_test.go rename to ocpp2.0.1_test/set_variables_test.go index 9ee1172d..8149bd19 100644 --- a/ocpp2.0_test/set_variables_test.go +++ b/ocpp2.0.1_test/set_variables_test.go @@ -3,11 +3,12 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/provisioning" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/provisioning" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -86,7 +87,7 @@ func (suite *OcppV2TestSuite) TestSetVariablesE2EMocked() { getVariablesResponse := provisioning.NewSetVariablesResponse([]provisioning.SetVariableResult{variableResult}) channel := NewMockWebSocket(wsId) - handler := MockChargingStationProvisioningHandler{} + handler := &MockChargingStationProvisioningHandler{} handler.On("OnSetVariables", mock.Anything).Return(getVariablesResponse, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*provisioning.SetVariablesRequest) require.True(t, ok) diff --git a/ocpp2.0_test/sign_certificate_test.go b/ocpp2.0.1_test/sign_certificate_test.go similarity index 96% rename from ocpp2.0_test/sign_certificate_test.go rename to ocpp2.0.1_test/sign_certificate_test.go index 0c5656f6..31c2b9be 100644 --- a/ocpp2.0_test/sign_certificate_test.go +++ b/ocpp2.0.1_test/sign_certificate_test.go @@ -3,11 +3,12 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/security" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/security" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -51,7 +52,7 @@ func (suite *OcppV2TestSuite) TestSignCertificateE2EMocked() { signCertificateResponse.StatusInfo = statusInfo channel := NewMockWebSocket(wsId) - handler := MockCSMSSecurityHandler{} + handler := &MockCSMSSecurityHandler{} handler.On("OnSignCertificate", mock.AnythingOfType("string"), mock.Anything).Return(signCertificateResponse, nil).Run(func(args mock.Arguments) { request, ok := args.Get(1).(*security.SignCertificateRequest) require.True(t, ok) diff --git a/ocpp2.0_test/status_notification_test.go b/ocpp2.0.1_test/status_notification_test.go similarity index 96% rename from ocpp2.0_test/status_notification_test.go rename to ocpp2.0.1_test/status_notification_test.go index 1fbae491..dee08c0e 100644 --- a/ocpp2.0_test/status_notification_test.go +++ b/ocpp2.0.1_test/status_notification_test.go @@ -4,11 +4,12 @@ import ( "fmt" "time" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/availability" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/availability" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -52,7 +53,7 @@ func (suite *OcppV2TestSuite) TestStatusNotificationE2EMocked() { statusNotificationResponse := availability.NewStatusNotificationResponse() channel := NewMockWebSocket(wsId) - handler := MockCSMSAvailabilityHandler{} + handler := &MockCSMSAvailabilityHandler{} handler.On("OnStatusNotification", mock.AnythingOfType("string"), mock.Anything).Return(statusNotificationResponse, nil).Run(func(args mock.Arguments) { request, ok := args.Get(1).(*availability.StatusNotificationRequest) require.True(t, ok) diff --git a/ocpp2.0_test/transaction_event_test.go b/ocpp2.0.1_test/transaction_event_test.go similarity index 99% rename from ocpp2.0_test/transaction_event_test.go rename to ocpp2.0.1_test/transaction_event_test.go index 0f447cf1..bc357e0d 100644 --- a/ocpp2.0_test/transaction_event_test.go +++ b/ocpp2.0.1_test/transaction_event_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/transactions" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/transactions" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -111,7 +111,7 @@ func (suite *OcppV2TestSuite) TestTransactionEventE2EMocked() { transactionResponse.UpdatedPersonalMessage = &messageContent channel := NewMockWebSocket(wsId) - handler := MockCSMSTransactionsHandler{} + handler := &MockCSMSTransactionsHandler{} handler.On("OnTransactionEvent", mock.AnythingOfType("string"), mock.Anything).Return(transactionResponse, nil).Run(func(args mock.Arguments) { request, ok := args.Get(1).(*transactions.TransactionEventRequest) require.True(t, ok) diff --git a/ocpp2.0_test/trigger_message_test.go b/ocpp2.0.1_test/trigger_message_test.go similarity index 96% rename from ocpp2.0_test/trigger_message_test.go rename to ocpp2.0.1_test/trigger_message_test.go index 772b1213..ce43fe0f 100644 --- a/ocpp2.0_test/trigger_message_test.go +++ b/ocpp2.0.1_test/trigger_message_test.go @@ -3,8 +3,8 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/remotecontrol" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/remotecontrol" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" @@ -53,7 +53,7 @@ func (suite *OcppV2TestSuite) TestTriggerMessageE2EMocked() { triggerMessageResponse.StatusInfo = statusInfo channel := NewMockWebSocket(wsId) - handler := MockChargingStationRemoteControlHandler{} + handler := &MockChargingStationRemoteControlHandler{} handler.On("OnTriggerMessage", mock.Anything).Return(triggerMessageResponse, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*remotecontrol.TriggerMessageRequest) require.True(t, ok) diff --git a/ocpp2.0_test/unlock_connector_test.go b/ocpp2.0.1_test/unlock_connector_test.go similarity index 95% rename from ocpp2.0_test/unlock_connector_test.go rename to ocpp2.0.1_test/unlock_connector_test.go index 6fa6db78..1be9e26d 100644 --- a/ocpp2.0_test/unlock_connector_test.go +++ b/ocpp2.0.1_test/unlock_connector_test.go @@ -3,8 +3,8 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/remotecontrol" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/remotecontrol" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" @@ -53,7 +53,7 @@ func (suite *OcppV2TestSuite) TestUnlockConnectorE2EMocked() { triggerMessageResponse.StatusInfo = statusInfo channel := NewMockWebSocket(wsId) - handler := MockChargingStationRemoteControlHandler{} + handler := &MockChargingStationRemoteControlHandler{} handler.On("OnUnlockConnector", mock.Anything).Return(triggerMessageResponse, nil).Run(func(args mock.Arguments) { request, ok := args.Get(0).(*remotecontrol.UnlockConnectorRequest) require.True(t, ok) diff --git a/ocpp2.0_test/unpublish_firmware_test.go b/ocpp2.0.1_test/unpublish_firmware_test.go similarity index 96% rename from ocpp2.0_test/unpublish_firmware_test.go rename to ocpp2.0.1_test/unpublish_firmware_test.go index a235e3dd..bbe33b63 100644 --- a/ocpp2.0_test/unpublish_firmware_test.go +++ b/ocpp2.0.1_test/unpublish_firmware_test.go @@ -3,10 +3,11 @@ package ocpp2_test import ( "fmt" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/firmware" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/firmware" ) // Test @@ -46,7 +47,7 @@ func (suite *OcppV2TestSuite) TestUnpublishFirmwareE2EMocked() { unpublishFirmwareResponse := firmware.NewUnpublishFirmwareResponse(status) channel := NewMockWebSocket(wsId) - handler := MockChargingStationFirmwareHandler{} + handler := &MockChargingStationFirmwareHandler{} handler.On("OnUnpublishFirmware", mock.Anything).Return(unpublishFirmwareResponse, nil).Run(func(args mock.Arguments) { request := args.Get(0).(*firmware.UnpublishFirmwareRequest) assert.Equal(t, checksum, request.Checksum) diff --git a/ocpp2.0_test/update_firmware_test.go b/ocpp2.0.1_test/update_firmware_test.go similarity index 98% rename from ocpp2.0_test/update_firmware_test.go rename to ocpp2.0.1_test/update_firmware_test.go index 263d46ef..89262d6b 100644 --- a/ocpp2.0_test/update_firmware_test.go +++ b/ocpp2.0.1_test/update_firmware_test.go @@ -4,11 +4,12 @@ import ( "fmt" "time" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/firmware" - "github.com/lorenzodonini/ocpp-go/ocpp2.0/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/firmware" + "github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types" ) // Test @@ -76,7 +77,7 @@ func (suite *OcppV2TestSuite) TestUpdateFirmwareE2EMocked() { updateFirmwareResponse.StatusInfo = &statusInfo channel := NewMockWebSocket(wsId) - handler := MockChargingStationFirmwareHandler{} + handler := &MockChargingStationFirmwareHandler{} handler.On("OnUpdateFirmware", mock.Anything).Return(updateFirmwareResponse, nil).Run(func(args mock.Arguments) { request := args.Get(0).(*firmware.UpdateFirmwareRequest) require.NotNil(t, request)