ConfigurationServiceImpl implements ConfigurationService { @NonAuditable @Transactional public ImageLogo getExcelLogo() { ImageLogo logo = getPersistedLogo("excelHeader"); if (logo == null) { LOGGER.debug("No logo found in database, using default logo."); logo = getDefaultExcelLogo(); } return logo; }  @Transactional @Auditable(actionType = AuditActionType.UPDATE) void persistExcelLogo(ImageLogo logo); @NonAuditable @Transactional ImageLogo getExcelLogo(); @Transactional @NonAuditable EhourConfigStub getConfiguration(); @Override List<Configuration> findAllConfiguration(); @Transactional @Auditable(actionType = AuditActionType.UPDATE) void persistConfiguration(EhourConfig config); void setConfigDao(ConfigurationDao configDao); void setBinConfigDAO(BinaryConfigurationDao binaryConfigDAO); void setTranslationDiscovery(TranslationDiscovery translationDiscovery);  }
@Test public void shouldReturnDefaultExcelLogo() { when(binaryConfigDao.findById("excelHeaderLogo")).thenReturn(null); ImageLogo logo = configurationService.getExcelLogo(); assertTrue(logo.getImageData().length > 1); }
@Test public void shouldGetDefaultLogo() { ImageLogo logo = configurationService.getExcelLogo(); assertNotNull(logo); assertTrue(logo.getImageData().length > 2); }