diff --git a/mdx-models/src/main/java/com/mx/path/model/mdx/model/account/Account.java b/mdx-models/src/main/java/com/mx/path/model/mdx/model/account/Account.java index 3bfa6fc7..f8f99d9d 100644 --- a/mdx-models/src/main/java/com/mx/path/model/mdx/model/account/Account.java +++ b/mdx-models/src/main/java/com/mx/path/model/mdx/model/account/Account.java @@ -31,10 +31,6 @@ public class Account extends MdxBase { private BigDecimal creditLimit; @XmlElement(name = "currency_code") private String currencyCode; - @XmlElement(name = "daily_deposit_limit_current") - private Double dailyDepositLimitCurrent; - @XmlElement(name = "daily_deposit_limit_total") - private Double dailyDepositLimitTotal; @XmlElement(name = "day_payment_is_due") private LocalDate dayPaymentIsDue; @XmlElement(name = "guid") @@ -45,10 +41,6 @@ public class Account extends MdxBase { private BigDecimal holdTotal; @XmlElement(name = "id") private String id; - @XmlElement(name = "interest_paid_previous_year") - private Double interestPaidPreviousYear; - @XmlElement(name = "interest_paid_ytd") - private Double interestPaidYtd; @XmlElement(name = "interest_rate") private Double interestRate; @XmlElement(name = "is_closed") @@ -61,10 +53,6 @@ public class Account extends MdxBase { private Long lastPaymentAt; @XmlElement(name = "last_payment_on") private LocalDate lastPaymentOn; - @XmlElement(name = "monthly_deposit_limit_current") - private Double monthlyDepositLimitCurrent; - @XmlElement(name = "monthly_deposit_limit_total") - private Double monthlyDepositLimitTotal; @XmlElement(name = "matures_at") private Long maturesAt; @XmlElement(name = "matures_on") @@ -85,8 +73,6 @@ public class Account extends MdxBase { private String name; @XmlElement(name = "nickname") private String nickname; - @XmlElement(name = "next_payment") - private Double nextPayment; @XmlElement(name = "original_balance") private BigDecimal originalBalance; @XmlElement(name = "past_due_amount") @@ -103,8 +89,6 @@ public class Account extends MdxBase { private BigDecimal pendingBalance; @XmlElement(name = "pending_transactions_total") private BigDecimal pendingTransactionsTotal; - @XmlElement(name = "principal_balance") - private Double principalBalance; @XmlElement(name = "routing_number") private String routingNumber; @Deprecated @@ -118,8 +102,6 @@ public class Account extends MdxBase { private BigDecimal statementBalance; @XmlElement(name = "statement_closed_on") private LocalDate statementClosedOn; - @XmlElement(name = "statement_late_charges") - private Double statementLateCharges; @XmlElement(name = "subtype") private String subtype; @XmlElement(name = "type") @@ -227,22 +209,6 @@ public final void setCurrencyCode(String newCurrencyCode) { this.currencyCode = newCurrencyCode; } - public final Double getDailyDepositLimitCurrent() { - return dailyDepositLimitCurrent; - } - - public final void setDailyDepositLimitCurrent(Double dailyDepositLimitCurrent) { - this.dailyDepositLimitCurrent = dailyDepositLimitCurrent; - } - - public final Double getDailyDepositLimitTotal() { - return dailyDepositLimitTotal; - } - - public final void setDailyDepositLimitTotal(Double dailyDepositLimitTotal) { - this.dailyDepositLimitTotal = dailyDepositLimitTotal; - } - public final LocalDate getDayPaymentIsDue() { return dayPaymentIsDue; } @@ -283,22 +249,6 @@ public final void setId(String newId) { this.id = newId; } - public final Double getInterestPaidPreviousYear() { - return interestPaidPreviousYear; - } - - public final void setInterestPaidPreviousYear(Double interestPaidPreviousYear) { - this.interestPaidPreviousYear = interestPaidPreviousYear; - } - - public final Double getInterestPaidYtd() { - return interestPaidYtd; - } - - public final void setInterestPaidYtd(Double interestPaidYtd) { - this.interestPaidYtd = interestPaidYtd; - } - public final Double getInterestRate() { return interestRate; } @@ -347,22 +297,6 @@ public final void setLastPaymentOn(LocalDate newLastPaymentOn) { this.lastPaymentOn = newLastPaymentOn; } - public final Double getMonthlyDepositLimitCurrent() { - return monthlyDepositLimitCurrent; - } - - public final void setMonthlyDepositLimitCurrent(Double monthlyDepositLimitCurrent) { - this.monthlyDepositLimitCurrent = monthlyDepositLimitCurrent; - } - - public final Double getMonthlyDepositLimitTotal() { - return monthlyDepositLimitTotal; - } - - public final void setMonthlyDepositLimitTotal(Double monthlyDepositLimitTotal) { - this.monthlyDepositLimitTotal = monthlyDepositLimitTotal; - } - public final Long getMaturesAt() { return maturesAt; } @@ -443,14 +377,6 @@ public final void setNickname(String newNickname) { this.nickname = newNickname; } - public final Double getNextPayment() { - return nextPayment; - } - - public final void setNextPayment(Double nextPayment) { - this.nextPayment = nextPayment; - } - public final BigDecimal getOriginalBalance() { return originalBalance; } @@ -515,14 +441,6 @@ public final void setPendingTransactionsTotal(BigDecimal pendingTransactionsTota this.pendingTransactionsTotal = pendingTransactionsTotal; } - public final Double getPrincipalBalance() { - return principalBalance; - } - - public final void setPrincipalBalance(Double principalBalance) { - this.principalBalance = principalBalance; - } - public final String getRoutingNumber() { return routingNumber; } @@ -571,14 +489,6 @@ public final void setStatementClosedOn(LocalDate newStatementClosedOn) { this.statementClosedOn = newStatementClosedOn; } - public final Double getStatementLateCharges() { - return statementLateCharges; - } - - public final void setStatementLateCharges(Double statementLateCharges) { - this.statementLateCharges = statementLateCharges; - } - public final String getSubtype() { return subtype; } diff --git a/mdx-models/src/main/java/com/mx/path/model/mdx/model/account/StopPayment.java b/mdx-models/src/main/java/com/mx/path/model/mdx/model/account/StopPayment.java index a4e42db0..16aebfb6 100644 --- a/mdx-models/src/main/java/com/mx/path/model/mdx/model/account/StopPayment.java +++ b/mdx-models/src/main/java/com/mx/path/model/mdx/model/account/StopPayment.java @@ -1,7 +1,5 @@ package com.mx.path.model.mdx.model.account; -import java.time.LocalDate; - import lombok.Data; import lombok.EqualsAndHashCode; @@ -11,7 +9,6 @@ @Data public class StopPayment extends MdxBase { private Double amount; - private LocalDate effectiveOn; private String endingCheckNumber; private Double fee; private String id; diff --git a/mdx-models/src/main/java/com/mx/path/model/mdx/model/account/Transaction.java b/mdx-models/src/main/java/com/mx/path/model/mdx/model/account/Transaction.java index 334b871c..6819d2ca 100644 --- a/mdx-models/src/main/java/com/mx/path/model/mdx/model/account/Transaction.java +++ b/mdx-models/src/main/java/com/mx/path/model/mdx/model/account/Transaction.java @@ -1,6 +1,5 @@ package com.mx.path.model.mdx.model.account; -import java.math.BigDecimal; import java.time.LocalDate; import javax.xml.bind.annotation.XmlElement; @@ -54,8 +53,6 @@ public class Transaction extends MdxBase { private Long postedAt; @XmlElement(name = "posted_on") private LocalDate postedOn; - @XmlElement(name = "running_balance") - private BigDecimal runningBalance; @XmlElement(name = "status") private String status; @XmlElement(name = "transacted_at") @@ -235,14 +232,6 @@ public final void setPostedOn(LocalDate newPostedOn) { this.postedOn = newPostedOn; } - public final BigDecimal getRunningBalance() { - return runningBalance; - } - - public final void setRunningBalance(BigDecimal runningBalance) { - this.runningBalance = runningBalance; - } - public final String getStatus() { return status; } diff --git a/mdx-models/src/test/groovy/com/mx/path/extensions/StringStaticExtension.groovy b/mdx-models/src/test/groovy/com/mx/path/extensions/StringStaticExtension.groovy new file mode 100644 index 00000000..5f640c20 --- /dev/null +++ b/mdx-models/src/test/groovy/com/mx/path/extensions/StringStaticExtension.groovy @@ -0,0 +1,12 @@ +package com.mx.path.extensions + +class StringStaticExtension { + + static String sanitizeXml(final StringWriter self) { + sanitizeXml(self.toString()) + } + + static String sanitizeXml(final String self) { + self.replaceAll("\n","").replaceAll("\r","").replaceAll("\t","").replaceAll(">\\s+<", "") + } +} diff --git a/mdx-models/src/test/groovy/com/mx/path/model/mdx/model/ondemand/MdxOnDemandMdxListSerializerTest.groovy b/mdx-models/src/test/groovy/com/mx/path/model/mdx/model/ondemand/MdxOnDemandMdxListSerializerTest.groovy index d0b2689e..5602a39e 100644 --- a/mdx-models/src/test/groovy/com/mx/path/model/mdx/model/ondemand/MdxOnDemandMdxListSerializerTest.groovy +++ b/mdx-models/src/test/groovy/com/mx/path/model/mdx/model/ondemand/MdxOnDemandMdxListSerializerTest.groovy @@ -1,5 +1,7 @@ package com.mx.path.model.mdx.model.ondemand +import static com.mx.path.extensions.StringStaticExtension.sanitizeXml + import com.fasterxml.jackson.core.JsonGenerator import com.fasterxml.jackson.databind.SerializerProvider import com.fasterxml.jackson.dataformat.xml.XmlFactory @@ -52,12 +54,14 @@ class MdxOnDemandMdxListSerializerTest extends Specification implements WithMock generator.flush() then: - stringWriter.toString() == "\n" + + def expectedResponse = "\n" + " false\n" + " 9.99\n" + " Fees\n" + " T-123\n" + "\n" + + sanitizeXml(stringWriter) == sanitizeXml(expectedResponse) } def "wrapper name, empty interacts with generator"() { @@ -108,7 +112,7 @@ class MdxOnDemandMdxListSerializerTest extends Specification implements WithMock generator.flush() then: - stringWriter.toString() == "\n" + + def expectedResponse = "\n" + "\n" + "\n" + " false\n" + @@ -124,6 +128,8 @@ class MdxOnDemandMdxListSerializerTest extends Specification implements WithMock "\n" + "\n" + "\n" + + sanitizeXml(stringWriter) == sanitizeXml(expectedResponse) } def "wraps list interacts with generator applies mixins"() { @@ -149,7 +155,7 @@ class MdxOnDemandMdxListSerializerTest extends Specification implements WithMock subject.serialize(list, (JsonGenerator) generator, (SerializerProvider) null) then: - stringWriter.toString() == "\n" + + def expectedResponse = "\n" + "\n" + "\n" + " 9.99\n" + @@ -161,5 +167,7 @@ class MdxOnDemandMdxListSerializerTest extends Specification implements WithMock "\n" "\n" + "\n" + + sanitizeXml(stringWriter) == sanitizeXml(expectedResponse) } } diff --git a/mdx-models/src/test/groovy/com/mx/path/model/mdx/model/ondemand/MdxOnDemandSerializerTest.groovy b/mdx-models/src/test/groovy/com/mx/path/model/mdx/model/ondemand/MdxOnDemandSerializerTest.groovy index 253813b6..8e324957 100644 --- a/mdx-models/src/test/groovy/com/mx/path/model/mdx/model/ondemand/MdxOnDemandSerializerTest.groovy +++ b/mdx-models/src/test/groovy/com/mx/path/model/mdx/model/ondemand/MdxOnDemandSerializerTest.groovy @@ -1,5 +1,7 @@ package com.mx.path.model.mdx.model.ondemand +import static com.mx.path.extensions.StringStaticExtension.sanitizeXml + import java.time.LocalDate import com.fasterxml.jackson.core.JsonGenerator @@ -47,12 +49,14 @@ class MdxOnDemandSerializerTest extends Specification implements WithMockery { generator.flush() then: - stringWriter.toString() == "\n" + + def expectedResponse = "\n" + " false\n" + " 0.09\n" + " A-123\n" + " Checking\n" + "\n" + + sanitizeXml(stringWriter) == sanitizeXml(expectedResponse) } def "wrapped, interacts with generator"() { @@ -69,7 +73,7 @@ class MdxOnDemandSerializerTest extends Specification implements WithMockery { generator.flush() then: - stringWriter.toString() == "\n" + + def expectedResponse = "\n" + "\n" + " true\n" + " 0.09\n" + @@ -77,6 +81,8 @@ class MdxOnDemandSerializerTest extends Specification implements WithMockery { " Checking\n" + "\n" + "\n" + + sanitizeXml(stringWriter) == sanitizeXml(expectedResponse) } def "applies mixins"() { @@ -96,7 +102,7 @@ class MdxOnDemandSerializerTest extends Specification implements WithMockery { generator.flush() then: - stringWriter.toString() == "\n" + + def expectedResponse = "\n" + "\n" + " 0.09\n" + " A-123\n" + @@ -104,6 +110,8 @@ class MdxOnDemandSerializerTest extends Specification implements WithMockery { " 2020-12-05\n" + "\n" + "\n" + + sanitizeXml(stringWriter) == sanitizeXml(expectedResponse) } def "accounts list mixins"() { @@ -135,7 +143,7 @@ class MdxOnDemandSerializerTest extends Specification implements WithMockery { generator.flush() then: - stringWriter.toString() == "\n" + + def expectedResponse = "\n" + "\n" + " \n" + " 0.09\n" + @@ -151,6 +159,8 @@ class MdxOnDemandSerializerTest extends Specification implements WithMockery { " \n" + "\n" + "\n" + + sanitizeXml(stringWriter) == sanitizeXml(expectedResponse) } def "empty accounts list mixins"() { @@ -167,9 +177,11 @@ class MdxOnDemandSerializerTest extends Specification implements WithMockery { generator.flush() then: - stringWriter.toString() == "\n" + + def expectedResponse = "\n" + "\n" + "\n" + + sanitizeXml(stringWriter) == sanitizeXml(expectedResponse) } def "serializes LocalDate to string"() { @@ -183,10 +195,12 @@ class MdxOnDemandSerializerTest extends Specification implements WithMockery { generator.flush() then: - stringWriter.toString() == "\n" + + def expectedResponse = "\n" + " false\n" + " 2020-01-12\n" + "\n" + + sanitizeXml(stringWriter) == sanitizeXml(expectedResponse) } def "serializes large amounts"() { @@ -204,7 +218,7 @@ class MdxOnDemandSerializerTest extends Specification implements WithMockery { generator.flush() then: - stringWriter.toString() == "\n" + + def expectedResponse = "\n" + "\n" + " true\n" + " 30000000.00\n" + @@ -212,5 +226,7 @@ class MdxOnDemandSerializerTest extends Specification implements WithMockery { " Checking\n" + "\n" + "\n" + + sanitizeXml(stringWriter) == sanitizeXml(expectedResponse) } }