Skip to content

Fixes many testacc #296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,7 @@ func testAccCheckMongoDBAtlasAlertConfigurationImportStateIDFunc(resourceName st
return "", fmt.Errorf("not found: %s", resourceName)
}

ids := decodeStateID(rs.Primary.ID)

return fmt.Sprintf("%s-%s", ids["project_id"], ids["id"]), nil
return fmt.Sprintf("%s-%s", rs.Primary.Attributes["project_id"], rs.Primary.Attributes["alert_configuration_id"]), nil
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,7 @@ func testAccCheckMongoDBAtlasCloudProviderSnapshotRestoreJobImportStateIDFunc(re
return "", fmt.Errorf("not found:: %s", resourceName)
}

ids := decodeStateID(rs.Primary.ID)

return fmt.Sprintf("%s-%s-%s", ids["project_id"], ids["cluster_name"], ids["snapshot_restore_job_id"]), nil
return fmt.Sprintf("%s-%s-%s", rs.Primary.Attributes["project_id"], rs.Primary.Attributes["cluster_name"], rs.Primary.Attributes["snapshot_restore_job_id"]), nil
}
}

Expand Down
4 changes: 1 addition & 3 deletions mongodbatlas/resource_mongodbatlas_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -862,9 +862,7 @@ func testAccCheckMongoDBAtlasClusterImportStateIDFunc(resourceName string) resou
return "", fmt.Errorf("not found: %s", resourceName)
}

ids := decodeStateID(rs.Primary.ID)

return fmt.Sprintf("%s-%s", ids["project_id"], ids["cluster_name"]), nil
return fmt.Sprintf("%s-%s", rs.Primary.Attributes["project_id"], rs.Primary.Attributes["name"]), nil
}
}

Expand Down