@@ -104,7 +104,7 @@ public void afterFiberStarted_timeoutStepScheduled() {
104
104
public void afterTimeout_newRequestSent () {
105
105
callFactory .clearRequest ();
106
106
107
- testSupport .setTime (TIMEOUT_SECONDS , TimeUnit .SECONDS );
107
+ testSupport .setTime (TIMEOUT_SECONDS + 1 , TimeUnit .SECONDS );
108
108
109
109
assertTrue (callFactory .invokedWith (requestParams ));
110
110
}
@@ -158,22 +158,14 @@ public void afterFailedCallback_retrySentAfterDelay() {
158
158
159
159
@ Test
160
160
public void afterMultipleRetriesAndSuccessfulCallback_nextStepAppliedWithValue () {
161
- sendMultipleFailedCallback (0 , 2 );
161
+ sendMultipleFailedCallbackWithSetTime (0 , 2 );
162
162
testSupport .schedule (() -> callFactory .sendSuccessfulCallback (smallList ));
163
163
assertThat (nextStep .result , equalTo (smallList ));
164
164
}
165
165
166
- @ SuppressWarnings ("SameParameterValue" )
167
- private void sendMultipleFailedCallback (int statusCode , int maxRetries ) {
168
- for (int retryCount = 0 ; retryCount < maxRetries ; retryCount ++) {
169
- testSupport .schedule (
170
- () -> callFactory .sendFailedCallback (new ApiException ("test failure" ), statusCode ));
171
- }
172
- }
173
-
174
166
@ Test
175
167
public void afterRetriesExhausted_fiberTerminatesWithException () {
176
- sendMultipleFailedCallback (0 , 3 );
168
+ sendMultipleFailedCallbackWithSetTime (0 , 3 );
177
169
178
170
testSupport .verifyCompletionThrowable (FailureStatusSourceException .class );
179
171
}
0 commit comments