@Test public void samSelectionRequest_parse() { SamSelector samSelector = SamSelector.builder() .samRevision(SamRevision.AUTO) .build(); SamSelectionRequest samSelectionRequest = new SamSelectionRequest(samSelector); SelectionStatus selectionStatus = new SelectionStatus(new AnswerToReset(ATR), null, true); CalypsoSam calypsoSam = samSelectionRequest.parse(new SeResponse(true, true, selectionStatus, null)); assertThat(calypsoSam.getSamRevision()).isEqualTo(SamRevision.C1); assertThat(calypsoSam.getSerialNumber()).isEqualTo(SN); }
@Override protected CalypsoSam parse(SeResponse seResponse) { List<AbstractSamCommandBuilder<? extends AbstractSamResponseParser>> commandBuilders = getCommandBuilders(); if (commandBuilders.size() == 1) { List<ApduResponse> apduResponses = seResponse.getApduResponses(); if (apduResponses == null) { throw new CalypsoDesynchronizedExchangesException( "Mismatch in the number of requests/responses"); } commandBuilders.get(0).createResponseParser(apduResponses.get(0)).checkStatus(); } return new CalypsoSam(seResponse); }
SamSelectionRequest extends AbstractSeSelectionRequest<
        AbstractSamCommandBuilder<? extends AbstractSamResponseParser>> { @Override protected CalypsoSam parse(SeResponse seResponse) { List<AbstractSamCommandBuilder<? extends AbstractSamResponseParser>> commandBuilders = getCommandBuilders(); if (commandBuilders.size() == 1) { List<ApduResponse> apduResponses = seResponse.getApduResponses(); if (apduResponses == null) { throw new CalypsoDesynchronizedExchangesException( "Mismatch in the number of requests/responses"); } commandBuilders.get(0).createResponseParser(apduResponses.get(0)).checkStatus(); } return new CalypsoSam(seResponse); } }
SamSelectionRequest extends AbstractSeSelectionRequest<
        AbstractSamCommandBuilder<? extends AbstractSamResponseParser>> { @Override protected CalypsoSam parse(SeResponse seResponse) { List<AbstractSamCommandBuilder<? extends AbstractSamResponseParser>> commandBuilders = getCommandBuilders(); if (commandBuilders.size() == 1) { List<ApduResponse> apduResponses = seResponse.getApduResponses(); if (apduResponses == null) { throw new CalypsoDesynchronizedExchangesException( "Mismatch in the number of requests/responses"); } commandBuilders.get(0).createResponseParser(apduResponses.get(0)).checkStatus(); } return new CalypsoSam(seResponse); } SamSelectionRequest(SamSelector samSelector); }
SamSelectionRequest extends AbstractSeSelectionRequest<
        AbstractSamCommandBuilder<? extends AbstractSamResponseParser>> { @Override protected CalypsoSam parse(SeResponse seResponse) { List<AbstractSamCommandBuilder<? extends AbstractSamResponseParser>> commandBuilders = getCommandBuilders(); if (commandBuilders.size() == 1) { List<ApduResponse> apduResponses = seResponse.getApduResponses(); if (apduResponses == null) { throw new CalypsoDesynchronizedExchangesException( "Mismatch in the number of requests/responses"); } commandBuilders.get(0).createResponseParser(apduResponses.get(0)).checkStatus(); } return new CalypsoSam(seResponse); } SamSelectionRequest(SamSelector samSelector);  }
SamSelectionRequest extends AbstractSeSelectionRequest<
        AbstractSamCommandBuilder<? extends AbstractSamResponseParser>> { @Override protected CalypsoSam parse(SeResponse seResponse) { List<AbstractSamCommandBuilder<? extends AbstractSamResponseParser>> commandBuilders = getCommandBuilders(); if (commandBuilders.size() == 1) { List<ApduResponse> apduResponses = seResponse.getApduResponses(); if (apduResponses == null) { throw new CalypsoDesynchronizedExchangesException( "Mismatch in the number of requests/responses"); } commandBuilders.get(0).createResponseParser(apduResponses.get(0)).checkStatus(); } return new CalypsoSam(seResponse); } SamSelectionRequest(SamSelector samSelector);   }