17
17
import io .airbyte .config .helpers .LogConfigs ;
18
18
import io .airbyte .config .persistence .ConfigNotFoundException ;
19
19
import io .airbyte .config .persistence .ConfigRepository ;
20
- import io .airbyte .db .ExceptionWrappingDatabase ;
21
20
import io .airbyte .scheduler .models .Job ;
22
21
import io .airbyte .scheduler .persistence .JobNotifier ;
23
22
import io .airbyte .scheduler .persistence .JobPersistence ;
@@ -108,8 +107,6 @@ public void createJob() throws JsonValidationException, ConfigNotFoundException,
108
107
.thenReturn (JOB_ID );
109
108
Mockito .when (mConfigRepository .getStandardSync (CONNECTION_ID ))
110
109
.thenReturn (Mockito .mock (StandardSync .class ));
111
- Mockito .when (mConfigRepository .getDatabase ())
112
- .thenReturn (Mockito .mock (ExceptionWrappingDatabase .class ));
113
110
114
111
final JobCreationOutput output = jobCreationAndStatusUpdateActivity .createNewJob (new JobCreationInput (CONNECTION_ID , false ));
115
112
@@ -119,8 +116,6 @@ public void createJob() throws JsonValidationException, ConfigNotFoundException,
119
116
@ Test
120
117
@ DisplayName ("Test attempt creation" )
121
118
public void createAttempt () throws IOException {
122
- Mockito .when (mConfigRepository .getDatabase ()).thenReturn (Mockito .mock (ExceptionWrappingDatabase .class ));
123
-
124
119
final Job mJob = Mockito .mock (Job .class );
125
120
126
121
Mockito .when (mJobPersistence .getJob (JOB_ID ))
@@ -169,8 +164,6 @@ public void createAttemptThrowException() throws IOException {
169
164
@ Test
170
165
@ DisplayName ("Test attempt creation" )
171
166
public void createAttemptNumber () throws IOException {
172
- Mockito .when (mConfigRepository .getDatabase ()).thenReturn (Mockito .mock (ExceptionWrappingDatabase .class ));
173
-
174
167
final Job mJob = Mockito .mock (Job .class );
175
168
176
169
Mockito .when (mJobPersistence .getJob (JOB_ID ))
@@ -223,8 +216,6 @@ class Update {
223
216
224
217
@ Test
225
218
public void setJobSuccess () throws IOException {
226
- Mockito .when (mConfigRepository .getDatabase ()).thenReturn (Mockito .mock (ExceptionWrappingDatabase .class ));
227
-
228
219
jobCreationAndStatusUpdateActivity .jobSuccess (new JobSuccessInput (JOB_ID , ATTEMPT_ID , standardSyncOutput ));
229
220
230
221
Mockito .verify (mJobPersistence ).writeOutput (JOB_ID , ATTEMPT_ID , jobOutput );
@@ -245,8 +236,6 @@ public void setJobSuccessWrapException() throws IOException {
245
236
246
237
@ Test
247
238
public void setJobFailure () throws IOException {
248
- Mockito .when (mConfigRepository .getDatabase ()).thenReturn (Mockito .mock (ExceptionWrappingDatabase .class ));
249
-
250
239
jobCreationAndStatusUpdateActivity .jobFailure (new JobFailureInput (JOB_ID , "reason" ));
251
240
252
241
Mockito .verify (mJobPersistence ).failJob (JOB_ID );
@@ -265,8 +254,6 @@ public void setJobFailureWrapException() throws IOException {
265
254
266
255
@ Test
267
256
public void setAttemptFailure () throws IOException {
268
- Mockito .when (mConfigRepository .getDatabase ()).thenReturn (Mockito .mock (ExceptionWrappingDatabase .class ));
269
-
270
257
jobCreationAndStatusUpdateActivity .attemptFailure (new AttemptFailureInput (JOB_ID , ATTEMPT_ID , standardSyncOutput , failureSummary ));
271
258
272
259
Mockito .verify (mJobPersistence ).failAttempt (JOB_ID , ATTEMPT_ID );
@@ -288,8 +275,6 @@ public void setAttemptFailureWrapException() throws IOException {
288
275
289
276
@ Test
290
277
public void setJobCancelled () throws IOException {
291
- Mockito .when (mConfigRepository .getDatabase ()).thenReturn (Mockito .mock (ExceptionWrappingDatabase .class ));
292
-
293
278
jobCreationAndStatusUpdateActivity .jobCancelled (new JobCancelledInput (JOB_ID , ATTEMPT_ID , failureSummary ));
294
279
295
280
Mockito .verify (mJobPersistence ).cancelJob (JOB_ID );
0 commit comments