// Path: client/src/main/java/com/github/e13mort/stf/console/commands/UnknownCommandException.java
// public class UnknownCommandException extends Exception {
//     public UnknownCommandException(String message) {
//         super(message);
//     }
// }


import com.beust.jcommander.ParameterException;
import com.github.e13mort.stf.adapter.filters.StringsFilterDescription;
import com.github.e13mort.stf.client.parameters.DevicesParams;
import com.github.e13mort.stf.console.commands.UnknownCommandException;
import io.reactivex.Flowable;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource;
import java.io.IOException;
import java.util.Arrays;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertLinesMatch;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
    @EnumSource(DeviceParamsProducingCommand.class)
    void testVoidNameThrowsAnException(DeviceParamsProducingCommand source) {
        assertThrows(Exception.class, test(source, "-n"));
    }

    @DisplayName("Call app without any param will execute the help command")
    @Test
    void testEmptyCommandParamsWillExecuteHelp() throws Exception {
        createCommander("").execute();
        verify(helpCommand).execute();
    }

    @DisplayName("Call app without any param will execute the help command")
    @Test
    void test() throws Exception {
        createCommander("unknown").execute();
        verify(helpCommand).execute();
    }

    @DisplayName("Provider = p1 is parsed in command")
    @ParameterizedTest(name = "Command is {0}")
    @EnumSource(DeviceParamsProducingCommand.class)
    void testProviderDescriptionNotNullWithParameter(DeviceParamsProducingCommand source) throws Exception {
        DevicesParams params = runDeviceParamsTest(source, "-provider p1");
        assertNotNull(params.getProviderFilterDescription());
    }

    @DisplayName("Serial = serial1,serial2 is parsed in command")
    @ParameterizedTest(name = "Command is {0}")
    @EnumSource(DeviceParamsProducingCommand.class)
// Path: client/src/main/java/com/github/e13mort/stf/console/commands/UnknownCommandException.java
// public class UnknownCommandException extends Exception {
//     public UnknownCommandException(String message) {
//         super(message);
//     }
// }


// Path: client/src/test/java/com/github/e13mort/stf/console/StfCommanderTest.java
import com.beust.jcommander.ParameterException;
import com.github.e13mort.stf.adapter.filters.StringsFilterDescription;
import com.github.e13mort.stf.client.parameters.DevicesParams;
import com.github.e13mort.stf.console.commands.UnknownCommandException;
import io.reactivex.Flowable;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource;
import java.io.IOException;
import java.util.Arrays;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertLinesMatch;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

    @EnumSource(DeviceParamsProducingCommand.class)
    void testVoidNameThrowsAnException(DeviceParamsProducingCommand source) {
        assertThrows(Exception.class, test(source, "-n"));
    }

    @DisplayName("Call app without any param will execute the help command")
    @Test
    void testEmptyCommandParamsWillExecuteHelp() throws Exception {
        createCommander("").execute();
        verify(helpCommand).execute();
    }

    @DisplayName("Call app without any param will execute the help command")
    @Test
    void test() throws Exception {
        createCommander("unknown").execute();
        verify(helpCommand).execute();
    }

    @DisplayName("Provider = p1 is parsed in command")
    @ParameterizedTest(name = "Command is {0}")
    @EnumSource(DeviceParamsProducingCommand.class)
    void testProviderDescriptionNotNullWithParameter(DeviceParamsProducingCommand source) throws Exception {
        DevicesParams params = runDeviceParamsTest(source, "-provider p1");
        assertNotNull(params.getProviderFilterDescription());
    }

    @DisplayName("Serial = serial1,serial2 is parsed in command")
    @ParameterizedTest(name = "Command is {0}")
    @EnumSource(DeviceParamsProducingCommand.class)
    void testSerialNumberDescriptionNotNullWithParameter(DeviceParamsProducingCommand source) throws IOException, UnknownCommandException {