summaryrefslogtreecommitdiffstats
path: root/infra/cfg-init
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2016-10-28 13:12:19 +0200
committerMarek Gradzki <mgradzki@cisco.com>2016-11-01 20:59:57 +0100
commitb8f86e7069a67031514c43caf8022e8553159fa7 (patch)
treed112017e36341e114fea4cdefdc5b2a8a90b2030 /infra/cfg-init
parent80804f713cdd8d3c30c7e2dd19cbc2a61a1a70c0 (diff)
HONEYCOMB-272: bump mockito version to 2.2.9
ArgumentMatchers.any() does not match null anymore, so some of the tests has been updated. Change-Id: I5de0fdfe87fc8e5c8ce24bfae8daeaba032195ff Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'infra/cfg-init')
-rw-r--r--infra/cfg-init/src/test/java/io/fd/honeycomb/data/init/RestoringInitializerTest.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/infra/cfg-init/src/test/java/io/fd/honeycomb/data/init/RestoringInitializerTest.java b/infra/cfg-init/src/test/java/io/fd/honeycomb/data/init/RestoringInitializerTest.java
index e4f1639..85ecc6c 100644
--- a/infra/cfg-init/src/test/java/io/fd/honeycomb/data/init/RestoringInitializerTest.java
+++ b/infra/cfg-init/src/test/java/io/fd/honeycomb/data/init/RestoringInitializerTest.java
@@ -16,7 +16,6 @@
package io.fd.honeycomb.data.init;
-import static org.mockito.Matchers.any;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
@@ -46,6 +45,8 @@ public class RestoringInitializerTest {
@Mock
private SchemaService schemaService;
@Mock
+ private SchemaContext schemaContext;
+ @Mock
private DOMDataBroker dataTree;
@Mock
private RestoringInitializer.JsonReader jsonReader;
@@ -61,7 +62,8 @@ public class RestoringInitializerTest {
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
path = Files.createTempFile("hc", "restoretest");
- when(jsonReader.readData(any(SchemaContext.class), any(Path.class))).thenReturn(data);
+ when(schemaService.getGlobalContext()).thenReturn(schemaContext);
+ when(jsonReader.readData(schemaContext, path)).thenReturn(data);
when(dataTree.newWriteOnlyTransaction()).thenReturn(writeTx);
when(writeTx.submit()).thenReturn(Futures.immediateCheckedFuture(null));
when(data.getValue()).thenReturn(Collections.singleton(data));
@@ -86,7 +88,7 @@ public class RestoringInitializerTest {
init.initialize();
verify(schemaService).getGlobalContext();
- verify(jsonReader).readData(any(SchemaContext.class), any(Path.class));
+ verify(jsonReader).readData(schemaContext, path);
verify(dataTree).newWriteOnlyTransaction();
verify(writeTx).put(LogicalDatastoreType.OPERATIONAL, YangInstanceIdentifier.create(nodeId), data);
@@ -118,7 +120,7 @@ public class RestoringInitializerTest {
@Test(expected = DataTreeInitializer.InitializeException.class)
public void testFail() throws Exception {
- when(jsonReader.readData(any(SchemaContext.class), any(Path.class))).thenThrow(new IOException("t"));
+ when(jsonReader.readData(schemaContext, path)).thenThrow(new IOException("t"));
final RestoringInitializer init =
new RestoringInitializer(schemaService, path, dataTree,