Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ocpp2.0.1/iso15118/get_certificate_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ type GetCertificateStatusRequest struct {
// This field definition of the GetCertificateStatus response payload, sent by the CSMS to the Charging Station in response to a GetCertificateStatusRequest.
// In case the request was invalid, or couldn't be processed, an error will be sent instead.
type GetCertificateStatusResponse struct {
Status types.GenericStatus `json:"status" validate:"required,genericStatus"`
OcspResult string `json:"ocspResult,omitempty" validate:"omitempty,max=5500"`
StatusInfo *types.StatusInfo `json:"statusInfo,omitempty" validate:"omitempty"`
Status types.Certificate15118EVStatus `json:"status" validate:"required,15118EVCertificate"`
OcspResult string `json:"ocspResult,omitempty" validate:"omitempty,max=5500"`
StatusInfo *types.StatusInfo `json:"statusInfo,omitempty" validate:"omitempty"`
}

// For 15118 certificate installation on EVs, the Charging Station requests the CSMS to provide the OCSP certificate
Expand Down Expand Up @@ -56,6 +56,6 @@ func NewGetCertificateStatusRequest(ocspRequestData types.OCSPRequestDataType) *
}

// Creates a new GetCertificateStatusResponse, containing all required fields. Optional fields may be set afterwards.
func NewGetCertificateStatusResponse(status types.GenericStatus) *GetCertificateStatusResponse {
func NewGetCertificateStatusResponse(status types.Certificate15118EVStatus) *GetCertificateStatusResponse {
return &GetCertificateStatusResponse{Status: status}
}
2 changes: 1 addition & 1 deletion ocpp2.0.1/iso15118/get_installed_certificate_ids.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func isValidGetInstalledCertificateStatus(fl validator.FieldLevel) bool {

// The field definition of the GetInstalledCertificateIdsRequest PDU sent by the CSMS to the Charging Station.
type GetInstalledCertificateIdsRequest struct {
CertificateTypes []types.CertificateUse `json:"certificateType" validate:"omitempty,dive,certificateUse"`
CertificateTypes []types.CertificateUse `json:"certificateType,omitempty" validate:"omitempty,dive,certificateUse"`
}

// The field definition of the GetInstalledCertificateIds response payload sent by the Charging Station to the CSMS in response to a GetInstalledCertificateIdsRequest.
Expand Down
10 changes: 5 additions & 5 deletions ocpp2.0.1_test/get_certificate_status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ func (suite *OcppV2TestSuite) TestGetCertificateStatusRequestValidation() {
func (suite *OcppV2TestSuite) TestGetCertificateStatusConfirmationValidation() {
t := suite.T()
var confirmationTable = []GenericTestEntry{
{iso15118.GetCertificateStatusResponse{Status: types.GenericStatusAccepted, OcspResult: "deadbeef"}, true},
{iso15118.GetCertificateStatusResponse{Status: types.GenericStatusAccepted}, true},
{iso15118.GetCertificateStatusResponse{Status: types.GenericStatusRejected}, true},
{iso15118.GetCertificateStatusResponse{Status: types.Certificate15188EVStatusAccepted, OcspResult: "deadbeef"}, true},
{iso15118.GetCertificateStatusResponse{Status: types.Certificate15188EVStatusAccepted}, true},
{iso15118.GetCertificateStatusResponse{Status: types.Certificate15118EVStatusFailed}, true},
{iso15118.GetCertificateStatusResponse{Status: "invalidGenericStatus"}, false},
{iso15118.GetCertificateStatusResponse{Status: types.GenericStatusAccepted, OcspResult: newLongString(5501)}, false},
{iso15118.GetCertificateStatusResponse{Status: types.Certificate15188EVStatusAccepted, OcspResult: newLongString(5501)}, false},
{iso15118.GetCertificateStatusResponse{}, false},
}
ExecuteGenericTestTable(t, confirmationTable)
Expand All @@ -42,7 +42,7 @@ func (suite *OcppV2TestSuite) TestGetCertificateStatusE2EMocked() {
wsUrl := "someUrl"
ocspData := types.OCSPRequestDataType{HashAlgorithm: types.SHA256, IssuerNameHash: "hash00", IssuerKeyHash: "hash01", SerialNumber: "serial0", ResponderURL: "http://someUrl"}
ocspResult := "deadbeef"
status := types.GenericStatusAccepted
status := types.Certificate15188EVStatusAccepted
requestJson := fmt.Sprintf(`[2,"%v","%v",{"ocspRequestData":{"hashAlgorithm":"%v","issuerNameHash":"%v","issuerKeyHash":"%v","serialNumber":"%v","responderURL":"%v"}}]`,
messageId, iso15118.GetCertificateStatusFeatureName, ocspData.HashAlgorithm, ocspData.IssuerNameHash, ocspData.IssuerKeyHash, ocspData.SerialNumber, ocspData.ResponderURL)
responseJson := fmt.Sprintf(`[3,"%v",{"status":"%v","ocspResult":"%v"}]`, messageId, status, ocspResult)
Expand Down
1 change: 1 addition & 0 deletions ocpp2.0.1_test/get_composite_schedule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ func (suite *OcppV2TestSuite) TestGetCompositeScheduleE2EMocked() {
responseJson := fmt.Sprintf(`[3,"%v",{"status":"%v","statusInfo":{"reasonCode":"%v"},"schedule":{"startDateTime":"%v","chargingSchedule":{"id":%v,"startSchedule":"%v","duration":%v,"chargingRateUnit":"%v","minChargingRate":%v,"chargingSchedulePeriod":[{"startPeriod":%v,"limit":%v,"numberPhases":%v}]}}}]`,
messageId, status, statusInfo.ReasonCode, compositeSchedule.StartDateTime.FormatTimestamp(), chargingSchedule.ID, chargingSchedule.StartSchedule.FormatTimestamp(), *chargingSchedule.Duration, chargingSchedule.ChargingRateUnit, *chargingSchedule.MinChargingRate, chargingSchedulePeriod.StartPeriod, chargingSchedulePeriod.Limit, *chargingSchedulePeriod.NumberPhases)
getCompositeScheduleConfirmation := smartcharging.NewGetCompositeScheduleResponse(status)
getCompositeScheduleConfirmation.StatusInfo = statusInfo
getCompositeScheduleConfirmation.Schedule = &compositeSchedule
channel := NewMockWebSocket(wsId)

Expand Down