Skip to content

Commit

Permalink
updated jersey version and Bounce ID to long type
Browse files Browse the repository at this point in the history
  • Loading branch information
ibalosh committed Mar 12, 2020
1 parent 6b6c10d commit 8bd6308
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
11 changes: 9 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@
</developers>

<properties>
<postmark.version>1.2.5</postmark.version>
<postmark.version>1.5.0</postmark.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<jackson.minimum.version>2.9.7</jackson.minimum.version>
<jackson.version>2.10.0</jackson.version>
<jersey.version>2.27</jersey.version>
<junit.jupiter.version>5.0.0-M4</junit.jupiter.version>
<junit.platform.version>1.0.0-M4</junit.platform.version>
</properties>
Expand All @@ -53,7 +54,13 @@
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>2.25.1</version>
<version>${jersey.version}</version>
</dependency>

<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>${jersey.version}</version>
</dependency>

<!-- Serialization -->
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/wildbit/java/postmark/client/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@ public Bounces getBounces(Parameters parameters) throws PostmarkException, IOExc
return dataHandler.fromJson(response, Bounces.class);
}

public Bounce getBounce(Integer id) throws PostmarkException, IOException {
public Bounce getBounce(Long id) throws PostmarkException, IOException {
String response = execute(HttpClient.REQUEST_TYPES.GET, getEndpointUrl(bouncesEndpoint + id));
return dataHandler.fromJson(response, Bounce.class);
}

public BounceDump getBounceDump(Integer id) throws PostmarkException, IOException {
public BounceDump getBounceDump(Long id) throws PostmarkException, IOException {
String response = execute(HttpClient.REQUEST_TYPES.GET, getEndpointUrl(bouncesEndpoint + id + "/dump"));
return dataHandler.fromJson(response, BounceDump.class);
}

public String activateBounce(Integer id) throws PostmarkException, IOException {
public String activateBounce(Long id) throws PostmarkException, IOException {
return execute(HttpClient.REQUEST_TYPES.PUT, getEndpointUrl(bouncesEndpoint + id + "/activate"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
public class Bounce {

private Integer id;
private Long id;
private String type;
private Integer typeCode;
private String name;
Expand Down Expand Up @@ -41,9 +41,9 @@ public void setMessageStream(String messageStream) {

public void setRecordType(String recordType) { this.recordType = recordType; }

public Integer getId() { return id;}
public Long getId() { return id;}

public void setId(Integer id) {
public void setId(Long id) {
this.id = id;
}

Expand Down
6 changes: 3 additions & 3 deletions src/test/java/integration/BounceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void invalidBounceList() throws PostmarkException, IOException {
@Test
void bounceById() throws PostmarkException, IOException {
Bounces bounces = client.getBounces(Parameters.init().build("count", 1).build("offset", 0));
Integer bounceId = bounces.getBounces().get(0).getId();
Long bounceId = bounces.getBounces().get(0).getId();

Bounce bounce = client.getBounce(bounceId);
assertNotNull(bounce.getDescription());
Expand All @@ -68,7 +68,7 @@ void bounceById() throws PostmarkException, IOException {
@Test
void activateBounce() throws PostmarkException, IOException {
Bounces bounces = client.getBounces(Parameters.init().build("count", 1).build("offset", 0).build("inactive",true));
Integer bounceId = bounces.getBounces().get(0).getId();
Long bounceId = bounces.getBounces().get(0).getId();

String message = client.activateBounce(bounceId);
assertNotNull(message);
Expand All @@ -77,7 +77,7 @@ void activateBounce() throws PostmarkException, IOException {
@Test
void bounceByIdDump() throws PostmarkException, IOException {
Bounces bounces = client.getBounces(Parameters.init().build("count", 1).build("offset", 0));
Integer bounceId = bounces.getBounces().get(0).getId();
Long bounceId = bounces.getBounces().get(0).getId();

BounceDump bounceDump = client.getBounceDump(bounceId);
assertNotNull(bounceDump.getBody());
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/unit/data/BounceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void bouncesData() throws IOException{
"}";

Bounce bounce = new Bounce();
bounce.setId(1);
bounce.setId(1L);
bounce.setContent("test");
ArrayList<Bounce> data = new ArrayList<>();
data.add(bounce);
Expand Down

0 comments on commit 8bd6308

Please sign in to comment.