Bug 5947: additional tests for dom-broker and inmemory-datastore #4
[mdsal.git] / dom / mdsal-dom-inmemory-datastore / src / test / java / org / opendaylight / mdsal / dom / store / inmemory / InMemoryDOMDataStoreFactoryTest.java
index e2fc19d11ae80ed488e4ee2b925496997f539ab7..2cfae2198c3a296ba03732d1108cea7a492bd12e 100644 (file)
@@ -10,8 +10,10 @@ package org.opendaylight.mdsal.dom.store.inmemory;
 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;
 
@@ -45,6 +47,8 @@ public class InMemoryDOMDataStoreFactoryTest {
         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