This commit is contained in:
2026-08-20 09:49:28 +08:00
parent 7cf4a8d562
commit be5d89a4e6
3 changed files with 37 additions and 7 deletions
@@ -50,7 +50,7 @@ class FinanceFeeSourceCommandServiceTest {
objectMapper = new ObjectMapper().findAndRegisterModules();
service = new FinanceFeeSourceCommandService(commands, inboundFees, pricing,
containerFees, containerFeeService, outbox, objectMapper);
doAnswer(invocation -> {
lenient().doAnswer(invocation -> {
FinanceFeeSourceCommandEntity value = invocation.getArgument(0);
value.setId(901L);
return null;
@@ -80,13 +80,13 @@ class FinanceFeeSourceCommandServiceTest {
VoidRequest request = inboundRequest(700L, 3);
when(inboundFees.findSourceVersion(100L, 700L, 3))
.thenReturn(inboundDetail("FBA_PRICING", 778L, 700L, 3, 9L));
when(pricing.voidSentFee(9L, 100L, 700L, 3, any())).thenReturn(1);
when(pricing.voidSentFee(eq(9L), eq(100L), eq(700L), eq(3), any())).thenReturn(1);
when(pricing.markInboundFeeVoided(9L, 100L)).thenReturn(1);
when(inboundFees.voidApproved(9L, 100L, 778L, 3, 71L)).thenReturn(1);
service.voidSource("void-fba", hash(request), request);
verify(pricing).voidSentFee(9L, 100L, 700L, 3, any());
verify(pricing).voidSentFee(eq(9L), eq(100L), eq(700L), eq(3), any());
verify(pricing).markInboundFeeVoided(9L, 100L);
verify(outbox).publishInbound(org.mockito.ArgumentMatchers.eq(FinanceFeeSourceOutboxService.VOIDED),
org.mockito.ArgumentMatchers.eq(9L), org.mockito.ArgumentMatchers.eq(100L),