forked from TrueCloudLab/frostfs-api-go
[#168] session: Implement binary/JSON encoders/decoders on XHeader
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
85d4713348
commit
7e3e9e1cba
4 changed files with 45 additions and 4 deletions
|
@ -54,3 +54,15 @@ func TestSessionTokenJSON(t *testing.T) {
|
|||
|
||||
require.Equal(t, tok, tok2)
|
||||
}
|
||||
|
||||
func TestXHeaderJSON(t *testing.T) {
|
||||
x := generateXHeader("key", "value")
|
||||
|
||||
data, err := x.MarshalJSON()
|
||||
require.NoError(t, err)
|
||||
|
||||
x2 := new(session.XHeader)
|
||||
require.NoError(t, x2.UnmarshalJSON(data))
|
||||
|
||||
require.Equal(t, x, x2)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue