优化
This commit is contained in:
+2
-2
@@ -33,10 +33,10 @@ class OverseasStorageFeeInitializationServiceTest {
|
||||
|
||||
@Test void retriesThreeTimesWithDeterministicKey() {
|
||||
when(client.initialize(anyString(), any())).thenThrow(new RuntimeException("timeout"));
|
||||
when(client.compensate(anyString(), anyLong(), anyString())).thenReturn(ApiResponse.success(null));
|
||||
when(client.compensate(anyString(), any(OverseasStorageFeeClient.CompensationRequest.class))).thenReturn(ApiResponse.success(null));
|
||||
BizException error = assertThrows(BizException.class, () -> service.initialize(208L, 9L));
|
||||
assertEquals(ResultCode.SERVICE_UNAVAILABLE, error.getResultCode());
|
||||
verify(client, times(3)).initialize(anyString(), any(OverseasStorageFeeClient.InitializationRequest.class));
|
||||
verify(client).compensate("internal-token", 208L, "iam-customer-create-overseas-fee:208");
|
||||
verify(client).compensate("internal-token", new OverseasStorageFeeClient.CompensationRequest(208L, "iam-customer-create-overseas-fee:208"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user