This commit is contained in:
2026-08-08 13:51:28 +08:00
parent 374ceed493
commit f690abbaeb
3 changed files with 6 additions and 6 deletions
@@ -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"));
}
}