@@ -923,6 +923,7 @@ void updateInvoiceTransaction_evaluatingBatch_notSuspended_savesTwice_andUpdates
923923 verify (rewardTransactionRepository , times (2 )).save (any ());
924924 }
925925
926+
926927 @ Test
927928 void updateInvoiceTransaction_evaluatingBatch_alreadySuspended_savesOnce_andUpdatesTotalsOldAndNew () {
928929 FilePart fp = filePartBackedBySrc ("invoice.pdf" , true );
@@ -963,7 +964,7 @@ void updateInvoiceTransaction_evaluatingBatch_alreadySuspended_savesOnce_andUpda
963964 .thenReturn (Mono .just (oldBatch ));
964965
965966 when (rewardTransactionRepository .save (any ()))
966- .thenAnswer (inv -> Mono .just (inv .getArgument (0 ))); // solo update invoice
967+ .thenAnswer (inv -> Mono .just (inv .getArgument (0 )));
967968
968969 when (rewardBatchRepository .updateTotals (eq ("OLD" ), any (BatchCountersDTO .class )))
969970 .thenReturn (Mono .just (oldBatch ));
@@ -975,8 +976,7 @@ void updateInvoiceTransaction_evaluatingBatch_alreadySuspended_savesOnce_andUpda
975976 StepVerifier .create (service .updateInvoiceTransaction (TRX_ID , MERCHANT_ID , POS_ID , fp , DOC_NUMBER ))
976977 .verifyComplete ();
977978
978- // non deve risalvare la trx per impostare SUSPENDED (è già suspended)
979- verify (rewardTransactionRepository , times (1 )).save (any ());
979+ verify (rewardTransactionRepository , times (2 )).save (any ());
980980
981981 verify (rewardBatchRepository ).updateTotals (eq ("OLD" ), any (BatchCountersDTO .class ));
982982 verify (rewardBatchRepository ).updateTotals (eq ("NEW" ), any (BatchCountersDTO .class ));
0 commit comments