ReadRecordsCmdBuild extends AbstractPoCommandBuilder<ReadRecordsRespPars> { public ReadMode getReadMode() { return readMode; } ReadRecordsCmdBuild(
      PoClass poClass, int sfi, int firstRecordNumber, ReadMode readMode, int expectedLength); @Override ReadRecordsRespPars createResponseParser(ApduResponse apduResponse); @Override boolean isSessionBufferUsed(); int getSfi(); int getFirstRecordNumber(); ReadMode getReadMode();  }
@Test public void readRecords_rev2_4() { byte cla = (byte) 0x94; byte cmd = (byte) 0xB2; byte sfi = (byte) 0x08; byte p2 = (byte) ((byte) (sfi * 8) + 4); byte[] request2_4 = {cla, cmd, record_number, p2, 0x00}; readRecordsCmdBuilder = new ReadRecordsCmdBuild( PoClass.LEGACY, sfi, record_number, ReadRecordsCmdBuild.ReadMode.ONE_RECORD, expectedLength); apduRequest = readRecordsCmdBuilder.getApduRequest(); assertThat(apduRequest.getBytes()).isEqualTo(request2_4); assertThat(readRecordsCmdBuilder.getReadMode()) .isEqualTo(ReadRecordsCmdBuild.ReadMode.ONE_RECORD); }
@Test public void readRecords_rev2_4_2() { byte cla = (byte) 0x94; byte cmd = (byte) 0xB2; byte sfi = (byte) 0x08; byte p2 = (byte) ((byte) (sfi * 8) + 5); byte[] request2_4 = {cla, cmd, record_number, p2, 0x00}; readRecordsCmdBuilder = new ReadRecordsCmdBuild( PoClass.LEGACY, sfi, record_number, ReadRecordsCmdBuild.ReadMode.MULTIPLE_RECORD, expectedLength); apduRequest = readRecordsCmdBuilder.getApduRequest(); assertThat(apduRequest.getBytes()).isEqualTo(request2_4); assertThat(readRecordsCmdBuilder.getReadMode()) .isEqualTo(ReadRecordsCmdBuild.ReadMode.MULTIPLE_RECORD); }
@Test public void readRecords_rev3_1() { byte cla = (byte) 0x00; byte cmd = (byte) 0xB2; byte sfi = (byte) 0x08; byte p2 = (byte) ((byte) (sfi * 8) + 5); byte[] request3_1 = {cla, cmd, record_number, p2, 0x00}; readRecordsCmdBuilder = new ReadRecordsCmdBuild( PoClass.ISO, sfi, record_number, ReadRecordsCmdBuild.ReadMode.MULTIPLE_RECORD, expectedLength); apduRequest = readRecordsCmdBuilder.getApduRequest(); assertThat(apduRequest.getBytes()).isEqualTo(request3_1); assertThat(readRecordsCmdBuilder.getReadMode()) .isEqualTo(ReadRecordsCmdBuild.ReadMode.MULTIPLE_RECORD); }
@Test public void readRecords_rev3_2() { byte cla = (byte) 0x00; byte cmd = (byte) 0xB2; byte sfi = (byte) 0x08; byte p2 = (byte) ((byte) (sfi * 8) + 5); byte[] request3_2 = {cla, cmd, record_number, p2, 0x00}; readRecordsCmdBuilder = new ReadRecordsCmdBuild( PoClass.ISO, sfi, record_number, ReadRecordsCmdBuild.ReadMode.MULTIPLE_RECORD, expectedLength); apduRequest = readRecordsCmdBuilder.getApduRequest(); assertThat(apduRequest.getBytes()).isEqualTo(request3_2); assertThat(readRecordsCmdBuilder.getReadMode()) .isEqualTo(ReadRecordsCmdBuild.ReadMode.MULTIPLE_RECORD); }