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