fix: inject deps for tests
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
pbaero "github.com/flowy-live/llink/genproto/aero"
|
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/network"
|
||||||
"github.com/flowy-live/llink/internal/network/mocks"
|
"github.com/flowy-live/llink/internal/network/mocks"
|
||||||
"github.com/flowy-live/llink/internal/testhelper"
|
"github.com/flowy-live/llink/internal/testhelper"
|
||||||
@@ -31,7 +32,7 @@ func newTestService(t *testing.T) network.Service {
|
|||||||
ShootEmail(gomock.Any(), gomock.Any()).
|
ShootEmail(gomock.Any(), gomock.Any()).
|
||||||
Return(&pbaero.ShootEmailResponse{}, nil).
|
Return(&pbaero.ShootEmailResponse{}, nil).
|
||||||
AnyTimes()
|
AnyTimes()
|
||||||
return network.NewService(dbPool, mockAero)
|
return network.NewService(dbPool, mockAero, billing.Noop())
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestNetworkService(t *testing.T) {
|
func TestNetworkService(t *testing.T) {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/flowy-live/llink/internal/billing"
|
||||||
"github.com/flowy-live/llink/internal/network"
|
"github.com/flowy-live/llink/internal/network"
|
||||||
"github.com/flowy-live/llink/internal/particle"
|
"github.com/flowy-live/llink/internal/particle"
|
||||||
"github.com/flowy-live/llink/internal/testhelper"
|
"github.com/flowy-live/llink/internal/testhelper"
|
||||||
@@ -33,7 +34,7 @@ func getStreamStatus(data json.RawMessage) string {
|
|||||||
|
|
||||||
func TestParticleService_CreateAndGet(t *testing.T) {
|
func TestParticleService_CreateAndGet(t *testing.T) {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
networkSvc := network.NewService(dbPool, nil)
|
networkSvc := network.NewService(dbPool, nil, billing.Noop())
|
||||||
svc := particle.NewService(dbPool, networkSvc)
|
svc := particle.NewService(dbPool, networkSvc)
|
||||||
|
|
||||||
// Create a network first
|
// Create a network first
|
||||||
@@ -72,7 +73,7 @@ func TestParticleService_CreateAndGet(t *testing.T) {
|
|||||||
|
|
||||||
func TestParticleService_NestedParticles(t *testing.T) {
|
func TestParticleService_NestedParticles(t *testing.T) {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
networkSvc := network.NewService(dbPool, nil)
|
networkSvc := network.NewService(dbPool, nil, billing.Noop())
|
||||||
svc := particle.NewService(dbPool, networkSvc)
|
svc := particle.NewService(dbPool, networkSvc)
|
||||||
|
|
||||||
// Create a network
|
// Create a network
|
||||||
@@ -118,7 +119,7 @@ func TestParticleService_NestedParticles(t *testing.T) {
|
|||||||
|
|
||||||
func TestParticleService_CustomVisibility(t *testing.T) {
|
func TestParticleService_CustomVisibility(t *testing.T) {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
networkSvc := network.NewService(dbPool, nil)
|
networkSvc := network.NewService(dbPool, nil, billing.Noop())
|
||||||
svc := particle.NewService(dbPool, networkSvc)
|
svc := particle.NewService(dbPool, networkSvc)
|
||||||
|
|
||||||
// Create a network with a member
|
// Create a network with a member
|
||||||
@@ -160,7 +161,7 @@ func TestParticleService_CustomVisibility(t *testing.T) {
|
|||||||
|
|
||||||
func TestParticleService_UpdateAndDelete(t *testing.T) {
|
func TestParticleService_UpdateAndDelete(t *testing.T) {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
networkSvc := network.NewService(dbPool, nil)
|
networkSvc := network.NewService(dbPool, nil, billing.Noop())
|
||||||
svc := particle.NewService(dbPool, networkSvc)
|
svc := particle.NewService(dbPool, networkSvc)
|
||||||
|
|
||||||
// Create a network
|
// Create a network
|
||||||
@@ -198,7 +199,7 @@ func TestParticleService_UpdateAndDelete(t *testing.T) {
|
|||||||
|
|
||||||
func TestParticleService_ListRootParticles(t *testing.T) {
|
func TestParticleService_ListRootParticles(t *testing.T) {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
networkSvc := network.NewService(dbPool, nil)
|
networkSvc := network.NewService(dbPool, nil, billing.Noop())
|
||||||
svc := particle.NewService(dbPool, networkSvc)
|
svc := particle.NewService(dbPool, networkSvc)
|
||||||
|
|
||||||
// Create a network
|
// Create a network
|
||||||
@@ -224,7 +225,7 @@ func TestParticleService_ListRootParticles(t *testing.T) {
|
|||||||
|
|
||||||
func TestParticleService_OpenCloseStream(t *testing.T) {
|
func TestParticleService_OpenCloseStream(t *testing.T) {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
networkSvc := network.NewService(dbPool, nil)
|
networkSvc := network.NewService(dbPool, nil, billing.Noop())
|
||||||
svc := particle.NewService(dbPool, networkSvc)
|
svc := particle.NewService(dbPool, networkSvc)
|
||||||
|
|
||||||
// Create a network
|
// Create a network
|
||||||
@@ -272,7 +273,7 @@ func TestParticleService_OpenCloseStream(t *testing.T) {
|
|||||||
|
|
||||||
func TestParticleService_NotAStream(t *testing.T) {
|
func TestParticleService_NotAStream(t *testing.T) {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
networkSvc := network.NewService(dbPool, nil)
|
networkSvc := network.NewService(dbPool, nil, billing.Noop())
|
||||||
svc := particle.NewService(dbPool, networkSvc)
|
svc := particle.NewService(dbPool, networkSvc)
|
||||||
|
|
||||||
// Create a network
|
// Create a network
|
||||||
@@ -301,7 +302,7 @@ func TestParticleService_NotAStream(t *testing.T) {
|
|||||||
|
|
||||||
func TestParticleService_AccessInheritance(t *testing.T) {
|
func TestParticleService_AccessInheritance(t *testing.T) {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
networkSvc := network.NewService(dbPool, nil)
|
networkSvc := network.NewService(dbPool, nil, billing.Noop())
|
||||||
svc := particle.NewService(dbPool, networkSvc)
|
svc := particle.NewService(dbPool, networkSvc)
|
||||||
|
|
||||||
// Create a network with members
|
// Create a network with members
|
||||||
|
|||||||
Reference in New Issue
Block a user