Remove redundant constructor, h/t sergio

This commit is contained in:
Pim van Pelt
2025-11-15 22:41:57 +01:00
parent 27c7a5bcae
commit a0d5c61643
12 changed files with 48 additions and 44 deletions

View File

@@ -10,7 +10,7 @@ import (
)
func TestNewInterfaceManager(t *testing.T) {
client := NewVPPClient()
client := &VPPClient{}
manager := NewInterfaceManager(client)
if manager == nil {
@@ -36,7 +36,7 @@ func TestNewInterfaceManager(t *testing.T) {
}
func TestInterfaceManagerSetEventCallback(t *testing.T) {
client := NewVPPClient()
client := &VPPClient{}
manager := NewInterfaceManager(client)
var callbackCalled bool
@@ -82,7 +82,7 @@ func TestInterfaceManagerSetEventCallback(t *testing.T) {
}
func TestInterfaceManagerGetAllInterfaceDetailsWithoutConnection(t *testing.T) {
client := NewVPPClient()
client := &VPPClient{}
manager := NewInterfaceManager(client)
_, err := manager.GetAllInterfaceDetails()
@@ -101,7 +101,7 @@ func TestInterfaceManagerGetAllInterfaceDetailsWithoutConnection(t *testing.T) {
}
func TestInterfaceManagerStartEventWatcherWithoutConnection(t *testing.T) {
client := NewVPPClient()
client := &VPPClient{}
manager := NewInterfaceManager(client)
err := manager.StartEventWatcher()
@@ -120,7 +120,7 @@ func TestInterfaceManagerStartEventWatcherWithoutConnection(t *testing.T) {
}
func TestInterfaceManagerHandleInterfaceEventWithoutCallback(t *testing.T) {
client := NewVPPClient()
client := &VPPClient{}
manager := NewInterfaceManager(client)
// Should not panic when callback is nil
@@ -128,7 +128,7 @@ func TestInterfaceManagerHandleInterfaceEventWithoutCallback(t *testing.T) {
}
func TestInterfaceManagerInitializeEventWatchingWithoutConnection(t *testing.T) {
client := NewVPPClient()
client := &VPPClient{}
manager := NewInterfaceManager(client)
err := manager.InitializeEventWatching()
@@ -220,7 +220,7 @@ func TestInterfaceEventCallback(t *testing.T) {
}
func TestInterfaceManagerStartStopEventMonitoring(t *testing.T) {
client := NewVPPClient()
client := &VPPClient{}
manager := NewInterfaceManager(client)
if manager.running {
@@ -248,7 +248,7 @@ func TestInterfaceManagerStartStopEventMonitoring(t *testing.T) {
}
func TestInterfaceManagerEventMonitoringWithConnectionChanges(t *testing.T) {
client := NewVPPClient()
client := &VPPClient{}
manager := NewInterfaceManager(client)
// Set a callback to track calls