34 lines
1.2 KiB
Go
34 lines
1.2 KiB
Go
package app
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"hyapp/services/activity-service/internal/config"
|
|
)
|
|
|
|
func TestRoomOutboxConsumerConfigSerializesCompositeProjection(t *testing.T) {
|
|
cfg := config.Default().RocketMQ
|
|
cfg.RoomOutbox.ConsumerGroup = "activity-room-outbox-test"
|
|
|
|
consumerConfig := roomOutboxConsumerConfig(cfg)
|
|
if consumerConfig.ConsumeGoroutines != 1 {
|
|
t.Fatalf("room outbox consume goroutines = %d, want 1", consumerConfig.ConsumeGoroutines)
|
|
}
|
|
if consumerConfig.GroupName != cfg.RoomOutbox.ConsumerGroup {
|
|
t.Fatalf("room outbox group = %q, want %q", consumerConfig.GroupName, cfg.RoomOutbox.ConsumerGroup)
|
|
}
|
|
}
|
|
|
|
func TestVIPRebateNoticeConsumerDoesNotReplayHistoricalWalletEvents(t *testing.T) {
|
|
cfg := config.Default().RocketMQ
|
|
cfg.WalletOutbox.VIPRebateNoticeConsumerGroup = "activity-vip-rebate-notice-test"
|
|
|
|
consumerConfig := walletOutboxVIPRebateNoticeConsumerConfig(cfg)
|
|
if consumerConfig.ConsumeFromFirst {
|
|
t.Fatal("VIP rebate notice consumer must start at the latest offset for a new group")
|
|
}
|
|
if consumerConfig.GroupName != cfg.WalletOutbox.VIPRebateNoticeConsumerGroup {
|
|
t.Fatalf("VIP rebate notice group = %q, want %q", consumerConfig.GroupName, cfg.WalletOutbox.VIPRebateNoticeConsumerGroup)
|
|
}
|
|
}
|