diff --git a/controller/api/initialise_test.go b/controller/api/initialise_test.go index 70d84dc97df463b197365493ed247b59a058149b..1e8e02578bc39287a33fc0af4ca58eddcbd252b8 100644 --- a/controller/api/initialise_test.go +++ b/controller/api/initialise_test.go @@ -151,7 +151,7 @@ func bootstrapUnitTest() { jwtManager := rbacImpl.NewJWTManager("", (10000 * time.Hour)) nodeStore := store.NewGenericStore[nodes.Node]() - nodeService := nodes.NewNodeService(nodeStore) + nodeService := nodes.NewNodeService(nodeStore, eventService) portStore := store.NewGenericStore[ports.Port]() portService := ports.NewPortService(portStore) diff --git a/controller/topology/routing-tables/routingTableService_test.go b/controller/topology/routing-tables/routingTableService_test.go index 55fd7a19fc3bdfc2489ac3527e6f5b3a07332954..b815946d3be3f47721b772ecfefd28767991870b 100644 --- a/controller/topology/routing-tables/routingTableService_test.go +++ b/controller/topology/routing-tables/routingTableService_test.go @@ -4,6 +4,7 @@ import ( "reflect" "testing" + eventservice "code.fbi.h-da.de/danet/gosdn/controller/eventService" "code.fbi.h-da.de/danet/gosdn/controller/topology/nodes" "code.fbi.h-da.de/danet/gosdn/controller/topology/ports" "code.fbi.h-da.de/danet/gosdn/controller/topology/store" @@ -95,12 +96,12 @@ func TestNewRoutingTableService(t *testing.T) { name: "should create a new topology service", args: args{ store: getTestStoreWithRoutingTables(t, []RoutingTable{}), - nodeService: nodes.NewNodeService(getTestStoreWithNodes(t, []nodes.Node{})), + nodeService: nodes.NewNodeService(getTestStoreWithNodes(t, []nodes.Node{}), eventservice.NewMockEventService()), portService: ports.NewPortService(getTestStoreWithPorts(t, []ports.Port{})), }, want: NewRoutingTableService( getTestStoreWithRoutingTables(t, []RoutingTable{}), - nodes.NewNodeService(getTestStoreWithNodes(t, []nodes.Node{})), + nodes.NewNodeService(getTestStoreWithNodes(t, []nodes.Node{}), eventservice.NewMockEventService()), ports.NewPortService(getTestStoreWithPorts(t, []ports.Port{})), ), }, @@ -137,7 +138,7 @@ func TestTopologyService_EnsureExists(t *testing.T) { nodeService: nodes.NewNodeService(getTestStoreWithNodes( t, []nodes.Node{}, - )), + ), eventservice.NewMockEventService()), portService: ports.NewPortService(getTestStoreWithPorts( t, []ports.Port{}, @@ -156,7 +157,7 @@ func TestTopologyService_EnsureExists(t *testing.T) { nodeService: nodes.NewNodeService(getTestStoreWithNodes( t, []nodes.Node{getTestNode()}, - )), + ), eventservice.NewMockEventService()), portService: ports.NewPortService(getTestStoreWithPorts( t, []ports.Port{getTestPort()}, @@ -208,7 +209,7 @@ func TestRoutingTableService_Update(t *testing.T) { name: "should update an existing routing table", fields: fields{ store: getTestStoreWithRoutingTables(t, []RoutingTable{getTestRoutingTable()}), - nodeService: nodes.NewNodeService(getTestStoreWithNodes(t, []nodes.Node{})), + nodeService: nodes.NewNodeService(getTestStoreWithNodes(t, []nodes.Node{}), eventservice.NewMockEventService()), portService: ports.NewPortService(getTestStoreWithPorts(t, []ports.Port{})), }, args: args{ @@ -252,7 +253,7 @@ func TestRoutingTableService_Delete(t *testing.T) { name: "should delete an existing routing table", fields: fields{ store: getTestStoreWithRoutingTables(t, []RoutingTable{getTestRoutingTable()}), - nodeService: nodes.NewNodeService(getTestStoreWithNodes(t, []nodes.Node{})), + nodeService: nodes.NewNodeService(getTestStoreWithNodes(t, []nodes.Node{}), eventservice.NewMockEventService()), portService: ports.NewPortService(getTestStoreWithPorts(t, []ports.Port{})), }, args: args{ @@ -264,7 +265,7 @@ func TestRoutingTableService_Delete(t *testing.T) { name: "should fail if a routing table does not exists", fields: fields{ store: store.NewGenericStore[RoutingTable](), - nodeService: nodes.NewNodeService(getTestStoreWithNodes(t, []nodes.Node{})), + nodeService: nodes.NewNodeService(getTestStoreWithNodes(t, []nodes.Node{}), eventservice.NewMockEventService()), portService: ports.NewPortService(getTestStoreWithPorts(t, []ports.Port{})), }, args: args{ @@ -307,7 +308,7 @@ func TestRoutingTableService_Get(t *testing.T) { name: "should error if routing table with uuid is not in store", fields: fields{ store: getTestStoreWithRoutingTables(t, []RoutingTable{}), - nodeService: nodes.NewNodeService(getTestStoreWithNodes(t, []nodes.Node{})), + nodeService: nodes.NewNodeService(getTestStoreWithNodes(t, []nodes.Node{}), eventservice.NewMockEventService()), portService: ports.NewPortService(getTestStoreWithPorts(t, []ports.Port{})), }, args: args{ @@ -367,7 +368,7 @@ func TestRoutingTableService_GetAll(t *testing.T) { name: "should get all stored routing tables", fields: fields{ store: getTestStoreWithRoutingTables(t, []RoutingTable{getTestRoutingTable()}), - nodeService: nodes.NewNodeService(getTestStoreWithNodes(t, []nodes.Node{})), + nodeService: nodes.NewNodeService(getTestStoreWithNodes(t, []nodes.Node{}), eventservice.NewMockEventService()), portService: ports.NewPortService(getTestStoreWithPorts(t, []ports.Port{})), }, want: []RoutingTable{getTestRoutingTable()},