verify(bannerDao).saveOrUpdate(uploadedBanner);
}
@Test
public void existingBannerShouldBeSavedWithNewContent() {
Banner newBanner = new Banner(BannerPosition.TOP, "<html></html>");
Banner existingBanner = new Banner(BannerPosition.TOP, "<html>exists banner</html>");
when(bannerDao.getByPosition(BannerPosition.TOP)).thenReturn(existingBanner);
bannerService.uploadBanner(newBanner, new Component());
verify(bannerDao).saveOrUpdate(existingBanner);
assertEquals(existingBanner.getContent(), newBanner.getContent(), "Content of banner must be changed.");
}