2026-05-21 15:31:00 +08:00

25 lines
588 B
Go

package grpc
import (
"testing"
gamedomain "hyapp/services/game-service/internal/domain/game"
)
func TestPlatformToProtoExposesCallbackSecretForAdmin(t *testing.T) {
const secret = "leadercc-admin-visible-key"
got := platformToProto(gamedomain.Platform{
PlatformCode: "lingxian",
CallbackSecretCiphertext: secret,
CallbackSecretConfigured: true,
})
if got.GetCallbackSecret() != secret {
t.Fatalf("callback_secret = %q, want %q", got.GetCallbackSecret(), secret)
}
if !got.GetCallbackSecretSet() {
t.Fatal("callback_secret_set = false, want true")
}
}