@Test public void biographyAndImageUrlAreReturnedAsInfo() throws ApplicationException { deleteArtistInfos(); int abbaId = musicDao.getArtistId(aiAbba.getArtist()); dao.createArtistInfo(Arrays.asList(aiAbba)); ArtistInfo dbAbba = dao.getArtistInfo(abbaId); Assert.assertEquals(ABBA_IMAGE_URL, dbAbba.getLargeImageUrl()); Assert.assertEquals(ABBA_BIO_SUMMARY, dbAbba.getBioSummary()); }
@Test public void bioSummaryCanBeUpdated() { deleteArtistInfos(); int abbaId = musicDao.getArtistId(aiAbba.getArtist()); String biography = "new ABBA biography"; dao.createArtistInfo(Arrays.asList(aiAbba)); dao.setBioSummary(abbaId, biography); ArtistInfo dbAbba = dao.getArtistInfo(abbaId); Assert.assertEquals(biography, dbAbba.getBioSummary()); }
@Before public void loadFunctionDependency() throws ApplicationException { PostgreSQLUtil.loadFunction(dao, UPDATE_ARTISTINFO); aiAbba = new ArtistInfoParserImpl(new ResourceUtil(AI_ABBA_FILE).getInputStream()).getArtistInfo(); aiCher = new ArtistInfoParserImpl(new ResourceUtil(AI_CHER_FILE).getInputStream()).getArtistInfo(); aiTina = new ArtistInfoParserImpl(new ResourceUtil(AI_TINA_FILE).getInputStream()).getArtistInfo(); deleteArtists(); // re-create artists for (ArtistInfo ai : new ArtistInfo[] {aiAbba, aiCher, aiTina}) { musicDao.getArtistId(ai.getArtist()); } }