@@ -36,6 +36,30 @@ func TestAccPubsubSubscription_emptyTTL(t *testing.T) {
36
36
})
37
37
}
38
38
39
+ func TestAccPubsubSubscription_emptyRetryPolicy (t * testing.T ) {
40
+ t .Parallel ()
41
+
42
+ topic := fmt .Sprintf ("tf-test-topic-%s" , acctest .RandString (t , 10 ))
43
+ subscription := fmt .Sprintf ("tf-test-sub-%s" , acctest .RandString (t , 10 ))
44
+
45
+ acctest .VcrTest (t , resource.TestCase {
46
+ PreCheck : func () { acctest .AccTestPreCheck (t ) },
47
+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories (t ),
48
+ CheckDestroy : testAccCheckPubsubSubscriptionDestroyProducer (t ),
49
+ Steps : []resource.TestStep {
50
+ {
51
+ Config : testAccPubsubSubscription_emptyRetryPolicy (topic , subscription ),
52
+ },
53
+ {
54
+ ResourceName : "google_pubsub_subscription.foo" ,
55
+ ImportStateId : subscription ,
56
+ ImportState : true ,
57
+ ImportStateVerify : true ,
58
+ },
59
+ },
60
+ })
61
+ }
62
+
39
63
func TestAccPubsubSubscription_basic (t * testing.T ) {
40
64
t .Parallel ()
41
65
@@ -494,6 +518,22 @@ resource "google_pubsub_subscription" "foo" {
494
518
` , topic , subscription )
495
519
}
496
520
521
+ func testAccPubsubSubscription_emptyRetryPolicy (topic , subscription string ) string {
522
+ return fmt .Sprintf (`
523
+ resource "google_pubsub_topic" "foo" {
524
+ name = "%s"
525
+ }
526
+
527
+ resource "google_pubsub_subscription" "foo" {
528
+ name = "%s"
529
+ topic = google_pubsub_topic.foo.id
530
+
531
+ retry_policy {
532
+ }
533
+ }
534
+ ` , topic , subscription )
535
+ }
536
+
497
537
func testAccPubsubSubscription_push (topicFoo , saAccount , subscription string ) string {
498
538
return fmt .Sprintf (`
499
539
data "google_project" "project" { }
0 commit comments