// Path: spydra/src/test/java/com/spotify/spydra/CliTestHelpers.java
// public class CliTestHelpers {
//   public static <T> void ensureAllThrow(CliParser<T> parser, List<String[]> argsList, Class exceptionCls) {
//     for (String[] args : argsList) {
//       String errorMsg = "Should throw for: " + String.join(";", args);
//       assertTrue(errorMsg, checkThrows(parser, args, exceptionCls));
//     }
//   }
// 
//   public static <T> boolean checkThrows(CliParser<T> parser, String[] args, Class exceptionCls) {
//     boolean threw = false;
// 
//     try {
//       parser.parse(args);
//     } catch (Exception e) {
//       if (exceptionCls.isInstance(e)) {
//         threw = true;
//       }
//     }
//     return threw;
//   }
// 
//   public static String toStrOpt(String optionName, String optionValue) {
//     return String.format("--%s=%s", optionName, optionValue);
//   }
// }
// 
// Path: spydra/src/main/java/com/spotify/spydra/historytools/commands/DumpHistoryCommand.java
// @AutoValue
// public abstract class DumpHistoryCommand {
// 
//   DumpHistoryCommand() {
//   }
// 
//   public abstract String clientId();
// 
//   public abstract ApplicationId applicationId();
// 
//   public abstract String logBucket();
// 
//   public static Builder builder() {
//     return new AutoValue_DumpHistoryCommand.Builder();
//   }
// 
//   @AutoValue.Builder
//   public abstract static class Builder {
//     public abstract Builder clientId(String clientId);
// 
//     public abstract Builder applicationId(ApplicationId jobId);
// 
//     public abstract Builder logBucket(String logBucket);
// 
//     public abstract DumpHistoryCommand build();
//   }
// }
// 
// Path: spydra/src/main/java/com/spotify/spydra/submitter/runner/CliConsts.java
// public class CliConsts {
//   public static final String SUBMIT_CMD_NAME = "submit";
//   public static final String LOGS_CMD_NAME = "dump-logs";
//   public static final String DUMP_HISTORY_CMD_NAME = "dump-history";
//   public static final String RUN_JHS_CMD_NAME = "run-jhs";
//   public static final String JOB_ID_OPTION_NAME = "application";
//   public static final String CLIENT_ID_OPTION_NAME = "clientid";
//   public static final String JAR_OPTION_NAME = "jar";
//   public static final String JARS_OPTION_NAME = "jars";
//   public static final String SPYDRA_JSON_OPTION_NAME = "spydra-json";
//   public static final String USERNAME_OPTION_NAME = "username";
//   public static final String LOG_BUCKET_OPTION_NAME = "log-bucket";
//   public static final String JOBNAME_OPTION_NAME = "job-name";
// }
// 
// Path: spydra/src/main/java/com/spotify/spydra/submitter/runner/CliParser.java
// public interface CliParser<T> {
// 
//   T parse(String[] args) throws IOException;
// 
//   /**
//    * Prints help for the subcommand this parser is responsible for.
//    */
//   void printHelp();
// 
//   boolean enoughArgs(String[] args);
// 
//   class ParsingException extends RuntimeException {
//     public ParsingException(Throwable cause) {
//       super(cause);
//     }
//   }
// }


import static org.junit.Assert.assertEquals;
import com.spotify.spydra.CliTestHelpers;
import com.spotify.spydra.historytools.commands.DumpHistoryCommand;
import com.spotify.spydra.submitter.runner.CliConsts;
import com.spotify.spydra.submitter.runner.CliParser;
import java.util.Arrays;
import java.util.List;
import org.junit.Test;
/*-
 * -\-\-
 * Spydra
 * --
 * Copyright (C) 2016 - 2018 Spotify AB
 * --
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * -/-/-
 */

package com.spotify.spydra.historytools;



public class DumpHistoryCliParserTest {

  private static final DumpHistoryCliParser PARSER = new DumpHistoryCliParser();
  private static final String DUMMY_APP_ID = "application_1345678910111_123456";
  private static final String DUMMY_CLIENT_ID = "pretty-client-2342";
  private static final String DUMMY_BUCKET = "bucket";

