frostfs-api-go/v2/container/message_test.go
Leonard Lyubich 1031f3122e [#263] v2: Support new rpc library
Implement `message.Message` interface on all structures and use new methods
for conversion instead of functions. make `Unmarshal` and JSON methods to
use encoding functions from `message` library. Remove all per-service
clients and implement `rpc` library of the functions which execute NeoFS API
RPC through new RPC client. Remove no longer used gRPC per-service clients.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-03-17 14:03:49 +03:00

43 lines
2.9 KiB
Go

package container_test
import (
"testing"
"github.com/nspcc-dev/neofs-api-go/rpc/message"
messagetest "github.com/nspcc-dev/neofs-api-go/rpc/message/test"
containertest "github.com/nspcc-dev/neofs-api-go/v2/container/test"
)
func TestMessageConvert(t *testing.T) {
messagetest.TestRPCMessage(t,
func(empty bool) message.Message { return containertest.GenerateAttribute(empty) },
func(empty bool) message.Message { return containertest.GenerateContainer(empty) },
func(empty bool) message.Message { return containertest.GeneratePutRequestBody(empty) },
func(empty bool) message.Message { return containertest.GeneratePutRequest(empty) },
func(empty bool) message.Message { return containertest.GeneratePutResponseBody(empty) },
func(empty bool) message.Message { return containertest.GeneratePutResponse(empty) },
func(empty bool) message.Message { return containertest.GenerateGetRequestBody(empty) },
func(empty bool) message.Message { return containertest.GenerateGetRequest(empty) },
func(empty bool) message.Message { return containertest.GenerateGetResponseBody(empty) },
func(empty bool) message.Message { return containertest.GenerateGetResponse(empty) },
func(empty bool) message.Message { return containertest.GenerateDeleteRequestBody(empty) },
func(empty bool) message.Message { return containertest.GenerateDeleteRequest(empty) },
func(empty bool) message.Message { return containertest.GenerateDeleteResponseBody(empty) },
func(empty bool) message.Message { return containertest.GenerateDeleteResponse(empty) },
func(empty bool) message.Message { return containertest.GenerateListRequestBody(empty) },
func(empty bool) message.Message { return containertest.GenerateListRequest(empty) },
func(empty bool) message.Message { return containertest.GenerateListResponseBody(empty) },
func(empty bool) message.Message { return containertest.GenerateListResponse(empty) },
func(empty bool) message.Message { return containertest.GenerateSetExtendedACLRequestBody(empty) },
func(empty bool) message.Message { return containertest.GenerateSetExtendedACLRequest(empty) },
func(empty bool) message.Message { return containertest.GenerateGetRequestBody(empty) },
func(empty bool) message.Message { return containertest.GenerateGetRequest(empty) },
func(empty bool) message.Message { return containertest.GenerateGetResponseBody(empty) },
func(empty bool) message.Message { return containertest.GenerateGetResponse(empty) },
func(empty bool) message.Message { return containertest.GenerateUsedSpaceAnnouncement(empty) },
func(empty bool) message.Message { return containertest.GenerateAnnounceUsedSpaceRequestBody(empty) },
func(empty bool) message.Message { return containertest.GenerateAnnounceUsedSpaceRequest(empty) },
func(empty bool) message.Message { return containertest.GenerateAnnounceUsedSpaceResponseBody(empty) },
func(empty bool) message.Message { return containertest.GenerateAnnounceUsedSpaceResponse(empty) },
)
}