@Test(expected = IllegalArgumentException.class) public void clean_and_insert_operation_should_throw_an_exception_is_no_data_available() { CleanInsertLoadStrategyOperation cleanInsertLoadStrategyOperation = new CleanInsertLoadStrategyOperation(databaseOperation); String[] contents = new String[] {}; cleanInsertLoadStrategyOperation.executeScripts(contents); }
@Test public void clean_and_insert_operations_should_be_executed() { CleanInsertLoadStrategyOperation cleanInsertLoadStrategyOperation = new CleanInsertLoadStrategyOperation(databaseOperation); String[] contents = new String[] {"My name is", "Jimmy Pop"}; cleanInsertLoadStrategyOperation.executeScripts(contents); verify(databaseOperation, times(1)).deleteAll(); verify(databaseOperation, times(2)).insert(anyString()); }