Negentwee: Fix 'type' parameter name.

This commit is contained in:
full-duplex 2018-09-22 11:42:16 +02:00 committed by Andreas Schildbach
parent e10de06c13
commit 34487194d9
2 changed files with 10 additions and 2 deletions

View file

@ -212,7 +212,7 @@ public class NegentweeProvider extends AbstractNetworkProvider {
// Add types if specified
String locationTypes = locationTypesToQueryParameterString(types);
if (locationTypes.length() > 0)
queryParameters.add(new QueryParameter("types", locationTypes));
queryParameters.add(new QueryParameter("type", locationTypes));
HttpUrl url = buildApiUrl("locations", queryParameters);
final CharSequence page = httpClient.get(url);
@ -724,7 +724,7 @@ public class NegentweeProvider extends AbstractNetworkProvider {
// Add types if specified
String locationTypes = locationTypesToQueryParameterString(types);
if (locationTypes.length() > 0)
queryParameters.add(new QueryParameter("types", locationTypes));
queryParameters.add(new QueryParameter("type", locationTypes));
HttpUrl url = buildApiUrl("locations", queryParameters);

View file

@ -18,6 +18,7 @@
package de.schildbach.pte.live;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.util.Date;
@ -49,6 +50,13 @@ public class NegentweeProviderLiveTest extends AbstractProviderLiveTest {
new Location(LocationType.STATION, "station-amsterdam-centraal"));
print(result);
assertEquals(NearbyLocationsResult.Status.OK, result.status);
// Assert that queryNearbyStations only returns STATION locations
assertNotNull(result.locations);
assertTrue(result.locations.size() > 0);
for (Location location : result.locations) {
assertEquals(location.type, LocationType.STATION);
}
}
@Test