Skip to content
Snippets Groups Projects

Resolve "Improve security by enabling and enforcing more linting rules"

All threads resolved!
1 file
+ 38
27
Compare changes
  • Side-by-side
  • Inline
@@ -123,9 +123,10 @@ func TestNewRoutingTableService(t *testing.T) {
func TestTopologyService_EnsureExists(t *testing.T) {
type fields struct {
store Store
nodeService nodes.Service
portService ports.Service
store Store
nodeService nodes.Service
portService ports.Service
eventService eventInterfaces.Service
}
type args struct {
routingTable RoutingTable
@@ -155,6 +156,7 @@ func TestTopologyService_EnsureExists(t *testing.T) {
),
eventservice.NewMockEventService(),
),
eventService: eventservice.NewMockEventService(),
},
args: args{
routingTable: getTestRoutingTable(),
@@ -180,6 +182,7 @@ func TestTopologyService_EnsureExists(t *testing.T) {
),
eventservice.NewMockEventService(),
),
eventService: eventservice.NewMockEventService(),
},
args: args{
routingTable: getTestRoutingTable(),
@@ -191,9 +194,10 @@ func TestTopologyService_EnsureExists(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
p := &RoutingTableService{
store: tt.fields.store,
nodeService: tt.fields.nodeService,
portService: tt.fields.portService,
store: tt.fields.store,
nodeService: tt.fields.nodeService,
portService: tt.fields.portService,
eventService: tt.fields.eventService,
}
got, err := p.EnsureExists(tt.args.routingTable)
if (err != nil) != tt.wantErr {
@@ -209,9 +213,10 @@ func TestTopologyService_EnsureExists(t *testing.T) {
func TestRoutingTableService_Update(t *testing.T) {
type fields struct {
store Store
nodeService nodes.Service
portService ports.Service
store Store
nodeService nodes.Service
portService ports.Service
eventService eventInterfaces.Service
}
type args struct {
routingTable RoutingTable
@@ -226,9 +231,10 @@ 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{}), eventservice.NewMockEventService()),
portService: ports.NewPortService(getTestStoreWithPorts(t, []ports.Port{}), eventservice.NewMockEventService()),
store: getTestStoreWithRoutingTables(t, []RoutingTable{getTestRoutingTable()}),
nodeService: nodes.NewNodeService(getTestStoreWithNodes(t, []nodes.Node{}), eventservice.NewMockEventService()),
portService: ports.NewPortService(getTestStoreWithPorts(t, []ports.Port{}), eventservice.NewMockEventService()),
eventService: eventservice.NewMockEventService(),
},
args: args{
routingTable: getTestRoutingTable(),
@@ -240,9 +246,10 @@ func TestRoutingTableService_Update(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
p := &RoutingTableService{
store: tt.fields.store,
nodeService: tt.fields.nodeService,
portService: tt.fields.portService,
store: tt.fields.store,
nodeService: tt.fields.nodeService,
portService: tt.fields.portService,
eventService: tt.fields.eventService,
}
if err := p.Update(tt.args.routingTable); (err != nil) != tt.wantErr {
t.Errorf("RoutingTableService.Update() error = %v, wantErr %v", err, tt.wantErr)
@@ -253,9 +260,10 @@ func TestRoutingTableService_Update(t *testing.T) {
func TestRoutingTableService_Delete(t *testing.T) {
type fields struct {
store Store
nodeService nodes.Service
portService ports.Service
store Store
nodeService nodes.Service
portService ports.Service
eventService eventInterfaces.Service
}
type args struct {
routingTable RoutingTable
@@ -270,9 +278,10 @@ 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{}), eventservice.NewMockEventService()),
portService: ports.NewPortService(getTestStoreWithPorts(t, []ports.Port{}), eventservice.NewMockEventService()),
store: getTestStoreWithRoutingTables(t, []RoutingTable{getTestRoutingTable()}),
nodeService: nodes.NewNodeService(getTestStoreWithNodes(t, []nodes.Node{}), eventservice.NewMockEventService()),
portService: ports.NewPortService(getTestStoreWithPorts(t, []ports.Port{}), eventservice.NewMockEventService()),
eventService: eventservice.NewMockEventService(),
},
args: args{
routingTable: getTestRoutingTable(),
@@ -282,9 +291,10 @@ 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{}), eventservice.NewMockEventService()),
portService: ports.NewPortService(getTestStoreWithPorts(t, []ports.Port{}), eventservice.NewMockEventService()),
store: store.NewGenericStore[RoutingTable](),
nodeService: nodes.NewNodeService(getTestStoreWithNodes(t, []nodes.Node{}), eventservice.NewMockEventService()),
portService: ports.NewPortService(getTestStoreWithPorts(t, []ports.Port{}), eventservice.NewMockEventService()),
eventService: eventservice.NewMockEventService(),
},
args: args{
routingTable: getTestRoutingTable(),
@@ -295,9 +305,10 @@ func TestRoutingTableService_Delete(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
p := &RoutingTableService{
store: tt.fields.store,
nodeService: tt.fields.nodeService,
portService: tt.fields.portService,
store: tt.fields.store,
nodeService: tt.fields.nodeService,
portService: tt.fields.portService,
eventService: tt.fields.eventService,
}
if err := p.Delete(tt.args.routingTable); (err != nil) != tt.wantErr {
t.Errorf("RoutingTableService.Delete() error = %v, wantErr %v", err, tt.wantErr)
Loading