Skip to content

Commit

Permalink
test: remove unused clusterName and align fields
Browse files Browse the repository at this point in the history
  • Loading branch information
EspenAlbert committed Jul 15, 2024
1 parent d0ef2ad commit 2f2ef65
Showing 1 changed file with 19 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ func TestAccLDAPConfiguration_withVerify_CACertificateComplete(t *testing.T) {
},
})
projectID = clusterInfo.ProjectID
clusterName = clusterInfo.ClusterName
clusterTerraformStr = clusterInfo.ClusterTerraformStr
)

Expand All @@ -46,7 +45,7 @@ func TestAccLDAPConfiguration_withVerify_CACertificateComplete(t *testing.T) {
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
Steps: []resource.TestStep{
{
Config: configWithVerify(clusterTerraformStr, clusterInfo.ClusterResourceName, projectID, clusterName, hostname, username, password, caCertificate, cast.ToInt(port), true),
Config: configWithVerify(clusterTerraformStr, clusterInfo.ClusterResourceName, projectID, hostname, username, password, caCertificate, cast.ToInt(port), true),
Check: resource.ComposeAggregateTestCheckFunc(
checkExists(resourceName),
resource.TestCheckResourceAttrSet(resourceName, "project_id"),
Expand Down Expand Up @@ -162,39 +161,39 @@ func configBasic(projectID, hostname, username, password string, authEnabled boo
`, projectID, hostname, username, password, authEnabled, port)
}

func configWithVerify(clusterTerraformStr, clusterResourceName, projectID, clusterName, hostname, username, password, caCertificate string, port int, authEnabled bool) string {
func configWithVerify(clusterTerraformStr, clusterResourceName, projectID, hostname, username, password, caCertificate string, port int, authEnabled bool) string {
return fmt.Sprintf(`
%[9]s
%[8]s
resource "mongodbatlas_ldap_verify" "test" {
project_id = %[1]q
hostname = %[3]q
bind_username = %[4]q
bind_password = %[5]q
port = %[6]d
project_id = %[1]q
hostname = %[2]q
bind_username = %[3]q
bind_password = %[4]q
port = %[5]d
ca_certificate = <<-EOF
%[8]s
%[7]s
EOF
authz_query_template = "{USER}?memberOf?base"
depends_on = [%[10]s]
depends_on = [%[9]s]
}
resource "mongodbatlas_ldap_configuration" "test" {
project_id = %[1]q
authorization_enabled = false
hostname = %[3]q
bind_username = %[4]q
bind_password = %[5]q
port = %[6]d
authentication_enabled = %[7]t
project_id = %[1]q
authorization_enabled = false
hostname = %[2]q
bind_username = %[3]q
bind_password = %[4]q
port = %[5]d
authentication_enabled = %[6]t
ca_certificate = <<-EOF
%[8]s
%[7]s
EOF
authz_query_template = "{USER}?memberOf?base"
user_to_dn_mapping{
match = "(.+)"
ldap_query = "DC=example,DC=com??sub?(userPrincipalName={0})"
}
depends_on = [mongodbatlas_ldap_verify.test]
}`, projectID, clusterName, hostname, username, password, port, authEnabled, caCertificate, clusterTerraformStr, clusterResourceName)
}`, projectID, hostname, username, password, port, authEnabled, caCertificate, clusterTerraformStr, clusterResourceName)
}

0 comments on commit 2f2ef65

Please sign in to comment.