func (m *DNSServerMock) HandleListZonesEmpty() {
	m.Mux.HandleFunc("/v2/zones", func(w http.ResponseWriter, r *http.Request) {
		assert.Equal(m.t, r.Method, http.MethodGet)
		assert.Equal(m.t, r.URL.Path, "/v2/zones")
		assert.Equal(m.t, r.URL.RawQuery, "name=example.com.")
		assert.Equal(m.t, r.Header.Get("Content-Type"), "application/json")
		fmt.Fprintf(w, `{
		  "zones":[
		  ]}
		`)
	})
}
HandleListZonesEmpty Handle list zones empty.
package otc
import (
	"fmt"
	"io"
	"net/http"
	"net/http/httptest"
	"testing"
	"github.com/stretchr/testify/assert"
)
const fakeOTCToken = "62244bc21da68d03ebac94e6636ff01f"
type DNSServerMock struct {
	t      *testing.T
	server *httptest.Server
	Mux    *http.ServeMux
}
func NewDNSServerMock(t *testing.T) *DNSServerMock {
	t.Helper()
	mux := http.NewServeMux()
	return &DNSServerMock{
		t:      t,
		server: httptest.NewServer(mux),
		Mux:    mux,
	}
}
func (m *DNSServerMock) GetServerURL() string {
	return m.server.URL
}
func (m *DNSServerMock) ShutdownServer() {
	m.server.Close()
}
func (m *DNSServerMock) HandleAuthSuccessfully() {
	m.Mux.HandleFunc("/v3/auth/token", func(w http.ResponseWriter, _ *http.Request) {
		w.Header().Set("X-Subject-Token", fakeOTCToken)
		fmt.Fprintf(w, `{
		  "token": {
		    "catalog": [
		      {
			"type": "dns",
			"id": "56cd81db1f8445d98652479afe07c5ba",
			"name": "",
			"endpoints": [
			  {
			    "url": "%s",
			    "region": "eu-de",
			    "region_id": "eu-de",
			    "interface": "public",
			    "id": "0047a06690484d86afe04877074efddf"
			  }
			]
		      }
		    ]
		  }}`, m.server.URL)
	})
}
func (m *DNSServerMock) HandleListZonesSuccessfully() {
	m.Mux.HandleFunc("/v2/zones", func(w http.ResponseWriter, r *http.Request) {
		assert.Equal(m.t, r.Method, http.MethodGet)
		assert.Equal(m.t, r.URL.Path, "/v2/zones")
		assert.Equal(m.t, r.URL.RawQuery, "name=example.com.")
		assert.Equal(m.t, r.Header.Get("Content-Type"), "application/json")
		fmt.Fprintf(w, `{
		  "zones":[{
		    "id":"123123",
		    "name":"example.com."
		  }]}
		`)
	})
}