2727import java .util .Optional ;
2828import java .util .concurrent .TimeUnit ;
2929
30+ import static ee .sk .test .smartid .integration .SmartIdIntegrationTest .TEST_AGAINST_SMART_ID_DEMO ;
3031import static java .util .Arrays .asList ;
32+ import static org .junit .Assume .assumeTrue ;
3133
3234/**
3335 * These tests contain snippets used in Readme.md
@@ -99,6 +101,8 @@ public void setUp() {
99101 // this class also has a method to set hash as bite array
100102 hashToSign .setHashInBase64 ("0nbgC2fVdLVQFZJdBbmG7oPoElpCYsQMtrY0c0wKYRg=" );
101103
104+ // this allows to switch off tests going against smart-id demo env
105+ assumeTrue (TEST_AGAINST_SMART_ID_DEMO );
102106 }
103107
104108 /*
@@ -176,11 +180,10 @@ public void documentConfigureTheClient_feedSeparately() {
176180
177181 @ Test
178182 public void documentAuthenticatingWithSemanticsIdentifier () {
179-
180183 SemanticsIdentifier semanticsIdentifier = new SemanticsIdentifier (
181184 SemanticsIdentifier .IdentityType .PNO , // 3 character identity type (PAS-passport, IDC-national identity card or PNO - (national) personal number)
182- SemanticsIdentifier .CountryCode .EE , // 2 character ISO 3166-1 alpha-2 country code
183- "30303039914 " ); // identifier (according to country and identity type reference)
185+ SemanticsIdentifier .CountryCode .LT , // 2 character ISO 3166-1 alpha-2 country code
186+ "30303039903 " ); // identifier (according to country and identity type reference)
184187
185188 // For security reasons a new hash value must be created for each new authentication request
186189 AuthenticationHash authenticationHash = AuthenticationHash .generateRandomHash ();
@@ -231,7 +234,7 @@ public void documentAuthenticatingWithDocumentNumber() {
231234
232235 SmartIdAuthenticationResponse authenticationResponse = client
233236 .createAuthentication ()
234- .withDocumentNumber ("PNOEE-30303039914-5QSV -Q" )
237+ .withDocumentNumber ("PNOEE-30303039903-1DNH -Q" )
235238 .withAuthenticationHash (authenticationHash )
236239 .withCertificateLevel ("QUALIFIED" )
237240 .withAllowedInteractionsOrder (Collections .singletonList (
@@ -294,7 +297,7 @@ public void documentObtainingUsersCertificate() {
294297
295298 SmartIdCertificate responseWithSigningCertificate = client
296299 .getCertificate ()
297- .withDocumentNumber ("PNOEE-30303039914-5QSV -Q" ) // returned as authentication result
300+ .withDocumentNumber ("PNOEE-30303039903-1DNH -Q" ) // returned as authentication result
298301 .withCertificateLevel ("QUALIFIED" )
299302 .fetch ();
300303
@@ -340,7 +343,7 @@ public void documentCreatingSignature() {
340343
341344 SmartIdSignature smartIdSignature = client
342345 .createSignature ()
343- .withDocumentNumber ("PNOEE -30303039914-5QSV -Q" ) // returned as authentication result
346+ .withDocumentNumber ("PNOLT -30303039914-PBZK -Q" ) // returned as authentication result
344347 .withSignableHash (hashToSign )
345348 .withCertificateLevel ("QUALIFIED" )
346349 .withAllowedInteractionsOrder (asList (
@@ -389,7 +392,7 @@ public void documentCreatingSignature() {
389392 public void documentInteractionOrderMostCommon () {
390393 SmartIdSignature smartIdSignature = client
391394 .createSignature ()
392- .withDocumentNumber ("PNOEE -30303039914-5QSV -Q" )
395+ .withDocumentNumber ("PNOLT -30303039914-PBZK -Q" )
393396 .withSignableHash (hashToSign )
394397 .withCertificateLevel ("QUALIFIED" )
395398 .withAllowedInteractionsOrder (Collections .singletonList (
@@ -416,7 +419,7 @@ public void documentInteractionOrderVerificationChoice() {
416419 try {
417420 SmartIdSignature smartIdSignature = client
418421 .createSignature ()
419- .withDocumentNumber ("PNOEE -30303039914-5QSV -Q" )
422+ .withDocumentNumber ("PNOLT -30303039914-PBZK -Q" )
420423 .withSignableHash (hashToSign )
421424 .withCertificateLevel ("QUALIFIED" )
422425 .withAllowedInteractionsOrder (Arrays .asList (
@@ -444,7 +447,7 @@ public void documentInteractionOrderVerificationChoice() {
444447 public void documentInteractionOrderConfirmationWithFallbackToPin () {
445448 SmartIdSignature smartIdSignature = client
446449 .createSignature ()
447- .withDocumentNumber ("PNOEE -30303039914-5QSV -Q" )
450+ .withDocumentNumber ("PNOLT -30303039914-PBZK -Q" ) //
448451 .withSignableHash (hashToSign )
449452 .withCertificateLevel ("QUALIFIED" )
450453 .withAllowedInteractionsOrder (asList (
@@ -476,7 +479,7 @@ else if (InteractionFlow.DISPLAY_TEXT_AND_PIN.is(smartIdSignature.getInteraction
476479 public void documentInteractionOrder2 () {
477480 SmartIdSignature smartIdSignature = client
478481 .createSignature ()
479- .withDocumentNumber ("PNOEE-30303039914-5QSV -Q" )
482+ .withDocumentNumber ("PNOEE-30303039903-1DNH -Q" )
480483 .withSignableHash (hashToSign )
481484 .withCertificateLevel ("QUALIFIED" )
482485 .withAllowedInteractionsOrder (asList (
@@ -512,7 +515,7 @@ public void documentInteractionOrderWithoutFallback() {
512515 try {
513516 client
514517 .createSignature ()
515- .withDocumentNumber ("PNOEE -30303039914-5QSV -Q" )
518+ .withDocumentNumber ("PNOLT -30303039914-PBZK -Q" )
516519 .withSignableHash (hashToSign )
517520 .withCertificateLevel ("QUALIFIED" )
518521 .withAllowedInteractionsOrder (Collections .singletonList (
0 commit comments