@Test public void deleteItem_should_return_minus_one_if_unsuccessful() { Item item = new Item(1); String json = jsonHandler.itemToJSON(item); dbHandler.setDeleteResult(false); initProvider(); int result = provider.deleteItem(json); assertEquals(-1, result); }
@Test public void deleteItem_should_return_the_id_if_successful() { Item item = new Item(1); String json = jsonHandler.itemToJSON(item); dbHandler.setDeleteResult(true); initProvider(); int result = provider.deleteItem(json); assertEquals(item.getItemno(), result); }