BAEL-3298 Some more refactoring

This commit is contained in:
Shubhra 2020-02-09 19:13:33 +05:30
parent 7e05fcbe3f
commit 113e3d8ab3
5 changed files with 10 additions and 4 deletions

View File

@ -38,7 +38,7 @@ public class SpringBatchRetryConfig {
@Autowired @Autowired
private StepBuilderFactory stepBuilderFactory; private StepBuilderFactory stepBuilderFactory;
@Value("input/record.csv") @Value("input/recordRetry.csv")
private Resource inputCsv; private Resource inputCsv;
@Value("file:xml/retryOutput.xml") @Value("file:xml/retryOutput.xml")

View File

@ -0,0 +1,3 @@
username, user_id, transaction_date, transaction_amount
sammy, 1234, 31/10/2015, 10000
john, 2134, 3/12/2015, 12321
1 username user_id transaction_date transaction_amount
2 sammy 1234 31/10/2015 10000
3 john 2134 3/12/2015 12321

View File

@ -92,7 +92,10 @@ public class SpringBatchRetryIntegrationTest {
//fails for first two calls and passes third time onwards //fails for first two calls and passes third time onwards
when(httpResponse.getEntity()).thenReturn(new StringEntity("{ \"age\":10, \"postCode\":\"430222\" }")); when(httpResponse.getEntity()).thenReturn(new StringEntity("{ \"age\":10, \"postCode\":\"430222\" }"));
when(httpClient.execute(any())).thenThrow(new ConnectTimeoutException("Timeout count 1")).thenThrow(new ConnectTimeoutException("Timeout count 2")).thenReturn(httpResponse); when(httpClient.execute(any()))
.thenThrow(new ConnectTimeoutException("Timeout count 1"))
.thenThrow(new ConnectTimeoutException("Timeout count 2"))
.thenReturn(httpResponse);
JobExecution jobExecution = jobLauncherTestUtils.launchJob(defaultJobParameters()); JobExecution jobExecution = jobLauncherTestUtils.launchJob(defaultJobParameters());
JobInstance actualJobInstance = jobExecution.getJobInstance(); JobInstance actualJobInstance = jobExecution.getJobInstance();

View File

@ -1 +1 @@
<?xml version="1.0" encoding="UTF-8"?><transactionRecord><transactionRecord><age>10</age><amount>10000.0</amount><postCode>430222</postCode><transactionDate>2015-10-31T00:00:00+05:30</transactionDate><userId>1234</userId><username>devendra</username></transactionRecord><transactionRecord><age>10</age><amount>12321.0</amount><postCode>430222</postCode><transactionDate>2015-12-03T00:00:00+05:30</transactionDate><userId>2134</userId><username>john</username></transactionRecord><transactionRecord><age>10</age><amount>23411.0</amount><postCode>430222</postCode><transactionDate>2015-02-02T00:00:00+05:30</transactionDate><userId>2134</userId><username>robin</username></transactionRecord></transactionRecord> <?xml version="1.0" encoding="UTF-8"?><transactionRecord><transactionRecord><age>10</age><amount>10000.0</amount><postCode>430222</postCode><transactionDate>2015-10-31T00:00:00+05:30</transactionDate><userId>1234</userId><username>sammy</username></transactionRecord><transactionRecord><age>10</age><amount>12321.0</amount><postCode>430222</postCode><transactionDate>2015-12-03T00:00:00+05:30</transactionDate><userId>2134</userId><username>john</username></transactionRecord></transactionRecord>

View File

@ -1 +1 @@
<?xml version="1.0" encoding="UTF-8"?><transactionRecord><transactionRecord><age>10</age><amount>10000.0</amount><postCode>430222</postCode><transactionDate>2015-10-31T00:00:00+05:30</transactionDate><userId>1234</userId><username>devendra</username></transactionRecord><transactionRecord><age>10</age><amount>12321.0</amount><postCode>430222</postCode><transactionDate>2015-12-03T00:00:00+05:30</transactionDate><userId>2134</userId><username>john</username></transactionRecord><transactionRecord><age>10</age><amount>23411.0</amount><postCode>430222</postCode><transactionDate>2015-02-02T00:00:00+05:30</transactionDate><userId>2134</userId><username>robin</username></transactionRecord></transactionRecord> <?xml version="1.0" encoding="UTF-8"?><transactionRecord><transactionRecord><age>10</age><amount>10000.0</amount><postCode>430222</postCode><transactionDate>2015-10-31T00:00:00+05:30</transactionDate><userId>1234</userId><username>sammy</username></transactionRecord><transactionRecord><age>10</age><amount>12321.0</amount><postCode>430222</postCode><transactionDate>2015-12-03T00:00:00+05:30</transactionDate><userId>2134</userId><username>john</username></transactionRecord></transactionRecord>