@@ -41,28 +41,28 @@ public class BankAccountServiceTest {
4141
4242 @ Test
4343 public void testBankAccountServiceCreation () {
44- BankAccountService chargeService = new BankAccountService ();
45- Assert .assertNull (chargeService .getRequestContext ());
44+ BankAccountService bankService = new BankAccountService ();
45+ Assert .assertNull (bankService .getRequestContext ());
4646 }
4747
4848 @ Test
4949 public void testBankAccountServiceRequestContext () {
5050 RequestContext requestContext = new RequestContext ();
5151 requestContext .setBaseUrl ("fakeBaseUrl" );
52- BankAccountService chargeService = new BankAccountService (requestContext );
53- Assert .assertEquals (requestContext , chargeService .getRequestContext ());
52+ BankAccountService bankService = new BankAccountService (requestContext );
53+ Assert .assertEquals (requestContext , bankService .getRequestContext ());
5454
5555 RequestContext secondRequestContext = new RequestContext ();
5656 secondRequestContext .setBaseUrl ("secondBaseUrl" );
57- chargeService .setRequestContext (secondRequestContext );
58- Assert .assertEquals (secondRequestContext , chargeService .getRequestContext ());
57+ bankService .setRequestContext (secondRequestContext );
58+ Assert .assertEquals (secondRequestContext , bankService .getRequestContext ());
5959 }
6060
6161 @ Test
6262 public void testCreateBankAccount () throws BaseException {
6363 BankAccount expectedBankAccount = new BankAccount .Builder ().build ();
64- final String chargeString = JsonUtil .serialize (expectedBankAccount );
65- final Response mockedResponse = new Response (200 , chargeString , "fjkdlsfd" );
64+ final String bankAccountString = JsonUtil .serialize (expectedBankAccount );
65+ final Response mockedResponse = new Response (200 , bankAccountString , "fjkdlsfd" );
6666 mockedResponse .setResponseObject (expectedBankAccount );
6767
6868 new Expectations () {{
@@ -72,12 +72,12 @@ public void testCreateBankAccount() throws BaseException {
7272
7373 RequestContext requestContext = new RequestContext ();
7474 requestContext .setBaseUrl ("fakeBaseUrl" );
75- BankAccountService chargeService = new BankAccountService (requestContext );
75+ BankAccountService bankService = new BankAccountService (requestContext );
7676
7777 try {
7878 BankAccount bankAccount = new BankAccount ();
79- BankAccount chargeGenerated = chargeService .create (bankAccount , "customerId" );
80- Assert .assertEquals (expectedBankAccount , chargeGenerated );
79+ BankAccount bankAccountGenerated = bankService .create (bankAccount , "customerId" );
80+ Assert .assertEquals (expectedBankAccount , bankAccountGenerated );
8181
8282 } catch (BaseException e ) {
8383 Assert .fail ("Unexpected BaseException thrown " + e .getMessage ());
@@ -86,17 +86,17 @@ public void testCreateBankAccount() throws BaseException {
8686
8787 @ Test
8888 public void testCreateBankAccountNullBankAccountId () {
89- BankAccountService chargeService = new BankAccountService ();
89+ BankAccountService bankService = new BankAccountService ();
9090 try {
91- chargeService .create (null , null );
91+ bankService .create (null , null );
9292 Assert .fail ("Expected IllegalArgumentException thrown" );
9393 } catch (IllegalArgumentException e ) {
9494 Assert .assertTrue (true , "Expected IllegalArgumentException was thrown" );
9595 } catch (BaseException e ) {
9696 Assert .fail ("Unexpected BaseException thrown " + e .getMessage ());
9797 }
9898 try {
99- chargeService .create (null , "" );
99+ bankService .create (null , "" );
100100 Assert .fail ("Expected IllegalArgumentException thrown" );
101101 } catch (IllegalArgumentException e ) {
102102 Assert .assertTrue (true , "Expected IllegalArgumentException was thrown" );
@@ -109,8 +109,8 @@ public void testCreateBankAccountNullBankAccountId() {
109109 @ Test
110110 public void testCreateFromTokenBankAccount () throws BaseException {
111111 BankAccount expectedBankAccount = new BankAccount .Builder ().build ();
112- final String chargeString = JsonUtil .serialize (expectedBankAccount );
113- final Response mockedResponse = new Response (200 , chargeString , "fjkdlsfd" );
112+ final String bankAccountGeneratedString = JsonUtil .serialize (expectedBankAccount );
113+ final Response mockedResponse = new Response (200 , bankAccountGeneratedString , "fjkdlsfd" );
114114 mockedResponse .setResponseObject (expectedBankAccount );
115115
116116 new Expectations () {{
@@ -120,12 +120,12 @@ public void testCreateFromTokenBankAccount() throws BaseException {
120120
121121 RequestContext requestContext = new RequestContext ();
122122 requestContext .setBaseUrl ("fakeBaseUrl" );
123- BankAccountService chargeService = new BankAccountService (requestContext );
123+ BankAccountService bankService = new BankAccountService (requestContext );
124124
125125 try {
126126 Token token = new Token ();
127- BankAccount chargeGenerated = chargeService .createFromToken (token , "customerId" );
128- Assert .assertEquals (expectedBankAccount , chargeGenerated );
127+ BankAccount bankAccountGenerated = bankService .createFromToken (token , "customerId" );
128+ Assert .assertEquals (expectedBankAccount , bankAccountGenerated );
129129
130130 } catch (BaseException e ) {
131131 Assert .fail ("Unexpected BaseException thrown " + e .getMessage ());
@@ -134,17 +134,17 @@ public void testCreateFromTokenBankAccount() throws BaseException {
134134
135135 @ Test
136136 public void testCreateFromTokenBankAccountNullBankAccountId () {
137- BankAccountService chargeService = new BankAccountService ();
137+ BankAccountService bankService = new BankAccountService ();
138138 try {
139- chargeService .createFromToken (null , null );
139+ bankService .createFromToken (null , null );
140140 Assert .fail ("Expected IllegalArgumentException thrown" );
141141 } catch (IllegalArgumentException e ) {
142142 Assert .assertTrue (true , "Expected IllegalArgumentException was thrown" );
143143 } catch (BaseException e ) {
144144 Assert .fail ("Unexpected BaseException thrown " + e .getMessage ());
145145 }
146146 try {
147- chargeService .createFromToken (null , "" );
147+ bankService .createFromToken (null , "" );
148148 Assert .fail ("Expected IllegalArgumentException thrown" );
149149 } catch (IllegalArgumentException e ) {
150150 Assert .assertTrue (true , "Expected IllegalArgumentException was thrown" );
@@ -156,8 +156,8 @@ public void testCreateFromTokenBankAccountNullBankAccountId() {
156156 @ Test
157157 public void testRetrieveBankAccount () throws BaseException {
158158 BankAccount expectedBankAccount = new BankAccount .Builder ().id ("ijids" ).accountNumber ("accountId" ).build ();
159- final String chargeString = JsonUtil .serialize (expectedBankAccount );
160- final Response mockedResponse = new Response (200 , chargeString , "fjkdlsfd" );
159+ final String bankAccountGeneratedString = JsonUtil .serialize (expectedBankAccount );
160+ final Response mockedResponse = new Response (200 , bankAccountGeneratedString , "fjkdlsfd" );
161161 mockedResponse .setResponseObject (expectedBankAccount );
162162
163163 new Expectations () {{
@@ -180,33 +180,33 @@ public void testRetrieveBankAccount() throws BaseException {
180180
181181 @ Test
182182 public void testRetrieveBankAccountNullBankAccountId () {
183- BankAccountService chargeService = new BankAccountService ();
183+ BankAccountService bankService = new BankAccountService ();
184184 try {
185- chargeService .getBankAccount (null , null );
185+ bankService .getBankAccount (null , null );
186186 Assert .fail ("Expected IllegalArgumentException thrown" );
187187 } catch (IllegalArgumentException e ) {
188188 Assert .assertTrue (true , "Expected IllegalArgumentException was thrown" );
189189 } catch (BaseException e ) {
190190 Assert .fail ("Unexpected BaseException thrown " + e .getMessage ());
191191 }
192192 try {
193- chargeService .getBankAccount ("customerId" , null );
193+ bankService .getBankAccount ("customerId" , null );
194194 Assert .fail ("Expected IllegalArgumentException thrown" );
195195 } catch (IllegalArgumentException e ) {
196196 Assert .assertTrue (true , "Expected IllegalArgumentException was thrown" );
197197 } catch (BaseException e ) {
198198 Assert .fail ("Unexpected BaseException thrown " + e .getMessage ());
199199 }
200200 try {
201- chargeService .getBankAccount ("customerId" , "" );
201+ bankService .getBankAccount ("customerId" , "" );
202202 Assert .fail ("Expected IllegalArgumentException thrown" );
203203 } catch (IllegalArgumentException e ) {
204204 Assert .assertTrue (true , "Expected IllegalArgumentException was thrown" );
205205 } catch (BaseException e ) {
206206 Assert .fail ("Unexpected BaseException thrown " + e .getMessage ());
207207 }
208208 try {
209- chargeService .getBankAccount ("" , "" );
209+ bankService .getBankAccount ("" , "" );
210210 Assert .fail ("Expected IllegalArgumentException thrown" );
211211 } catch (IllegalArgumentException e ) {
212212 Assert .assertTrue (true , "Expected IllegalArgumentException was thrown" );
@@ -225,8 +225,8 @@ public void testRetrieveAllBankAccount() throws BaseException {
225225 bankAccount2 .setAccountNumber ("accountNumber2" );
226226 bankAccounts .add (bankAccount2 );
227227 QueryResponse expectedQueryResponse = new QueryResponse .Builder ().bankAccounts (bankAccounts ).build ();
228- final String chargeString = JsonUtil .serialize (expectedQueryResponse );
229- final Response mockedResponse = new Response (200 , chargeString , "fjkdlsfd" );
228+ final String bankAccountString = JsonUtil .serialize (expectedQueryResponse );
229+ final Response mockedResponse = new Response (200 , bankAccountString , "fjkdlsfd" );
230230 mockedResponse .setResponseObject (bankAccounts );
231231
232232 new Expectations () {{
@@ -249,17 +249,17 @@ public void testRetrieveAllBankAccount() throws BaseException {
249249
250250 @ Test
251251 public void testRetrieveAllBankAccountNullBankAccountId () {
252- BankAccountService chargeService = new BankAccountService ();
252+ BankAccountService bankService = new BankAccountService ();
253253 try {
254- chargeService .getAllBankAccounts (null );
254+ bankService .getAllBankAccounts (null );
255255 Assert .fail ("Expected IllegalArgumentException thrown" );
256256 } catch (IllegalArgumentException e ) {
257257 Assert .assertTrue (true , "Expected IllegalArgumentException was thrown" );
258258 } catch (BaseException e ) {
259259 Assert .fail ("Unexpected BaseException thrown " + e .getMessage ());
260260 }
261261 try {
262- chargeService .getAllBankAccounts ("" );
262+ bankService .getAllBankAccounts ("" );
263263 Assert .fail ("Expected IllegalArgumentException thrown" );
264264 } catch (IllegalArgumentException e ) {
265265 Assert .assertTrue (true , "Expected IllegalArgumentException was thrown" );
@@ -279,8 +279,8 @@ public void testRetrieveAllBankAccountWithCount() throws BaseException {
279279 bankAccount2 .setAccountNumber ("accountNumber2" );
280280 bankAccounts .add (bankAccount2 );
281281 QueryResponse expectedQueryResponse = new QueryResponse .Builder ().bankAccounts (bankAccounts ).build ();
282- final String chargeString = JsonUtil .serialize (expectedQueryResponse );
283- final Response mockedResponse = new Response (200 , chargeString , "fjkdlsfd" );
282+ final String bankAccountString = JsonUtil .serialize (expectedQueryResponse );
283+ final Response mockedResponse = new Response (200 , bankAccountString , "fjkdlsfd" );
284284 mockedResponse .setResponseObject (bankAccounts );
285285
286286 new Expectations () {{
@@ -303,17 +303,17 @@ public void testRetrieveAllBankAccountWithCount() throws BaseException {
303303
304304 @ Test
305305 public void testRetrieveAllBankAccountNullBankAccountIdWithCount () {
306- BankAccountService chargeService = new BankAccountService ();
306+ BankAccountService bankService = new BankAccountService ();
307307 try {
308- chargeService .getAllBankAccounts (null , 0 );
308+ bankService .getAllBankAccounts (null , 0 );
309309 Assert .fail ("Expected IllegalArgumentException thrown" );
310310 } catch (IllegalArgumentException e ) {
311311 Assert .assertTrue (true , "Expected IllegalArgumentException was thrown" );
312312 } catch (BaseException e ) {
313313 Assert .fail ("Unexpected BaseException thrown " + e .getMessage ());
314314 }
315315 try {
316- chargeService .getAllBankAccounts ("" , 0 );
316+ bankService .getAllBankAccounts ("" , 0 );
317317 Assert .fail ("Expected IllegalArgumentException thrown" );
318318 } catch (IllegalArgumentException e ) {
319319 Assert .assertTrue (true , "Expected IllegalArgumentException was thrown" );
@@ -325,8 +325,8 @@ public void testRetrieveAllBankAccountNullBankAccountIdWithCount() {
325325 @ Test
326326 public void testDeleteBankAccount () throws BaseException {
327327 BankAccount expectedBankAccount = new BankAccount .Builder ().accountNumber ("accountId" ).build ();
328- final String chargeString = JsonUtil .serialize (expectedBankAccount );
329- final Response mockedResponse = new Response (200 , chargeString , "fjkdlsfd" );
328+ final String bankAccountString = JsonUtil .serialize (expectedBankAccount );
329+ final Response mockedResponse = new Response (200 , bankAccountString , "fjkdlsfd" );
330330 mockedResponse .setResponseObject (expectedBankAccount );
331331
332332 new Expectations () {{
@@ -336,11 +336,11 @@ public void testDeleteBankAccount() throws BaseException {
336336
337337 RequestContext requestContext = new RequestContext ();
338338 requestContext .setBaseUrl ("fakeBaseUrl" );
339- BankAccountService chargeService = new BankAccountService (requestContext );
339+ BankAccountService bankService = new BankAccountService (requestContext );
340340
341341 try {
342342 BankAccount bankAccount = new BankAccount ();
343- BankAccount chargeGenerated = chargeService .delete ("customerId" , "bankAccountId" );
343+ BankAccount bankAccountGenerated = bankService .delete ("customerId" , "bankAccountId" );
344344 // NOTE: No asserts required as a dummy response is being sent by delete API
345345 } catch (BaseException e ) {
346346 Assert .fail ("Unexpected BaseException thrown " + e .getMessage ());
@@ -350,33 +350,33 @@ public void testDeleteBankAccount() throws BaseException {
350350
351351 @ Test
352352 public void testDeleteBankAccountNullBankAccountId () {
353- BankAccountService chargeService = new BankAccountService ();
353+ BankAccountService bankService = new BankAccountService ();
354354 try {
355- chargeService .delete (null , null );
355+ bankService .delete (null , null );
356356 Assert .fail ("Expected IllegalArgumentException thrown" );
357357 } catch (IllegalArgumentException e ) {
358358 Assert .assertTrue (true , "Expected IllegalArgumentException was thrown" );
359359 } catch (BaseException e ) {
360360 Assert .fail ("Unexpected BaseException thrown " + e .getMessage ());
361361 }
362362 try {
363- chargeService .delete ("customerId" , null );
363+ bankService .delete ("customerId" , null );
364364 Assert .fail ("Expected IllegalArgumentException thrown" );
365365 } catch (IllegalArgumentException e ) {
366366 Assert .assertTrue (true , "Expected IllegalArgumentException was thrown" );
367367 } catch (BaseException e ) {
368368 Assert .fail ("Unexpected BaseException thrown " + e .getMessage ());
369369 }
370370 try {
371- chargeService .delete ("customerId" , "" );
371+ bankService .delete ("customerId" , "" );
372372 Assert .fail ("Expected IllegalArgumentException thrown" );
373373 } catch (IllegalArgumentException e ) {
374374 Assert .assertTrue (true , "Expected IllegalArgumentException was thrown" );
375375 } catch (BaseException e ) {
376376 Assert .fail ("Unexpected BaseException thrown " + e .getMessage ());
377377 }
378378 try {
379- chargeService .delete ("" , "" );
379+ bankService .delete ("" , "" );
380380 Assert .fail ("Expected IllegalArgumentException thrown" );
381381 } catch (IllegalArgumentException e ) {
382382 Assert .assertTrue (true , "Expected IllegalArgumentException was thrown" );
0 commit comments