File tree Expand file tree Collapse file tree
main/java/it/aboutbits/springboot/emailservice/lib/application
test/java/it/aboutbits/springboot/emailservice/lib/application Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,7 +80,6 @@ public EmailDto sendOrFail(@Valid EmailParameter parameter) throws EmailExceptio
8080
8181 email .setState (EmailState .SENDING );
8282 email .setExecutionStartTime (OffsetDateTime .now ());
83- email .setExecutionEndTime (null );
8483 email .setErrorMessage (null );
8584 email .incrementAttempts ();
8685 emailRepository .save (email );
Original file line number Diff line number Diff line change 1515import org .springframework .test .context .bean .override .mockito .MockitoSpyBean ;
1616
1717import java .time .OffsetDateTime ;
18+ import java .time .temporal .ChronoUnit ;
1819import java .util .concurrent .CountDownLatch ;
1920import java .util .concurrent .Executors ;
2021import java .util .concurrent .TimeUnit ;
@@ -161,7 +162,7 @@ void givenStuckSendingRow_sendEmails_shouldRecoverAndResend() {
161162 void givenFreshSendingRowWithinThreshold_sendEmails_shouldNotStealFromOtherPod () {
162163 // executionStartTime within the 5-minute threshold means another pod is legitimately
163164 // sending this right now; we must not re-claim it.
164- var recentStart = OffsetDateTime .now ().minusSeconds (30 );
165+ var recentStart = OffsetDateTime .now ().minusSeconds (30 ). truncatedTo ( ChronoUnit . MICROS ) ;
165166 emailRepository .save (
166167 EmailFactory .once ()
167168 .state (EmailState .SENDING )
You can’t perform that action at this time.
0 commit comments