2 * Copyright (c) 2010-2022 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.deutschebahn.internal.timetable;
15 import java.util.List;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.binding.deutschebahn.internal.timetable.TimetablesV1Impl.HttpCallable;
21 * Testmodule that contains the {@link TimetablesV1Api} and {@link TimetableStubHttpCallable}.
22 * Used in tests to check which http calls have been made.
24 * @author Sönke Küper - Initial contribution.
27 public final class TimetablesApiTestModule {
29 private final TimetablesV1Api api;
30 private final TimetableStubHttpCallable httpStub;
32 public TimetablesApiTestModule(TimetablesV1Api api, TimetableStubHttpCallable httpStub) {
34 this.httpStub = httpStub;
37 public TimetablesV1Api getApi() {
41 public void addAvailableUrl(String url) {
42 this.httpStub.addAvailableUrl(url);
45 public List<String> getRequestedPlanUrls() {
46 return httpStub.getRequestedPlanUrls();
49 public List<String> getRequestedFullChangesUrls() {
50 return httpStub.getRequestedFullChangesUrls();
53 public List<String> getRequestedRecentChangesUrls() {
54 return httpStub.getRequestedRecentChangesUrls();
57 public TimetablesV1ApiFactory getApiFactory() {
58 return (String clientId, String clientSecret, HttpCallable httpCallable) -> api;