@@ -42,8 +42,8 @@ start_http(Routes, ApiName) ->
4242
4343
4444init_per_suite (Config ) ->
45+ inets :start (),
4546 {ok , _ } = application :ensure_all_started (cowboy ),
46- {ok , _ } = application :ensure_all_started (lhttpc ),
4747
4848 PetstorePath = filename :join (code :lib_dir (openapi_handler )," test/redocly-petstore.json" ),
4949 TestSchemaPath = filename :join (code :lib_dir (openapi_handler )," test/test_schema.json" ),
@@ -183,9 +183,9 @@ json_body_parameters(_) ->
183183broken_json (_ ) ->
184184 Port = integer_to_list (ranch :get_port (petstore_api_server )),
185185 JSON = " {\" key\" :\" value\" ]}" ,
186- { ok , {{ 400 , _ }, Headers , Body }} = lhttpc : request ( " http://127.0.0.1:" ++ Port ++ " /test/yml/store/order" , post ,
187- [{ " Content-Type " , " application/json " }], JSON , 5000 ),
188- " application/json" = proplists :get_value (" Content-Type " , Headers ),
186+ Request = { " http://127.0.0.1:" ++ Port ++ " /test/yml/store/order" , [], " application/json " , JSON } ,
187+ { ok , {{ _ , 400 , _ }, Headers , Body }} = httpc : request ( post , Request , [{ timeout , 5000 }], [{ body_format , binary }] ),
188+ " application/json" = proplists :get_value (" content-type " , Headers ),
189189 #{<<" error" >> := <<" broken_json" >>} = openapi_json :decode (Body ),
190190 ok .
191191
0 commit comments