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
429 changes: 429 additions & 0 deletions edge-apis/api_session.go

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions edge-apis/api_session_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package edge_apis

import (
"encoding/json"
"testing"

"github.com/stretchr/testify/require"
)

func Test_ApiSessionMarshalling(t *testing.T) {

t.Run("test marshalling", func(t *testing.T) {
req := require.New(t)
type testStruct struct {
ApiSession ApiSessionJsonWrapper `json:"apiSession"`
}

test := &testStruct{
ApiSession: ApiSessionJsonWrapper{
ApiSession: NewApiSessionOidc("access", "refresh"),
},
}

testJson, err := json.Marshal(test)
req.NoError(err)

testUnmarhsal := &testStruct{}

err = json.Unmarshal(testJson, testUnmarhsal)
req.NoError(err)
req.Equal(test.ApiSession.ApiSession.GetToken(), testUnmarhsal.ApiSession.ApiSession.GetToken())
})
}
Loading
Loading