samba/server/other/handler/otherHandler_test.go
2025-06-04 09:51:39 +08:00

27 lines
580 B
Go

package handler
import (
"github.com/stretchr/testify/assert"
"samba/pkg/servername"
"samba/proto"
"samba/util/routingKey"
"samba/util/sender"
"samba/util/util"
"testing"
)
func Test_onModifyTimeOffset(t *testing.T) {
s := sender.NewMQSender(
util.Direct(servername.Other),
routingKey.Other,
)
req := &proto.ReqModifyTimeOffset{
Offset: 3600 * 8,
}
rsp := &proto.RspModifyTimeOffset{}
err := s.Call(proto.ReqModifyTimeOffsetId, req, rsp)
assert.NoError(t, err)
t.Logf("before: %s, after: %s", rsp.Ts["other"].TimeBeforeStr, rsp.Ts["other"].TimeAfterStr)
}