@@ -23,21 +23,6 @@ func TestHandler_FileServer(t *testing.T) {
2323 fn func (t * testing.T , h http.Handler )
2424 fileServer http.Handler
2525 }{
26- {
27- name : "request api info" ,
28- config : static.Api {Path : "/mokapi" , Dashboard : true },
29- fn : func (t * testing.T , h http.Handler ) {
30- try .Handler (t ,
31- http .MethodGet ,
32- "http://foo.api/mokapi/api/info" ,
33- nil ,
34- "" ,
35- h ,
36- try .HasStatusCode (200 ),
37- try .HasHeader ("Content-Type" , "application/json" ),
38- try .HasBody (`{"version":"","buildTime":""}` ))
39- },
40- },
4126 {
4227 name : "request web app" ,
4328 config : static.Api {Path : "/mokapi" , Dashboard : true },
@@ -161,7 +146,7 @@ func TestOpenGraphInDashboard(t *testing.T) {
161146 test : func (t * testing.T ) {
162147 cfg := & static.Config {}
163148 app := runtime .New (cfg )
164- app .Http . Add (& dynamic.Config {Info : dynamic.ConfigInfo {Url : mustParse ("https://foo.bar" )}, Data : openapitest .NewConfig ("3.0" , openapitest .WithInfo ("Swagger Petstore" , "1.0" , "This is a sample server Petstore server." ))})
149+ app .AddHttp (& dynamic.Config {Info : dynamic.ConfigInfo {Url : mustParse ("https://foo.bar" )}, Data : openapitest .NewConfig ("3.0" , openapitest .WithInfo ("Swagger Petstore" , "1.0" , "This is a sample server Petstore server." ))})
165150 h := api .New (app , static.Api {Path : "/mokapi" , Dashboard : true })
166151 try .Handler (t ,
167152 http .MethodGet ,
@@ -181,7 +166,7 @@ func TestOpenGraphInDashboard(t *testing.T) {
181166 test : func (t * testing.T ) {
182167 cfg := & static.Config {}
183168 app := runtime .New (cfg )
184- app .Http . Add (& dynamic.Config {Info : dynamic.ConfigInfo {Url : mustParse ("https://foo.bar" )}, Data : openapitest .NewConfig ("3.0" ,
169+ app .AddHttp (& dynamic.Config {Info : dynamic.ConfigInfo {Url : mustParse ("https://foo.bar" )}, Data : openapitest .NewConfig ("3.0" ,
185170 openapitest .WithInfo ("Swagger Petstore" , "1.0" , "This is a sample server Petstore server." ),
186171 openapitest .WithPath ("/pet/{petId}" , openapitest .NewPath ()),
187172 )},
@@ -205,7 +190,7 @@ func TestOpenGraphInDashboard(t *testing.T) {
205190 test : func (t * testing.T ) {
206191 cfg := & static.Config {}
207192 app := runtime .New (cfg )
208- app .Http . Add (& dynamic.Config {Info : dynamic.ConfigInfo {Url : mustParse ("https://foo.bar" )}, Data : openapitest .NewConfig ("3.0" ,
193+ app .AddHttp (& dynamic.Config {Info : dynamic.ConfigInfo {Url : mustParse ("https://foo.bar" )}, Data : openapitest .NewConfig ("3.0" ,
209194 openapitest .WithInfo ("Swagger Petstore" , "1.0" , "This is a sample server Petstore server." ),
210195 openapitest .WithPath ("/pet/{petId}" , openapitest .NewPath (
211196 openapitest .WithPathInfo ("foo" , "bar" ),
@@ -231,7 +216,7 @@ func TestOpenGraphInDashboard(t *testing.T) {
231216 test : func (t * testing.T ) {
232217 cfg := & static.Config {}
233218 app := runtime .New (cfg )
234- app .Http . Add (& dynamic.Config {Info : dynamic.ConfigInfo {Url : mustParse ("https://foo.bar" )}, Data : openapitest .NewConfig ("3.0" ,
219+ app .AddHttp (& dynamic.Config {Info : dynamic.ConfigInfo {Url : mustParse ("https://foo.bar" )}, Data : openapitest .NewConfig ("3.0" ,
235220 openapitest .WithInfo ("Swagger Petstore" , "1.0" , "This is a sample server Petstore server." ),
236221 openapitest .WithPath ("/pet/{petId}" , openapitest .NewPath (
237222 openapitest .WithPathInfo ("" , "bar" ),
@@ -256,7 +241,7 @@ func TestOpenGraphInDashboard(t *testing.T) {
256241 test : func (t * testing.T ) {
257242 cfg := & static.Config {}
258243 app := runtime .New (cfg )
259- app .Http . Add (& dynamic.Config {Info : dynamic.ConfigInfo {Url : mustParse ("https://foo.bar" )}, Data : openapitest .NewConfig ("3.0" ,
244+ app .AddHttp (& dynamic.Config {Info : dynamic.ConfigInfo {Url : mustParse ("https://foo.bar" )}, Data : openapitest .NewConfig ("3.0" ,
260245 openapitest .WithInfo ("Swagger Petstore" , "1.0" , "This is a sample server Petstore server." ),
261246 openapitest .WithPath ("/pet/{petId}" , openapitest .NewPath (
262247 openapitest .WithOperation ("GET" , openapitest .NewOperation ()),
@@ -281,7 +266,7 @@ func TestOpenGraphInDashboard(t *testing.T) {
281266 test : func (t * testing.T ) {
282267 cfg := & static.Config {}
283268 app := runtime .New (cfg )
284- app .Http . Add (& dynamic.Config {Info : dynamic.ConfigInfo {Url : mustParse ("https://foo.bar" )}, Data : openapitest .NewConfig ("3.0" ,
269+ app .AddHttp (& dynamic.Config {Info : dynamic.ConfigInfo {Url : mustParse ("https://foo.bar" )}, Data : openapitest .NewConfig ("3.0" ,
285270 openapitest .WithInfo ("Swagger Petstore" , "1.0" , "This is a sample server Petstore server." ),
286271 openapitest .WithPath ("/pet/{petId}" , openapitest .NewPath (
287272 openapitest .WithOperation ("GET" , openapitest .NewOperation ()),
0 commit comments