|
8 | 8 | "net/http/httptest" |
9 | 9 | "testing" |
10 | 10 |
|
11 | | - stackitdnsclient "github.com/stackitcloud/stackit-sdk-go/services/dns" |
| 11 | + stackitdnsclient "github.com/stackitcloud/stackit-sdk-go/services/dns/v1api" |
12 | 12 | "github.com/stretchr/testify/assert" |
13 | 13 | "sigs.k8s.io/external-dns/endpoint" |
14 | 14 | "sigs.k8s.io/external-dns/plan" |
@@ -114,8 +114,7 @@ func TestNoRRSetFound(t *testing.T) { |
114 | 114 | ctx := context.Background() |
115 | 115 | validZoneResponse := getValidResponseZoneAllBytes(t) |
116 | 116 | rrSets := getValidResponseRRSetAll() |
117 | | - rrSet := *rrSets.RrSets |
118 | | - *rrSet[0].Name = "notfound.test.com" |
| 117 | + rrSets.RrSets[0].Name = "notfound.test.com" |
119 | 118 | validRRSetResponse, err := json.Marshal(rrSets) |
120 | 119 | assert.NoError(t, err) |
121 | 120 |
|
@@ -375,42 +374,56 @@ func getValidResponseZoneAllBytes(t *testing.T) []byte { |
375 | 374 |
|
376 | 375 | func getValidZoneResponseAll() stackitdnsclient.ListZonesResponse { |
377 | 376 | return stackitdnsclient.ListZonesResponse{ |
378 | | - ItemsPerPage: pointerTo(int64(10)), |
379 | | - Message: pointerTo("success"), |
380 | | - TotalItems: pointerTo(int64(2)), |
381 | | - TotalPages: pointerTo(int64(1)), |
382 | | - Zones: &[]stackitdnsclient.Zone{ |
383 | | - {Id: pointerTo("1234"), DnsName: pointerTo("test.com")}, |
384 | | - {Id: pointerTo("5678"), DnsName: pointerTo("test2.com")}, |
| 377 | + ItemsPerPage: int32(10), |
| 378 | + Message: new("success"), |
| 379 | + TotalItems: int32(2), |
| 380 | + TotalPages: int32(1), |
| 381 | + Zones: []stackitdnsclient.Zone{ |
| 382 | + {Id: "1234", DnsName: "test.com"}, |
| 383 | + {Id: "5678", DnsName: "test2.com"}, |
385 | 384 | }, |
386 | 385 | } |
387 | 386 | } |
388 | 387 |
|
389 | 388 | func getValidResponseRRSetAllBytes(t *testing.T) []byte { |
390 | 389 | t.Helper() |
391 | 390 |
|
392 | | - rrSets := getValidResponseRRSetAll() |
393 | | - validRRSetResponse, err := json.Marshal(rrSets) |
| 391 | + rrSetResponse := getValidRecordSetResponse() |
| 392 | + validRRSetResponse, err := json.Marshal(rrSetResponse) |
394 | 393 | assert.NoError(t, err) |
395 | 394 |
|
396 | 395 | return validRRSetResponse |
397 | 396 | } |
398 | 397 |
|
| 398 | +func getValidRecordSetResponse() stackitdnsclient.RecordSetResponse { |
| 399 | + return stackitdnsclient.RecordSetResponse{ |
| 400 | + Message: new("success"), |
| 401 | + Rrset: stackitdnsclient.RecordSet{ |
| 402 | + Name: "test.com", |
| 403 | + Type: "A", |
| 404 | + Ttl: int32(300), |
| 405 | + Records: []stackitdnsclient.Record{ |
| 406 | + {Content: "1.2.3.4"}, |
| 407 | + }, |
| 408 | + }, |
| 409 | + } |
| 410 | +} |
| 411 | + |
399 | 412 | func getValidResponseRRSetAll() stackitdnsclient.ListRecordSetsResponse { |
400 | 413 | return stackitdnsclient.ListRecordSetsResponse{ |
401 | | - ItemsPerPage: pointerTo(int64(20)), |
402 | | - Message: pointerTo("success"), |
403 | | - RrSets: &[]stackitdnsclient.RecordSet{ |
| 414 | + ItemsPerPage: int32(20), |
| 415 | + Message: new("success"), |
| 416 | + RrSets: []stackitdnsclient.RecordSet{ |
404 | 417 | { |
405 | | - Name: pointerTo("test.com"), |
406 | | - Type: pointerTo(stackitdnsclient.RECORDSETTYPE_A), |
407 | | - Ttl: pointerTo(int64(300)), |
408 | | - Records: &[]stackitdnsclient.Record{ |
409 | | - {Content: pointerTo("1.2.3.4")}, |
| 418 | + Name: "test.com", |
| 419 | + Type: "A", |
| 420 | + Ttl: int32(300), |
| 421 | + Records: []stackitdnsclient.Record{ |
| 422 | + {Content: "1.2.3.4"}, |
410 | 423 | }, |
411 | 424 | }, |
412 | 425 | }, |
413 | | - TotalItems: pointerTo(int64(2)), |
414 | | - TotalPages: pointerTo(int64(1)), |
| 426 | + TotalItems: int32(2), |
| 427 | + TotalPages: int32(1), |
415 | 428 | } |
416 | 429 | } |
0 commit comments