import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.atLeast;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
doNothing().when(autoCloseable).close();
inMemoryDOMDataStore.setCloseable(autoCloseable);
inMemoryDOMDataStore.close();
- verify(autoCloseable).close();
+ doThrow(UnsupportedOperationException.class).when(autoCloseable).close();
+ inMemoryDOMDataStore.close();
+ verify(autoCloseable, atLeast(2)).close();
}
}
\ No newline at end of file