22
33import base .BaseTest ;
44import com .wildbit .java .postmark .Postmark ;
5+ import com .wildbit .java .postmark .client .AccountApiClient ;
6+ import com .wildbit .java .postmark .client .ApiClient ;
7+ import com .wildbit .java .postmark .client .Parameters ;
8+ import com .wildbit .java .postmark .client .data .model .bounces .Bounces ;
9+ import com .wildbit .java .postmark .client .exception .PostmarkException ;
510import org .junit .jupiter .api .Test ;
611
712import java .io .IOException ;
@@ -27,6 +32,18 @@ void getApiClientSecure() {
2732 assertNotNull (Postmark .getApiClient (apiToken , true ));
2833 }
2934
35+ @ Test
36+ void getApiClientCustomBaseUrl () throws IOException , PostmarkException {
37+ ApiClient client = Postmark .getApiClient (apiToken , true , "example.com" );
38+ assertEquals (client .getBaseUrl (), "example.com" );
39+ }
40+
41+ @ Test
42+ void getApiClientCustomUrl () throws IOException , PostmarkException {
43+ ApiClient client = Postmark .getApiClient (apiToken , true , "example.com" );
44+ assertEquals (client .getEndpointUrl ("/test" ), "example.com/test" );
45+ }
46+
3047 @ Test
3148 void getAccountApiClient () {
3249 assertNotNull (Postmark .getAccountApiClient (apiToken ));
@@ -36,4 +53,16 @@ void getAccountApiClient() {
3653 void getAccountApiClientSecure () {
3754 assertNotNull (Postmark .getAccountApiClient (apiToken ,true ));
3855 }
56+
57+ @ Test
58+ void getAccountApiClientCustomBaseUrl () throws IOException , PostmarkException {
59+ AccountApiClient client = Postmark .getAccountApiClient (apiToken , true , "example.com" );
60+ assertEquals (client .getBaseUrl (), "example.com" );
61+ }
62+
63+ @ Test
64+ void getAccountApiClientCustomUrl ()throws IOException , PostmarkException {
65+ AccountApiClient client = Postmark .getAccountApiClient (apiToken , true , "example.com" );
66+ assertEquals (client .getEndpointUrl ("/test" ), "example.com/test" );
67+ }
3968}
0 commit comments