66 "net/http/httptest"
77 "testing"
88
9- stackitdnsclient "github.com/stackitcloud/stackit-sdk-go/services/dns"
9+ stackitdnsclient "github.com/stackitcloud/stackit-sdk-go/services/dns/v1api "
1010 "github.com/stretchr/testify/assert"
1111 "k8s.io/utils/ptr"
1212)
@@ -116,13 +116,13 @@ func getZonesResponseSuccess(t *testing.T, w http.ResponseWriter) {
116116 w .Header ().Set ("Content-Type" , "application/json" )
117117
118118 zones := stackitdnsclient.ListZonesResponse {
119- ItemsPerPage : ptr . To ( int64 ( 10 ) ),
119+ ItemsPerPage : int32 ( 10 ),
120120 Message : ptr .To ("success" ),
121- TotalItems : ptr . To ( int64 ( 1 ) ),
122- TotalPages : ptr . To ( int64 ( 1 ) ),
123- Zones : ptr . To ( []stackitdnsclient.Zone {
124- {Id : ptr . To ( "1234" ) , DnsName : ptr . To ( "test.com" ) },
125- }) ,
121+ TotalItems : int32 ( 1 ),
122+ TotalPages : int32 ( 1 ),
123+ Zones : []stackitdnsclient.Zone {
124+ {Id : "1234" , DnsName : "test.com" },
125+ },
126126 }
127127
128128 successResponseBytes , err := json .Marshal (zones )
@@ -138,11 +138,11 @@ func getZonesResponseNoZones(t *testing.T, w http.ResponseWriter) {
138138 w .Header ().Set ("Content-Type" , "application/json" )
139139
140140 zones := stackitdnsclient.ListZonesResponse {
141- ItemsPerPage : ptr . To ( int64 ( 10 ) ),
141+ ItemsPerPage : int32 ( 10 ),
142142 Message : ptr .To ("success" ),
143- TotalItems : ptr . To ( int64 ( 1 ) ),
144- TotalPages : ptr . To ( int64 ( 1 ) ),
145- Zones : ptr . To ( []stackitdnsclient.Zone {}) ,
143+ TotalItems : int32 ( 1 ),
144+ TotalPages : int32 ( 1 ),
145+ Zones : []stackitdnsclient.Zone {},
146146 }
147147
148148 successResponseBytes , err := json .Marshal (zones )
@@ -165,21 +165,21 @@ func getRRSetResponseSuccess(t *testing.T, w http.ResponseWriter) {
165165 w .Header ().Set ("Content-Type" , "application/json" )
166166
167167 rrSets := stackitdnsclient.ListRecordSetsResponse {
168- ItemsPerPage : ptr . To ( int64 ( 20 ) ),
168+ ItemsPerPage : int32 ( 20 ),
169169 Message : ptr .To ("success" ),
170- RrSets : ptr . To ( []stackitdnsclient.RecordSet {
170+ RrSets : []stackitdnsclient.RecordSet {
171171 {
172- Name : ptr . To ( "test.com." ) ,
173- Type : stackitdnsclient . RecordSetGetTypeAttributeType ( ptr . To ( "TXT" )) ,
174- Ttl : ptr . To ( int64 ( 300 ) ),
175- Records : ptr . To ( []stackitdnsclient.Record {
176- {Content : ptr . To ( "_acme-challenge.test.com" ) },
177- }) ,
178- Id : ptr . To ( "1234" ) ,
172+ Name : "test.com." ,
173+ Type : "TXT" ,
174+ Ttl : int32 ( 300 ),
175+ Records : []stackitdnsclient.Record {
176+ {Content : "_acme-challenge.test.com" },
177+ },
178+ Id : "1234" ,
179179 },
180- }) ,
181- TotalItems : ptr . To ( int64 ( 2 ) ),
182- TotalPages : ptr . To ( int64 ( 1 ) ),
180+ },
181+ TotalItems : int32 ( 2 ),
182+ TotalPages : int32 ( 1 ),
183183 }
184184
185185 successResponseBytes , err := json .Marshal (rrSets )
@@ -195,11 +195,11 @@ func getRRSetResponseNoRRSets(t *testing.T, w http.ResponseWriter) {
195195 w .Header ().Set ("Content-Type" , "application/json" )
196196
197197 rrSets := stackitdnsclient.ListRecordSetsResponse {
198- ItemsPerPage : ptr . To ( int64 ( 20 ) ),
198+ ItemsPerPage : int32 ( 20 ),
199199 Message : ptr .To ("success" ),
200- RrSets : ptr . To ( []stackitdnsclient.RecordSet {}) ,
201- TotalItems : ptr . To ( int64 ( 2 ) ),
202- TotalPages : ptr . To ( int64 ( 1 ) ),
200+ RrSets : []stackitdnsclient.RecordSet {},
201+ TotalItems : int32 ( 2 ),
202+ TotalPages : int32 ( 1 ),
203203 }
204204
205205 successResponseBytes , err := json .Marshal (rrSets )
@@ -216,12 +216,12 @@ func postRRSetResponseSuccess(t *testing.T, w http.ResponseWriter) {
216216
217217 rrSets := stackitdnsclient.RecordSetResponse {
218218 Message : ptr .To ("success" ),
219- Rrset : ptr . To ( stackitdnsclient.RecordSet {
219+ Rrset : stackitdnsclient.RecordSet {
220220 Active : ptr .To (true ),
221221 Comment : ptr .To ("created by webhook" ),
222- Id : ptr . To ( "1234" ) ,
223- Name : ptr . To ( "test.com." ) ,
224- }) ,
222+ Id : "1234" ,
223+ Name : "test.com." ,
224+ },
225225 }
226226
227227 successResponseBytes , err := json .Marshal (rrSets )
0 commit comments