Package org.kapott.hbci.manager.ChallengeInfo

Examples of org.kapott.hbci.manager.ChallengeInfo.HhdVersion


   * Testet, wenn fuer einen Geschaeftsvorfall in der HHD-Version keine Parameter vorhanden sind
   */
  @Test
  public void testMissing()
  {
    HhdVersion version = getHhdVersion("HKDTE",ChallengeInfo.VERSION_HHD_1_4);
    Assert.assertEquals(version.getParams().size(),0);
  }
View Full Code Here


   * Testet die korrekten Challenge-Klassen.
   */
  @Test
  public void testKlass()
  {
    HhdVersion version = null;
    String code        = null;
   
    code = "HKAOM";
    version = getHhdVersion(code,ChallengeInfo.VERSION_HHD_1_2);
    Assert.assertEquals(version.getKlass(),"20");

    version = getHhdVersion(code,ChallengeInfo.VERSION_HHD_1_3);
    Assert.assertEquals(version.getKlass(),"20");
 
    version = getHhdVersion(code,ChallengeInfo.VERSION_HHD_1_4);
    Assert.assertEquals(version.getKlass(),"10");


    code = "HKCCS";
    version = getHhdVersion(code,ChallengeInfo.VERSION_HHD_1_2);
    Assert.assertEquals(version.getKlass(),"22");

    version = getHhdVersion(code,ChallengeInfo.VERSION_HHD_1_3);
    Assert.assertEquals(version.getKlass(),"22");
 
    version = getHhdVersion(code,ChallengeInfo.VERSION_HHD_1_4);
    Assert.assertEquals(version.getKlass(),"09");
  }
