diff options
author | Valerij Fredriksen <valerijf@oath.com> | 2018-10-24 14:41:06 +0200 |
---|---|---|
committer | Valerij Fredriksen <valerijf@oath.com> | 2018-10-24 14:41:06 +0200 |
commit | ee769a79f75daaa2bb867ad66c492aa161df31b3 (patch) | |
tree | b3bbecd88956a397a155fb896ad2668a590b8f07 /node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/maintenance/acl | |
parent | 102e3802289225bcaace9e8aee781c372796f1c5 (diff) |
Use latest mockito
Diffstat (limited to 'node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/maintenance/acl')
2 files changed, 14 insertions, 15 deletions
diff --git a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/maintenance/acl/AclMaintainerTest.java b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/maintenance/acl/AclMaintainerTest.java index a270585bcaa..07d3fab9534 100644 --- a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/maintenance/acl/AclMaintainerTest.java +++ b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/maintenance/acl/AclMaintainerTest.java @@ -20,9 +20,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.anyVararg; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; @@ -59,8 +58,8 @@ public class AclMaintainerTest { aclMaintainer.converge(); - verify(dockerOperations, times(1)).executeCommandInNetworkNamespace(eq(container.name), eq("iptables-restore"), anyVararg()); //we don;t have a ip4 address for the container so no redirect either - verify(dockerOperations, times(2)).executeCommandInNetworkNamespace(eq(container.name), eq("ip6tables-restore"), anyVararg()); + verify(dockerOperations, times(1)).executeCommandInNetworkNamespace(eq(container.name), eq("iptables-restore"), any()); //we don;t have a ip4 address for the container so no redirect either + verify(dockerOperations, times(2)).executeCommandInNetworkNamespace(eq(container.name), eq("ip6tables-restore"), any()); } @Test @@ -77,8 +76,8 @@ public class AclMaintainerTest { aclMaintainer.converge(); - verify(dockerOperations, times(1)).executeCommandInNetworkNamespace(eq(container.name), eq("iptables-restore"), anyVararg()); //we don;t have a ip4 address for the container so no redirect either - verify(dockerOperations, times(2)).executeCommandInNetworkNamespace(eq(container.name), eq("ip6tables-restore"), anyVararg()); + verify(dockerOperations, times(1)).executeCommandInNetworkNamespace(eq(container.name), eq("iptables-restore"), any()); //we don;t have a ip4 address for the container so no redirect either + verify(dockerOperations, times(2)).executeCommandInNetworkNamespace(eq(container.name), eq("ip6tables-restore"), any()); } @Test @@ -90,7 +89,7 @@ public class AclMaintainerTest { aclMaintainer.converge(); - verify(dockerOperations, never()).executeCommandInNetworkNamespace(eq(container.name), anyVararg()); + verify(dockerOperations, never()).executeCommandInNetworkNamespace(eq(container.name), any()); } @Test @@ -123,8 +122,8 @@ public class AclMaintainerTest { aclMaintainer.converge(); - verify(dockerOperations, times(1)).executeCommandInNetworkNamespace(eq(container.name), eq("iptables-restore"), anyVararg()); - verify(dockerOperations, never()).executeCommandInNetworkNamespace(eq(container.name), eq("ip6tables-restore"), anyVararg()); + verify(dockerOperations, times(1)).executeCommandInNetworkNamespace(eq(container.name), eq("iptables-restore"), any()); + verify(dockerOperations, never()).executeCommandInNetworkNamespace(eq(container.name), eq("ip6tables-restore"), any()); } @Test @@ -166,8 +165,8 @@ public class AclMaintainerTest { aclMaintainer.converge(); - verify(dockerOperations, never()).executeCommandInNetworkNamespace(any(), eq("ip6tables-restore"), anyVararg()); - verify(dockerOperations, never()).executeCommandInNetworkNamespace(any(), eq("iptables-restore"), anyVararg()); + verify(dockerOperations, never()).executeCommandInNetworkNamespace(any(), eq("ip6tables-restore"), any()); + verify(dockerOperations, never()).executeCommandInNetworkNamespace(any(), eq("iptables-restore"), any()); } @@ -189,11 +188,11 @@ public class AclMaintainerTest { when(dockerOperations.executeCommandInNetworkNamespace( eq(container.name), - eq("ip6tables-restore"), anyVararg())).thenThrow(new RuntimeException("iptables restore failed")); + eq("ip6tables-restore"), any())).thenThrow(new RuntimeException("iptables restore failed")); when(dockerOperations.executeCommandInNetworkNamespace( eq(container.name), - eq("iptables-restore"), anyVararg())).thenThrow(new RuntimeException("iptables restore failed")); + eq("iptables-restore"), any())).thenThrow(new RuntimeException("iptables restore failed")); aclMaintainer.converge(); diff --git a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/maintenance/acl/IPTablesEditorTest.java b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/maintenance/acl/IPTablesEditorTest.java index 5496adf3e69..1b39014a9c6 100644 --- a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/maintenance/acl/IPTablesEditorTest.java +++ b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/maintenance/acl/IPTablesEditorTest.java @@ -9,7 +9,7 @@ import com.yahoo.vespa.hosted.node.admin.task.util.network.IPVersion; import org.junit.Assert; import org.junit.Test; -import static org.mockito.Matchers.eq; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; |