  @Test
  public void testParse() {
    DumpHistoryCommand dumpCmd = PARSER.parse(new String[]{
// Path: spydra/src/test/java/com/spotify/spydra/CliTestHelpers.java
// public class CliTestHelpers {
//   public static <T> void ensureAllThrow(CliParser<T> parser, List<String[]> argsList, Class exceptionCls) {
//     for (String[] args : argsList) {
//       String errorMsg = "Should throw for: " + String.join(";", args);
//       assertTrue(errorMsg, checkThrows(parser, args, exceptionCls));
//     }
//   }
// 
//   public static <T> boolean checkThrows(CliParser<T> parser, String[] args, Class exceptionCls) {
//     boolean threw = false;
// 
//     try {
//       parser.parse(args);
//     } catch (Exception e) {
//       if (exceptionCls.isInstance(e)) {
//         threw = true;
//       }
//     }
//     return threw;
//   }
// 
//   public static String toStrOpt(String optionName, String optionValue) {
//     return String.format("--%s=%s", optionName, optionValue);
//   }
// }
// 
// Path: spydra/src/main/java/com/spotify/spydra/historytools/commands/DumpHistoryCommand.java
// @AutoValue
// public abstract class DumpHistoryCommand {
// 
//   DumpHistoryCommand() {
//   }
// 
//   public abstract String clientId();
// 
//   public abstract ApplicationId applicationId();
// 
//   public abstract String logBucket();
// 
//   public static Builder builder() {
//     return new AutoValue_DumpHistoryCommand.Builder();
//   }
// 
//   @AutoValue.Builder
//   public abstract static class Builder {
//     public abstract Builder clientId(String clientId);
// 
//     public abstract Builder applicationId(ApplicationId jobId);
// 
//     public abstract Builder logBucket(String logBucket);
// 
//     public abstract DumpHistoryCommand build();
//   }
// }
// 
// Path: spydra/src/main/java/com/spotify/spydra/submitter/runner/CliConsts.java
// public class CliConsts {
//   public static final String SUBMIT_CMD_NAME = "submit";
//   public static final String LOGS_CMD_NAME = "dump-logs";
//   public static final String DUMP_HISTORY_CMD_NAME = "dump-history";
//   public static final String RUN_JHS_CMD_NAME = "run-jhs";
//   public static final String JOB_ID_OPTION_NAME = "application";
//   public static final String CLIENT_ID_OPTION_NAME = "clientid";
//   public static final String JAR_OPTION_NAME = "jar";
//   public static final String JARS_OPTION_NAME = "jars";
//   public static final String SPYDRA_JSON_OPTION_NAME = "spydra-json";
//   public static final String USERNAME_OPTION_NAME = "username";
//   public static final String LOG_BUCKET_OPTION_NAME = "log-bucket";
//   public static final String JOBNAME_OPTION_NAME = "job-name";
// }
// 
// Path: spydra/src/main/java/com/spotify/spydra/submitter/runner/CliParser.java
// public interface CliParser<T> {
// 
//   T parse(String[] args) throws IOException;
// 
//   /**
//    * Prints help for the subcommand this parser is responsible for.
//    */
//   void printHelp();
// 
//   boolean enoughArgs(String[] args);
// 
//   class ParsingException extends RuntimeException {
//     public ParsingException(Throwable cause) {
//       super(cause);
//     }
//   }
// }


// Path: spydra/src/test/java/com/spotify/spydra/historytools/DumpHistoryCliParserTest.java
import static org.junit.Assert.assertEquals;
import com.spotify.spydra.CliTestHelpers;
import com.spotify.spydra.historytools.commands.DumpHistoryCommand;
import com.spotify.spydra.submitter.runner.CliConsts;
import com.spotify.spydra.submitter.runner.CliParser;
import java.util.Arrays;
import java.util.List;
import org.junit.Test;

/*-
 * -\-\-
 * Spydra
 * --
 * Copyright (C) 2016 - 2018 Spotify AB
 * --
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * -/-/-
 */

package com.spotify.spydra.historytools;



public class DumpHistoryCliParserTest {

  private static final DumpHistoryCliParser PARSER = new DumpHistoryCliParser();
  private static final String DUMMY_APP_ID = "application_1345678910111_123456";
  private static final String DUMMY_CLIENT_ID = "pretty-client-2342";
  private static final String DUMMY_BUCKET = "bucket";

  @Test
  public void testParse() {
    DumpHistoryCommand dumpCmd = PARSER.parse(new String[]{
        CliTestHelpers.toStrOpt(CliConsts.JOB_ID_OPTION_NAME, DUMMY_APP_ID),