From 903939fe7ce1045d5e7bc3c860afe9d11d40dfd8 Mon Sep 17 00:00:00 2001 From: barco Date: Fri, 24 May 2024 10:35:06 +0200 Subject: [PATCH] test: adjust tests to new offset encoded page_token --- pkg/rules/handlers_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/rules/handlers_test.go b/pkg/rules/handlers_test.go index 0e2446249..43f517f0d 100644 --- a/pkg/rules/handlers_test.go +++ b/pkg/rules/handlers_test.go @@ -82,12 +82,12 @@ func TestHandleListSuccess(t *testing.T) { }, } - var page int64 = 1 + var offset int64 = 0 var size int64 = 100 - mockService.EXPECT().ListRules(gomock.Any(), page, size).Return(serviceOutput, nil) + mockService.EXPECT().ListRules(gomock.Any(), offset, size).Return(serviceOutput, nil) - req := httptest.NewRequest(http.MethodGet, "/api/v0/rules?page=1&size=100", nil) + req := httptest.NewRequest(http.MethodGet, "/api/v0/rules?page_token=eyJvZmZzZXQiOjB9&size=100", nil) w := httptest.NewRecorder() mux := chi.NewMux() NewAPI(mockService, mockLogger).RegisterEndpoints(mux) @@ -130,10 +130,10 @@ func TestHandleListFailed(t *testing.T) { mockLogger := NewMockLoggerInterface(ctrl) mockService := NewMockServiceInterface(ctrl) - var page int64 = 1 + var offset int64 = 0 var size int64 = 100 - mockService.EXPECT().ListRules(gomock.Any(), page, size).Return(nil, fmt.Errorf("mock_error")) + mockService.EXPECT().ListRules(gomock.Any(), offset, size).Return(nil, fmt.Errorf("mock_error")) req := httptest.NewRequest(http.MethodGet, "/api/v0/rules?page=0&offset=100", nil) w := httptest.NewRecorder()