From 266d7745253e2ece870500bfeb4f5468c2524555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20L=C3=B3pez?= Date: Thu, 30 Nov 2023 11:41:54 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Thomas Casteleyn --- plugins/outputs/zabbix/autoregister_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/outputs/zabbix/autoregister_test.go b/plugins/outputs/zabbix/autoregister_test.go index 968aeb22bfed0..7189d41c3ff3c 100644 --- a/plugins/outputs/zabbix/autoregister_test.go +++ b/plugins/outputs/zabbix/autoregister_test.go @@ -57,9 +57,9 @@ func TestZabbixAutoregisterPush(t *testing.T) { z.Autoregister = "autoregister" z.autoregisterAdd("hostname") z.autoregisterPush() - require.Equal(t, len(z.autoregisterLastSend), 1) - require.Equal(t, zabbixSender.hostname, "hostname") - require.Equal(t, zabbixSender.hostMetadata, "autoregister") + require.Len(t, z.autoregisterLastSend, 1) + require.Equal(t, "hostname", zabbixSender.hostname) + require.Equal(t, "autoregister", zabbixSender.hostMetadata) // Test that autoregister is not sent if the last send was less than AutoregisterResendInterval ago. z.Autoregister = "autoregister" @@ -67,7 +67,7 @@ func TestZabbixAutoregisterPush(t *testing.T) { z.autoregisterLastSend["hostname"] = time.Now().Add(time.Hour) zabbixSender.Reset() z.autoregisterPush() - require.Equal(t, len(z.autoregisterLastSend), 1) + require.Len(t, z.autoregisterLastSend, 1) require.Equal(t, "", zabbixSender.hostname) require.Equal(t, "", zabbixSender.hostMetadata) @@ -77,7 +77,7 @@ func TestZabbixAutoregisterPush(t *testing.T) { z.autoregisterLastSend["hostname"] = time.Now().Add(-24 * time.Hour) zabbixSender.Reset() z.autoregisterPush() - require.Equal(t, len(z.autoregisterLastSend), 1) + require.Len(t, z.autoregisterLastSend, 1) require.Equal(t, "hostname", zabbixSender.hostname) require.Equal(t, "autoregister", zabbixSender.hostMetadata) }