forked from TrueCloudLab/frostfs-api-go
[#168] session: Implement binary/JSON encoders/decoders on RequestMeta
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
7e3e9e1cba
commit
8f8e977a3e
4 changed files with 45 additions and 4 deletions
|
@ -66,3 +66,15 @@ func TestXHeaderJSON(t *testing.T) {
|
|||
|
||||
require.Equal(t, x, x2)
|
||||
}
|
||||
|
||||
func TestRequestMetaHeaderJSON(t *testing.T) {
|
||||
r := generateRequestMetaHeader(1, "bearer", "session")
|
||||
|
||||
data, err := r.MarshalJSON()
|
||||
require.NoError(t, err)
|
||||
|
||||
r2 := new(session.RequestMetaHeader)
|
||||
require.NoError(t, r2.UnmarshalJSON(data))
|
||||
|
||||
require.Equal(t, r, r2)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue