// Path: client/src/test/java/com/github/e13mort/stf/console/BaseStfCommanderTest.java
// public class BaseStfCommanderTest {
//     protected static final String TEST_DEVICE_REMOTE = "127.0.0.1:15500";
//     @Mock
//     protected FarmClient farmClient;
//     @Mock
//     protected AdbRunner adbRunner;
//     @Mock
//     protected CommandContainer.Command helpCommand;
//     @Mock
//     protected DeviceListCache cache;
//     @Mock
//     protected ErrorHandler errorHandler;
//     @Mock
//     protected DeviceListCache.CacheTransaction cacheTransaction;
//     @Mock
//     private HelpCommandCreator helpCommandCreator;
//     @Mock
//     protected OutputStream outputStream;
//     @Mock
//     protected Logger logger;
//     @Mock
//     private Device myDevice;
// 
//     @BeforeEach
//     protected void setUp() throws IOException {
//         MockitoAnnotations.initMocks(this);
//         when(farmClient.getDevices(any(DevicesParams.class))).thenReturn(Flowable.empty());
//         when(farmClient.connectToDevices(any(DevicesParams.class))).thenReturn(Flowable.empty());
//         when(farmClient.disconnectFromAllDevices()).thenReturn(Flowable.empty());
//         when(helpCommand.execute()).thenReturn(Completable.complete());
//         when(helpCommandCreator.createHelpCommand(any(JCommander.class))).thenReturn(helpCommand);
//         when(farmClient.getMyDevices()).thenReturn(Flowable.fromArray(myDevice));
//         when(myDevice.getRemoteConnectUrl()).thenReturn(TEST_DEVICE_REMOTE);
//         when(cache.beginTransaction()).thenReturn(cacheTransaction);
//         when(cache.getCachedFiles()).thenReturn(Collections.emptyList());
//     }
// 
//     protected DevicesParams runDeviceParamsTest(DeviceParamsProducingCommand source, String params) throws IOException, UnknownCommandException {
//         ArgumentCaptor<DevicesParams> objectArgumentCaptor = ArgumentCaptor.forClass(DevicesParams.class);
//         createCommander(source.name().toLowerCase() + " " + params).execute();
//         if (source == DeviceParamsProducingCommand.DEVICES) {
//             verify(farmClient).getDevices(objectArgumentCaptor.capture());
//         } else {
//             verify(farmClient).connectToDevices(objectArgumentCaptor.capture());
//         }
//         return objectArgumentCaptor.getValue();
//     }
// 
//     protected Executable test(final DeviceParamsProducingCommand source, final String str) {
//         return () -> runDeviceParamsTest(source, str);
//     }
// 
//     protected StfCommander createCommander(String str) throws IOException {
//         return StfCommander.create(new StfCommanderContext(farmClient, adbRunner, cache, outputStream, logger), helpCommandCreator, errorHandler, str.split(" "));
//     }
// 
//     enum DeviceParamsProducingCommand {DEVICES, CONNECT}
// }


import com.github.e13mort.stf.client.parameters.DevicesParams;
import com.github.e13mort.stf.console.BaseStfCommanderTest;
import com.github.e13mort.stf.model.device.Device;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.mockito.ArgumentCaptor;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Stream;
import io.reactivex.Flowable;
import io.reactivex.Notification;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
package com.github.e13mort.stf.console.commands.connect;






@SuppressWarnings("unused")
@DisplayName("Detailed \"connect\" command cases")
// Path: client/src/test/java/com/github/e13mort/stf/console/BaseStfCommanderTest.java
// public class BaseStfCommanderTest {
//     protected static final String TEST_DEVICE_REMOTE = "127.0.0.1:15500";
//     @Mock
//     protected FarmClient farmClient;
//     @Mock
//     protected AdbRunner adbRunner;
//     @Mock
//     protected CommandContainer.Command helpCommand;
//     @Mock
//     protected DeviceListCache cache;
//     @Mock
//     protected ErrorHandler errorHandler;
//     @Mock
//     protected DeviceListCache.CacheTransaction cacheTransaction;
//     @Mock
//     private HelpCommandCreator helpCommandCreator;
//     @Mock
//     protected OutputStream outputStream;
//     @Mock
//     protected Logger logger;
//     @Mock
//     private Device myDevice;
// 
//     @BeforeEach
//     protected void setUp() throws IOException {
//         MockitoAnnotations.initMocks(this);
//         when(farmClient.getDevices(any(DevicesParams.class))).thenReturn(Flowable.empty());
//         when(farmClient.connectToDevices(any(DevicesParams.class))).thenReturn(Flowable.empty());
//         when(farmClient.disconnectFromAllDevices()).thenReturn(Flowable.empty());
//         when(helpCommand.execute()).thenReturn(Completable.complete());
//         when(helpCommandCreator.createHelpCommand(any(JCommander.class))).thenReturn(helpCommand);
//         when(farmClient.getMyDevices()).thenReturn(Flowable.fromArray(myDevice));
//         when(myDevice.getRemoteConnectUrl()).thenReturn(TEST_DEVICE_REMOTE);
//         when(cache.beginTransaction()).thenReturn(cacheTransaction);
//         when(cache.getCachedFiles()).thenReturn(Collections.emptyList());
//     }
// 
//     protected DevicesParams runDeviceParamsTest(DeviceParamsProducingCommand source, String params) throws IOException, UnknownCommandException {
//         ArgumentCaptor<DevicesParams> objectArgumentCaptor = ArgumentCaptor.forClass(DevicesParams.class);
//         createCommander(source.name().toLowerCase() + " " + params).execute();
//         if (source == DeviceParamsProducingCommand.DEVICES) {
//             verify(farmClient).getDevices(objectArgumentCaptor.capture());
//         } else {
//             verify(farmClient).connectToDevices(objectArgumentCaptor.capture());
//         }
//         return objectArgumentCaptor.getValue();
//     }
// 
//     protected Executable test(final DeviceParamsProducingCommand source, final String str) {
//         return () -> runDeviceParamsTest(source, str);
//     }
// 
//     protected StfCommander createCommander(String str) throws IOException {
//         return StfCommander.create(new StfCommanderContext(farmClient, adbRunner, cache, outputStream, logger), helpCommandCreator, errorHandler, str.split(" "));
//     }
// 
//     enum DeviceParamsProducingCommand {DEVICES, CONNECT}
// }


// Path: client/src/test/java/com/github/e13mort/stf/console/commands/connect/ConnectCommandTest.java
import com.github.e13mort.stf.client.parameters.DevicesParams;
import com.github.e13mort.stf.console.BaseStfCommanderTest;
import com.github.e13mort.stf.model.device.Device;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.mockito.ArgumentCaptor;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Stream;
import io.reactivex.Flowable;
import io.reactivex.Notification;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

package com.github.e13mort.stf.console.commands.connect;






@SuppressWarnings("unused")
@DisplayName("Detailed \"connect\" command cases")
class ConnectCommandTest extends BaseStfCommanderTest {