diff --git a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GetAllMessagesData.java b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GetAllMessagesData.java index d06510489..e6325c33f 100644 --- a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GetAllMessagesData.java +++ b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GetAllMessagesData.java @@ -1,5 +1,6 @@ package org.avni.messaging.contract.glific; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -11,6 +12,7 @@ @JsonPropertyOrder({ "messages" }) +@JsonIgnoreProperties(ignoreUnknown = true) public class GetAllMessagesData { @JsonProperty("messages") @@ -18,13 +20,13 @@ public class GetAllMessagesData { /** * No args constructor for use in serialization - * + * */ public GetAllMessagesData() { } /** - * + * * @param messages */ public GetAllMessagesData(List messages) { @@ -42,4 +44,4 @@ public void setMessages(List messages) { this.messages = messages; } -} \ No newline at end of file +} diff --git a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificAuth.java b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificAuth.java index b0be6abdd..d64c038dc 100644 --- a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificAuth.java +++ b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificAuth.java @@ -1,7 +1,9 @@ package org.avni.messaging.contract.glific; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; +@JsonIgnoreProperties(ignoreUnknown = true) public class GlificAuth { @JsonProperty("access_token") private String accessToken; diff --git a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificAuthRequest.java b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificAuthRequest.java index 92752444c..ce4de7431 100644 --- a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificAuthRequest.java +++ b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificAuthRequest.java @@ -1,5 +1,8 @@ package org.avni.messaging.contract.glific; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +@JsonIgnoreProperties(ignoreUnknown = true) public class GlificAuthRequest { private final GlificUser user; diff --git a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificContactGroupContactCountResponse.java b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificContactGroupContactCountResponse.java index 4a16af79a..2619b3ea0 100644 --- a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificContactGroupContactCountResponse.java +++ b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificContactGroupContactCountResponse.java @@ -1,5 +1,8 @@ package org.avni.messaging.contract.glific; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +@JsonIgnoreProperties(ignoreUnknown = true) public class GlificContactGroupContactCountResponse { private int countContacts; diff --git a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificContactGroupContactsResponse.java b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificContactGroupContactsResponse.java index 6192735ef..893e31e24 100644 --- a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificContactGroupContactsResponse.java +++ b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificContactGroupContactsResponse.java @@ -1,7 +1,10 @@ package org.avni.messaging.contract.glific; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + import java.util.List; +@JsonIgnoreProperties(ignoreUnknown = true) public class GlificContactGroupContactsResponse { private List contacts; diff --git a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificContactGroupCountResponse.java b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificContactGroupCountResponse.java index 221951d1b..2cc06a045 100644 --- a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificContactGroupCountResponse.java +++ b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificContactGroupCountResponse.java @@ -1,5 +1,8 @@ package org.avni.messaging.contract.glific; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +@JsonIgnoreProperties(ignoreUnknown = true) public class GlificContactGroupCountResponse { private int countGroups; diff --git a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificContactGroupsResponse.java b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificContactGroupsResponse.java index 9b5a2e334..10ba4a81c 100644 --- a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificContactGroupsResponse.java +++ b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificContactGroupsResponse.java @@ -1,8 +1,11 @@ package org.avni.messaging.contract.glific; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + import java.io.Serializable; import java.util.List; +@JsonIgnoreProperties(ignoreUnknown = true) public class GlificContactGroupsResponse { private List groups; diff --git a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificContactResponse.java b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificContactResponse.java index 7871a3e4d..f165d0469 100644 --- a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificContactResponse.java +++ b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificContactResponse.java @@ -1,5 +1,8 @@ package org.avni.messaging.contract.glific; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +@JsonIgnoreProperties(ignoreUnknown = true) public class GlificContactResponse { private String id; private String name; diff --git a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificCreateContactGroupResponse.java b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificCreateContactGroupResponse.java index ad574d318..804a78ffe 100644 --- a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificCreateContactGroupResponse.java +++ b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificCreateContactGroupResponse.java @@ -1,7 +1,10 @@ package org.avni.messaging.contract.glific; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + import java.util.List; +@JsonIgnoreProperties(ignoreUnknown = true) public class GlificCreateContactGroupResponse { private CreateGroupErrors createGroup; diff --git a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificError.java b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificError.java index e3f00626c..eee6cd513 100644 --- a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificError.java +++ b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificError.java @@ -1,7 +1,10 @@ package org.avni.messaging.contract.glific; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + import java.util.List; +@JsonIgnoreProperties(ignoreUnknown = true) public class GlificError { private List locations; private String message; diff --git a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificErrorLocation.java b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificErrorLocation.java index 9a3a2f468..da6ce9728 100644 --- a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificErrorLocation.java +++ b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificErrorLocation.java @@ -1,5 +1,8 @@ package org.avni.messaging.contract.glific; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +@JsonIgnoreProperties(ignoreUnknown = true) public class GlificErrorLocation { private int column; private int row; diff --git a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificGetContactsResponse.java b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificGetContactsResponse.java index 2efc7c1bc..8a6affff2 100644 --- a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificGetContactsResponse.java +++ b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificGetContactsResponse.java @@ -1,7 +1,10 @@ package org.avni.messaging.contract.glific; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + import java.util.List; +@JsonIgnoreProperties(ignoreUnknown = true) public class GlificGetContactsResponse { private List contacts; diff --git a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificGetGroupResponse.java b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificGetGroupResponse.java index de60f7f04..2056bd673 100644 --- a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificGetGroupResponse.java +++ b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificGetGroupResponse.java @@ -1,5 +1,8 @@ package org.avni.messaging.contract.glific; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +@JsonIgnoreProperties(ignoreUnknown = true) public class GlificGetGroupResponse { private GlificGroupGroup group; diff --git a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificMessageResponse.java b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificMessageResponse.java index 7b12c7871..4e3f143a2 100644 --- a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificMessageResponse.java +++ b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificMessageResponse.java @@ -1,4 +1,7 @@ package org.avni.messaging.contract.glific; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +@JsonIgnoreProperties(ignoreUnknown = true) public class GlificMessageResponse { } diff --git a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificMessageTemplate.java b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificMessageTemplate.java index d490e17bf..3266eb783 100644 --- a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificMessageTemplate.java +++ b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificMessageTemplate.java @@ -1,7 +1,10 @@ package org.avni.messaging.contract.glific; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + import java.io.Serializable; +@JsonIgnoreProperties(ignoreUnknown = true) public class GlificMessageTemplate implements Serializable { private String body; private String id; diff --git a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificMessageTemplateResponse.java b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificMessageTemplateResponse.java index 31cf6da0d..25aa962f1 100644 --- a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificMessageTemplateResponse.java +++ b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificMessageTemplateResponse.java @@ -1,7 +1,10 @@ package org.avni.messaging.contract.glific; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + import java.util.List; +@JsonIgnoreProperties(ignoreUnknown = true) public class GlificMessageTemplateResponse { private List sessionTemplates; diff --git a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificOptinContactResponse.java b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificOptinContactResponse.java index d3ec18867..19213ab45 100644 --- a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificOptinContactResponse.java +++ b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificOptinContactResponse.java @@ -1,5 +1,8 @@ package org.avni.messaging.contract.glific; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +@JsonIgnoreProperties(ignoreUnknown = true) public class GlificOptinContactResponse { private GlificOptinContactWithErrorsResponse optinContact; diff --git a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificOptinContactWithErrorsResponse.java b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificOptinContactWithErrorsResponse.java index 3b19fe872..3b69b510f 100644 --- a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificOptinContactWithErrorsResponse.java +++ b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificOptinContactWithErrorsResponse.java @@ -1,5 +1,8 @@ package org.avni.messaging.contract.glific; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +@JsonIgnoreProperties(ignoreUnknown = true) public class GlificOptinContactWithErrorsResponse { private GlificContactResponse contact; diff --git a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificResponse.java b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificResponse.java index 3bac28317..38ff19715 100644 --- a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificResponse.java +++ b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificResponse.java @@ -1,7 +1,10 @@ package org.avni.messaging.contract.glific; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + import java.util.List; +@JsonIgnoreProperties(ignoreUnknown = true) public class GlificResponse { private T data; private List errors; diff --git a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificSearchDataResponse.java b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificSearchDataResponse.java index 36cd6aea9..edb887ac8 100644 --- a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificSearchDataResponse.java +++ b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificSearchDataResponse.java @@ -1,5 +1,6 @@ package org.avni.messaging.contract.glific; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -11,6 +12,7 @@ @JsonPropertyOrder({ "search" }) +@JsonIgnoreProperties(ignoreUnknown = true) public class GlificSearchDataResponse { @JsonProperty("search") @@ -18,13 +20,13 @@ public class GlificSearchDataResponse { /** * No args constructor for use in serialization - * + * */ public GlificSearchDataResponse() { } /** - * + * * @param search */ public GlificSearchDataResponse(List search) { @@ -42,4 +44,4 @@ public void setSearch(List search) { this.search = search; } -} \ No newline at end of file +} diff --git a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificUser.java b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificUser.java index 096dec74c..81e5cc294 100644 --- a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificUser.java +++ b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/GlificUser.java @@ -1,10 +1,12 @@ package org.avni.messaging.contract.glific; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import org.avni.messaging.domain.GlificSystemConfig; import org.springframework.util.Assert; import java.io.Serializable; +@JsonIgnoreProperties(ignoreUnknown = true) public class GlificUser implements Serializable { private final String phone; private final String password; diff --git a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/Message.java b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/Message.java index deb2702f7..727dabdc8 100644 --- a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/Message.java +++ b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/Message.java @@ -1,5 +1,6 @@ package org.avni.messaging.contract.glific; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -14,6 +15,7 @@ "receiver", "type" }) +@JsonIgnoreProperties(ignoreUnknown = true) public class Message { @JsonProperty("body") @@ -33,13 +35,13 @@ public class Message { /** * No args constructor for use in serialization - * + * */ public Message() { } /** - * + * * @param receiver * @param insertedAt * @param sender diff --git a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/Search.java b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/Search.java index ccf0becae..570549bfd 100644 --- a/avni-server-api/src/main/java/org/avni/messaging/contract/glific/Search.java +++ b/avni-server-api/src/main/java/org/avni/messaging/contract/glific/Search.java @@ -1,5 +1,6 @@ package org.avni.messaging.contract.glific; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -12,6 +13,7 @@ "contact", "messages" }) +@JsonIgnoreProperties(ignoreUnknown = true) public class Search { @JsonProperty("contact") @@ -21,13 +23,13 @@ public class Search { /** * No args constructor for use in serialization - * + * */ public Search() { } /** - * + * * @param contact * @param messages */ @@ -57,4 +59,4 @@ public void setMessages(List messages) { this.messages = messages; } -} \ No newline at end of file +} diff --git a/avni-server-api/src/test/java/org/avni/messaging/repository/GlificRestClientTest.java b/avni-server-api/src/test/java/org/avni/messaging/repository/GlificRestClientTest.java index 26920440a..cfec0dec8 100644 --- a/avni-server-api/src/test/java/org/avni/messaging/repository/GlificRestClientTest.java +++ b/avni-server-api/src/test/java/org/avni/messaging/repository/GlificRestClientTest.java @@ -23,7 +23,9 @@ import static com.github.tomakehurst.wiremock.client.WireMock.*; import static org.assertj.core.api.Assertions.assertThat; +@Sql(value = {"/tear-down.sql"}, executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = {"/test-data.sql"}) +@Sql(value = {"/tear-down.sql"}, executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public class GlificRestClientTest extends AbstractControllerIntegrationTest { private String SAMPLE_AUTH_RESPONSE = "{\"data\":{\"access_token\":\"SFMyNTY.YjQ2M2MzMmMtNGZlOC00OTEyLWIzYTEtZmRhZTRkOGQ1ZTIx.3TjKqpElrD5N2ffGHEAFX91cyp7zwoTztYR8p1jwwgA\",\"renewal_token\":\"SFMyNTY.MjYxODllMTgtNDM1OC00YjJjLTlmN2MtOTA5MzMwYzM3ZjA2.dDigSwftcGFGHu4o9MwkASp2KqH6eitp1aRmeYSgi5M\",\"token_expiry_time\":\"2022-10-13T21:42:33.342529Z\"}}";