1616package gateway
1717
1818import (
19- "fmt"
2019 "path"
2120 "testing"
2221 "time"
@@ -60,9 +59,7 @@ func (s *GatewayTestSuite) Test_Gateway_InvalidRef() {
6059 // Check Maps
6160 mapFileRelativePath := "hug_" + s .Test ().Namespace + "_gateway_http"
6261 expectedMapsPath := path .Join (expectationsPath , "maps" )
63- s .Eventually (func () bool {
64- return s .CheckMapContents (mapFileRelativePath , expectedMapsPath )
65- }, timeout , interval , fmt .Sprintf ("maps in %s did not match expected contents" , mapFileRelativePath ))
62+ s .ExpectMapContents (mapFileRelativePath , expectedMapsPath )
6663}
6764
6865func (s * GatewayTestSuite ) Test_Gateway_InvalidHTTPS () {
@@ -86,9 +83,7 @@ func (s *GatewayTestSuite) Test_Gateway_InvalidHTTPS() {
8683 // Check Maps
8784 mapFileRelativePath := "hug_" + s .Test ().Namespace + "_gateway_http"
8885 expectedMapsPath := path .Join (expectationsPath , "maps" )
89- s .Eventually (func () bool {
90- return s .CheckMapContents (mapFileRelativePath , expectedMapsPath )
91- }, timeout , interval , fmt .Sprintf ("maps in %s did not match expected contents" , mapFileRelativePath ))
86+ s .ExpectMapContents (mapFileRelativePath , expectedMapsPath )
9287}
9388
9489func (s * GatewayTestSuite ) Test_Gateway_validRef () {
@@ -112,9 +107,7 @@ func (s *GatewayTestSuite) Test_Gateway_validRef() {
112107 // Check Maps
113108 mapFileRelativePath := "hug_" + s .Test ().Namespace + "_gateway_http"
114109 expectedMapsPath := path .Join (expectationsPath , "maps" )
115- s .Eventually (func () bool {
116- return s .CheckMapContents (mapFileRelativePath , expectedMapsPath )
117- }, timeout , interval , fmt .Sprintf ("maps in %s did not match expected contents" , mapFileRelativePath ))
110+ s .ExpectMapContents (mapFileRelativePath , expectedMapsPath )
118111}
119112
120113func (s * GatewayTestSuite ) Test_Gateway_conflict_at_least_1_listener_ok () {
@@ -153,19 +146,13 @@ func (s *GatewayTestSuite) Test_Gateway_conflict_at_least_1_listener_ok() {
153146 // Check Maps
154147 mapFileRelativePath := "hug_http_8080"
155148 expectedMapsPath := path .Join (expectationsPath , "maps" )
156- s .Eventually (func () bool {
157- return s .CheckMapContents (mapFileRelativePath , expectedMapsPath )
158- }, timeout , interval , fmt .Sprintf ("maps in %s did not match expected contents" , mapFileRelativePath ))
149+ s .ExpectMapContents (mapFileRelativePath , expectedMapsPath )
159150
160151 mapFileRelativePath = "hug_http_8081"
161- s .Eventually (func () bool {
162- return s .CheckMapContents (mapFileRelativePath , expectedMapsPath )
163- }, timeout , interval , fmt .Sprintf ("maps in %s did not match expected contents" , mapFileRelativePath ))
152+ s .ExpectMapContents (mapFileRelativePath , expectedMapsPath )
164153
165154 mapFileRelativePath = "hug_http_9090"
166- s .Eventually (func () bool {
167- return s .CheckMapContents (mapFileRelativePath , expectedMapsPath )
168- }, timeout , interval , fmt .Sprintf ("maps in %s did not match expected contents" , mapFileRelativePath ))
155+ s .ExpectMapContents (mapFileRelativePath , expectedMapsPath )
169156}
170157
171158func (s * GatewayTestSuite ) Test_Gateway_conflict_empty_hostname_no_conflict () {
0 commit comments