@Test public void testGetTitles() { ModsDefinition mods = ModsUtils.unmarshal(XML, ModsDefinition.class); TitleInfoMapper instance = new TitleInfoMapper(mods); List<String> titleResult = instance.getTitles(); List<String> subtitleResult = instance.getSubtitles(); List<String> alternativeResult = instance.getAlternativeTitles(); List<String> keyResult = instance.getKeyTitles(); List<String> titleExpected = Arrays.asList("MTITLE[1][0]"); List<String> subtitleExpected = Arrays.asList("STITLE[1][0]"); List<String> alternativeExpected = Arrays.asList("ATITLE[0][0]", "ATITLE[0][1]"); List<String> keyExpected = Arrays.asList("KTITLE[2][0]"); assertThat(titleResult, Is.is(titleExpected)); assertThat(subtitleResult, Is.is(subtitleExpected)); assertThat(alternativeResult, Is.is(alternativeExpected)); assertThat(keyResult, Is.is(keyExpected)); }
public List<String> getTitles() { searchNodes(); readValues(); return titles; }
TitleInfoMapper { public List<String> getTitles() { searchNodes(); readValues(); return titles; } }
TitleInfoMapper { public List<String> getTitles() { searchNodes(); readValues(); return titles; } TitleInfoMapper(ModsDefinition mods); }
TitleInfoMapper { public List<String> getTitles() { searchNodes(); readValues(); return titles; } TitleInfoMapper(ModsDefinition mods); void setTitles(List<String> newTitles, List<String> newSubtitles); void setKeyTitles(List<String> updates); void setAlternativeTitles(List<String> updates); List<String> getTitles(); List<String> getAlternativeTitles(); List<String> getKeyTitles(); List<String> getSubtitles(); }
TitleInfoMapper { public List<String> getTitles() { searchNodes(); readValues(); return titles; } TitleInfoMapper(ModsDefinition mods); void setTitles(List<String> newTitles, List<String> newSubtitles); void setKeyTitles(List<String> updates); void setAlternativeTitles(List<String> updates); List<String> getTitles(); List<String> getAlternativeTitles(); List<String> getKeyTitles(); List<String> getSubtitles();  }