|
30 | 30 | @FixMethodOrder(MethodSorters.NAME_ASCENDING) |
31 | 31 | public class SdkUnitTests { |
32 | 32 |
|
33 | | - private static final String UserName = "[email protected]"; |
34 | | - private static final String UserId = "fcc5726c-xxxx-xxxx-xxxx-40bbbe6ca126"; |
35 | | - private static final String IntegratorKey = "ae30ea4e-xxxx-xxxx-xxxx-fcb57d2dc4df"; |
36 | | - private static final String IntegratorKeyImplicit = "68c1711f-xxxx-xxxx-xxxx-b49b4211d831"; |
37 | | - //private static final String ClientSecret = "b4dccdbe-xxxx-xxxx-xxxx-b2f0f7448f8f"; |
38 | | - private static final String RedirectURI = "https://www.docusign.com/api"; |
| 33 | + private static final String UserName = System.getProperty("USER_NAME"); |
| 34 | + private static final String UserId = System.getProperty("USER_ID"); |
| 35 | + private static final String IntegratorKey = System.getProperty("INTEGRATOR_KEY_JWT"); |
| 36 | + private static final String IntegratorKeyImplicit = System.getProperty("INTEGRATOR_KEY_IMPLICIT"); |
| 37 | + //private static final String ClientSecret = System.getProperty("CLIENT_SECRET"); |
| 38 | + private static final String RedirectURI = System.getProperty("REDIRECT_URI"); |
39 | 39 |
|
40 | 40 | private static final String BaseUrl = "https://demo.docusign.net/restapi"; |
41 | 41 | //private static final String OAuthBaseUrl = "account-d.docusign.com"; |
42 | | - private static final String privateKeyFullPath = System.getProperty("user.dir") + "/src/test/keys/docusign_private_key.txt"; |
| 42 | + private static final byte[] privateKeyBytes = System.getProperty("PRIVATE_KEY").getBytes(); |
43 | 43 | private static final String brandLogoFullPath = System.getProperty("user.dir") + "/src/test/docs/DS.png"; |
44 | 44 |
|
45 | 45 | private static final String SignTest1File = "/src/test/docs/SignTest1.pdf"; |
46 | | - private static final String TemplateId = "cf2a46c2-xxxx-xxxx-xxxx-752547b1a419"; |
47 | | - private static final String BrandId = "dbdaedc8-xxxx-xxxx-xxxx-b7cfd55f6b64"; |
| 46 | + private static final String TemplateId = System.getProperty("TEMPLATE_ID"); |
| 47 | + private static final String BrandId = System.getProperty("BRAND_ID"); |
48 | 48 | private String[] envelopeIds = new String[0]; |
49 | 49 | // JUnit 4.12 runs test cases in parallel, so the envelope ID needs to be initiated as well. |
50 | 50 |
|
@@ -89,14 +89,6 @@ public void JWTLoginTest() { |
89 | 89 | //Desktop.getDesktop().browse(URI.create(oauthLoginUrl)); |
90 | 90 | // END OF NOTE |
91 | 91 |
|
92 | | - byte[] privateKeyBytes = null; |
93 | | - try { |
94 | | - privateKeyBytes = Files.readAllBytes(Paths.get(privateKeyFullPath)); |
95 | | - } catch (IOException ioExcp) { |
96 | | - Assert.assertEquals(null, ioExcp); |
97 | | - } |
98 | | - if (privateKeyBytes == null) return; |
99 | | - |
100 | 92 | java.util.List<String> scopes = new ArrayList<String>(); |
101 | 93 | scopes.add(OAuth.Scope_SIGNATURE); |
102 | 94 | scopes.add(OAuth.Scope_IMPERSONATION); |
@@ -287,14 +279,6 @@ public void RequestASignatureTest() { |
287 | 279 | //Desktop.getDesktop().browse(URI.create(oauthLoginUrl)); |
288 | 280 | // END OF NOTE |
289 | 281 |
|
290 | | - byte[] privateKeyBytes = null; |
291 | | - try { |
292 | | - privateKeyBytes = Files.readAllBytes(Paths.get(privateKeyFullPath)); |
293 | | - } catch (IOException ioExcp) { |
294 | | - Assert.assertEquals(null, ioExcp); |
295 | | - } |
296 | | - if (privateKeyBytes == null) return; |
297 | | - |
298 | 282 | java.util.List<String> scopes = new ArrayList<String>(); |
299 | 283 | scopes.add(OAuth.Scope_SIGNATURE); |
300 | 284 |
|
@@ -376,14 +360,6 @@ public void RequestSignatureFromTemplate() { |
376 | 360 | //Desktop.getDesktop().browse(URI.create(oauthLoginUrl)); |
377 | 361 | // END OF NOTE |
378 | 362 |
|
379 | | - byte[] privateKeyBytes = null; |
380 | | - try { |
381 | | - privateKeyBytes = Files.readAllBytes(Paths.get(privateKeyFullPath)); |
382 | | - } catch (IOException ioExcp) { |
383 | | - Assert.assertEquals(null, ioExcp); |
384 | | - } |
385 | | - if (privateKeyBytes == null) return; |
386 | | - |
387 | 363 | java.util.List<String> scopes = new ArrayList<String>(); |
388 | 364 | scopes.add(OAuth.Scope_SIGNATURE); |
389 | 365 |
|
@@ -500,14 +476,6 @@ public void EmbeddedSigningTest() { |
500 | 476 | //Desktop.getDesktop().browse(URI.create(oauthLoginUrl)); |
501 | 477 | // END OF NOTE |
502 | 478 |
|
503 | | - byte[] privateKeyBytes = null; |
504 | | - try { |
505 | | - privateKeyBytes = Files.readAllBytes(Paths.get(privateKeyFullPath)); |
506 | | - } catch (IOException ioExcp) { |
507 | | - Assert.assertEquals(null, ioExcp); |
508 | | - } |
509 | | - if (privateKeyBytes == null) return; |
510 | | - |
511 | 479 | java.util.List<String> scopes = new ArrayList<String>(); |
512 | 480 | scopes.add(OAuth.Scope_SIGNATURE); |
513 | 481 |
|
@@ -636,14 +604,6 @@ public void CreateTemplateTest() { |
636 | 604 | //Desktop.getDesktop().browse(URI.create(oauthLoginUrl)); |
637 | 605 | // END OF NOTE |
638 | 606 |
|
639 | | - byte[] privateKeyBytes = null; |
640 | | - try { |
641 | | - privateKeyBytes = Files.readAllBytes(Paths.get(privateKeyFullPath)); |
642 | | - } catch (IOException ioExcp) { |
643 | | - Assert.assertEquals(null, ioExcp); |
644 | | - } |
645 | | - if (privateKeyBytes == null) return; |
646 | | - |
647 | 607 | java.util.List<String> scopes = new ArrayList<String>(); |
648 | 608 | scopes.add(OAuth.Scope_SIGNATURE); |
649 | 609 |
|
@@ -758,14 +718,6 @@ public void DownLoadEnvelopeDocumentsTest() { |
758 | 718 | //Desktop.getDesktop().browse(URI.create(oauthLoginUrl)); |
759 | 719 | // END OF NOTE |
760 | 720 |
|
761 | | - byte[] privateKeyBytes = null; |
762 | | - try { |
763 | | - privateKeyBytes = Files.readAllBytes(Paths.get(privateKeyFullPath)); |
764 | | - } catch (IOException ioExcp) { |
765 | | - Assert.assertEquals(null, ioExcp); |
766 | | - } |
767 | | - if (privateKeyBytes == null) return; |
768 | | - |
769 | 721 | java.util.List<String> scopes = new ArrayList<String>(); |
770 | 722 | scopes.add(OAuth.Scope_SIGNATURE); |
771 | 723 |
|
@@ -836,14 +788,6 @@ public void ListDocumentsTest() { |
836 | 788 | //Desktop.getDesktop().browse(URI.create(oauthLoginUrl)); |
837 | 789 | // END OF NOTE |
838 | 790 |
|
839 | | - byte[] privateKeyBytes = null; |
840 | | - try { |
841 | | - privateKeyBytes = Files.readAllBytes(Paths.get(privateKeyFullPath)); |
842 | | - } catch (IOException ioExcp) { |
843 | | - Assert.assertEquals(null, ioExcp); |
844 | | - } |
845 | | - if (privateKeyBytes == null) return; |
846 | | - |
847 | 791 | java.util.List<String> scopes = new ArrayList<String>(); |
848 | 792 | scopes.add(OAuth.Scope_SIGNATURE); |
849 | 793 |
|
@@ -957,14 +901,6 @@ public void ResendEnvelopeTest() { |
957 | 901 | //Desktop.getDesktop().browse(URI.create(oauthLoginUrl)); |
958 | 902 | // END OF NOTE |
959 | 903 |
|
960 | | - byte[] privateKeyBytes = null; |
961 | | - try { |
962 | | - privateKeyBytes = Files.readAllBytes(Paths.get(privateKeyFullPath)); |
963 | | - } catch (IOException ioExcp) { |
964 | | - Assert.assertEquals(null, ioExcp); |
965 | | - } |
966 | | - if (privateKeyBytes == null) return; |
967 | | - |
968 | 904 | java.util.List<String> scopes = new ArrayList<String>(); |
969 | 905 | scopes.add(OAuth.Scope_SIGNATURE); |
970 | 906 |
|
@@ -1086,14 +1022,6 @@ public void GetDiagnosticLogsTest() { |
1086 | 1022 | //Desktop.getDesktop().browse(URI.create(oauthLoginUrl)); |
1087 | 1023 | // END OF NOTE |
1088 | 1024 |
|
1089 | | - byte[] privateKeyBytes = null; |
1090 | | - try { |
1091 | | - privateKeyBytes = Files.readAllBytes(Paths.get(privateKeyFullPath)); |
1092 | | - } catch (IOException ioExcp) { |
1093 | | - Assert.assertEquals(null, ioExcp); |
1094 | | - } |
1095 | | - if (privateKeyBytes == null) return; |
1096 | | - |
1097 | 1025 | java.util.List<String> scopes = new ArrayList<String>(); |
1098 | 1026 | scopes.add(OAuth.Scope_SIGNATURE); |
1099 | 1027 |
|
@@ -1188,14 +1116,6 @@ public void ListStatusChangesTest() { |
1188 | 1116 | //Desktop.getDesktop().browse(URI.create(oauthLoginUrl)); |
1189 | 1117 | // END OF NOTE |
1190 | 1118 |
|
1191 | | - byte[] privateKeyBytes = null; |
1192 | | - try { |
1193 | | - privateKeyBytes = Files.readAllBytes(Paths.get(privateKeyFullPath)); |
1194 | | - } catch (IOException ioExcp) { |
1195 | | - Assert.assertEquals(null, ioExcp); |
1196 | | - } |
1197 | | - if (privateKeyBytes == null) return; |
1198 | | - |
1199 | 1119 | java.util.List<String> scopes = new ArrayList<String>(); |
1200 | 1120 | scopes.add(OAuth.Scope_SIGNATURE); |
1201 | 1121 |
|
@@ -1253,14 +1173,6 @@ public void ListStatusTest() { |
1253 | 1173 | //Desktop.getDesktop().browse(URI.create(oauthLoginUrl)); |
1254 | 1174 | // END OF NOTE |
1255 | 1175 |
|
1256 | | - byte[] privateKeyBytes = null; |
1257 | | - try { |
1258 | | - privateKeyBytes = Files.readAllBytes(Paths.get(privateKeyFullPath)); |
1259 | | - } catch (IOException ioExcp) { |
1260 | | - Assert.assertEquals(null, ioExcp); |
1261 | | - } |
1262 | | - if (privateKeyBytes == null) return; |
1263 | | - |
1264 | 1176 | java.util.List<String> scopes = new ArrayList<String>(); |
1265 | 1177 | scopes.add(OAuth.Scope_SIGNATURE); |
1266 | 1178 |
|
@@ -1320,14 +1232,6 @@ public void UpdateBulkRecipientsTest() { |
1320 | 1232 | //Desktop.getDesktop().browse(URI.create(oauthLoginUrl)); |
1321 | 1233 | // END OF NOTE |
1322 | 1234 |
|
1323 | | - byte[] privateKeyBytes = null; |
1324 | | - try { |
1325 | | - privateKeyBytes = Files.readAllBytes(Paths.get(privateKeyFullPath)); |
1326 | | - } catch (IOException ioExcp) { |
1327 | | - Assert.assertEquals(null, ioExcp); |
1328 | | - } |
1329 | | - if (privateKeyBytes == null) return; |
1330 | | - |
1331 | 1235 | java.util.List<String> scopes = new ArrayList<String>(); |
1332 | 1236 | scopes.add(OAuth.Scope_SIGNATURE); |
1333 | 1237 |
|
@@ -1486,14 +1390,6 @@ public void UpdateChunkedUpload() { |
1486 | 1390 | //Desktop.getDesktop().browse(URI.create(oauthLoginUrl)); |
1487 | 1391 | // END OF NOTE |
1488 | 1392 |
|
1489 | | - byte[] privateKeyBytes = null; |
1490 | | - try { |
1491 | | - privateKeyBytes = Files.readAllBytes(Paths.get(privateKeyFullPath)); |
1492 | | - } catch (IOException ioExcp) { |
1493 | | - Assert.assertEquals(null, ioExcp); |
1494 | | - } |
1495 | | - if (privateKeyBytes == null) return; |
1496 | | - |
1497 | 1393 | java.util.List<String> scopes = new ArrayList<String>(); |
1498 | 1394 | scopes.add(OAuth.Scope_SIGNATURE); |
1499 | 1395 |
|
@@ -1565,14 +1461,6 @@ public void UpdateBrandLogoByTypeTest() { |
1565 | 1461 | //Desktop.getDesktop().browse(URI.create(oauthLoginUrl)); |
1566 | 1462 | // END OF NOTE |
1567 | 1463 |
|
1568 | | - byte[] privateKeyBytes = null; |
1569 | | - try { |
1570 | | - privateKeyBytes = Files.readAllBytes(Paths.get(privateKeyFullPath)); |
1571 | | - } catch (IOException ioExcp) { |
1572 | | - Assert.assertEquals(null, ioExcp); |
1573 | | - } |
1574 | | - if (privateKeyBytes == null) return; |
1575 | | - |
1576 | 1464 | java.util.List<String> scopes = new ArrayList<String>(); |
1577 | 1465 | scopes.add(OAuth.Scope_SIGNATURE); |
1578 | 1466 |
|
@@ -1626,14 +1514,6 @@ private String[] getLastTenEnvelopeIds() { |
1626 | 1514 | //Desktop.getDesktop().browse(URI.create(oauthLoginUrl)); |
1627 | 1515 | // END OF NOTE |
1628 | 1516 |
|
1629 | | - byte[] privateKeyBytes = null; |
1630 | | - try { |
1631 | | - privateKeyBytes = Files.readAllBytes(Paths.get(privateKeyFullPath)); |
1632 | | - } catch (IOException ioExcp) { |
1633 | | - Assert.assertEquals(null, ioExcp); |
1634 | | - } |
1635 | | - if (privateKeyBytes == null) return envelopeIds; |
1636 | | - |
1637 | 1517 | java.util.List<String> scopes = new ArrayList<String>(); |
1638 | 1518 | scopes.add(OAuth.Scope_SIGNATURE); |
1639 | 1519 |
|
|
0 commit comments