@Test
public void canValidateOptions() throws IOException {

    final String content = UUID.randomUUID().toString();
    final File file = writeTemporaryFile(content);
    final ArchiveTransferManager atm = createMock(ArchiveTransferManager.class);
    final UploadArchiveCommand command = new UploadArchiveCommand(client, sqs, sns, atm);
    final OptionSet validOptions = optionParser.parse("--vault", "vaultName", "--upload", file.getAbsolutePath());
    assertTrue(command.valid(validOptions, optionParser));
    // omit the --upload option, which makes the command line invalid for this command
    final OptionSet invalidOptions = optionParser.parse("--vault", "vaultName");
    assertFalse(command.valid(invalidOptions, optionParser));
}