Skip to content

Commit fdd1ded

Browse files
author
Cristina Sánchez Sánchez
committed
WIP - Migration test
1 parent 9601faa commit fdd1ded

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
package clouduserprojectassignment_test
2+
3+
import (
4+
"testing"
5+
6+
"github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/mig"
7+
)
8+
9+
func TestMigCloudUserProjectAssignmentRS_basic(t *testing.T) {
10+
mig.SkipIfVersionBelow(t, "2.0.0") // when resource 1st released
11+
mig.CreateAndRunTest(t, basicTestCase(t))
12+
}
13+
14+
func TestMigCloudUserProjectAssignmentRS_migrationJourney(t *testing.T) {
15+
16+
}
17+
18+
func originalConfigFirst(t *testing.T) string {
19+
t.Helper()
20+
return `
21+
locals {
22+
username ="[email protected]"
23+
roles = [ "GROUP_READ_ONLY", "GROUP_DATA_ACCESS_READ_ONLY" ]
24+
}
25+
26+
resource "mongodbatlas_project" "mig_test" {
27+
name = "migration_user_project"
28+
org_id = var.org_id
29+
}
30+
31+
resource "mongodbatlas_project_invitation" "mig_test" {
32+
project_id = mongodbatlas_project.mig_test.id
33+
username = local.username
34+
roles = local.roles
35+
}
36+
`
37+
}
38+
39+
func userProjectAssignmentConfigSecond(t *testing.T) string {
40+
t.Helper()
41+
return `
42+
locals {
43+
username ="[email protected]"
44+
roles = [ "GROUP_READ_ONLY", "GROUP_DATA_ACCESS_READ_ONLY" ]
45+
}
46+
47+
resource "mongodbatlas_project" "mig_test" {
48+
name = "migration_user_project"
49+
org_id = var.org_id
50+
}
51+
52+
resource "mongodbatlas_project_invitation" "mig_test" {
53+
project_id = mongodbatlas_project.mig_test.id
54+
username = local.username
55+
roles = local.roles
56+
}
57+
58+
resource "mongodbatlas_cloud_user_project_assignment" "user_mig_test" {
59+
project_id = mongodbatlas_project.mig_test.id
60+
username = local.username
61+
roles = local.roles
62+
}
63+
`
64+
}

0 commit comments

Comments
 (0)