use of org.ambraproject.wombat.config.site.url.SiteRequestScheme in project wombat by PLOS.
the class TestTheme method testResolveForeignJournalKey.
@Test
public void testResolveForeignJournalKey() throws Exception {
SiteRequestScheme dummyScheme = SiteRequestScheme.builder().build();
Theme homeTheme = new StubTheme("homeTheme", "homeJournal") {
@Override
protected Map<String, Object> getJournalConfigMap() {
Map<String, Object> map = super.getJournalConfigMap();
if (useJournalKeyMap) {
ImmutableMap<String, String> otherJournals = ImmutableMap.of("targetJournal", "targetSite");
map.put("otherJournals", otherJournals);
}
return map;
}
};
Site homeSite = new Site("homeSite", homeTheme, dummyScheme, "");
Theme targetTheme = new StubTheme("targetTheme", "targetJournal");
Site targetSite = new Site("targetSite", targetTheme, dummyScheme, "");
SiteSet siteSet = new SiteSet(ImmutableList.of(homeSite, targetSite));
Site resolved = homeTheme.resolveForeignJournalKey(siteSet, "targetJournal");
assertEquals(targetSite, resolved);
}
Aggregations