@@ -2,13 +2,13 @@ package model
22
33import (
44 "context"
5+ "encoding/json"
56 "net/http"
67 "net/http/httptest"
78 "testing"
89
910 "github.com/stretchr/testify/assert"
1011 "github.com/stretchr/testify/suite"
11- "github.com/vmihailenco/msgpack/v5"
1212)
1313
1414type handshakeTestSuite struct {
@@ -21,12 +21,12 @@ func (s *handshakeTestSuite) TestHandshakeInitSuccess() {
2121 // Verify request
2222 assert .Equal (t , "POST" , r .Method )
2323 assert .Equal (t , "/api/v1/handshake/init" , r .URL .Path )
24- assert .Equal (t , "application/msgpack " , r .Header .Get ("Content-Type" ))
24+ assert .Equal (t , "application/json " , r .Header .Get ("Content-Type" ))
2525 assert .Contains (t , r .Header .Get ("User-Agent" ), "shelltimeCLI@" )
2626
2727 // Decode request body
2828 var payload handshakeInitRequest
29- err := msgpack .NewDecoder (r .Body ).Decode (& payload )
29+ err := json .NewDecoder (r .Body ).Decode (& payload )
3030 assert .NoError (t , err )
3131
3232 // Verify payload
@@ -74,11 +74,11 @@ func (s *handshakeTestSuite) TestHandshakeCheckWithToken() {
7474 // Verify request
7575 assert .Equal (t , "POST" , r .Method )
7676 assert .Equal (t , "/api/v1/handshake/check" , r .URL .Path )
77- assert .Equal (t , "application/msgpack " , r .Header .Get ("Content-Type" ))
77+ assert .Equal (t , "application/json " , r .Header .Get ("Content-Type" ))
7878
7979 // Decode request body
8080 var payload handshakeCheckRequest
81- err := msgpack .NewDecoder (r .Body ).Decode (& payload )
81+ err := json .NewDecoder (r .Body ).Decode (& payload )
8282 assert .NoError (t , err )
8383
8484 // Verify payload
0 commit comments