-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
99 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ | |
<organization>Wildbit</organization> | ||
<organizationUrl>https://wildbit.com/</organizationUrl> | ||
<url>https://twitter.com/ibalosh/</url> | ||
<email>[email protected]</email> | ||
</developer> | ||
</developers> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package integration; | ||
|
||
import base.BaseTest; | ||
import com.wildbit.java.postmark.client.ApiClient; | ||
import com.wildbit.java.postmark.client.Parameters; | ||
import com.wildbit.java.postmark.client.data.model.templates.*; | ||
import com.wildbit.java.postmark.client.data.model.triggers.InboundRules; | ||
import com.wildbit.java.postmark.client.data.model.triggers.TagMatchers; | ||
import com.wildbit.java.postmark.client.exception.PostmarkException; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.io.IOException; | ||
import java.util.HashMap; | ||
|
||
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 TriggersTest extends BaseTest { | ||
|
||
ApiClient client = getDefaultApiClient(); | ||
|
||
@Test | ||
void listTagTriggers() throws PostmarkException, IOException { | ||
TagMatchers matchers = client.getTriggerTags(Parameters.init().build("count",5).build("offset",0)); | ||
assertNotNull(matchers.getTotalCount()); | ||
} | ||
|
||
@Test | ||
void listInboundRuleTriggers() throws PostmarkException, IOException { | ||
InboundRules inboundRules = client.getInboundRules(Parameters.init().build("count",5).build("offset",0)); | ||
assertNotNull(inboundRules.getTotalCount()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package unit.client; | ||
|
||
import com.wildbit.java.postmark.Postmark; | ||
import com.wildbit.java.postmark.client.ApiClient; | ||
import com.wildbit.java.postmark.client.BaseApiClient; | ||
import com.wildbit.java.postmark.client.HttpClient; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import javax.ws.rs.core.MultivaluedHashMap; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
||
/** | ||
* Created by bash on 11/13/17. | ||
*/ | ||
public class BaseApiClientTest { | ||
|
||
MultivaluedHashMap headers = Postmark.DefaultHeaders.headers(); | ||
BaseApiClient client = new BaseApiClient(Postmark.DEFAULTS.API_URL.value, headers); | ||
|
||
@Test | ||
void getBaseUrl() { | ||
assertEquals(client.getBaseUrl(), Postmark.DEFAULTS.API_URL.value); | ||
client.getEndpointUrl("/test"); | ||
} | ||
|
||
@Test | ||
void getEndpointUrl() { | ||
String endpoint = "/test"; | ||
assertEquals(client.getEndpointUrl(endpoint), Postmark.DEFAULTS.API_URL.value + endpoint); | ||
} | ||
|
||
@Test | ||
void getHttpClient() { | ||
assertEquals(client.getHttpClient().getClass(), HttpClient.class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters