From b5cd2678336feeced367ec1e0399a4f6ff6429ad Mon Sep 17 00:00:00 2001 From: Igor Balos Date: Mon, 20 Nov 2017 11:05:02 +0100 Subject: [PATCH] added base server checks --- .travis.yml | 4 ++-- src/test/java/ServerTest.java | 23 +++++++++++++++++++++++ src/test/java/ServersTest.java | 28 ++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 src/test/java/ServerTest.java create mode 100644 src/test/java/ServersTest.java diff --git a/.travis.yml b/.travis.yml index e035878..14cc622 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ env: global: - secure: "sp0ArUVAUY5Y/e512jqlRsRFq/EIgcIe5yTIOumBmDOM036cjuyAZYoAukF5cegh0qbZWIW01okWbL+fCo5cpm4S5oPvYu7tEcwJYNlQ5erni6+WoYpwyTPJfiBUKTrp0KHmH9oxAemTn14O9XMXAaj+xcjYf14V8DcfLzqK0eeKF9mJcEFDMs3/E+1+x0VsKINlzT0SiUuhbGwhX3p/M3ShXz5yFEKLTzKxFu0QzaGkvPz5QYvaWUayqlpFRFQNrDZv/cWunMu67OPrWYnomYWpvIzjufEJS1RLvGG/+ctWjkQzbS5nIGkRDuJnLLi+qFmCOlNx526UcRngS3kIo59LPMuntopvxJ0DLlc3ECIvj4Oy3XMSy2CvB8WOJqqVjtjMWIhra1qIL1pAUvUOS8torisCAOugOYFTy4Q/kackuBTgcyufQCnGkvvD8e11mNcqpKEsOUJNjNaUSlg0PDbXCUxjvYLKlfgdVyhOlstsuDOK7fR0JlJkAxtGvdDCbbQZUDMmzWkwIW0rxJKJAv15mVuS/OIE4gco2svtnaowcrPhDhYy/INVfcZhBQBgNblvkJD5tH6vSqmwjemFqTtI+eCe8nGen3l1htdlfKyfRachnLb35bjLEExa7eIXLdfziQqIVb14tETaASCRQCrNoJE3yKjGqTrYXGAT9PI=" - - # ^^ POSTMARK_API_TOKEN + - # ^^ POSTMARK_API_TOKEN=? - secure: "xoND44ICIzZQ9aLCBEHWGt7/r6a9pDHnuWOcNqh24hQ3dNUUIpuLK0q1aEmRkC8xvRnQrMwbzXf4uLhoy4vE7M6fX/GrNVcsRdHY1xq9avCFYz5IoXoU9yHVAvYHaN6xoSlWI623KgJgPu3vXdcdJFcpfw62zb9d0r9UKZUo7TOoIQnSvKqRWzNknqOn37D/I0j/FujZQggr1CMOrXcecnyEJJhsxJCSS2JG1VyINjD1T1g8wejdpiiyT27ZgarGmCOenKuamLNkhgdurCx8ETGBusy6sxs0etpGdkoddd+m63T0tMMnynBoPpVSz0NxMzeHu4BitB23g5bwxSL+zCCdeeOBVnJ9z/lgNvk2oL4GytnQ/Aq0+aR0KaoCGI8o4yGGQsBX5WfyJj3D7OG3rthMcB+dmlg5Ue2QRA1c/KYg+19RYg2StvRK38KlYrRyl/3GgiPfJLcvuOFrps3B/YD5Y+Hm839Uqi/qww4IDQbbuYakngC1HER3IbsPwH0ELsXuAYMs+Q+icuvhJhv9HV6OAlv/J0Xj5iFbSqyuvdsDKo/XDjjFSIIF8szD6+m2zxM8srE/9diKlSTH2+hr7tVHRYCulTcNTsKggwNs68l2FW3yM50X0epkbdDEl08VQOUmY+l3sf8SjGBRFesJYbYi7jmTUz65dS3NS+HxoCY=" - - # ^^ POSTMARK_ACCOUNT_TOKEN + - # ^^ POSTMARK_ACCOUNT_TOKEN=? language: java install: mvn install -DskipTests=true -Dmaven.javadoc.skip=true -Dgpg.skip=true -B -V diff --git a/src/test/java/ServerTest.java b/src/test/java/ServerTest.java new file mode 100644 index 0000000..64d2f08 --- /dev/null +++ b/src/test/java/ServerTest.java @@ -0,0 +1,23 @@ +import com.wildbit.java.postmark.client.ApiClient; +import com.wildbit.java.postmark.client.data.model.server.Server; +import com.wildbit.java.postmark.client.exception.PostmarkException; +import org.junit.jupiter.api.Test; + +import java.io.IOException; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +/** + * Created by bash on 11/14/17. + */ +public class ServerTest extends BaseTest { + + ApiClient client = getDefaultApiClient(); + + @Test + void list() throws PostmarkException, IOException { + Server server = client.getServer(); + assertNotNull(server.getName()); + } +} diff --git a/src/test/java/ServersTest.java b/src/test/java/ServersTest.java new file mode 100644 index 0000000..9182c71 --- /dev/null +++ b/src/test/java/ServersTest.java @@ -0,0 +1,28 @@ +import com.wildbit.java.postmark.client.AccountApiClient; +import com.wildbit.java.postmark.client.Parameters; +import com.wildbit.java.postmark.client.data.model.server.Server; +import com.wildbit.java.postmark.client.data.model.servers.Servers; +import com.wildbit.java.postmark.client.exception.PostmarkException; +import org.junit.jupiter.api.Test; + +import java.io.IOException; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Created by bash on 11/14/17. + */ +public class ServersTest extends BaseTest { + + AccountApiClient client = getDefaultAccountApiClient(); + + @Test + void list() throws PostmarkException, IOException { + Servers servers = client.getServers(Parameters.init().build("count", 5).build("offset", 0)); + assertTrue(servers.getServers().size() > 0); + assertTrue(servers.getTotalCount() > 0); + } + +}