Skip to content

Commit 89926c0

Browse files
committed
PB-32731. Disable Java SDK SMS sending tests
1 parent 51be3dd commit 89926c0

9 files changed

Lines changed: 78 additions & 103 deletions

File tree

sdk/src/main/java/com/silanis/esl/sdk/examples/AuthenticationMethodsExample.java

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,44 +15,43 @@
1515
*/
1616
public class AuthenticationMethodsExample extends SDKSample {
1717

18-
public static void main( String... args ) {
18+
public static void main(String... args) {
1919
new AuthenticationMethodsExample().run();
2020
}
2121

2222
public void execute() {
2323
DocumentPackage superDuperPackage = newPackageNamed(getPackageName())
24-
.describedAs( "This is a package created using the eSignLive SDK to demonstrate the authentication methods." )
25-
.expiresAt( now().plusMonths( 1 ).toDate() )
26-
.withEmailMessage( "This message should be delivered to all signers" )
27-
.withSigner( newSignerWithEmail( email1 )
28-
.withFirstName( "Anna" )
29-
.withLastName( "Bel" ) )
30-
.withSigner( newSignerWithEmail( email2 )
31-
.withFirstName( "Bobby" )
32-
.withLastName( "Sue" )
33-
.challengedWithQuestions( firstQuestion( "What's 1+1?" )
34-
.answer( "2" )
35-
.secondQuestion( "What color's the sky?" )
36-
.answer( "blue" ) ) )
37-
.withSigner( newSignerWithEmail( email3 )
38-
.withFirstName( "Charlie" )
39-
.withLastName( "Brown" )
40-
.withSmsSentTo( sms3 ) )
41-
.withDocument( newDocumentWithName( "dave.silanis@gmail.com's Document" )
42-
.fromStream( documentInputStream1, DocumentType.PDF )
43-
.withSignature( signatureFor( email1 )
44-
.onPage( 0 )
45-
.atPosition( 100, 100 ) )
46-
.withSignature( signatureFor( email2 )
47-
.onPage( 0 )
48-
.atPosition( 100, 200 ) )
49-
.withSignature( signatureFor( email3 )
50-
.onPage( 0 )
51-
.atPosition( 100, 300 ) ) )
24+
.describedAs("This is a package created using the eSignLive SDK to demonstrate the authentication methods.")
25+
.expiresAt(now().plusMonths(1).toDate())
26+
.withEmailMessage("This message should be delivered to all signers")
27+
.withSigner(newSignerWithEmail(email1)
28+
.withFirstName("Anna")
29+
.withLastName("Bel"))
30+
.withSigner(newSignerWithEmail(email2)
31+
.withFirstName("Bobby")
32+
.withLastName("Sue")
33+
.challengedWithQuestions(firstQuestion("What's 1+1?")
34+
.answer("2")
35+
.secondQuestion("What color's the sky?")
36+
.answer("blue")))
37+
.withSigner(newSignerWithEmail(email3)
38+
.withFirstName("Charlie")
39+
.withLastName("Brown"))
40+
.withDocument(newDocumentWithName("dave.silanis@gmail.com's Document")
41+
.fromStream(documentInputStream1, DocumentType.PDF)
42+
.withSignature(signatureFor(email1)
43+
.onPage(0)
44+
.atPosition(100, 100))
45+
.withSignature(signatureFor(email2)
46+
.onPage(0)
47+
.atPosition(100, 200))
48+
.withSignature(signatureFor(email3)
49+
.onPage(0)
50+
.atPosition(100, 300)))
5251
.build();
5352

54-
packageId = eslClient.createPackage( superDuperPackage );
55-
retrievedPackage = eslClient.getPackage( packageId );
53+
packageId = eslClient.createPackage(superDuperPackage);
54+
retrievedPackage = eslClient.getPackage(packageId);
5655
}
5756

5857
}

sdk/src/main/java/com/silanis/esl/sdk/examples/SDKSample.java

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,13 @@ public abstract class SDKSample {
2424

2525
protected Properties props = Props.get();
2626

27-
public String email1, email2, email3, email4, email5, email6, senderEmail,
28-
sms1, sms2, sms3, sms4, sms5, sms6, senderSms, webpageUrl, senderUID,
27+
public String email1, email2, email3, email4, email5, email6, senderEmail, webpageUrl, senderUID,
2928
proxyHost, proxyWithCredentialsHost, proxyUserName, proxyPassword;
3029

3130
public int proxyPort, proxyWithCredentialsPort;
3231

3332
public SDKSample() {
34-
setupEslClientFromProps(Collections.<String,String>emptyMap(), null);
33+
setupEslClientFromProps(Collections.<String, String>emptyMap(), null);
3534
setProperties();
3635
}
3736

@@ -40,17 +39,17 @@ public SDKSample(String apiKey, String apiUrl) {
4039
setProperties();
4140
}
4241

43-
public EslClient setupEslClientFromProps(Map<String,String> additionalHeaders, ProxyConfiguration proxyConfiguration) {
42+
public EslClient setupEslClientFromProps(Map<String, String> additionalHeaders, ProxyConfiguration proxyConfiguration) {
4443
if (props.getProperty("api.clientId") == null) {
4544
eslClient = new EslClient(props.getProperty("api.key"), props.getProperty("api.url"), true, proxyConfiguration).setWebpageURL(props.getProperty("webpage.url"));
4645
} else {
4746
ApiTokenConfig apiTokenConfig = ApiTokenConfig.newBuilder()
48-
.clientAppId(props.getProperty("api.clientId"))
49-
.clientAppSecret(props.getProperty("api.secret"))
50-
.tokenType(ApiTokenConfig.TokenType.OWNER)
51-
.baseUrl(props.getProperty("webpage.url"))
52-
.build();
53-
eslClient = new EslClient(apiTokenConfig, props.getProperty("api.url"), true, proxyConfiguration, true, additionalHeaders);
47+
.clientAppId(props.getProperty("api.clientId"))
48+
.clientAppSecret(props.getProperty("api.secret"))
49+
.tokenType(ApiTokenConfig.TokenType.OWNER)
50+
.baseUrl(props.getProperty("webpage.url"))
51+
.build();
52+
eslClient = new EslClient(apiTokenConfig, props.getProperty("api.url"), true, proxyConfiguration, true, additionalHeaders);
5453
}
5554
return eslClient;
5655
}
@@ -69,13 +68,6 @@ private void setProperties() {
6968
email5 = props.getProperty("5.email");
7069
email6 = props.getProperty("6.email");
7170
senderEmail = props.getProperty("sender.email");
72-
sms1 = props.getProperty("1.sms");
73-
sms2 = props.getProperty("2.sms");
74-
sms3 = props.getProperty("3.sms");
75-
sms4 = props.getProperty("4.sms");
76-
sms5 = props.getProperty("5.sms");
77-
sms6 = props.getProperty("6.sms");
78-
senderSms = props.getProperty("sender.sms");
7971
webpageUrl = props.getProperty("webpage.url");
8072
proxyHost = props.getProperty("proxy.host");
8173
proxyPort = Integer.parseInt(props.getProperty("proxy.port"));

sdk/src/main/java/com/silanis/esl/sdk/examples/SendSmsToSignerExample.java

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class SendSmsToSignerExample extends SDKSample {
1919
public static final String SIGNER2_FIRST = "Patty";
2020
public static final String SIGNER2_LAST = "Galant";
2121

22-
public static void main( String... args ) {
22+
public static void main(String... args) {
2323
new SendSmsToSignerExample().run();
2424
}
2525

@@ -28,29 +28,27 @@ public void execute() {
2828
.describedAs("This is a package created using the eSignLive SDK")
2929
.withSettings(DocumentPackageSettingsBuilder.newDocumentPackageSettings().withInPerson())
3030
.withSigner(SignerBuilder.newSignerWithEmail(email1)
31-
.withFirstName(SIGNER1_FIRST)
32-
.withLastName(SIGNER1_LAST)
33-
.withSmsSentTo(sms1))
31+
.withFirstName(SIGNER1_FIRST)
32+
.withLastName(SIGNER1_LAST))
3433
.withSigner(SignerBuilder.newSignerWithEmail(email2)
35-
.withFirstName(SIGNER2_FIRST)
36-
.withLastName(SIGNER2_LAST)
37-
.withSmsSentTo(sms2))
34+
.withFirstName(SIGNER2_FIRST)
35+
.withLastName(SIGNER2_LAST))
3836
.withDocument(newDocumentWithName("First Document")
39-
.fromStream(documentInputStream1, DocumentType.PDF)
40-
.withSignature(signatureFor(email1)
41-
.onPage(0)
42-
.atPosition(100, 100))
43-
.withSignature(signatureFor(email2)
44-
.onPage(0)
45-
.atPosition(400, 100)))
37+
.fromStream(documentInputStream1, DocumentType.PDF)
38+
.withSignature(signatureFor(email1)
39+
.onPage(0)
40+
.atPosition(100, 100))
41+
.withSignature(signatureFor(email2)
42+
.onPage(0)
43+
.atPosition(400, 100)))
4644
.build();
4745

48-
packageId = eslClient.createPackage( superDuperPackage );
49-
eslClient.sendPackage( packageId );
50-
retrievedPackage = eslClient.getPackage( packageId );
46+
packageId = eslClient.createPackage(superDuperPackage);
47+
eslClient.sendPackage(packageId);
48+
retrievedPackage = eslClient.getPackage(packageId);
5149

5250
eslClient.getPackageService().sendSmsToSigner(packageId, retrievedPackage.getSigner(email1));
5351
eslClient.getPackageService().sendSmsToSigner(packageId, retrievedPackage.getSigner(email2));
54-
retrievedPackage = eslClient.getPackage( packageId );
52+
retrievedPackage = eslClient.getPackage(packageId);
5553
}
5654
}

sdk/src/main/java/com/silanis/esl/sdk/examples/SignerSMSAuthenticationExample.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,25 @@
1414

1515
public class SignerSMSAuthenticationExample extends SDKSample {
1616

17-
public static void main( String... args ) {
17+
public static void main(String... args) {
1818
new SignerSMSAuthenticationExample().run();
1919
}
2020

2121
public void execute() {
2222
DocumentPackage superDuperPackage = newPackageNamed(getPackageName())
23-
.describedAs( "This is a SMS authentication example" )
24-
.withSigner( newSignerWithEmail( email1 )
25-
.withFirstName( "John" )
26-
.withLastName( "Smith" )
27-
.withSmsSentTo( sms1 ) )
28-
.withDocument( newDocumentWithName( "First Document" )
29-
.fromStream( documentInputStream1, DocumentType.PDF )
30-
.withSignature( signatureFor( email1 )
31-
.onPage( 0 )
32-
.atPosition( 100, 100 ) ) )
23+
.describedAs("This is a SMS authentication example")
24+
.withSigner(newSignerWithEmail(email1)
25+
.withFirstName("John")
26+
.withLastName("Smith")
27+
.withSmsSentTo("+12042345678"))
28+
.withDocument(newDocumentWithName("First Document")
29+
.fromStream(documentInputStream1, DocumentType.PDF)
30+
.withSignature(signatureFor(email1)
31+
.onPage(0)
32+
.atPosition(100, 100)))
3333
.build();
3434

35-
packageId = eslClient.createPackage( superDuperPackage );
36-
retrievedPackage = eslClient.getPackage( packageId );
35+
packageId = eslClient.createPackage(superDuperPackage);
36+
retrievedPackage = eslClient.getPackage(packageId);
3737
}
3838
}

sdk/src/main/java/com/silanis/esl/sdk/examples/UpdateSignerExample.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ public void execute() {
6666
Signer signer4 = newSignerWithEmail(email2)
6767
.withFirstName(SIGNER2_FIRST_NAME)
6868
.withLastName(SIGNER2_LAST_NAME)
69-
.withSmsSentTo(sms1)
7069
.withLanguage(SIGNER2_UPDATE_LANGUAGE)
7170
.withCustomId(SIGNER2_CUSTOM_ID).build();
7271

tester/src/test/java/com/silanis/esl/sdk/examples/AuthenticationMethodsExampleTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public void verifyResult() {
2727

2828
assertThat( "Signer 1 authentication method was not set correctly.", documentPackage.getSigner(example.email1).getAuthentication().getMethod(), is(EMAIL) );
2929
assertThat( "Signer 2 authentication method was not set correctly.", documentPackage.getSigner(example.email2).getAuthentication().getMethod(), is(CHALLENGE) );
30-
assertThat( "Signer 3 authentication method was not set correctly.", documentPackage.getSigner(example.email3).getAuthentication().getMethod(), is(SMS) );
30+
assertThat( "Signer 3 authentication method was not set correctly.", documentPackage.getSigner(example.email3).getAuthentication().getMethod(), is(EMAIL) );
3131
}
3232

3333
}

tester/src/test/java/com/silanis/esl/sdk/examples/SignerSMSAuthenticationExampleTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.silanis.esl.sdk.examples;
22

33
import com.silanis.esl.sdk.DocumentPackage;
4+
import org.junit.Ignore;
45
import org.junit.Test;
56

67
import static com.silanis.esl.sdk.AuthenticationMethod.SMS;
@@ -11,12 +12,12 @@
1112
* User: jessica
1213
* Date: 23/01/14
1314
* Time: 11:33 AM
14-
*
15+
* <p>
1516
* Test SignerSMSAuthenticationExample.
16-
*
1717
*/
1818
public class SignerSMSAuthenticationExampleTest {
1919
@Test
20+
@Ignore("Since this example sends SMS, it is disabled.")
2021
public void verifyResult() {
2122
SignerSMSAuthenticationExample example = new SignerSMSAuthenticationExample();
2223
example.run();

tester/src/test/java/com/silanis/esl/sdk/examples/UpdateSignerExampleTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ public void verifyResult() {
3535

3636
assertNotNull("Package signer2 is not updated correctly.", example.updatedPackage.getSigner(example.email2));
3737
assertThat("Package signer2's authentication method is not updated correctly.", example.updatedPackage.getSigner(example.email2).getAuthentication().getMethod(), is(SMS));
38-
assertThat("Package signer2's authentication method is not updated correctly.", example.updatedPackage.getSigner(example.email2).getAuthentication().getPhoneNumber(), is(example.sms1));
3938
assertThat("Package signer2's authentication method is not updated correctly.", example.updatedPackage.getSigner(example.email2).getLanguage(), is(SIGNER2_UPDATE_LANGUAGE));
4039
}
4140
}

tester/src/test/resources/jenkins.properties

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,15 @@ api.key=
44
api.key.WithRolesAndPermission=
55

66
sender.email=bob@e-signlive.com
7-
sender.sms=+12042345678
87

98
sender.email.WithRolesAndPermission=bobrp@e-signlive.com
10-
sender.sms.WithRolesAndPermission=+12042345678
119

12-
1.email=auto1.silanis@e-signlive.com
13-
1.sms=+12042345678
14-
15-
2.email=auto2.silanis@e-signlive.com
16-
2.sms=+12042345678
17-
18-
3.email=auto3.silanis@e-signlive.com
19-
3.sms=+12042345678
20-
21-
4.email=auto4.silanis@e-signlive.com
22-
4.sms=+12042345678
23-
24-
5.email=auto5.silanis@e-signlive.com
25-
5.sms=+12042345678
26-
27-
6.email=auto6.silanis@e-signlive.com
28-
6.sms=+12042345678
10+
1.email=auto1.silanis@gmail.com
11+
2.email=auto2.silanis@gmail.com
12+
3.email=auto3.silanis@gmail.com
13+
4.email=auto4.silanis@gmail.com
14+
5.email=auto5.silanis@gmail.com
15+
6.email=auto6.silanis@gmail.com
2916

3017
proxy.host=localhost
3118
proxy.port=8001

0 commit comments

Comments
 (0)