File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
code/terraform/07-testing-terraform-code/test Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package test
33import (
44 "fmt"
55 "github.com/gruntwork-io/terratest/modules/random"
6+ "strings"
67
78 "github.com/gruntwork-io/terratest/modules/http-helper"
89
@@ -36,19 +37,18 @@ func TestHelloWorldAppExample(t *testing.T) {
3637 albDnsName := terraform .OutputRequired (t , opts , "alb_dns_name" )
3738 url := fmt .Sprintf ("http://%s" , albDnsName )
3839
39- expectedStatus := 200
40- expectedBody := "Hello, World"
41-
4240 maxRetries := 10
4341 timeBetweenRetries := 10 * time .Second
4442
45- http_helper .HttpGetWithRetry (
43+ http_helper .HttpGetWithRetryWithCustomValidation (
4644 t ,
4745 url ,
48- expectedStatus ,
49- expectedBody ,
5046 maxRetries ,
5147 timeBetweenRetries ,
48+ func (status int , body string ) bool {
49+ return status == 200 &&
50+ strings .Contains (body , "Hello, World" )
51+ },
5252 )
5353
5454}
You can’t perform that action at this time.
0 commit comments