### Question:
OvsdbConnectionManager implements OvsdbConnectionListener, AutoCloseable { public void disconnect(final OvsdbNodeAugmentation ovsdbNode) throws UnknownHostException { LOG.info("Disconnecting from {}", SouthboundUtil.connectionInfoToString(ovsdbNode.getConnectionInfo())); OvsdbConnectionInstance client = getConnectionInstance(ovsdbNode.getConnectionInfo()); if (client != null) { deleteOperNodeAndReleaseOwnership(client); client.disconnect(); removeInstanceIdentifier(ovsdbNode.getConnectionInfo()); stopBridgeConfigReconciliationIfActive(client.getInstanceIdentifier()); } else { LOG.debug("disconnect : connection instance not found for {}",ovsdbNode.getConnectionInfo()); } } OvsdbConnectionManager(final DataBroker db,final TransactionInvoker txInvoker,
                                  final EntityOwnershipService entityOwnershipService,
                                  final OvsdbConnection ovsdbConnection,
                                  final InstanceIdentifierCodec instanceIdentifierCodec,
                                  final UpgradeState upgradeState); @Override void connected(final OvsdbClient externalClient); OvsdbConnectionInstance connectedButCallBacksNotRegistered(final OvsdbClient externalClient); @Override void disconnected(final OvsdbClient client); OvsdbClient connect(final InstanceIdentifier<Node> iid,
            final OvsdbNodeAugmentation ovsdbNode); void disconnect(final OvsdbNodeAugmentation ovsdbNode); @Override void close(); InstanceIdentifier<Node> getInstanceIdentifier(final ConnectionInfo key); OvsdbConnectionInstance getConnectionInstance(final ConnectionInfo key); OvsdbConnectionInstance getConnectionInstance(final OvsdbBridgeAttributes mn); OvsdbConnectionInstance getConnectionInstance(final Node node); OvsdbConnectionInstance getConnectionInstance(final InstanceIdentifier<Node> nodePath); OvsdbClient getClient(final ConnectionInfo connectionInfo); OvsdbClient getClient(final OvsdbBridgeAttributes mn); OvsdbClient getClient(final Node node); Boolean getHasDeviceOwnership(final ConnectionInfo connectionInfo); void reconcileConnection(final InstanceIdentifier<Node> iid, final OvsdbNodeAugmentation ovsdbNode); void stopConnectionReconciliationIfActive(final InstanceIdentifier<Node> iid,
            final OvsdbNodeAugmentation ovsdbNode); void stopBridgeConfigReconciliationIfActive(final InstanceIdentifier<Node> iid); void reconcileBridgeConfigurations(final OvsdbConnectionInstance client); Map<ConnectionInfo, OvsdbConnectionInstance> getClients();  }### Answer:
@Test public void testDisconnect() throws Exception { OvsdbNodeAugmentation ovsdbNode = mock(OvsdbNodeAugmentation.class); ConnectionInfo connectionInfo = mock(ConnectionInfo.class); when(ovsdbNode.getConnectionInfo()).thenReturn(connectionInfo); suppress(MemberMatcher.method(OvsdbConnectionManager.class, "getConnectionInstance", ConnectionInfo.class)); OvsdbConnectionInstance ovsdbConnectionInstance = mock(OvsdbConnectionInstance.class); when(ovsdbConnManager.getConnectionInstance(any(ConnectionInfo.class))).thenReturn(ovsdbConnectionInstance); when(ovsdbConnectionInstance.getInstanceIdentifier()).thenReturn(mock(InstanceIdentifier.class)); suppress(MemberMatcher.method(OvsdbConnectionManager.class, "removeInstanceIdentifier", ConnectionInfo.class)); suppress(MemberMatcher.method(OvsdbConnectionManager.class, "unregisterEntityForOwnership", OvsdbConnectionInstance.class)); ovsdbConnManager.disconnect(ovsdbNode); verify(ovsdbConnectionInstance).disconnect(); }