Search in sources :

Example 1 with TaskPriority

use of org.aion.zero.impl.cli.Cli.TaskPriority in project aion by aionnetwork.

the class CliTest method testCheckArguments.

@Test
@Parameters(method = "parametersForArgumentCheck")
public void testCheckArguments(String[] input, TaskPriority expectedPriority, Set<String> expectedTasks) {
    Arguments options = new Arguments();
    CommandLine parser = new CommandLine(options);
    CommandLine.ParseResult result = parser.parseArgs(input);
    TaskPriority breakingTaskPriority = cli.getBreakingTaskPriority(options, result);
    assertEquals(expectedPriority, breakingTaskPriority);
    Set<String> skippedTasks = cli.getSkippedTasks(options, breakingTaskPriority, result);
    assertEquals(expectedTasks, skippedTasks);
}
Also used : CommandLine(picocli.CommandLine) ParseResult(picocli.CommandLine.ParseResult) TaskPriority(org.aion.zero.impl.cli.Cli.TaskPriority) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Parameters(junitparams.Parameters) Test(org.junit.Test)

Aggregations

Parameters (junitparams.Parameters)1 TaskPriority (org.aion.zero.impl.cli.Cli.TaskPriority)1 Test (org.junit.Test)1 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)1 CommandLine (picocli.CommandLine)1 ParseResult (picocli.CommandLine.ParseResult)1