View Full Code Here

   * Testet, ob ein Parameter korrekt als SyntaxWrt erkannt und formatiert wird.
   */
  @Test
  public void testWrt()
  {
    HhdVersion version = null;
    Param p            = null;
    String code        = "HKAOM";
   
   
    version = getHhdVersion(code,ChallengeInfo.VERSION_HHD_1_2);
    p = version.getParams().get(1);
    Assert.assertEquals(p.getPath(),"BTG.value");
    Assert.assertEquals(p.getType(),"Wrt");
    Assert.assertEquals(p.format("100"),"100,");
    Assert.assertEquals(p.format("100.50"),"100,5");
    Assert.assertEquals(p.format("100.99"),"100,99");
    Assert.assertNull(p.format(null));
   
    version = getHhdVersion(code,ChallengeInfo.VERSION_HHD_1_3);
    p = version.getParams().get(2);
    Assert.assertEquals(p.getPath(),"BTG.value");
    Assert.assertEquals(p.getType(),"Wrt");
    Assert.assertEquals(p.format("100"),"100,");
    Assert.assertEquals(p.format("100.50"),"100,5");
    Assert.assertEquals(p.format("100.99"),"100,99");
    Assert.assertNull(p.format(null));
   

    version = getHhdVersion(code,ChallengeInfo.VERSION_HHD_1_4);
    p = version.getParams().get(0);
    Assert.assertEquals(p.getPath(),"BTG.value");
    Assert.assertEquals(p.getType(),"Wrt");
    Assert.assertEquals(p.format("100"),"100,");
    Assert.assertEquals(p.format("100.50"),"100,5");
    Assert.assertEquals(p.format("100.99"),"100,99");
View Full Code Here

   * Testet, ob ein Parameter korrekt als SyntaxAN erkannt und formatiert wird.
   */
  @Test
  public void testAN()
  {
    HhdVersion version = null;
    Param p            = null;
    String code        = "HKAOM";
   
   
    version = getHhdVersion(code,ChallengeInfo.VERSION_HHD_1_2);
    p = version.getParams().get(0);
    Assert.assertEquals(p.getPath(),"Other.number");
    Assert.assertEquals(p.getType(),"");
    Assert.assertEquals(p.format("AaBb"),"AaBb");
   
    // Hier darf KEIN Escaping stattfinden. Das macht HBCI4Java dann spaeter
    // ohnehin beim Zusammenbauen des Segments, da ChallengeKlassParams#param[1-9]
    // ja in hbci-{version}.xml als Type="AN" deklariert sind.
    Assert.assertEquals(p.format("+:'@"),"+:'@");
    Assert.assertNull(p.format(null));
   
    version = getHhdVersion(code,ChallengeInfo.VERSION_HHD_1_3);
    p = version.getParams().get(1);
    Assert.assertEquals(p.getPath(),"Other.number");
    Assert.assertEquals(p.getType(),"");
    Assert.assertEquals(p.format("AaBb"),"AaBb");
    Assert.assertEquals(p.format("+:'@"),"+:'@");
    Assert.assertNull(p.format(null));
   

    version = getHhdVersion(code,ChallengeInfo.VERSION_HHD_1_4);
    p = version.getParams().get(3);
    Assert.assertEquals(p.getPath(),"Other.number");
    Assert.assertEquals(p.getType(),"");
    Assert.assertEquals(p.format("AaBb"),"AaBb");
    Assert.assertEquals(p.format("+:'@"),"+:'@");
    Assert.assertNull(p.format(null));
View Full Code Here

   * @throws Exception
   */
  @Test
  public void testDate() throws Exception
  {
    HhdVersion version = getHhdVersion("HKTUE",ChallengeInfo.VERSION_HHD_1_4);
    Param p = version.getParams().get(3);
    Assert.assertEquals(p.getPath(),"date");
    Assert.assertEquals(p.getType(),"Date");
    Assert.assertEquals(p.format("2011-05-20"),"20110520");
    Assert.assertNull(p.format(null));

View Full Code Here

   * Testet Parameter mit Bedingung.
   */
  @Test
  public void testCondition()
  {
    HhdVersion version = null;
    String code        = "HKAOM";
    List<Param> params = null;
   

    Properties secmech = new Properties();
    secmech.setProperty("needchallengevalue","N");
   
    // Darf nicht enthalten sein
    version = getHhdVersion(code,ChallengeInfo.VERSION_HHD_1_2);
    params = version.getParams();
    for (Param p:params)
    {
      if (p.getPath().equals("BTG.value"))
        Assert.assertFalse(p.isComplied(secmech));
    }

    // Darf nicht enthalten sein
    version = getHhdVersion(code,ChallengeInfo.VERSION_HHD_1_3);
    params = version.getParams();
    for (Param p:params)
    {
      if (p.getPath().equals("BTG.value"))
        Assert.assertFalse(p.isComplied(secmech));
    }

    // Hier ist er enthalten - auch wenn in den BPD etwas anderes steht
    version = getHhdVersion(code,ChallengeInfo.VERSION_HHD_1_4);
    params = version.getParams();
    for (Param p:params)
    {
      if (p.getPath().equals("BTG.value"))
        Assert.assertTrue(p.isComplied(secmech));
    }
View Full Code Here

   * Testet Parameter mit Bedingung.
   */
  @Test
  public void testCondition2()
  {
    HhdVersion version = null;
    String code        = "HKCCS";
    List<Param> params = null;
   

    Properties secmech = new Properties();
    secmech.setProperty("needchallengevalue","J");
   
    // Jetzt muss er enthalten sein
    version = getHhdVersion(code,ChallengeInfo.VERSION_HHD_1_2);
    params = version.getParams();
    for (Param p:params)
    {
      if (p.getPath().equals("sepa.btg.value"))
        Assert.assertTrue(p.isComplied(secmech));
    }

    // Jetzt muss er enthalten sein
    version = getHhdVersion(code,ChallengeInfo.VERSION_HHD_1_3);
    params = version.getParams();
    for (Param p:params)
    {
      if (p.getPath().equals("sepa.btg.value"))
        Assert.assertTrue(p.isComplied(secmech));
    }

    // Und hier bleibt er weiterhin enthalten
    version = getHhdVersion(code,ChallengeInfo.VERSION_HHD_1_4);
    params = version.getParams();
    for (Param p:params)
    {
      if (p.getPath().equals("sepa.btg.value"))
        Assert.assertTrue(p.isComplied(secmech));
    }
View Full Code Here

TOP

Related Classes of org.kapott.hbci.manager.ChallengeInfo.HhdVersion

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.