add voicehint test

This commit is contained in:
afischerdev 2022-11-24 20:13:36 +01:00
parent 8fa27bcf6e
commit 3e53659f18

View file

@ -92,6 +92,21 @@ public class RouteServerTest {
Assert.assertEquals("1902", geoJson.query("/features/0/properties/track-length")); Assert.assertEquals("1902", geoJson.query("/features/0/properties/track-length"));
} }
@Test
public void voiceHints() throws IOException {
URL requestUrl = new URL(baseUrl + "brouter?lonlats=8.705796,50.003124|8.705859,50.0039599&nogos=&profile=trekking&alternativeidx=0&format=geojson&timode=2");
HttpURLConnection httpConnection = (HttpURLConnection) requestUrl.openConnection();
httpConnection.connect();
Assert.assertEquals(HttpURLConnection.HTTP_OK, httpConnection.getResponseCode());
InputStream inputStream = httpConnection.getInputStream();
JSONObject geoJson = new JSONObject(new String(inputStream.readAllBytes(), StandardCharsets.UTF_8));
Assert.assertEquals(2, geoJson.query("/features/0/properties/voicehints/0/1")); // TL
Assert.assertEquals(1, geoJson.query("/features/0/properties/voicehints/1/1")); // C
}
@Test @Test
public void uploadValidProfile() throws IOException { public void uploadValidProfile() throws IOException {
URL requestUrl = new URL(baseUrl + "brouter/profile"); URL requestUrl = new URL(baseUrl + "brouter/profile");