### Question:
WikiPage extends WikiPageReference { public List<WikiTemplate> getInfoboxes() { return getTemplates("infobox", "geobox"); } WikiPage(int pageId, int namespaceId, String title, String text); String getMarkup(); String getCleanText(); List<String> getSections(); boolean isRedirect(); String getRedirectTitle(); List<String> getAlternativeTitles(); @Deprecated String getInfoboxMarkup(); @Deprecated String getInfoboxType(); List<WikiTemplate> getInfoboxes(); List<WikiTemplate> getTemplates(String... templateNames); List<String> getCategories(); boolean isDisambiguation(); List<WikiLink> getLinks(); @Override MarkupCoordinate getCoordinate(); @Override Set<String> getTags(); @Override String toString();  }### Answer:
@Test public void testGetInfoboxes() throws IOException { String markup = FileHelper.readFileToString(ResourceHelper .getResourceFile("/wikipedia/Dry_Fork_(Cheat_River).wikipedia")); WikiPage page = new WikiPage(0, 0, "Dry Fork (Cheat River)", markup); List<WikiTemplate> infoboxes = page.getInfoboxes(); assertEquals(1, infoboxes.size()); assertEquals("river", infoboxes.get(0).getName()); }
@Test public void testInfoboxExtraction() throws IOException { String markup = FileHelper.readFileToString(ResourceHelper.getResourceFile("/wikipedia/Dresden.wikipedia")); WikiPage page = new WikiPage(0, 0, "Dresden", markup); List<WikiTemplate> infoboxes = page.getInfoboxes(); assertEquals(1, infoboxes.size()); WikiTemplate infobox = CollectionHelper.getFirst(infoboxes); assertEquals(34, infobox.size()); assertEquals("Dresden", infobox.getEntry("Name")); assertEquals("City", infobox.getEntry("Art")); assertEquals("Dresden-Altstadt von der Marienbruecke-II.jpg", infobox.getEntry("image_photo")); assertEquals("300px", infobox.getEntry("imagesize")); assertEquals("", infobox.getEntry("image_caption")); assertEquals("1206", infobox.getEntry("year")); markup = FileHelper.readFileToString(ResourceHelper.getResourceFile("/wikipedia/Stack_Overflow.wikipedia")); page = new WikiPage(0, 0, "Stack Overflow", markup); infoboxes = page.getInfoboxes(); assertEquals(1, infoboxes.size()); infobox = CollectionHelper.getFirst(infoboxes); assertEquals(17, infobox.size()); assertEquals( "84 ({{as of|2013|02|15|alt=February 2013}})<ref name=\"alexa\">{{cite web|url= http: infobox.getEntry("alexa")); markup = FileHelper.readFileToString(ResourceHelper .getResourceFile("/wikipedia/Dry_Fork_(Cheat_River).wikipedia")); page = new WikiPage(0, 0, "Dry Fork (Cheat River)", markup); infoboxes = page.getInfoboxes(); assertEquals(1, infoboxes.size()); infobox = CollectionHelper.getFirst(infoboxes); assertEquals("river", infobox.getName()); assertEquals(70, infobox.size()); markup = FileHelper.readFileToString(ResourceHelper .getResourceFile("/wikipedia/Muskingum_University.wikipedia")); page = new WikiPage(0, 0, "Muskingum University", markup); infoboxes = page.getInfoboxes(); assertEquals(2, infoboxes.size()); }