forked from TrueCloudLab/frostfs-api-go
[#168] acl: Implement binary/JSON encoders/decoders on HeaderFilter
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
9bebc1247d
commit
7f42156201
6 changed files with 175 additions and 60 deletions
|
@ -64,3 +64,15 @@ func TestBearerTokenJSON(t *testing.T) {
|
|||
require.Equal(t, exp, got)
|
||||
})
|
||||
}
|
||||
|
||||
func TestFilterJSON(t *testing.T) {
|
||||
f := generateFilter(acl.HeaderTypeObject, "key", "value")
|
||||
|
||||
data, err := f.MarshalJSON()
|
||||
require.NoError(t, err)
|
||||
|
||||
f2 := new(acl.HeaderFilter)
|
||||
require.NoError(t, f2.UnmarshalJSON(data))
|
||||
|
||||
require.Equal(t, f, f2)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue