From 2e8fc9da407e1e743c2caeb874c8b848f964f177 Mon Sep 17 00:00:00 2001 From: Imre Halasz Date: Mon, 2 Dec 2024 11:31:57 +0100 Subject: [PATCH] as: Add test for default pagination in packages --- pkg/applicationserver/io/packages/grpc_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/applicationserver/io/packages/grpc_test.go b/pkg/applicationserver/io/packages/grpc_test.go index cb0cc6a1584..5069cd7fdbe 100644 --- a/pkg/applicationserver/io/packages/grpc_test.go +++ b/pkg/applicationserver/io/packages/grpc_test.go @@ -30,6 +30,7 @@ import ( "go.thethings.network/lorawan-stack/v3/pkg/config" "go.thethings.network/lorawan-stack/v3/pkg/errors" mockis "go.thethings.network/lorawan-stack/v3/pkg/identityserver/mock" + ttnredis "go.thethings.network/lorawan-stack/v3/pkg/redis" "go.thethings.network/lorawan-stack/v3/pkg/rpcmetadata" "go.thethings.network/lorawan-stack/v3/pkg/ttnpb" "go.thethings.network/lorawan-stack/v3/pkg/unique" @@ -371,6 +372,8 @@ func TestAssociations(t *testing.T) { t.Run("Pagination", func(t *testing.T) { a := assertions.New(t) + ttnredis.SetPaginationDefaults(ttnredis.PaginationDefaults{DefaultLimit: 10}) + for i := 1; i < 21; i++ { association := &ttnpb.ApplicationPackageAssociation{ Ids: &ttnpb.ApplicationPackageAssociationIdentifiers{ @@ -424,8 +427,8 @@ func TestAssociations(t *testing.T) { limit: 0, page: 0, portLow: 1, - portHigh: 20, - length: 20, + portHigh: 10, + length: 10, }, } { t.Run(fmt.Sprintf("limit:%v_page:%v", tc.limit, tc.page),