@Test
public void testProcessVerifyPin_encrypted_outside_secureSession() {

  CalypsoPo calypsoPoRev31 = createCalypsoPo(FCI_REV31);
  PoSecuritySettings poSecuritySettings =
      new PoSecuritySettings.PoSecuritySettingsBuilder(samResource) //
          .sessionDefaultKif(AccessLevel.SESSION_LVL_DEBIT, DEFAULT_KIF_DEBIT) //
          .sessionDefaultKeyRecordNumber(
              AccessLevel.SESSION_LVL_DEBIT, DEFAULT_KEY_RECORD_NUMBER_DEBIT)
          .pinTransmissionMode(PoTransaction.PinTransmissionMode.ENCRYPTED)
          .build();
  poTransaction =
      new PoTransaction(new SeResource<CalypsoPo>(poReader, calypsoPoRev31), poSecuritySettings);
  samCommandsTestSet.put(SAM_SELECT_DIVERSIFIER_CMD, SW1SW2_OK_RSP);
  samCommandsTestSet.put(SAM_GIVE_RANDOM_CMD, SAM_GIVE_RANDOM_RSP);
  samCommandsTestSet.put(SAM_CARD_CIPHER_PIN_CMD, SAM_CARD_CIPHER_PIN_RSP);
  poCommandsTestSet.put(PO_GET_CHALLENGE_CMD, PO_GET_CHALLENGE_RSP);
  poCommandsTestSet.put(PO_VERIFY_PIN_ENCRYPTED_OK_CMD, PO_VERIFY_PIN_OK_RSP);
  poTransaction.processVerifyPin(PIN_OK);
  assertThat(calypsoPoRev31.getPinAttemptRemaining()).isEqualTo(3);
}