@@ -394,7 +394,6 @@ func TestAddMasterZoneWithoutDNSSec(t *testing.T) {
394394
395395 p := initialisePowerDNSTestClient ()
396396 zone , err := p .Zones .AddMaster (context .Background (), testDomain , false , "" , false , "foo" , "foo" , true , []string {"ns.foo.tld." })
397-
398397 if err != nil {
399398 t .Errorf ("%s" , err )
400399 }
@@ -483,7 +482,28 @@ func TestAddZoneError(t *testing.T) {
483482 }
484483}
485484
486- func TestChangeZone (t * testing.T ) {
485+ func TestChangeZoneWithDNSSec (t * testing.T ) {
486+ testDomain := generateTestZone (true )
487+
488+ httpmock .Activate ()
489+ defer httpmock .DeactivateAndReset ()
490+ registerZoneMockResponder (testDomain , NativeZoneKind )
491+
492+ p := initialisePowerDNSTestClient ()
493+
494+ t .Run ("ChangeValidZone" , func (t * testing.T ) {
495+ if err := p .Zones .Change (context .Background (), testDomain , & Zone {Nameservers : []string {"ns23.foo.tld." }, Nsec3Param : String ("" ), DNSsec : Bool (true )}); err != nil {
496+ t .Errorf ("%s" , err )
497+ }
498+ })
499+ t .Run ("ChangeInvalidZone" , func (t * testing.T ) {
500+ if err := p .Zones .Change (context .Background (), "doesnt-exist" , & Zone {Nameservers : []string {"ns23.foo.tld." }, Nsec3Param : String ("" ), DNSsec : Bool (true )}); err == nil {
501+ t .Errorf ("Changing an invalid zone does not return an error" )
502+ }
503+ })
504+ }
505+
506+ func TestChangeZoneWithoutDNSSec (t * testing.T ) {
487507 testDomain := generateTestZone (true )
488508
489509 httpmock .Activate ()
@@ -493,12 +513,12 @@ func TestChangeZone(t *testing.T) {
493513 p := initialisePowerDNSTestClient ()
494514
495515 t .Run ("ChangeValidZone" , func (t * testing.T ) {
496- if err := p .Zones .Change (context .Background (), testDomain , & Zone {Nameservers : []string {"ns23.foo.tld." }}); err != nil {
516+ if err := p .Zones .Change (context .Background (), testDomain , & Zone {Nameservers : []string {"ns23.foo.tld." }, Nsec3Param : String ( "" ), DNSsec : Bool ( false ) }); err != nil {
497517 t .Errorf ("%s" , err )
498518 }
499519 })
500520 t .Run ("ChangeInvalidZone" , func (t * testing.T ) {
501- if err := p .Zones .Change (context .Background (), "doesnt-exist" , & Zone {Nameservers : []string {"ns23.foo.tld." }}); err == nil {
521+ if err := p .Zones .Change (context .Background (), "doesnt-exist" , & Zone {Nameservers : []string {"ns23.foo.tld." }, Nsec3Param : String ( "" ), DNSsec : Bool ( false ) }); err == nil {
502522 t .Errorf ("Changing an invalid zone does not return an error" )
503523 }
504524 })
0 commit comments