package Ġio . ple o . ant ae us . ret rier . retry . delivery . bus Ċ Ċ import Ġio . mock k . every Ċ import Ġio . mock k . mock k Ċ import Ġio . mock k . verify Ċ import Ġio . ple o . ant ae us . rabbitmq . Message Ċ import Ġio . ple o . ant ae us . ret rier . retry . app . services . Retry Service Ċ import Ġio . ple o . ant ae us . ret rier . retry . domain . Payment Event Ċ import Ġio . ple o . ant ae us . ret rier . retry . domain . event . Invoice Pay Commit Failed Event Ċ import Ġio . ple o . ant ae us . ret rier . retry . domain . event . Invoice Pay Commit Suc ceed Event Ċ import Ġio . ple o . ant ae us . ret rier . retry . domain . event . topic . Event Topic Ċ import Ġorg . junit . jupiter . api . Test Ċ Ċ class ĠHandler Test Ġ{ ĊĠĠĠ Ġprivate Ġval Ġretry Service Ġ= Ġmock k < Retry Service >( relax ed Ġ= Ġtrue ) Ġ{ ĊĠĠĠĠĠĠĠ Ġevery Ġ{ Ġpayment Event ( any ()) Ġ} Ġreturns ĠUnit ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` it Ġshould Ġpass Ġthe Ġcorrect Ġparams Ġin Ġinvoice Pay Commit Failed Handler `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġinvoice Pay Commit Failed Handler Ġ= Ġinvoice Pay Commit Failed Handler ( retry Service ) ĊĠĠĠĠĠĠĠ Ġval Ġmessage Ġ= ĠMessage ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ"{\" invoice ID \": 1 ,\" timestamp \": 1 5 6 8 4 3 8 4 6 0 2 6 3 ,\" reason \":\" foo \" }", ĠEvent Topic . Invoice Pay Commit Failed Event . name ) ĊĠĠĠĠĠĠĠ Ġinvoice Pay Commit Failed Handler ( message ) ĊĊĠĠĠĠĠĠĠ Ġval Ġevent Ġ= ĠInvoice Pay Commit Failed Event ( invoice ID Ġ= Ġ 1 , Ġtimestamp Ġ= Ġ 1 5 6 8 4 3 8 4 6 0 2 6 3 , Ġreason Ġ= Ġ" foo ") ĊĠĠĠĠĠĠĠ Ġverify Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġretry Service . payment Event ( Payment Event ( invoice Id Ġ= Ġevent . invoice ID , Ġtype Ġ= Ġevent . topic (), Ġevent Ġ= Ġevent )) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` it Ġshould Ġpass Ġthe Ġcorrect Ġparams Ġin Ġinvoice Pay Commit Suc ceed Handler `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġinvoice Pay Commit Suc ceed Handler Ġ= Ġinvoice Pay Commit Suc ceed Handler ( retry Service ) ĊĠĠĠĠĠĠĠ Ġval Ġmessage Ġ= ĠMessage ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ"{\" invoice ID \": 1 ,\" timestamp \": 1 5 6 8 4 3 8 4 6 0 2 6 3 }", ĠEvent Topic . Invoice Pay Commit Suc ceed Event . name ) ĊĠĠĠĠĠĠĠ Ġinvoice Pay Commit Suc ceed Handler ( message ) ĊĊĠĠĠĠĠĠĠ Ġval Ġevent Ġ= ĠInvoice Pay Commit Suc ceed Event ( invoice ID Ġ= Ġ 1 , Ġtimestamp Ġ= Ġ 1 5 6 8 4 3 8 4 6 0 2 6 3 ) ĊĠĠĠĠĠĠĠ Ġverify Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġretry Service . payment Event ( Payment Event ( invoice Id Ġ= Ġevent . invoice ID , Ġtype Ġ= Ġevent . topic (), Ġevent Ġ= Ġevent )) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }