mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-16 01:19:49 +00:00
Fix umlauts in suggested locations for Rhineland-Palatinate, Rhine-Neckar & Baden-Württemberg.
This commit is contained in:
parent
f48c0ef60e
commit
39008afc0b
2 changed files with 21 additions and 2 deletions
|
@ -19,6 +19,8 @@ package de.schildbach.pte;
|
|||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
|
||||
import de.schildbach.pte.dto.Line;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
|
||||
|
@ -27,13 +29,16 @@ import de.schildbach.pte.dto.Product;
|
|||
*/
|
||||
public class VrnProvider extends AbstractEfaProvider
|
||||
{
|
||||
private static final String API_BASE = "http://fahrplanauskunft.vrn.de/vrn_mobile/";
|
||||
private static final String API_BASE = "http://fahrplanauskunft.vrn.de/vrn/";
|
||||
|
||||
// http://fahrplanauskunft.vrn.de/vrn_mobile/
|
||||
// http://efa9.vrn.de/vrt/
|
||||
|
||||
public VrnProvider()
|
||||
{
|
||||
super(NetworkId.VRN, API_BASE);
|
||||
|
||||
setRequestUrlEncoding(Charsets.UTF_8);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,7 +17,9 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.hasItem;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
|
@ -85,7 +87,8 @@ public class VrnProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("grün");
|
||||
final SuggestLocationsResult result = suggestLocations("Käfertal");
|
||||
assertThat(result.getLocations(), hasItem(new Location(LocationType.STATION, "6005547")));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -166,4 +169,15 @@ public class VrnProviderLiveTest extends AbstractProviderLiveTest
|
|||
final QueryTripsResult earlierResult = queryMoreTrips(later2Result.context, false);
|
||||
print(earlierResult);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void tripWithUmlaut() throws Exception
|
||||
{
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.ANY, null, null, "Käfertal"), null, new Location(LocationType.STATION,
|
||||
"6002417", "Mannheim", "Hauptbahnhof"), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
print(result);
|
||||
assertEquals(QueryTripsResult.Status.OK, result.status);
|
||||
assertTrue(result.trips.size() > 0);
|
||||
assertEquals(result.trips.get(0).from, new Location(LocationType.STATION, "6005547"));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue