frostfs-api-go/netmap/message_test.go
Airat Arifullin bc16a32c24 [#40] types: Generate StableMarshaler/StableSize methods for protobufs
* Add plugin option for protogen in Makefile
* Fix the generator for the plugin in util/protogen
* Erase convertable types, move helpful methods to gRPC protobufs
* Erase helpers for convertations
* Generate StableMarshlal/StableSize for protobufs by the protoc plugin

Signed-off-by: Airat Arifullin a.arifullin@yadro.com
2023-07-10 12:08:48 +03:00

32 lines
1.8 KiB
Go

package netmap_test
import (
"testing"
netmaptest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/test"
messagetest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message/test"
"google.golang.org/protobuf/proto"
)
func TestMessageConvert(t *testing.T) {
messagetest.TestRPCMessage(t,
func(empty bool) proto.Message { return netmaptest.GenerateFilter(empty) },
func(empty bool) proto.Message { return netmaptest.GenerateSelector(empty) },
func(empty bool) proto.Message { return netmaptest.GenerateReplica(empty) },
func(empty bool) proto.Message { return netmaptest.GeneratePlacementPolicy(empty) },
func(empty bool) proto.Message { return netmaptest.GenerateAttribute(empty) },
func(empty bool) proto.Message { return netmaptest.GenerateNodeInfo(empty) },
func(empty bool) proto.Message { return netmaptest.GenerateLocalNodeInfoRequest(empty) },
func(empty bool) proto.Message { return netmaptest.GenerateLocalNodeInfoResponseBody(empty) },
func(empty bool) proto.Message { return netmaptest.GenerateNetworkParameter(empty) },
func(empty bool) proto.Message { return netmaptest.GenerateNetworkConfig(empty) },
func(empty bool) proto.Message { return netmaptest.GenerateNetworkInfo(empty) },
func(empty bool) proto.Message { return netmaptest.GenerateNetworkInfoRequest(empty) },
func(empty bool) proto.Message { return netmaptest.GenerateNetworkInfoResponseBody(empty) },
func(empty bool) proto.Message { return netmaptest.GenerateNetMap(empty) },
func(empty bool) proto.Message { return netmaptest.GenerateSnapshotRequestBody(empty) },
func(empty bool) proto.Message { return netmaptest.GenerateSnapshotRequest(empty) },
func(empty bool) proto.Message { return netmaptest.GenerateSnapshotResponseBody(empty) },
func(empty bool) proto.Message { return netmaptest.GenerateSnapshotResponse(empty) },
)
}