use of picocli.CommandLine.MutuallyExclusiveArgsException in project neo4j by neo4j.
the class CheckConsistencyCommandIT method databaseAndBackupAreMutuallyExclusive.
@Test
void databaseAndBackupAreMutuallyExclusive() throws Exception {
ConsistencyCheckService consistencyCheckService = mock(ConsistencyCheckService.class);
CheckConsistencyCommand checkConsistencyCommand = new CheckConsistencyCommand(new ExecutionContext(homeDir, confPath), consistencyCheckService);
when(consistencyCheckService.runFullConsistencyCheck(any(), any(), any(), any(), any(), anyBoolean(), any(ConsistencyFlags.class))).thenReturn(ConsistencyCheckService.Result.success(null, null));
MutuallyExclusiveArgsException incorrectUsage = assertThrows(MutuallyExclusiveArgsException.class, () -> {
CommandLine.populateCommand(checkConsistencyCommand, "--database=foo", "--backup=bar");
checkConsistencyCommand.execute();
});
assertThat(incorrectUsage.getMessage()).contains("--database=<database>, --backup=<path> are mutually exclusive (specify only one)");
}
Aggregations