@@ -84,6 +84,38 @@ func TestAccArtifactRegistryRepository_createMvnRelease(t *testing.T) {
84
84
})
85
85
}
86
86
87
+ func TestAccArtifactRegistryRepository_updateEmptyMvn(t *testing.T) {
88
+ t.Parallel()
89
+
90
+ repositoryID := fmt.Sprintf("tf-test-%d", acctest.RandInt(t))
91
+
92
+ acctest.VcrTest(t, resource.TestCase{
93
+ PreCheck: func() { acctest.AccTestPreCheck(t) },
94
+ ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
95
+ CheckDestroy: testAccCheckArtifactRegistryRepositoryDestroyProducer(t),
96
+ Steps: []resource.TestStep{
97
+ {
98
+ Config: testAccArtifactRegistryRepository_createMvnEmpty1(repositoryID),
99
+ },
100
+ {
101
+ ResourceName: "google_artifact_registry_repository.test",
102
+ ImportState: true,
103
+ ImportStateVerify: true,
104
+ },
105
+ {
106
+ Config: testAccArtifactRegistryRepository_createMvnEmpty2(repositoryID),
107
+ PlanOnly: true,
108
+ ExpectNonEmptyPlan: false,
109
+ },
110
+ {
111
+ Config: testAccArtifactRegistryRepository_createMvnEmpty3(repositoryID),
112
+ PlanOnly: true,
113
+ ExpectNonEmptyPlan: false,
114
+ },
115
+ },
116
+ })
117
+ }
118
+
87
119
func TestAccArtifactRegistryRepository_kfp(t *testing.T) {
88
120
t.Parallel()
89
121
@@ -152,6 +184,43 @@ resource "google_artifact_registry_repository" "test" {
152
184
`, repositoryID, versionPolicy)
153
185
}
154
186
187
+ func testAccArtifactRegistryRepository_createMvnEmpty1(repositoryID string) string {
188
+ return fmt.Sprintf(`
189
+ resource "google_artifact_registry_repository" "test" {
190
+ repository_id = "%s"
191
+ location = "us-central1"
192
+ description = "maven repository with empty maven_config"
193
+ format = "MAVEN"
194
+ }
195
+ `, repositoryID)
196
+ }
197
+
198
+ func testAccArtifactRegistryRepository_createMvnEmpty2(repositoryID string) string {
199
+ return fmt.Sprintf(`
200
+ resource "google_artifact_registry_repository" "test" {
201
+ repository_id = "%s"
202
+ location = "us-central1"
203
+ description = "maven repository with empty maven_config"
204
+ format = "MAVEN"
205
+ maven_config { }
206
+ }
207
+ `, repositoryID)
208
+ }
209
+
210
+ func testAccArtifactRegistryRepository_createMvnEmpty3(repositoryID string) string {
211
+ return fmt.Sprintf(`
212
+ resource "google_artifact_registry_repository" "test" {
213
+ repository_id = "%s"
214
+ location = "us-central1"
215
+ description = "maven repository with empty maven_config"
216
+ format = "MAVEN"
217
+ maven_config {
218
+ allow_snapshot_overwrites = false
219
+ }
220
+ }
221
+ `, repositoryID)
222
+ }
223
+
155
224
func testAccArtifactRegistryRepository_kfp(repositoryID string) string {
156
225
return fmt.Sprintf(`
157
226
resource "google_artifact_registry_repository" "test" {
0 commit comments