mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-02 08:55:56 +08:00
issue: #33285 - make message builder and message conversion type safe - add adaptor type and function to adapt old msgstream msgpack and message interface --------- Signed-off-by: chyezh <chyezh@outlook.com>
21 lines
622 B
Go
21 lines
622 B
Go
package adaptor
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/apache/pulsar-client-go/pulsar"
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
msgpulsar "github.com/milvus-io/milvus/pkg/streaming/walimpls/impls/pulsar"
|
|
"github.com/milvus-io/milvus/pkg/streaming/walimpls/impls/rmq"
|
|
)
|
|
|
|
func TestIDCoversion(t *testing.T) {
|
|
id := MustGetMessageIDFromMQWrapperID(MustGetMQWrapperIDFromMessage(rmq.NewRmqID(1)))
|
|
assert.True(t, id.EQ(rmq.NewRmqID(1)))
|
|
|
|
msgID := pulsar.EarliestMessageID()
|
|
id = MustGetMessageIDFromMQWrapperID(MustGetMQWrapperIDFromMessage(msgpulsar.NewPulsarID(msgID)))
|
|
assert.True(t, id.EQ(msgpulsar.NewPulsarID(msgID)))
|
|
}
|