nginx-proxy-manager-zh/backend/internal/dnsproviders/dns_ad_test.go

34 lines
722 B
Go
Raw Normal View History

2023-07-31 01:31:38 -04:00
package dnsproviders
import (
"npm/internal/util"
"testing"
"github.com/stretchr/testify/assert"
2023-11-07 18:57:15 -05:00
"go.uber.org/goleak"
2023-07-31 01:31:38 -04:00
)
func TestAdProvider(t *testing.T) {
2023-11-07 18:57:15 -05:00
// goleak is used to detect goroutine leaks
defer goleak.VerifyNone(t, goleak.IgnoreAnyFunction("database/sql.(*DB).connectionOpener"))
2023-07-31 01:31:38 -04:00
provider := getDNSAd()
provider.ConvertToUpdatable()
json, err := provider.GetJsonSchema()
assert.Nil(t, err)
assert.Equal(t, `{
"title": "dns_ad",
"type": "object",
"additionalProperties": false,
"minProperties": 1,
"properties": {
"AD_API_KEY": {
"title": "api-key",
"type": "string",
"additionalProperties": false,
"minLength": 1
}
}
}`, util.PrettyPrintJSON(json))
}