RequestArchivesListCommand extends AbstractCommand { @Override public boolean valid(OptionSet options, GlacierUploaderOptionParser optionParser) { log.debug("Checking options for {}: {},", getClass(), options.specs()); return !StringUtils.isBlank(options.valueOf(optionParser.vault)) && options.has(optionParser.inventoryListing) && !options.hasArgument(optionParser.inventoryListing); } RequestArchivesListCommand(final AmazonGlacier client, final AmazonSQS sqs, final AmazonSNS sns); @Override void exec(OptionSet options, GlacierUploaderOptionParser optionParser); @Override boolean valid(OptionSet options, GlacierUploaderOptionParser optionParser);  }
@Test public void execWithBlankVault() { final OptionSet options = optionParser.parse("--list-jobs", UUID.randomUUID().toString()); final RequestArchivesListCommand command = new RequestArchivesListCommand(client, sqs, sns); assertFalse(command.valid(options, optionParser)); }