From 3fca00f01d4b6e2d947a1f6206f7ed0ef49756b9 Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Mon, 2 Dec 2024 10:44:32 +0100 Subject: [PATCH] Apply suggestions from code review Signed-off-by: Matthieu MOREL --- pkg/cache/v3/linear_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cache/v3/linear_test.go b/pkg/cache/v3/linear_test.go index 4327faf14..5d199c2ab 100644 --- a/pkg/cache/v3/linear_test.go +++ b/pkg/cache/v3/linear_test.go @@ -45,7 +45,7 @@ func verifyResponse(t *testing.T, ch <-chan Response, version string, num int) { assert.NotNilf(t, r.GetContext(), "unexpected empty response context") out, err := r.GetDiscoveryResponse() require.NoError(t, err) - assert.NotEqualf(t, "", out.GetVersionInfo(), "unexpected response empty version") + assert.NotEmptyf(t, out.GetVersionInfo(), "unexpected response empty version") n := len(out.GetResources()) assert.Equalf(t, n, num, "unexpected number of responses: got %d, want %d", n, num) if version != "" { @@ -65,7 +65,7 @@ func validateDeltaResponse(t *testing.T, resp DeltaResponse, resources []resourc assert.Equalf(t, testType, resp.GetDeltaRequest().GetTypeUrl(), "unexpected empty request type URL: %q", resp.GetDeltaRequest().GetTypeUrl()) out, err := resp.GetDeltaDiscoveryResponse() require.NoError(t, err) - assert.Equalf(t, len(out.GetResources()), len(resources), "unexpected number of responses: got %d, want %d", len(out.GetResources()), len(resources)) + assert.Lenf(t, out.GetResources(), len(resources), "unexpected number of responses: got %d, want %d", len(out.GetResources()), len(resources)) for _, r := range resources { found := false for _, r1 := range out.GetResources() {