Skip to content

Commit

Permalink
Merge pull request #4942 from weichou1229/upgrade-contracts
Browse files Browse the repository at this point in the history
build: Upgrade core-contracts to v3.2.0-dev.48
  • Loading branch information
cloudxxx8 authored Oct 7, 2024
2 parents 2495dbd + 1fce781 commit 5fec19b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/eclipse/paho.mqtt.golang v1.5.0
github.com/edgexfoundry/go-mod-bootstrap/v3 v3.2.0-dev.58
github.com/edgexfoundry/go-mod-configuration/v3 v3.2.0-dev.17
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.2.0-dev.45
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.2.0-dev.48
github.com/edgexfoundry/go-mod-messaging/v3 v3.2.0-dev.35
github.com/edgexfoundry/go-mod-secrets/v3 v3.2.0-dev.12
github.com/fxamacker/cbor/v2 v2.7.0
Expand Down Expand Up @@ -56,7 +56,7 @@ require (
github.com/go-openapi/validate v0.24.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.22.0 // indirect
github.com/go-playground/validator/v10 v10.22.1 // indirect
github.com/go-redis/redis/v7 v7.3.0 // indirect
github.com/go-resty/resty/v2 v2.13.1 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ github.com/edgexfoundry/go-mod-bootstrap/v3 v3.2.0-dev.58 h1:AHp6ChEe44PhQX72Ord
github.com/edgexfoundry/go-mod-bootstrap/v3 v3.2.0-dev.58/go.mod h1:MoAhP94mD4GI1ReeHQz0M7R4vD8MlA3/paP3u6QrEM4=
github.com/edgexfoundry/go-mod-configuration/v3 v3.2.0-dev.17 h1:eNLGThT5fYtFLSrr6vtvHV92cm5IohJzwSRYcd5pvtg=
github.com/edgexfoundry/go-mod-configuration/v3 v3.2.0-dev.17/go.mod h1:va3l+Nri1KijDM5KItsaYrwUSG3Nhj/4EDvR4uB+Jds=
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.2.0-dev.45 h1:rr/1rv8JxM6b8EXKPeqK97msmj7++20fgLNSyxaTHrM=
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.2.0-dev.45/go.mod h1:d/FCa9Djq/pb7RYGEEhrR7fnKo+JK5IQ2YGW4LIHAqE=
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.2.0-dev.48 h1:wL2f6AFsByGGXfmez7LdEKsK4oMnGprJqK6PA/RpS/g=
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.2.0-dev.48/go.mod h1:MLk37/79M26+bZr3IptNZuYmQBEVbXwzDp1VHQkFhIk=
github.com/edgexfoundry/go-mod-messaging/v3 v3.2.0-dev.35 h1:ZKmq5Vd1QN86OLTbD8A2JIKTxR8k21gtqmEUS3hApBY=
github.com/edgexfoundry/go-mod-messaging/v3 v3.2.0-dev.35/go.mod h1:SUTdo8v9V+XacowkZP5puBXnBcVP2NDSk5PBzOdsLEk=
github.com/edgexfoundry/go-mod-registry/v3 v3.2.0-dev.16 h1:vG6cI1LU8QLpzUXYleYuVyqbpeYghLF3Jj6afcaUCHA=
Expand Down Expand Up @@ -171,8 +171,8 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
github.com/go-playground/validator/v10 v10.22.0 h1:k6HsTZ0sTnROkhS//R0O+55JgM8C4Bx7ia+JlgcnOao=
github.com/go-playground/validator/v10 v10.22.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
github.com/go-playground/validator/v10 v10.22.1 h1:40JcKH+bBNGFczGuoBYgX4I6m/i27HYW8P9FDk5PbgA=
github.com/go-playground/validator/v10 v10.22.1/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
github.com/go-redis/redis/v7 v7.3.0 h1:3oHqd0W7f/VLKBxeYTEpqdMUsmMectngjM9OtoRoIgg=
github.com/go-redis/redis/v7 v7.3.0/go.mod h1:JDNMw23GTyLNC4GZu9njt15ctBQVn7xjRfnwdHj/Dcg=
github.com/go-resty/resty/v2 v2.13.1 h1:x+LHXBI2nMB1vqndymf26quycC4aggYJ7DECYbiz03g=
Expand Down
14 changes: 8 additions & 6 deletions internal/core/data/controller/http/event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@ import (

var expectedEventId = uuid.New().String()

var testReadingValue = "45"
var testReading = dtos.BaseReading{
DeviceName: TestDeviceName,
ResourceName: TestDeviceResourceName,
ProfileName: TestDeviceProfileName,
Origin: TestOriginTime,
ValueType: common.ValueTypeUint8,
SimpleReading: dtos.SimpleReading{
Value: TestReadingValue,
Value: &testReadingValue,
},
}

Expand Down Expand Up @@ -162,7 +163,8 @@ func TestAddEvent(t *testing.T) {

noSimpleValue := validRequest
noSimpleValue.Event.Readings = []dtos.BaseReading{testReading}
noSimpleValue.Event.Readings[0].Value = ""
emptyStr := ""
noSimpleValue.Event.Readings[0].Value = &emptyStr
noBinaryValue := validRequest
noBinaryValue.Event.Readings = []dtos.BaseReading{{
DeviceName: TestDeviceName,
Expand Down Expand Up @@ -215,8 +217,8 @@ func TestAddEvent(t *testing.T) {
{"Invalid - No Reading ValueType JSON", noReadingValueType, common.ContentTypeJSON, noReadingValueType.Event.ProfileName, noReadingValueType.Event.DeviceName, true, http.StatusBadRequest},
{"Invalid - Invalid Reading ValueType JSON", invalidReadingInvalidValueType, common.ContentTypeJSON, invalidReadingInvalidValueType.Event.ProfileName, invalidReadingInvalidValueType.Event.DeviceName, true, http.StatusBadRequest},
{"Invalid - No SimpleReading Value JSON", noSimpleValue, common.ContentTypeJSON, noSimpleValue.Event.ProfileName, noSimpleValue.Event.DeviceName, true, http.StatusBadRequest},
{"Invalid - No BinaryReading BinaryValue JSON", noBinaryValue, common.ContentTypeJSON, noBinaryValue.Event.ProfileName, noBinaryValue.Event.DeviceName, true, http.StatusBadRequest},
{"Invalid - No BinaryReading MediaType JSON", noBinaryMediaType, common.ContentTypeJSON, noBinaryMediaType.Event.ProfileName, noBinaryMediaType.Event.DeviceName, true, http.StatusBadRequest},
{"Valid - No BinaryReading BinaryValue JSON", noBinaryValue, common.ContentTypeJSON, noBinaryValue.Event.ProfileName, noBinaryValue.Event.DeviceName, false, http.StatusCreated},
{"Valid - No BinaryReading MediaType JSON", noBinaryMediaType, common.ContentTypeJSON, noBinaryMediaType.Event.ProfileName, noBinaryMediaType.Event.DeviceName, false, http.StatusCreated},
{"Valid - AddEventRequest CBOR", validRequest, common.ContentTypeCBOR, validRequest.Event.ProfileName, validRequest.Event.DeviceName, false, http.StatusCreated},
{"Valid - No RequestId CBOR", noRequestId, common.ContentTypeCBOR, noRequestId.Event.ProfileName, noRequestId.Event.DeviceName, false, http.StatusCreated},
{"Invalid - Bad RequestId CBOR", badRequestId, common.ContentTypeCBOR, badRequestId.Event.ProfileName, badRequestId.Event.DeviceName, true, http.StatusBadRequest},
Expand All @@ -235,8 +237,8 @@ func TestAddEvent(t *testing.T) {
{"Invalid - No Reading ValueType CBOR", noReadingValueType, common.ContentTypeCBOR, noReadingValueType.Event.ProfileName, noReadingValueType.Event.DeviceName, true, http.StatusBadRequest},
{"Invalid - Invalid Reading ValueType CBOR", invalidReadingInvalidValueType, common.ContentTypeCBOR, invalidReadingInvalidValueType.Event.ProfileName, invalidReadingInvalidValueType.Event.DeviceName, true, http.StatusBadRequest},
{"Invalid - No SimpleReading Value CBOR", noSimpleValue, common.ContentTypeCBOR, noSimpleValue.Event.ProfileName, noSimpleValue.Event.DeviceName, true, http.StatusBadRequest},
{"Invalid - No BinaryReading BinaryValue CBOR", noBinaryValue, common.ContentTypeCBOR, noBinaryValue.Event.ProfileName, noBinaryValue.Event.DeviceName, true, http.StatusBadRequest},
{"Invalid - No BinaryReading MediaType CBOR", noBinaryMediaType, common.ContentTypeCBOR, noBinaryMediaType.Event.ProfileName, noBinaryMediaType.Event.DeviceName, true, http.StatusBadRequest},
{"Valid - No BinaryReading BinaryValue CBOR", noBinaryValue, common.ContentTypeCBOR, noBinaryValue.Event.ProfileName, noBinaryValue.Event.DeviceName, false, http.StatusCreated},
{"Valid - No BinaryReading MediaType CBOR", noBinaryMediaType, common.ContentTypeCBOR, noBinaryMediaType.Event.ProfileName, noBinaryMediaType.Event.DeviceName, false, http.StatusCreated},
}

for _, testCase := range tests {
Expand Down

0 comments on commit 5fec19b

Please sign in to comment.