use of org.craftercms.commons.converters.Converter in project engine by craftercms.
the class NavTreeBuilderImplTest method getItemConverter.
private Converter<SiteItem, NavItem> getItemConverter() {
Converter<SiteItem, NavItem> converter = mock(Converter.class);
doAnswer((Answer<NavItem>) invocation -> {
SiteItem siteItem = (SiteItem) invocation.getArguments()[0];
NavItem navItem = new NavItem();
navItem.setLabel(siteItem.getStoreName());
navItem.setUrl(siteItem.getStoreUrl());
return navItem;
}).when(converter).convert(any(SiteItem.class));
return converter;
}
Aggregations