- ovsdbConnectionManager = PowerMockito.mock(OvsdbConnectionManager.class, Mockito.CALLS_REAL_METHODS);
- MemberModifier.field(OvsdbConnectionManager.class, "db").set(ovsdbConnectionManager, db);
- MemberModifier.field(OvsdbConnectionManager.class, "txInvoker").set(ovsdbConnectionManager, txInvoker);
+ ovsdbConnManager = PowerMockito.mock(OvsdbConnectionManager.class, Mockito.CALLS_REAL_METHODS);
+ field(OvsdbConnectionManager.class, "db").set(ovsdbConnManager, db);
+ field(OvsdbConnectionManager.class, "txInvoker").set(ovsdbConnManager, txInvoker);
+ field(OvsdbConnectionManager.class, "entityOwnershipService").set(ovsdbConnManager, entityOwnershipService);
+ field(OvsdbConnectionManager.class, "reconciliationManager").set(ovsdbConnManager, reconciliationManager);
+ field(OvsdbConnectionManager.class, "ovsdbConnection").set(ovsdbConnManager, ovsdbConnection);
+ entityConnectionMap = new ConcurrentHashMap<>();
+
+ externalClient = mock(OvsdbClient.class, Mockito.RETURNS_DEEP_STUBS);
+ when(externalClient.getConnectionInfo().getRemoteAddress()).thenReturn(mock(InetAddress.class));
+ when(externalClient.getConnectionInfo().getRemotePort()).thenReturn(8080);
+ when(externalClient.getConnectionInfo().getLocalAddress()).thenReturn(mock(InetAddress.class));
+ when(externalClient.getConnectionInfo().getLocalPort()).thenReturn(8080);
+ List<String> databases = Collections.singletonList("Open_vSwitch");
+ when(externalClient.getDatabases().get(1000, TimeUnit.MILLISECONDS)).thenReturn(databases);
+
+ PowerMockito.mockStatic(SouthboundUtil.class);
+ when(SouthboundUtil.connectionInfoToString(any(ConnectionInfo.class))).thenReturn("192.18.120.31:8080");