@Test public void testUpdateSpecies() throws AWNoSuchEntityException, AWNonUniqueException { Species species = mSpeciesDao.getSpecies(SPECIES_ONE_ID); species.setName(SPECIES_ONE_NEW_NAME); species = mSpeciesDao.store(species); Assert.assertNotEquals(SPECIES_ONE_NAME, species.getName()); species.setName(SPECIES_ONE_NAME); mSpeciesDao.store(species); }
@Test public void testStoreValidSpecies() throws AWNonUniqueException { Species species = new Species(); species.setName(SPECIES_FOUR_NAME); species = mSpeciesDao.store(species); Assert.assertNotEquals(TestConstants.NON_PERSISTED_ID, species.getId()); deleteSpecies(species); }
@Test(expectedExceptions = {AWNonUniqueException.class}) public void testStoreNonUniqueSpecies() throws AWNonUniqueException { Species species = new Species(); species.setName(SPECIES_ONE_NAME); mSpeciesDao.store(species); }