mirror of
https://github.com/jc21/nginx-proxy-manager.git
synced 2024-08-30 18:22:48 +00:00
34 lines
722 B
Go
34 lines
722 B
Go
package dnsproviders
|
|
|
|
import (
|
|
"npm/internal/util"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"go.uber.org/goleak"
|
|
)
|
|
|
|
func TestAdProvider(t *testing.T) {
|
|
// goleak is used to detect goroutine leaks
|
|
defer goleak.VerifyNone(t, goleak.IgnoreAnyFunction("database/sql.(*DB).connectionOpener"))
|
|
|
|
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))
|
|
}
|