Skip to content

Commit 8778b57

Browse files
author
sangeet-joy_xero
committed
Updated the test cases
1 parent 3a5b8d7 commit 8778b57

9 files changed

+12
-13
lines changed

src/test/java/com/xero/api/client/AccountingApiBankTransactionTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
import static org.hamcrest.MatcherAssert.*;
88
import static org.hamcrest.Matchers.*;
9-
import static org.hamcrest.Matchers.containsInAnyOrder;
10-
import static org.hamcrest.Matchers.greaterThan;
119
import static org.hamcrest.collection.IsCollectionWithSize.hasSize;
1210
import static org.hamcrest.core.Every.everyItem;
1311

@@ -91,7 +89,7 @@ public void testGetBankTransactions() throws Exception {
9189
Integer page = null;
9290
Integer unitdp = null;
9391
Integer pageSize = null;
94-
GetBankTransactionsResponse response = accountingApi.getBankTransactions(accessToken,xeroTenantId,ifModifiedSince, where, order, page, unitdp, pageSize);
92+
BankTransactions response = accountingApi.getBankTransactions(accessToken,xeroTenantId,ifModifiedSince, where, order, page, unitdp, pageSize);
9593
assertThat(response.getBankTransactions().get(0).getBankTransactionID(), is(equalTo(UUID.fromString("db54aab0-ad40-4ced-bcff-0940ba20db2c"))));
9694
assertThat(response.getBankTransactions().get(0).getStatus(), is(equalTo(com.xero.models.accounting.BankTransaction.StatusEnum.AUTHORISED)));
9795
assertThat(response.getBankTransactions().get(0).getType(), is(equalTo(com.xero.models.accounting.BankTransaction.TypeEnum.RECEIVE)));

src/test/java/com/xero/api/client/AccountingApiContactsTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
import static org.hamcrest.MatcherAssert.*;
88
import static org.hamcrest.Matchers.*;
9-
import static org.hamcrest.Matchers.containsInAnyOrder;
10-
import static org.hamcrest.Matchers.greaterThan;
119
import static org.hamcrest.collection.IsCollectionWithSize.hasSize;
1210
import static org.hamcrest.core.Every.everyItem;
1311

@@ -96,7 +94,7 @@ public void getContactsTest() throws IOException {
9694
List<UUID> ids = new ArrayList();
9795
Boolean includeArchived = null;
9896
Boolean summaryOnly = null;
99-
GetContactsResponse response = accountingApi.getContacts(accessToken,xeroTenantId,ifModifiedSince, where, order, ids, null, includeArchived, summaryOnly, null, null);
97+
Contacts response = accountingApi.getContacts(accessToken,xeroTenantId,ifModifiedSince, where, order, ids, null, includeArchived, summaryOnly, null, null);
10098

10199
assertThat(response.getContacts().get(0).getContactID(), is(equalTo(UUID.fromString("5cc8cf28-567e-4d43-b287-687cfcaec47c"))));
102100
assertThat(response.getContacts().get(0).getName(), is(equalTo("Katherine Warren")));

src/test/java/com/xero/api/client/AccountingApiCreditNotesTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ public void getCreditNotesTest() throws IOException {
207207
Integer page = null;
208208
Integer unitdp = null;
209209
Integer pageSize = null;
210-
GetCreditNotesResponse response = accountingApi.getCreditNotes(accessToken,xeroTenantId,ifModifiedSince, where, order, page, unitdp, pageSize);
210+
CreditNotes response = accountingApi.getCreditNotes(accessToken,xeroTenantId,ifModifiedSince, where, order, page, unitdp, pageSize);
211211

212212
assertThat(response.getCreditNotes().get(0).getType(), is(equalTo(com.xero.models.accounting.CreditNote.TypeEnum.ACCRECCREDIT)));
213213
assertThat(response.getCreditNotes().get(0).getDateAsDate(), is(equalTo(LocalDate.of(2019, 03, 05))));

src/test/java/com/xero/api/client/AccountingApiInvoicesTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,8 @@ public void getInvoicesTest() throws IOException {
231231
Integer unitdp = null;
232232
Boolean summaryOnly = null;
233233
Integer pageSize = null;
234-
GetInvoicesResponse response = accountingApi.getInvoices(accessToken, xeroTenantId, ifModifiedSince, where, order, ids, invoiceNumbers, contactIDs, statuses, page, includeArchived, createdByMyApp, unitdp, summaryOnly, pageSize);
234+
String searchTerm = null;
235+
Invoices response = accountingApi.getInvoices(accessToken, xeroTenantId, ifModifiedSince, where, order, ids, invoiceNumbers, contactIDs, statuses, page, includeArchived, createdByMyApp, unitdp, summaryOnly, pageSize, searchTerm);
235236

236237
assertThat(response.getInvoices().get(0).getType(), is(equalTo(com.xero.models.accounting.Invoice.TypeEnum.ACCREC)));
237238
assertThat(response.getInvoices().get(0).getDateAsDate(), is(equalTo(LocalDate.of(2018,10,20))));

src/test/java/com/xero/api/client/AccountingApiManualJournalsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public void getManualJournalsTest() throws IOException {
191191
String order = null;
192192
Integer page = null;
193193
Integer pageSize = null;
194-
GetManualJournalsResponse response = accountingApi.getManualJournals(accessToken,xeroTenantId,ifModifiedSince, where, order, page, pageSize);
194+
ManualJournals response = accountingApi.getManualJournals(accessToken,xeroTenantId,ifModifiedSince, where, order, page, pageSize);
195195

196196
assertThat(response.getManualJournals().get(0).getNarration(), is(equalTo("Reversal: These aren't the droids you are looking for")));
197197
assertThat(response.getManualJournals().get(0).getDateAsDate(), is(equalTo(LocalDate.of(2019,03,21))));

src/test/java/com/xero/api/client/AccountingApiOverpaymentsTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,9 @@ public void getOverpaymentsTest() throws IOException {
148148
String order = null;
149149
Integer page = null;
150150
Integer unitdp = null;
151+
Integer pageSize = null;
151152

152-
GetOverpaymentsResponse response = accountingApi.getOverpayments(accessToken,xeroTenantId,ifModifiedSince, where, order, page, unitdp);
153+
Overpayments response = accountingApi.getOverpayments(accessToken,xeroTenantId,ifModifiedSince, where, order, page, unitdp, pageSize);
153154

154155
assertThat(response.getOverpayments().get(0).getDateAsDate(), is(equalTo(LocalDate.of(2019,03,12))));
155156
assertThat(response.getOverpayments().get(0).getStatus(), is(equalTo(com.xero.models.accounting.Overpayment.StatusEnum.AUTHORISED)));

src/test/java/com/xero/api/client/AccountingApiPaymentsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public void getPaymentsTest() throws IOException {
139139
OffsetDateTime ifModifiedSince = null;
140140
String where = null;
141141
String order = null;
142-
GetPaymentsResponse response = accountingApi.getPayments(accessToken,xeroTenantId,ifModifiedSince, where, order,1, null);
142+
Payments response = accountingApi.getPayments(accessToken,xeroTenantId,ifModifiedSince, where, order,1, null);
143143

144144
assertThat(response.getPayments().get(0).getInvoice().getInvoiceNumber(), is(equalTo("INV-0002")));
145145
assertThat(response.getPayments().get(0).getAccount().getCode(), is(equalTo("970")));

src/test/java/com/xero/api/client/AccountingApiPrepaymentsTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ public void getPrepaymentsTest() throws IOException {
144144
String order = null;
145145
Integer page = null;
146146
Integer unitdp = null;
147-
GetPrepaymentsResponse response = accountingApi.getPrepayments(accessToken,xeroTenantId,ifModifiedSince, where, order, page, unitdp);
147+
Integer pageSize = null;
148+
Prepayments response = accountingApi.getPrepayments(accessToken,xeroTenantId,ifModifiedSince, where, order, page, unitdp, pageSize);
148149

149150
assertThat(response.getPrepayments().get(0).getType().toString(), is(equalTo("RECEIVE-PREPAYMENT")));
150151
assertThat(response.getPrepayments().get(0).getContact().getName(), is(equalTo("Luke Skywalker")));

src/test/java/com/xero/api/client/AccountingApiPurchaseOrdersTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public void getPurchaseOrdersTest() throws IOException {
181181
String order = null;
182182
Integer page = null;
183183
Integer pageSize = null;
184-
GetPurchaseOrdersResponse response = accountingApi.getPurchaseOrders(accessToken,xeroTenantId,ifModifiedSince, status, dateFrom, dateTo, order, page, pageSize);
184+
PurchaseOrders response = accountingApi.getPurchaseOrders(accessToken,xeroTenantId,ifModifiedSince, status, dateFrom, dateTo, order, page, pageSize);
185185

186186
assertThat(response.getPurchaseOrders().get(0).getContact().getContactID(), is(equalTo(UUID.fromString("430fa14a-f945-44d3-9f97-5df5e28441b8"))));
187187
assertThat(response.getPurchaseOrders().get(0).getLineItems().get(0).getLineItemID(), is(equalTo(UUID.fromString("0f7b54b8-bfa4-4c5d-9c22-73dbd5796e54"))));

0 commit comments

Comments
 (0)