diff --git a/internal/common/utils.go b/internal/common/utils.go index a505db799..4fc1f6d66 100644 --- a/internal/common/utils.go +++ b/internal/common/utils.go @@ -13,7 +13,6 @@ import ( "crypto/md5" "encoding/json" "fmt" - "github.com/OneOfOne/xxhash" "io" "io/ioutil" "net/http" @@ -28,6 +27,7 @@ import ( contract "github.com/edgexfoundry/go-mod-core-contracts/models" "github.com/google/uuid" + "github.com/OneOfOne/xxhash" "github.com/ugorji/go/codec" ) diff --git a/internal/handler/command_test.go b/internal/handler/command_test.go index 1384b19bd..87f69288f 100644 --- a/internal/handler/command_test.go +++ b/internal/handler/command_test.go @@ -83,18 +83,18 @@ func init() { common.LoggingClient = logger.NewClient("command_test", false, "./device-simple.log", "INFO") } -//func TestParseWriteParamsWrongParamName(t *testing.T) { -// profileName := "notFound" -// ro := []contract.ResourceOperation{{Index: ""}} -// params := "{ \"key\": \"value\" }" -// -// r := newRequestWithContentType(clients.ContentTypeJSON) -// _, err := parseWriteParams(profileName, ro, params, r) -// -// if err == nil { -// t.Error("expected error") -// } -//} +func TestParseWriteParamsWrongParamName(t *testing.T) { + profileName := "notFound" + ro := []contract.ResourceOperation{{Index: ""}} + params := "{ \"key\": \"value\" }" + r := newRequestWithContentType(clients.ContentTypeJSON) + + _, err := parseWriteParams(profileName, ro, params, r) + + if err == nil { + t.Error("expected error") + } +} func TestParseWriteParamsNoParams(t *testing.T) { profileName := "notFound"