package transip import ( "encoding/xml" "fmt" "reflect" "strings" "sync" "testing" "time" "github.com/go-acme/lego/v3/log" "github.com/go-acme/lego/v3/platform/tester" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/transip/gotransip" "github.com/transip/gotransip/domain" ) type argDNSEntries struct { Items domain.DNSEntries `xml:"item"` } type argDomainName struct { DomainName string `xml:",chardata"` } type fakeClient struct { dnsEntries []domain.DNSEntry setDNSEntriesLatency time.Duration getInfoLatency time.Duration } func (f *fakeClient) Call(r gotransip.SoapRequest, b interface{}) error { switch r.Method { case "getInfo": d := b.(*domain.Domain) cp := f.dnsEntries if f.getInfoLatency != 0 { time.Sleep(f.getInfoLatency) } d.DNSEntries = cp log.Printf("getInfo: %+v\n", d.DNSEntries) return nil case "setDnsEntries": var domainName argDomainName var dnsEntries argDNSEntries args := readArgs(r) for _, arg := range args { if strings.HasPrefix(arg, "