@@ -2,13 +2,12 @@ package google
22
33import (
44 "fmt"
5- "regexp"
65 "testing"
76 "time"
87
98 "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
109 "github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
11- "google.golang.org/api/runtimeconfig/v1beta1"
10+ runtimeconfig "google.golang.org/api/runtimeconfig/v1beta1"
1211)
1312
1413func TestAccRuntimeconfigVariable_basic (t * testing.T ) {
@@ -107,38 +106,6 @@ func TestAccRuntimeconfigVariable_basicValue(t *testing.T) {
107106 })
108107}
109108
110- func TestAccRuntimeconfigVariable_errorsOnBothValueAndText (t * testing.T ) {
111- // Unit test, no HTTP interactions
112- skipIfVcr (t )
113- t .Parallel ()
114-
115- vcrTest (t , resource.TestCase {
116- PreCheck : func () { testAccPreCheck (t ) },
117- Providers : testAccProviders ,
118- Steps : []resource.TestStep {
119- {
120- Config : testAccRuntimeconfigVariable_invalidBothTextValue (randString (t , 10 )),
121- ExpectError : regexp .MustCompile ("conflicts with" ),
122- },
123- },
124- })
125- }
126-
127- func TestAccRuntimeconfigVariable_errorsOnMissingValueAndText (t * testing.T ) {
128- t .Parallel ()
129-
130- vcrTest (t , resource.TestCase {
131- PreCheck : func () { testAccPreCheck (t ) },
132- Providers : testAccProviders ,
133- Steps : []resource.TestStep {
134- {
135- Config : testAccRuntimeconfigVariable_invalidMissingTextValue (randString (t , 10 )),
136- ExpectError : regexp .MustCompile ("You must specify one of value or text" ),
137- },
138- },
139- })
140- }
141-
142109func testAccCheckRuntimeconfigVariableExists (t * testing.T , resourceName string , variable * runtimeconfig.Variable ) resource.TestCheckFunc {
143110 return func (s * terraform.State ) error {
144111 rs , ok := s .RootModule ().Resources [resourceName ]
@@ -268,31 +235,3 @@ resource "google_runtimeconfig_variable" "foobar" {
268235}
269236` , suffix , name , value )
270237}
271-
272- func testAccRuntimeconfigVariable_invalidBothTextValue (suffix string ) string {
273- return fmt .Sprintf (`
274- resource "google_runtimeconfig_config" "foobar" {
275- name = "some-config-%s"
276- }
277-
278- resource "google_runtimeconfig_variable" "foobar" {
279- parent = google_runtimeconfig_config.foobar.name
280- name = "%s"
281- text = "here's my value"
282- value = "Zm9vYmFyCg=="
283- }
284- ` , suffix , suffix )
285- }
286-
287- func testAccRuntimeconfigVariable_invalidMissingTextValue (suffix string ) string {
288- return fmt .Sprintf (`
289- resource "google_runtimeconfig_config" "foobar" {
290- name = "some-config-%s"
291- }
292-
293- resource "google_runtimeconfig_variable" "foobar" {
294- parent = google_runtimeconfig_config.foobar.name
295- name = "my-variable-namespace/%s"
296- }
297- ` , suffix , suffix )
298- }
0 commit comments