SISIS extends OkHttpBaseApi implements OpacApi { <I extends AccountItem> void loadPages(List<I> media, Document doc, ParseAccountListFunction<I> func) throws IOException { HashSet<Integer> pagesLoaded = new HashSet<>(); pagesLoaded.add(1); loadPages(media, doc, pagesLoaded, func); }  List<SearchField> parseSearchFields(); @Override void start(); @Override void init(Library lib, HttpClientFactory httpClientFactory); @Override SearchRequestResult search(List<SearchQuery> query); SearchRequestResult volumeSearch(Map<String, String> query); @Override SearchRequestResult searchGetPage(int page); SearchRequestResult parse_search(String html, int page); @Override DetailedItem getResultById(String id, String homebranch); @Override DetailedItem getResult(int nr); @Override ReservationResult reservation(DetailedItem item, Account acc,
            int useraction, String selection); @Override ProlongResult prolong(String a, Account account, int useraction,
            String Selection); @Override CancelResult cancel(String media, Account account, int useraction,
            String selection); static void parse_medialist(List<LentItem> media, Document doc, int offset,
            JSONObject data); static void parse_reslist6(List<ReservedItem> reservations, Document doc, int offset,
            JSONObject data); static void parse_reslist7(List<ReservedItem> reservations, Document doc, int offset,
            JSONObject data); @Override String getPendingAccountFees(Account account); @Override AccountData account(Account acc); @Override String getShareUrl(String id, String title); @Override int getSupportFlags(); @Override ProlongAllResult prolongAll(Account account, int useraction,
            String selection); @Override SearchRequestResult filterResults(Filter filter, Option option); @Override void checkAccountData(Account account); @Override void setLanguage(String language); @Override Set<String> getSupportedLanguages();  }
@Test public void testLoadPages() throws IOException, OpacApi.OpacErrorException, JSONException { Account acc = new Account(); String basedir = "/sisis/medialist/erfurt_pages/Katalog StuRB Erfurt Seite "; String html = readResource(basedir + "1.html"); doNothing().when(sisis).start(); doReturn(true).when(sisis).login(acc); doAnswer(invocation -> { String accountBase = "https: String url = invocation.getArgumentAt(0, String.class); if (url.equals(accountBase + "methodToCall=showAccount&typ=1")) { return html; } else if (url .equals(accountBase + "methodToCall=pos&accountTyp=AUSLEIHEN&anzPos=11")) { return readResource(basedir + "2.html"); } else if (url .equals(accountBase + "methodToCall=pos&accountTyp=AUSLEIHEN&anzPos=21")) { return readResource(basedir + "3.html"); } else if (url .equals(accountBase + "methodToCall=pos&accountTyp=AUSLEIHEN&anzPos=31")) { return readResource(basedir + "4.html"); } else if (url .equals(accountBase + "methodToCall=pos&accountTyp=AUSLEIHEN&anzPos=41")) { return readResource(basedir + "5.html"); } else if (url.equals(accountBase + "methodToCall=showAccount&typ=6") || url.equals(accountBase + "methodToCall=showAccount&typ=7")) { return "<table class=\"data\"><tr><td>keine Daten</td></tr></table>"; } else { return null; } }).when(sisis).httpGet(anyString(), anyString()); AccountData data = sisis.account(acc); assertEquals(43, data.getLent().size()); }