mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
issue: #33285 - move streaming related proto into pkg. - add v2 message type and change flush message into v2 message. Signed-off-by: chyezh <chyezh@outlook.com>
36 lines
1.0 KiB
Go
36 lines
1.0 KiB
Go
package options
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/milvus-io/milvus/pkg/mocks/streaming/util/mock_message"
|
|
"github.com/milvus-io/milvus/pkg/streaming/proto/streamingpb"
|
|
)
|
|
|
|
func TestDeliverPolicy(t *testing.T) {
|
|
policy := DeliverPolicyAll()
|
|
_ = policy.GetPolicy().(*streamingpb.DeliverPolicy_All)
|
|
|
|
policy = DeliverPolicyLatest()
|
|
_ = policy.GetPolicy().(*streamingpb.DeliverPolicy_Latest)
|
|
|
|
messageID := mock_message.NewMockMessageID(t)
|
|
messageID.EXPECT().Marshal().Return("messageID")
|
|
policy = DeliverPolicyStartFrom(messageID)
|
|
_ = policy.GetPolicy().(*streamingpb.DeliverPolicy_StartFrom)
|
|
|
|
policy = DeliverPolicyStartAfter(messageID)
|
|
_ = policy.GetPolicy().(*streamingpb.DeliverPolicy_StartAfter)
|
|
}
|
|
|
|
func TestDeliverFilter(t *testing.T) {
|
|
filter := DeliverFilterTimeTickGT(1)
|
|
_ = filter.GetFilter().(*streamingpb.DeliverFilter_TimeTickGt)
|
|
|
|
filter = DeliverFilterTimeTickGTE(2)
|
|
_ = filter.GetFilter().(*streamingpb.DeliverFilter_TimeTickGte)
|
|
|
|
filter = DeliverFilterVChannel("vchannel")
|
|
_ = filter.GetFilter().(*streamingpb.DeliverFilter_Vchannel)
|
|
}
|