Skip to content

Commit

Permalink
added base server checks
Browse files Browse the repository at this point in the history
  • Loading branch information
ibalosh committed Nov 20, 2017
1 parent 3a0fd84 commit b5cd267
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
23 changes: 23 additions & 0 deletions src/test/java/ServerTest.java
Original file line number Diff line number Diff line change
@@ -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());
}
}
28 changes: 28 additions & 0 deletions src/test/java/ServersTest.java
Original file line number Diff line number Diff line change
@@ -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);
}

}

0 comments on commit b5cd267

Please sign in to comment.