From 8bd630812d104d20442d1223f12397189e8d22a3 Mon Sep 17 00:00:00 2001 From: Igor Balos Date: Thu, 12 Mar 2020 12:37:21 +0100 Subject: [PATCH] updated jersey version and Bounce ID to long type --- pom.xml | 11 +++++++++-- .../com/wildbit/java/postmark/client/ApiClient.java | 6 +++--- .../postmark/client/data/model/bounces/Bounce.java | 6 +++--- src/test/java/integration/BounceTest.java | 6 +++--- src/test/java/unit/data/BounceTest.java | 2 +- 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/pom.xml b/pom.xml index 4384fb5..3b765fa 100644 --- a/pom.xml +++ b/pom.xml @@ -24,11 +24,12 @@ - 1.2.5 + 1.5.0 UTF-8 1.8 2.9.7 2.10.0 + 2.27 5.0.0-M4 1.0.0-M4 @@ -53,7 +54,13 @@ org.glassfish.jersey.core jersey-client - 2.25.1 + ${jersey.version} + + + + org.glassfish.jersey.inject + jersey-hk2 + ${jersey.version} diff --git a/src/main/java/com/wildbit/java/postmark/client/ApiClient.java b/src/main/java/com/wildbit/java/postmark/client/ApiClient.java index dc840ef..e746363 100644 --- a/src/main/java/com/wildbit/java/postmark/client/ApiClient.java +++ b/src/main/java/com/wildbit/java/postmark/client/ApiClient.java @@ -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")); } diff --git a/src/main/java/com/wildbit/java/postmark/client/data/model/bounces/Bounce.java b/src/main/java/com/wildbit/java/postmark/client/data/model/bounces/Bounce.java index e22dedd..cc8d140 100644 --- a/src/main/java/com/wildbit/java/postmark/client/data/model/bounces/Bounce.java +++ b/src/main/java/com/wildbit/java/postmark/client/data/model/bounces/Bounce.java @@ -7,7 +7,7 @@ */ public class Bounce { - private Integer id; + private Long id; private String type; private Integer typeCode; private String name; @@ -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; } diff --git a/src/test/java/integration/BounceTest.java b/src/test/java/integration/BounceTest.java index a4865f6..50b71c5 100644 --- a/src/test/java/integration/BounceTest.java +++ b/src/test/java/integration/BounceTest.java @@ -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()); @@ -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); @@ -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()); diff --git a/src/test/java/unit/data/BounceTest.java b/src/test/java/unit/data/BounceTest.java index d238115..6dfa0ce 100644 --- a/src/test/java/unit/data/BounceTest.java +++ b/src/test/java/unit/data/BounceTest.java @@ -35,7 +35,7 @@ void bouncesData() throws IOException{ "}"; Bounce bounce = new Bounce(); - bounce.setId(1); + bounce.setId(1L); bounce.setContent("test"); ArrayList data = new ArrayList<>(); data.add(bounce);