[#295] pkg: Remove usage of deprecated elements

Remove usage of deprecated of `container.ID` and `token.SessionToken` code
elements. Replace using of custom message generators with the ones provided
by packages. Replace string comparison with `Equal` method call.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-05-31 15:09:04 +03:00 committed by Leonard Lyubich
parent 89be8d3f5a
commit 65080c8b69
22 changed files with 97 additions and 209 deletions

View file

@ -1,10 +1,9 @@
package session_test
import (
"crypto/rand"
"testing"
"github.com/nspcc-dev/neofs-api-go/pkg/owner"
ownertest "github.com/nspcc-dev/neofs-api-go/pkg/owner/test"
"github.com/nspcc-dev/neofs-api-go/pkg/session"
sessiontest "github.com/nspcc-dev/neofs-api-go/pkg/session/test"
"github.com/stretchr/testify/require"
@ -22,12 +21,7 @@ func TestSessionToken_SetID(t *testing.T) {
func TestSessionToken_SetOwnerID(t *testing.T) {
token := session.NewToken()
w := new(owner.NEO3Wallet)
_, err := rand.Read(w.Bytes())
require.NoError(t, err)
ownerID := owner.NewID()
ownerID.SetNeo3Wallet(w)
ownerID := ownertest.Generate()
token.SetOwnerID(ownerID)