@@ -144,55 +144,6 @@ func TestIntegration_HTTPSubscription(t *testing.T) {
144144 shutdownGuard .ShutdownAndWait ()
145145}
146146
147- func TestIntegration_HTTPResponse (t * testing.T ) {
148- logCfg := zap .NewDevelopmentConfig ()
149- logCfg .DisableStacktrace = true
150- log , _ := logCfg .Build ()
151-
152- kv , shutdownGuard := newTestEtcd ()
153-
154- testAPIServer := newConfigAPIServer (kv , log )
155- defer testAPIServer .Close ()
156-
157- router , testRouterServer := newTestRouterServer (kv , log )
158- defer testRouterServer .Close ()
159-
160- testTargetServer := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
161- fmt .Fprintf (w , `{"statusCode":201,"headers":{"content-type":"text/html"},"body":"<head></head>"}` )
162- }))
163- defer testTargetServer .Close ()
164-
165- post (testAPIServer .URL + "/v1/functions" ,
166- functions.Function {
167- ID : functions .FunctionID ("httpresponse" ),
168- Provider : & functions.Provider {
169- Type : functions .HTTPEndpoint ,
170- URL : testTargetServer .URL ,
171- },
172- })
173-
174- post (testAPIServer .URL + "/v1/subscriptions" , subscriptions.Subscription {
175- FunctionID : functions .FunctionID ("httpresponse" ),
176- Event : "http" ,
177- Method : "GET" ,
178- Path : "/httpresponse" ,
179- })
180-
181- select {
182- case <- router .WaitForEndpoint (subscriptions .NewEndpointID ("GET" , "/httpresponse" )):
183- case <- time .After (10 * time .Second ):
184- panic ("timed out waiting for endpoint to be configured!" )
185- }
186-
187- statusCode , headers , body := get (testRouterServer .URL + "/httpresponse" )
188- assert .Equal (t , statusCode , 201 )
189- assert .Equal (t , headers .Get ("content-type" ), "text/html" )
190- assert .Equal (t , body , "<head></head>" )
191-
192- router .Drain ()
193- shutdownGuard .ShutdownAndWait ()
194- }
195-
196147func wait10Seconds (ch <- chan struct {}, errMsg string ) {
197148 select {
198149 case <- ch :
0 commit comments