mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-07 06:08:52 +00:00
CMTA: Require API authorization.
This commit is contained in:
parent
ea79ac82f9
commit
e244e57722
3 changed files with 6 additions and 4 deletions
|
@ -33,15 +33,16 @@ public class CmtaProvider extends AbstractHafasClientInterfaceProvider {
|
||||||
null, null, null, null, null, Product.BUS };
|
null, null, null, null, null, Product.BUS };
|
||||||
private static final String DEFAULT_API_CLIENT = "{\"id\":\"CMTA\",\"type\":\"AND\"}";
|
private static final String DEFAULT_API_CLIENT = "{\"id\":\"CMTA\",\"type\":\"AND\"}";
|
||||||
|
|
||||||
public CmtaProvider() {
|
public CmtaProvider(final String apiAuthorization) {
|
||||||
this(DEFAULT_API_CLIENT);
|
this(DEFAULT_API_CLIENT, apiAuthorization);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CmtaProvider(final String apiClient) {
|
public CmtaProvider(final String apiClient, final String apiAuthorization) {
|
||||||
super(NetworkId.CMTA, API_BASE, PRODUCTS_MAP);
|
super(NetworkId.CMTA, API_BASE, PRODUCTS_MAP);
|
||||||
setTimeZone("America/Chicago");
|
setTimeZone("America/Chicago");
|
||||||
setApiVersion("1.14");
|
setApiVersion("1.14");
|
||||||
setApiExt("SBB.TZT.1");
|
setApiExt("SBB.TZT.1");
|
||||||
setApiClient(apiClient);
|
setApiClient(apiClient);
|
||||||
|
setApiAuthorization(apiAuthorization);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||||
*/
|
*/
|
||||||
public class CmtaProviderLiveTest extends AbstractProviderLiveTest {
|
public class CmtaProviderLiveTest extends AbstractProviderLiveTest {
|
||||||
public CmtaProviderLiveTest() {
|
public CmtaProviderLiveTest() {
|
||||||
super(new CmtaProvider());
|
super(new CmtaProvider(secretProperty("cmta.api_authorization")));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = IllegalArgumentException.class)
|
@Test(expected = IllegalArgumentException.class)
|
||||||
|
|
|
@ -31,3 +31,4 @@ dsb.api_authorization =
|
||||||
se.api_authorization =
|
se.api_authorization =
|
||||||
lu.api_authorization =
|
lu.api_authorization =
|
||||||
bart.api_authorization =
|
bart.api_authorization =
|
||||||
|
cmta.api_authorization =
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue