Skip to content

Commit

Permalink
Update unit test.
Browse files Browse the repository at this point in the history
Signed-off-by: Akram Ahmad <sftwr2020@gmail.com>
  • Loading branch information
akramtexas committed Apr 15, 2020
1 parent 7e91e03 commit 5992b07
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion internal/controller/restfuncs.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ func commandFunc(w http.ResponseWriter, req *http.Request) {
} else {
common.LoggingClient.Trace("DeviceCommand: EventClient.MarshalEvent passed through encoded event", "device", event.Device, "event", event)
}
// TODO: Resolve why this header is not included in response from Core-Command to originating caller (while the written body is).
w.Header().Set(clients.ContentType, clients.ContentTypeCBOR)
w.Write(event.EncodedEvent)
} else {
Expand Down
2 changes: 1 addition & 1 deletion internal/handler/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ func TestCommandHandler(t *testing.T) {
func TestParseWriteParamsCborHeader(t *testing.T) {
profileName := mock.ProfileBinary
ros, _ := cache.Profiles().ResourceOperations(profileName, "RandomValue_Binary", common.SetCmdMethod)
params := `°xEnableRandomization_Binarydtrue`
params := `°xEnableRandomization_Binarydtrue§nparameterNamesxEnableRandomization_BinarydPathx/api/v1/device/9f872d68/BinarycUrlxBhttp://localhost:48082/api/v1/device/9f872d68/command/7ff8d51ea50dbidx$9f872d68-2281-4af4-959d-29e4d51c2192dnametRandom-Binary-DevicejadminStatehUNLOCKEDnoperatingStategENABLED°xEnableRandomization_Binarydtrue`
r := newRequestWithHeaders(map[string]string{clients.ContentType: clients.ContentTypeCBOR}, http.MethodPut)
_, err := parseWriteParams(profileName, ros, params, r)

Expand Down

0 comments on commit 5992b07

Please sign in to comment.