Exemplo pratico de Java (UnitTest)#Java@Test public void testaItemSalvo() { Repositorio repositorio = new RepositorioItem(); Item item = new Item("Item A", 100, ...); assertThrows(repositorio.salvar(item), Exception.class) ; }