mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-14 08:40:29 +00:00
fix autocomplete coverage for Baden-Württemberg
This commit is contained in:
parent
5c79bf70a3
commit
a4c148709c
2 changed files with 19 additions and 11 deletions
|
@ -17,11 +17,6 @@
|
|||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -35,6 +30,7 @@ public class NvbwProvider extends AbstractEfaProvider
|
|||
{
|
||||
super(API_BASE);
|
||||
|
||||
setIncludeRegionId(false);
|
||||
setUseRouteIndexAsConnectionId(false);
|
||||
}
|
||||
|
||||
|
@ -51,10 +47,4 @@ public class NvbwProvider extends AbstractEfaProvider
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,6 +87,22 @@ public class NvbwProviderLiveTest extends AbstractProviderLiveTest
|
|||
print(autocompletes);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteCoverage() throws Exception
|
||||
{
|
||||
final List<Location> freiburgAutocompletes = provider.autocompleteStations("Freiburg Hauptbahnhof");
|
||||
print(freiburgAutocompletes);
|
||||
assertThat(freiburgAutocompletes, hasItem(new Location(LocationType.STATION, 6906508)));
|
||||
|
||||
final List<Location> baselAutocompletes = provider.autocompleteStations("Basel");
|
||||
print(baselAutocompletes);
|
||||
assertThat(baselAutocompletes, hasItem(new Location(LocationType.STATION, 51000007)));
|
||||
|
||||
final List<Location> constanceAutocompletes = provider.autocompleteStations("Konstanz");
|
||||
print(constanceAutocompletes);
|
||||
assertThat(constanceAutocompletes, hasItem(new Location(LocationType.STATION, 8706554)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shortConnection() throws Exception
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue