forked from TrueCloudLab/frostfs-api-go
[#168] session: Implement binary/JSON encoders/decoders on TokenBody
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
20bf21e5e4
commit
4e163617d1
4 changed files with 45 additions and 4 deletions
|
@ -30,3 +30,15 @@ func TestTokenLifetimeJSON(t *testing.T) {
|
|||
|
||||
require.Equal(t, l, l2)
|
||||
}
|
||||
|
||||
func TestSessionTokenBodyJSON(t *testing.T) {
|
||||
b := generateSessionTokenBody("id")
|
||||
|
||||
data, err := b.MarshalJSON()
|
||||
require.NoError(t, err)
|
||||
|
||||
b2 := new(session.SessionTokenBody)
|
||||
require.NoError(t, b2.UnmarshalJSON(data))
|
||||
|
||||
require.Equal(t, b, b2)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue