Ejemplo n.º 1
0
  @Test
  public void testExtractCodeForSheetTwoVariantTwo() {
    DecodeStrategy decoder = DecodeStrategy.levelTwoDecoderForSheetTwo();

    String input = "01390130003";
    BankParticipantCodeStructure pairs = decoder.decode(input);

    assertEquals("00003", pairs.getBankCode());
    assertEquals("9013", pairs.getParentCode());

    input = "038903801404";
    pairs = decoder.decode(input);

    assertEquals("01404", pairs.getBankCode());
    assertEquals("9038", pairs.getParentCode());
  }
Ejemplo n.º 2
0
  @Test
  public void testExtractCode() {

    DecodeStrategy decoder = DecodeStrategy.decoderForSheetZero();
    BankParticipantCodeStructure pairs;

    String input = "1385920000";
    pairs = decoder.decode(input);

    assertEquals("8592", pairs.getBankCode());
    assertEquals("13", pairs.getParentCode());

    input = "4086050000";
    pairs = decoder.decode(input);

    assertEquals("8605", pairs.getBankCode());
    assertEquals("40", pairs.getParentCode());

    input = "0000000000";
    pairs = decoder.decode(input);

    assertEquals("00", pairs.getBankCode());
    assertNull(pairs.getParentCode());

    input = "1600000000";
    pairs = decoder.decode(input);

    assertEquals("16", pairs.getBankCode());
    assertEquals("00", pairs.getParentCode());
  }