@@ -617,15 +617,15 @@ public void createPermanentlyDeleteTickets() throws Exception {
617
617
final Long [] ticketsIds = tickets .stream ().map (Ticket ::getId ).toArray (Long []::new );
618
618
// when
619
619
// We soft delete them
620
- instance .deleteTickets (firstElement (ticketsIds ), otherElements (ticketsIds ));
621
- waitTicketsDeleted ( ticketsIds );
620
+ JobStatus softDeleteJobStatus = waitJobCompletion ( instance .deleteTickets (firstElement (ticketsIds ), otherElements (ticketsIds ) ));
621
+ assertThat ( "Soft Delete Job is completed" , softDeleteJobStatus . getStatus (), is ( JobStatus . JobStatusEnum . completed ) );
622
622
// We permanently delete them
623
- JobStatus jobStatus =
623
+ JobStatus permDeleteJobStatus =
624
624
waitJobCompletion (
625
625
instance .permanentlyDeleteTickets (firstElement (ticketsIds ), otherElements (ticketsIds )));
626
626
// then
627
- assertThat ("Job is completed" , jobStatus .getStatus (), is (JobStatus .JobStatusEnum .completed ));
628
- jobStatus .getResults ().forEach (jobResult -> {
627
+ assertThat ("Job is completed" , permDeleteJobStatus .getStatus (), is (JobStatus .JobStatusEnum .completed ));
628
+ permDeleteJobStatus .getResults ().forEach (jobResult -> {
629
629
assertThat ("The job result has no account_id entry" , jobResult .getAccountId (), nullValue ());
630
630
assertThat ("The job result has no action entry" , jobResult .getAction (), nullValue ());
631
631
assertThat ("The job result has no details entry" , jobResult .getDetails (), nullValue ());
@@ -710,7 +710,7 @@ public void createTickets() throws Exception {
710
710
assertThat ("A unique ID must be set" , id , notNullValue ()));
711
711
} finally {
712
712
// cleanup
713
- instance .deleteTickets (firstElement (createdTicketsIds ), otherElements (createdTicketsIds ));
713
+ waitJobCompletion ( instance .deleteTickets (firstElement (createdTicketsIds ), otherElements (createdTicketsIds ) ));
714
714
}
715
715
}
716
716
@@ -752,7 +752,7 @@ public void updateTickets() throws Exception {
752
752
assertThat ("The job result has a success entry" , jobResult .getSuccess (), is (TRUE ));
753
753
});
754
754
} finally {
755
- instance .deleteTickets (firstElement (ticketsIds ), otherElements (ticketsIds ));
755
+ waitJobCompletion ( instance .deleteTickets (firstElement (ticketsIds ), otherElements (ticketsIds ) ));
756
756
}
757
757
}
758
758
@@ -839,7 +839,7 @@ public void importTickets() throws Exception {
839
839
// then
840
840
} finally {
841
841
// cleanup
842
- instance .deleteTickets (firstElement (createdTicketsIds ), otherElements (createdTicketsIds ));
842
+ waitJobCompletion ( instance .deleteTickets (firstElement (createdTicketsIds ), otherElements (createdTicketsIds ) ));
843
843
}
844
844
}
845
845
0 commit comments