@Test
  public void test() {
    System.out.println("---------Erstelle Job");
    HBCIJob job = handler.newJob("DauerSEPAList");

    int source_acc_idx = Integer.parseInt(params.getProperty("source_account_idx"));
    job.setParam("src", passport.getAccounts()[source_acc_idx]);

    System.out.println("---------Für Job zur Queue");
    job.addToQueue();

    HBCIExecStatus ret = handler.execute();
    HBCIJobResult res = job.getJobResult();
    System.out.println("----------Result: " + res.toString());

    Assert.assertEquals("Job Result ist nicht OK!", true, res.isOK());
  }
  /**
   * Uebernimmt die Challenge-Parameter in den HKTAN-Geschaeftsvorfall.
   *
   * @param task der Job, zu dem die Challenge-Parameter ermittelt werden sollen.
   * @param hktan der HKTAN-Geschaeftsvorfall, in dem die Parameter gesetzt werden sollen.
   * @param secmech die BPD-Informationen zum TAN-Verfahren.
   */
  public void applyParams(HBCIJobImpl task, HBCIJob hktan, Properties secmech) {
    String code = task.getHBCICode(); // Code des Geschaeftsvorfalls

    // Job-Parameter holen
    Job job = this.getData(code);

    // Den Geschaeftsvorfall kennen wir nicht. Dann brauchen wir
    // auch keine Challenge-Parameter setzen
    if (job == null) {
      HBCIUtils.log(
          "have no challenge data for " + code + ", will not apply challenge params",
          HBCIUtils.LOG_INFO);
      return;
    }

    HHDVersion version = HHDVersion.find(secmech);
    HBCIUtils.log("using hhd version " + version, HBCIUtils.LOG_DEBUG2);

    // Parameter fuer die passende HHD-Version holen
    HhdVersion hhd = job.getVersion(version.getChallengeVersion());

    // Wir haben keine Parameter fuer diese HHD-Version
    if (hhd == null) {
      HBCIUtils.log(
          "have no challenge data for "
              + code
              + " in "
              + version
              + ", will not apply challenge params",
          HBCIUtils.LOG_INFO);
      return;
    }

    // Schritt 1: Challenge-Klasse uebernehmen
    String klass = hhd.getKlass();
    HBCIUtils.log("using challenge klass " + klass, HBCIUtils.LOG_DEBUG2);
    hktan.setParam("challengeklass", klass);

    // Schritt 2: Challenge-Parameter uebernehmen
    List<Param> params = hhd.getParams();
    for (int i = 0; i < params.size(); ++i) {
      int num = i + 1; // Die Job-Parameter beginnen bei 1
      Param param = params.get(i);

      // Checken, ob der Parameter angewendet werden soll.
      if (!param.isComplied(secmech)) {
        HBCIUtils.log(
            "skipping challenge parameter "
                + num
                + " ("
                + param.path
                + "), condition "
                + param.conditionName
                + "="
                + param.conditionValue
                + " not complied",
            HBCIUtils.LOG_DEBUG2);
        continue;
      }

      // Parameter uebernehmen. Aber nur wenn er auch einen Wert hat.
      // Seit HHD 1.4 duerfen Parameter mittendrin optional sein, sie
      // werden dann freigelassen
      String value = param.getValue(task);
      if (value == null || value.length() == 0) {
        HBCIUtils.log(
            "challenge parameter " + num + " (" + param.path + ") is empty", HBCIUtils.LOG_DEBUG2);
        continue;
      }

      HBCIUtils.log(
          "adding challenge parameter " + num + " " + param.path + "=" + value,
          HBCIUtils.LOG_DEBUG2);
      hktan.setParam("ChallengeKlassParam" + num, value);
    }
  }