IndexRepositoryImpl extends AbstractCRUDRepository<Index> implements IndexRepository { @Override public Index update(Index entity) { throw new UnsupportedOperationException("Updates are not supported on indices; create a new one and delete the old one if you would like this functionality."); } IndexRepositoryImpl(Session session); @Override boolean exists(Identifier identifier); @Override Index read(Identifier identifier); @Override Index create(Index entity); @Override void markActive(Index entity); @Override Index update(Index entity); @Override void delete(Identifier id); @Override void delete(Index entity); @Override List<Index> readAll(Identifier id); @Override List<Index> readAll(); @Override List<Index> readAllCached(Identifier id); @Override long countAll(Identifier id);  }
@Test public void testUpdate() { System.out.println("update"); IndexRepositoryImpl instance = new IndexRepositoryImpl(f.getSession()); boolean expectedExceptionThrown = false; try { Index result = instance.update(Fixtures.createTestIndexOneField()); } catch (UnsupportedOperationException e) { expectedExceptionThrown = true; } assertTrue(expectedExceptionThrown); }