FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
postmark-java/src/test/java/integration/BounceTest.java at main · ActiveCampaign/postmark-java · GitHub
ActiveCampaign
/
postmark-java
Public
Notifications
You must be signed in to change notification settings
Fork
31
Star
45
Code
Issues
6
Pull requests
5
Discussions
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
postmark-java
/
src
/
test
/
java
/
integration
/
BounceTest.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
87 lines (67 loc) · 3.06 KB
Breadcrumbs
postmark-java
/
src
/
test
/
java
/
integration
/
BounceTest.java
Copy path
File metadata and controls
87 lines (67 loc) · 3.06 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package
integration
;
import
base
.
BaseTest
;
import
com
.
postmarkapp
.
postmark
.
client
.
ApiClient
;
import
com
.
postmarkapp
.
postmark
.
client
.
Parameters
;
import
com
.
postmarkapp
.
postmark
.
client
.
data
.
model
.
bounces
.
Bounce
;
import
com
.
postmarkapp
.
postmark
.
client
.
data
.
model
.
bounces
.
BounceDump
;
import
com
.
postmarkapp
.
postmark
.
client
.
data
.
model
.
bounces
.
Bounces
;
import
com
.
postmarkapp
.
postmark
.
client
.
data
.
model
.
bounces
.
DeliveryStats
;
import
com
.
postmarkapp
.
postmark
.
client
.
exception
.
InvalidMessageException
;
import
com
.
postmarkapp
.
postmark
.
client
.
exception
.
PostmarkException
;
import
org
.
junit
.
jupiter
.
api
.
Test
;
import
java
.
io
.
IOException
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.*;
/**
* Created by bash on 11/14/17.
*/
public
class
BounceTest
extends
BaseTest
{
ApiClient
client
;
@
org
.
junit
.
jupiter
.
api
.
BeforeEach
void
setUp
() {
client
=
getDefaultApiClientCustomUrl
();
}
@
Test
void
deliveryStats
()
throws
PostmarkException
,
IOException
{
DeliveryStats
deliveryStats
=
client
.
getDeliveryStats
();
assertTrue
(
deliveryStats
.
getBounces
().
size
() >
0
);
assertNotNull
(
deliveryStats
.
getBounces
().
get
(
0
).
getName
());
assertNotNull
(
deliveryStats
.
getBounces
().
get
(
0
).
getCount
());
}
@
Test
void
bounceList
()
throws
PostmarkException
,
IOException
{
Bounces
bounces
=
client
.
getBounces
(
Parameters
.
init
().
build
(
"count"
,
5
).
build
(
"offset"
,
0
));
assertTrue
(
bounces
.
getTotalCount
() >
0
);
assertNotNull
(
bounces
.
getBounces
().
get
(
0
).
getBouncedAt
());
}
@
Test
void
bounceListEmpty
()
throws
PostmarkException
,
IOException
{
Bounces
bounces
=
client
.
getBounces
(
Parameters
.
init
().
build
(
"count"
,
5
).
build
(
"offset"
,
0
).
build
(
"emailFilter"
,
"notexist292random"
));
assertEquals
(
bounces
.
getTotalCount
(),
0
);
}
@
Test
void
invalidBounceList
()
throws
PostmarkException
,
IOException
{
Throwable
exception
=
assertThrows
(
InvalidMessageException
.
class
,
()->
client
.
getBounces
(
Parameters
.
init
().
build
(
"count"
, -
1
).
build
(
"offset"
,
0
)));
}
@
Test
void
bounceById
()
throws
PostmarkException
,
IOException
{
Bounces
bounces
=
client
.
getBounces
(
Parameters
.
init
().
build
(
"count"
,
1
).
build
(
"offset"
,
0
));
Long
bounceId
=
bounces
.
getBounces
().
get
(
0
).
getId
();
Bounce
bounce
=
client
.
getBounce
(
bounceId
);
assertNotNull
(
bounce
.
getDescription
());
}
@
Test
void
activateBounce
()
throws
PostmarkException
,
IOException
{
Bounces
bounces
=
client
.
getBounces
(
Parameters
.
init
().
build
(
"count"
,
1
).
build
(
"offset"
,
0
).
build
(
"inactive"
,
true
));
Long
bounceId
=
bounces
.
getBounces
().
get
(
0
).
getId
();
String
message
=
client
.
activateBounce
(
bounceId
);
assertNotNull
(
message
);
}
@
Test
void
bounceByIdDump
()
throws
PostmarkException
,
IOException
{
Bounces
bounces
=
client
.
getBounces
(
Parameters
.
init
().
build
(
"count"
,
1
).
build
(
"offset"
,
0
));
Long
bounceId
=
bounces
.
getBounces
().
get
(
0
).
getId
();
BounceDump
bounceDump
=
client
.
getBounceDump
(
bounceId
);
assertNotNull
(
bounceDump
.
getBody
());
}
}
Back
|
FazBrowse Home
|
New Git URL