From e6ebac1ae32dce3902e72d15d11c64df6d0588fa Mon Sep 17 00:00:00 2001 From: Hidde Wieringa Date: Sun, 21 Jul 2024 21:13:42 +0200 Subject: [PATCH] tests for q, ref and UIC ref searches --- api/tests/api.hurl | 61 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 59 insertions(+), 2 deletions(-) diff --git a/api/tests/api.hurl b/api/tests/api.hurl index b97c69ad..8911ef94 100644 --- a/api/tests/api.hurl +++ b/api/tests/api.hurl @@ -119,8 +119,65 @@ HTTP 200 jsonpath "$" count == 1 jsonpath "$[0].name" == "Karl-Marx-Straße" -# TODO facility request with q query -# TODO facility request with UIC queries +# Facility search for reference +GET {{base_url}}/facility +[QueryStringParams] +ref: BOKN +HTTP 200 +[Asserts] +jsonpath "$" count == 1 +jsonpath "$[0].name" == "Berlin Ostkreuz (Ringbahn-F)" + +# Facility search for reference +GET {{base_url}}/facility +[QueryStringParams] +ref: BOKN +HTTP 200 +[Asserts] +jsonpath "$" count == 1 +jsonpath "$[0].name" == "Berlin Ostkreuz (Ringbahn-F)" + +# Facility search for UIC reference +GET {{base_url}}/facility +[QueryStringParams] +uic_ref: 8089028 +HTTP 200 +[Asserts] +jsonpath "$" count == 2 +jsonpath "$[0].name" == "Ostkreuz" +jsonpath "$[1].name" == "Ostkreuz (Ringbahn)" + +# Facility search for name, reference or UIC reference +GET {{base_url}}/facility +[QueryStringParams] +q: BOK +HTTP 200 +[Asserts] +jsonpath "$" count == 1 +jsonpath "$[0].name" == "Ostkreuz (Ringbahn)" + +# Facility search for name, reference or UIC reference +GET {{base_url}}/facility +[QueryStringParams] +q: Berlin Ostkreuz +HTTP 200 +[Asserts] +jsonpath "$" count == 5 +jsonpath "$[0].name" == "Ostkreuz" +jsonpath "$[1].name" == "Berlin Ostkreuz (Stadtbahn-F)" +jsonpath "$[2].name" == "Berlin Ostkreuz (Ringbahn-F)" +jsonpath "$[3].name" == "Berlin Ostkreuz (Ostbahn)" +jsonpath "$[4].name" == "Ostkreuz (Ringbahn)" + +# Facility search for name, reference or UIC reference +GET {{base_url}}/facility +[QueryStringParams] +q: 8089028 +HTTP 200 +[Asserts] +jsonpath "$" count == 2 +jsonpath "$[0].name" == "Ostkreuz" +jsonpath "$[1].name" == "Ostkreuz (Ringbahn)" # Milestone request for line 6020 milestone 22.7 GET {{base_url}}/milestone