Files
llink/go/internal/testhelper/network.go
T
2026-04-22 09:06:10 -07:00

24 lines
667 B
Go

package testhelper
import (
"testing"
pbaero "github.com/flowy-live/llink/genproto/aero"
"github.com/flowy-live/llink/internal/billing"
"github.com/flowy-live/llink/internal/network"
"github.com/flowy-live/llink/internal/testhelper/mocks/aero"
"github.com/jackc/pgx/v5/pgxpool"
"go.uber.org/mock/gomock"
)
func NewNetworkService(t *testing.T, pool *pgxpool.Pool) network.Service {
t.Helper()
ctrl := gomock.NewController(t)
mockAero := aero.NewMockPrimaryClient(ctrl)
mockAero.EXPECT().
ShootEmail(gomock.Any(), gomock.Any()).
Return(&pbaero.ShootEmailResponse{}, nil).
AnyTimes()
return network.NewService(pool, mockAero, billing.Noop(), nil)
}