@@ -21,8 +21,13 @@ func TestRepositoriesService_List(t *testing.T) {
2121 name : "successful list repositories" ,
2222 registryID : "reg-123" ,
2323 response : `{
24- "goal": {
25- "total": 2
24+ "meta": {
25+ "page": {
26+ "count": 2,
27+ "limit": 0,
28+ "offset": 0,
29+ "total": 2
30+ }
2631 },
2732 "results": [
2833 {
@@ -43,7 +48,7 @@ func TestRepositoriesService_List(t *testing.T) {
4348 }` ,
4449 statusCode : http .StatusOK ,
4550 want : & RepositoriesResponse {
46- Goal : AmountRepositoryResponse { Total : 2 },
51+ Meta : Meta { Page : Page { Count : 2 , Limit : 0 , Offset : 0 , Total : 2 } },
4752 Results : []RepositoryResponse {
4853 {
4954 RegistryName : "test-registry" ,
@@ -111,7 +116,14 @@ func TestRepositoriesService_List(t *testing.T) {
111116 Offset : intPtr (20 ),
112117 },
113118 response : `{
114- "goal": {"total": 30},
119+ "meta": {
120+ "page": {
121+ "count": 1,
122+ "limit": 10,
123+ "offset": 20,
124+ "total": 30
125+ }
126+ },
115127 "results": [
116128 {
117129 "registry_name": "test-registry",
@@ -124,7 +136,7 @@ func TestRepositoriesService_List(t *testing.T) {
124136 }` ,
125137 statusCode : http .StatusOK ,
126138 want : & RepositoriesResponse {
127- Goal : AmountRepositoryResponse { Total : 30 },
139+ Meta : Meta { Page : Page { Count : 1 , Limit : 10 , Offset : 20 , Total : 30 } },
128140 Results : []RepositoryResponse {
129141 {
130142 RegistryName : "test-registry" ,
@@ -144,7 +156,14 @@ func TestRepositoriesService_List(t *testing.T) {
144156 Sort : strPtr ("name:asc" ),
145157 },
146158 response : `{
147- "goal": {"total": 1},
159+ "meta": {
160+ "page": {
161+ "count": 1,
162+ "limit": 0,
163+ "offset": 0,
164+ "total": 1
165+ }
166+ },
148167 "results": [
149168 {
150169 "registry_name": "test-registry",
@@ -157,7 +176,7 @@ func TestRepositoriesService_List(t *testing.T) {
157176 }` ,
158177 statusCode : http .StatusOK ,
159178 want : & RepositoriesResponse {
160- Goal : AmountRepositoryResponse { Total : 1 },
179+ Meta : Meta { Page : Page { Count : 1 , Limit : 0 , Offset : 0 , Total : 1 } },
161180 Results : []RepositoryResponse {
162181 {
163182 RegistryName : "test-registry" ,
@@ -195,8 +214,8 @@ func TestRepositoriesService_List(t *testing.T) {
195214 if len (got .Results ) != len (tt .want .Results ) {
196215 t .Errorf ("List() got %v results, want %v" , len (got .Results ), len (tt .want .Results ))
197216 }
198- if got .Goal . Total != tt .want .Goal .Total {
199- t .Errorf ("List() got total %v, want %v" , got .Goal . Total , tt .want .Goal .Total )
217+ if got .Meta . Page . Total != tt .want .Meta . Page .Total {
218+ t .Errorf ("List() got total %v, want %v" , got .Meta . Page . Total , tt .want .Meta . Page .Total )
200219 }
201220 }
202221 })
@@ -363,7 +382,7 @@ func TestRepositoriesService_Concurrent(t *testing.T) {
363382 server := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
364383 w .Header ().Set ("Content-Type" , "application/json" )
365384 w .WriteHeader (http .StatusOK )
366- w .Write ([]byte (`{"goal ": {"total": 0}, "results": []}` ))
385+ w .Write ([]byte (`{"meta ": {"page": {"count": 0, "limit": 0, "offset": 0, " total": 0} }, "results": []}` ))
367386 }))
368387 defer server .Close ()
369388
0 commit comments