diff --git a/xoa/data_source_host_test.go b/xoa/data_source_host_test.go index 2353f02..c578abf 100644 --- a/xoa/data_source_host_test.go +++ b/xoa/data_source_host_test.go @@ -54,6 +54,32 @@ func TestAccXenorchestraDataSource_hostXoTokenAuth(t *testing.T) { ) } +func TestAccXenorchestraDataSource_hostXoTokenAuthShouldFail(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + // Specify all the parameters to the provider to force the validation + // to fail + Config: `provider xenorchestra { + alias = "token_auth" + username = "test" + password = "test" + token = "token" + } + data "xenorchestra_host" "host" { + provider = xenorchestra.token_auth + name_label = "%s" + } + `, + ExpectError: regexp.MustCompile(`Error: Conflicting configuration arguments`), + }, + }, + }, + ) +} + func TestAccXenorchestraDataSource_hostNotFound(t *testing.T) { resourceName := "data.xenorchestra_host.host" resource.Test(t, resource.TestCase{