Minor refactoring in test class

This commit is contained in:
Shubhra Srivastava 2020-02-11 07:31:32 +05:30 committed by GitHub
parent bc229a692e
commit 02f140e1c5
1 changed files with 6 additions and 6 deletions

View File

@ -66,12 +66,6 @@ public class SpringBatchRetryIntegrationTest {
MockitoAnnotations.initMocks(this); MockitoAnnotations.initMocks(this);
} }
private JobParameters defaultJobParameters() {
JobParametersBuilder paramsBuilder = new JobParametersBuilder();
paramsBuilder.addString("jobID", String.valueOf(System.currentTimeMillis()));
return paramsBuilder.toJobParameters();
}
@Test @Test
public void whenEndpointAlwaysFailing_thenJobFails() throws Exception { public void whenEndpointAlwaysFailing_thenJobFails() throws Exception {
when(httpClient.execute(any())).thenThrow(new ConnectTimeoutException("Endpoint is down")); when(httpClient.execute(any())).thenThrow(new ConnectTimeoutException("Endpoint is down"));
@ -105,4 +99,10 @@ public class SpringBatchRetryIntegrationTest {
assertThat(actualJobExitStatus.getExitCode(), is("COMPLETED")); assertThat(actualJobExitStatus.getExitCode(), is("COMPLETED"));
AssertFile.assertFileEquals(expectedResult, actualResult); AssertFile.assertFileEquals(expectedResult, actualResult);
} }
private JobParameters defaultJobParameters() {
JobParametersBuilder paramsBuilder = new JobParametersBuilder();
paramsBuilder.addString("jobID", String.valueOf(System.currentTimeMillis()));
return paramsBuilder.toJobParameters();
}
} }