when(portalJdbcOperations.queryForList(
"SELECT USER_NAME FROM UP_USER WHERE USER_ID=?",
String.class,
1)).thenReturn(Collections.singletonList("FragmentName"));
this.execute(new CallableWithoutResult() {
@Override
protected void callWithoutResult() {
final AggregatedTabMapping tabMappings = aggregatedTabLookupDao.getMappedTabForLayoutId("u1l1s1");
assertNotNull(tabMappings);
assertEquals("FragmentName", tabMappings.getFragmentName());
assertEquals("TabName", tabMappings.getTabName());
}
});
this.execute(new CallableWithoutResult() {
@Override
protected void callWithoutResult() {
final AggregatedTabMapping tabMappings = aggregatedTabLookupDao.getMappedTabForLayoutId("u1l1s2");
assertNotNull(tabMappings);
assertEquals("FragmentName", tabMappings.getFragmentName());
assertEquals("u1l1s2", tabMappings.getTabName());
}
});
this.execute(new CallableWithoutResult() {
@Override
protected void callWithoutResult() {
final AggregatedTabMapping tabMappings = aggregatedTabLookupDao.getMappedTabForLayoutId(null);
assertNotNull(tabMappings);
assertEquals(AggregatedTabMapping.MISSING_TAB_FRAGMENT_NAME, tabMappings.getFragmentName());
assertEquals(AggregatedTabMapping.MISSING_TAB_NAME, tabMappings.getTabName());
}
});
this.execute(new CallableWithoutResult() {
@Override
protected void callWithoutResult() {
final AggregatedTabMapping tabMappings = aggregatedTabLookupDao.getMappedTabForLayoutId("s1");
assertNotNull(tabMappings);
assertEquals(AggregatedTabMapping.PERSONAL_TAB_FRAGMENT_NAME, tabMappings.getFragmentName());
assertEquals(AggregatedTabMapping.PERSONAL_TAB_NAME, tabMappings.getTabName());
}
});
this.execute(new CallableWithoutResult() {
@Override
protected void callWithoutResult() {
final AggregatedTabMapping tabMappings = aggregatedTabLookupDao.getMappedTabForLayoutId("u1l1s1");
assertNotNull(tabMappings);
assertEquals("FragmentName", tabMappings.getFragmentName());
assertEquals("TabName", tabMappings.getTabName());
}
});
this.execute(new CallableWithoutResult() {
@Override
protected void callWithoutResult() {
final AggregatedTabMapping tabMappings = aggregatedTabLookupDao.getMappedTabForLayoutId("u1l1s2");
assertNotNull(tabMappings);
assertEquals("FragmentName", tabMappings.getFragmentName());
assertEquals("u1l1s2", tabMappings.getTabName());
}
});
this.execute(new CallableWithoutResult() {
@Override
protected void callWithoutResult() {
final AggregatedTabMapping tabMappings = aggregatedTabLookupDao.getMappedTabForLayoutId(null);
assertNotNull(tabMappings);
assertEquals(AggregatedTabMapping.MISSING_TAB_FRAGMENT_NAME, tabMappings.getFragmentName());
assertEquals(AggregatedTabMapping.MISSING_TAB_NAME, tabMappings.getTabName());
}
});
this.execute(new CallableWithoutResult() {
@Override
protected void callWithoutResult() {
final AggregatedTabMapping tabMappings = aggregatedTabLookupDao.getMappedTabForLayoutId("s1");
assertNotNull(tabMappings);