@@ -256,6 +256,7 @@ func TestClient_GetHostedZone_v0(t *testing.T) {
256256func TestClient_UpdateRecords (t * testing.T ) {
257257 client := setupTest (t , http .MethodPatch , "/api/v1/servers/localhost/zones/example.org." , http .StatusOK , "zone.json" )
258258 client .apiVersion = 1
259+ client .serverName = "localhost"
259260
260261 zone := & HostedZone {
261262 ID : "example.org." ,
@@ -282,9 +283,41 @@ func TestClient_UpdateRecords(t *testing.T) {
282283 require .NoError (t , err )
283284}
284285
286+ func TestClient_UpdateRecords_NonRootApi (t * testing.T ) {
287+ client := setupTest (t , http .MethodPatch , "/some/path/api/v1/servers/localhost/zones/example.org." , http .StatusOK , "zone.json" )
288+ client .Host = client .Host .JoinPath ("some" , "path" )
289+ client .apiVersion = 1
290+ client .serverName = "localhost"
291+
292+ zone := & HostedZone {
293+ ID : "example.org." ,
294+ Name : "example.org." ,
295+ URL : "some/path/api/v1/servers/server/zones/example.org." ,
296+ Kind : "Master" ,
297+ }
298+
299+ rrSets := RRSets {
300+ RRSets : []RRSet {{
301+ Name : "example.org." ,
302+ Type : "NS" ,
303+ ChangeType : "REPLACE" ,
304+ Records : []Record {{
305+ Content : "192.0.2.5" ,
306+ Name : "ns1.example.org." ,
307+ TTL : 86400 ,
308+ Type : "A" ,
309+ }},
310+ }},
311+ }
312+
313+ err := client .UpdateRecords (context .Background (), zone , rrSets )
314+ require .NoError (t , err )
315+ }
316+
285317func TestClient_UpdateRecords_v0 (t * testing.T ) {
286318 client := setupTest (t , http .MethodPatch , "/servers/localhost/zones/example.org." , http .StatusOK , "zone.json" )
287319 client .apiVersion = 0
320+ client .serverName = "localhost"
288321
289322 zone := & HostedZone {
290323 ID : "example.org." ,
@@ -314,6 +347,7 @@ func TestClient_UpdateRecords_v0(t *testing.T) {
314347func TestClient_Notify (t * testing.T ) {
315348 client := setupTest (t , http .MethodPut , "/api/v1/servers/localhost/zones/example.org./notify" , http .StatusOK , "" )
316349 client .apiVersion = 1
350+ client .serverName = "localhost"
317351
318352 zone := & HostedZone {
319353 ID : "example.org." ,
@@ -326,8 +360,26 @@ func TestClient_Notify(t *testing.T) {
326360 require .NoError (t , err )
327361}
328362
363+ func TestClient_Notify_NonRootApi (t * testing.T ) {
364+ client := setupTest (t , http .MethodPut , "/some/path/api/v1/servers/localhost/zones/example.org./notify" , http .StatusOK , "" )
365+ client .Host = client .Host .JoinPath ("some" , "path" )
366+ client .apiVersion = 1
367+ client .serverName = "localhost"
368+
369+ zone := & HostedZone {
370+ ID : "example.org." ,
371+ Name : "example.org." ,
372+ URL : "/some/path/api/v1/servers/server/zones/example.org." ,
373+ Kind : "Master" ,
374+ }
375+
376+ err := client .Notify (context .Background (), zone )
377+ require .NoError (t , err )
378+ }
379+
329380func TestClient_Notify_v0 (t * testing.T ) {
330381 client := setupTest (t , http .MethodPut , "/api/v1/servers/localhost/zones/example.org./notify" , http .StatusOK , "" )
382+ client .apiVersion = 0
331383
332384 zone := & HostedZone {
333385 ID : "example.org." ,
0 commit comments