mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-02-18 00:17:39 +01:00
33 lines
969 B
Go
33 lines
969 B
Go
package api
|
|
|
|
import "testing"
|
|
|
|
func TestConfigHandlersSetMultiTenantMonitor(t *testing.T) {
|
|
handler := &ConfigHandlers{}
|
|
handler.SetMultiTenantMonitor(nil)
|
|
if handler.mtMonitor != nil {
|
|
t.Fatalf("mtMonitor should be nil after SetMultiTenantMonitor(nil)")
|
|
}
|
|
}
|
|
|
|
func TestRouterSetMultiTenantMonitor(t *testing.T) {
|
|
router := &Router{
|
|
alertHandlers: &AlertHandlers{},
|
|
notificationHandlers: &NotificationHandlers{},
|
|
dockerAgentHandlers: &DockerAgentHandlers{},
|
|
hostAgentHandlers: &HostAgentHandlers{},
|
|
kubernetesAgentHandlers: &KubernetesAgentHandlers{},
|
|
systemSettingsHandler: &SystemSettingsHandler{},
|
|
resourceHandlers: NewResourceHandlers(),
|
|
}
|
|
|
|
router.SetMultiTenantMonitor(nil)
|
|
|
|
if router.mtMonitor != nil {
|
|
t.Fatalf("mtMonitor should be nil after SetMultiTenantMonitor(nil)")
|
|
}
|
|
if router.resourceHandlers.tenantStateProvider == nil {
|
|
t.Fatalf("tenantStateProvider should be set on resource handlers")
|
|
}
|
|
}
|