|
|
@@ -15,6 +15,7 @@ import com.ruoyi.app.flashdelivery.dto.FlashDeliveryDeliverRequest;
|
|
|
import com.ruoyi.app.flashdelivery.dto.FlashDeliveryRiderOrderPageView;
|
|
|
import com.ruoyi.app.flashdelivery.exception.FlashDeliveryQuoteChangedException;
|
|
|
import com.ruoyi.app.flashdelivery.route.FlashDeliveryRouteService;
|
|
|
+import com.ruoyi.app.flashdelivery.route.GeoPoint;
|
|
|
import com.ruoyi.app.flashdelivery.route.RouteDistance;
|
|
|
import com.ruoyi.app.order.RiderDeliveryAcceptanceService;
|
|
|
import com.ruoyi.app.order.RiderDeliveryLockService;
|
|
|
@@ -55,6 +56,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
|
|
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
|
import static org.mockito.ArgumentMatchers.any;
|
|
|
+import static org.mockito.ArgumentMatchers.anyInt;
|
|
|
import static org.mockito.ArgumentMatchers.anyString;
|
|
|
import static org.mockito.ArgumentMatchers.eq;
|
|
|
import static org.mockito.ArgumentMatchers.isNull;
|
|
|
@@ -90,8 +92,8 @@ class FlashDeliveryApplicationServiceTest {
|
|
|
@Test
|
|
|
void quoteUsesServerRouteAndCurrentTimePricing() {
|
|
|
Fixture fixture = new Fixture();
|
|
|
- when(fixture.pricingMapper.selectAtTime(anyString())).thenReturn(List.of(pricing()));
|
|
|
- when(fixture.routeService.calculate(any(), any())).thenReturn(new RouteDistance(3001, 600, "ROUTE"));
|
|
|
+ when(fixture.pricingMapper.selectAtTime(anyString(), anyInt())).thenReturn(List.of(pricing()));
|
|
|
+ when(fixture.routeService.calculate(any(GeoPoint.class), any(GeoPoint.class), anyInt())).thenReturn(new RouteDistance(3001, 600, "ROUTE"));
|
|
|
|
|
|
var quote = fixture.service.quote(request());
|
|
|
|
|
|
@@ -106,8 +108,8 @@ class FlashDeliveryApplicationServiceTest {
|
|
|
@Test
|
|
|
void quoteRejectsRoutesLongerThanFortyKilometres() {
|
|
|
Fixture fixture = new Fixture();
|
|
|
- when(fixture.pricingMapper.selectAtTime(anyString())).thenReturn(List.of(pricing()));
|
|
|
- when(fixture.routeService.calculate(any(), any())).thenReturn(new RouteDistance(40001, 1800, "ROUTE"));
|
|
|
+ when(fixture.pricingMapper.selectAtTime(anyString(), anyInt())).thenReturn(List.of(pricing()));
|
|
|
+ when(fixture.routeService.calculate(any(GeoPoint.class), any(GeoPoint.class), anyInt())).thenReturn(new RouteDistance(40001, 1800, "ROUTE"));
|
|
|
|
|
|
assertThrows(ServiceException.class, () -> fixture.service.quote(request()));
|
|
|
}
|
|
|
@@ -169,8 +171,8 @@ class FlashDeliveryApplicationServiceTest {
|
|
|
Fixture fixture = new Fixture();
|
|
|
when(fixture.userMapper.selectOrdinaryUserIdsByNormalizedPhone("0922222222"))
|
|
|
.thenReturn(List.of(88L));
|
|
|
- when(fixture.pricingMapper.selectAtTime(anyString())).thenReturn(List.of(pricing()));
|
|
|
- when(fixture.routeService.calculate(any(), any())).thenReturn(new RouteDistance(3200, 600, "ROUTE"));
|
|
|
+ when(fixture.pricingMapper.selectAtTime(anyString(), anyInt())).thenReturn(List.of(pricing()));
|
|
|
+ when(fixture.routeService.calculate(any(GeoPoint.class), any(GeoPoint.class), anyInt())).thenReturn(new RouteDistance(3200, 600, "ROUTE"));
|
|
|
doAnswer(invocation -> {
|
|
|
FlashDeliveryOrder order = invocation.getArgument(0);
|
|
|
order.setId(99L);
|
|
|
@@ -244,8 +246,8 @@ class FlashDeliveryApplicationServiceTest {
|
|
|
@Test
|
|
|
void createDoesNotBindReceiverWhenNormalizedPhoneMatchesMultipleUsers() {
|
|
|
Fixture fixture = new Fixture();
|
|
|
- when(fixture.pricingMapper.selectAtTime(anyString())).thenReturn(List.of(pricing()));
|
|
|
- when(fixture.routeService.calculate(any(), any())).thenReturn(new RouteDistance(3200, 600, "ROUTE"));
|
|
|
+ when(fixture.pricingMapper.selectAtTime(anyString(), anyInt())).thenReturn(List.of(pricing()));
|
|
|
+ when(fixture.routeService.calculate(any(GeoPoint.class), any(GeoPoint.class), anyInt())).thenReturn(new RouteDistance(3200, 600, "ROUTE"));
|
|
|
when(fixture.userMapper.selectOrdinaryUserIdsByNormalizedPhone("886912345678"))
|
|
|
.thenReturn(List.of(88L, 99L));
|
|
|
doAnswer(invocation -> {
|
|
|
@@ -266,8 +268,8 @@ class FlashDeliveryApplicationServiceTest {
|
|
|
@Test
|
|
|
void createLeavesReceiverUnboundWhenPhoneHasNoRegisteredUser() {
|
|
|
Fixture fixture = new Fixture();
|
|
|
- when(fixture.pricingMapper.selectAtTime(anyString())).thenReturn(List.of(pricing()));
|
|
|
- when(fixture.routeService.calculate(any(), any())).thenReturn(new RouteDistance(3200, 600, "ROUTE"));
|
|
|
+ when(fixture.pricingMapper.selectAtTime(anyString(), anyInt())).thenReturn(List.of(pricing()));
|
|
|
+ when(fixture.routeService.calculate(any(GeoPoint.class), any(GeoPoint.class), anyInt())).thenReturn(new RouteDistance(3200, 600, "ROUTE"));
|
|
|
when(fixture.userMapper.selectOrdinaryUserIdsByNormalizedPhone("0922222222"))
|
|
|
.thenReturn(List.of());
|
|
|
doAnswer(invocation -> {
|
|
|
@@ -655,7 +657,7 @@ class FlashDeliveryApplicationServiceTest {
|
|
|
void concurrentPricingUpdateIsRejected() {
|
|
|
Fixture fixture = new Fixture();
|
|
|
when(fixture.pricingMapper.selectById(1L)).thenReturn(pricing());
|
|
|
- when(fixture.pricingMapper.countOverlapping("00:00", "12:00", 1L)).thenReturn(0);
|
|
|
+ when(fixture.pricingMapper.countOverlapping(eq("00:00"), eq("12:00"), anyInt(), eq(1L))).thenReturn(0);
|
|
|
when(fixture.pricingMapper.update(isNull(), any(Wrapper.class))).thenReturn(0);
|
|
|
FlashDeliveryPricingRequest request = pricingRequest();
|
|
|
request.setEndTime("12:00");
|
|
|
@@ -670,7 +672,7 @@ class FlashDeliveryApplicationServiceTest {
|
|
|
void overlappingPricingPeriodIsRejectedBeforeInsert() {
|
|
|
Fixture fixture = new Fixture();
|
|
|
FlashDeliveryPricingRequest request = pricingRequest();
|
|
|
- when(fixture.pricingMapper.countOverlapping("00:00", "24:00", null)).thenReturn(1);
|
|
|
+ when(fixture.pricingMapper.countOverlapping(eq("00:00"), eq("24:00"), anyInt(), isNull())).thenReturn(1);
|
|
|
|
|
|
assertThrows(ServiceException.class, () -> fixture.service.createPricing(1L, request));
|
|
|
|
|
|
@@ -708,7 +710,7 @@ class FlashDeliveryApplicationServiceTest {
|
|
|
void createPricingPersistsImmediatelyActiveTimePeriod() {
|
|
|
Fixture fixture = new Fixture();
|
|
|
FlashDeliveryPricingRequest request = pricingRequest();
|
|
|
- when(fixture.pricingMapper.countOverlapping("00:00", "24:00", null)).thenReturn(0);
|
|
|
+ when(fixture.pricingMapper.countOverlapping(eq("00:00"), eq("24:00"), anyInt(), isNull())).thenReturn(0);
|
|
|
|
|
|
fixture.service.createPricing(7L, request);
|
|
|
|
|
|
@@ -720,7 +722,7 @@ class FlashDeliveryApplicationServiceTest {
|
|
|
|
|
|
InOrder writeOrder = inOrder(fixture.pricingMapper);
|
|
|
writeOrder.verify(fixture.pricingMapper)
|
|
|
- .countOverlapping("00:00", "24:00", null);
|
|
|
+ .countOverlapping(eq("00:00"), eq("24:00"), anyInt(), isNull());
|
|
|
writeOrder.verify(fixture.pricingMapper).insert(any(FlashDeliveryPricing.class));
|
|
|
}
|
|
|
|
|
|
@@ -737,18 +739,18 @@ class FlashDeliveryApplicationServiceTest {
|
|
|
|
|
|
assertThrows(ServiceException.class, () -> fixture.service.quote(request()));
|
|
|
|
|
|
- verify(fixture.routeService, never()).calculate(any(), any());
|
|
|
+ verify(fixture.routeService, never()).calculate(any(GeoPoint.class), any(GeoPoint.class), anyInt());
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
void multipleCurrentPricingPeriodsFailExplicitlyBeforeRouteLookup() {
|
|
|
Fixture fixture = new Fixture();
|
|
|
- when(fixture.pricingMapper.selectAtTime(anyString()))
|
|
|
+ when(fixture.pricingMapper.selectAtTime(anyString(), anyInt()))
|
|
|
.thenReturn(List.of(pricing(), pricing()));
|
|
|
|
|
|
assertThrows(ServiceException.class, () -> fixture.service.quote(request()));
|
|
|
|
|
|
- verify(fixture.routeService, never()).calculate(any(), any());
|
|
|
+ verify(fixture.routeService, never()).calculate(any(GeoPoint.class), any(GeoPoint.class), anyInt());
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
@@ -764,7 +766,7 @@ class FlashDeliveryApplicationServiceTest {
|
|
|
|
|
|
InOrder writeOrder = inOrder(fixture.pricingMapper);
|
|
|
writeOrder.verify(fixture.pricingMapper)
|
|
|
- .countOverlapping("00:00", "24:00", 1L);
|
|
|
+ .countOverlapping(eq("00:00"), eq("24:00"), anyInt(), eq(1L));
|
|
|
writeOrder.verify(fixture.pricingMapper).update(isNull(), any(Wrapper.class));
|
|
|
}
|
|
|
|
|
|
@@ -782,8 +784,8 @@ class FlashDeliveryApplicationServiceTest {
|
|
|
@Test
|
|
|
void urgentQuoteReturnsSeparatedFeesAndUsesScheduledPickupTime() {
|
|
|
Fixture fixture = new Fixture();
|
|
|
- when(fixture.pricingMapper.selectAtTime("16:30")).thenReturn(List.of(pricing()));
|
|
|
- when(fixture.routeService.calculate(any(), any())).thenReturn(new RouteDistance(6000, 900, "ROUTE"));
|
|
|
+ when(fixture.pricingMapper.selectAtTime(eq("16:30"), anyInt())).thenReturn(List.of(pricing()));
|
|
|
+ when(fixture.routeService.calculate(any(GeoPoint.class), any(GeoPoint.class), anyInt())).thenReturn(new RouteDistance(6000, 900, "ROUTE"));
|
|
|
FlashDeliveryQuoteRequest request = request();
|
|
|
request.setDeliveryType("URGENT");
|
|
|
request.setTipAmount(5L);
|
|
|
@@ -800,18 +802,19 @@ class FlashDeliveryApplicationServiceTest {
|
|
|
var quote = fixture.service.quote(request);
|
|
|
|
|
|
assertEquals(45L, quote.getDistanceFee());
|
|
|
- assertEquals(135L, quote.getBaseDeliveryFee());
|
|
|
+ // 起步价与 45 元距离附加费分开返回,避免前端重复相加。
|
|
|
+ assertEquals(90L, quote.getBaseDeliveryFee());
|
|
|
assertEquals(27L, quote.getUrgentFee());
|
|
|
assertEquals(5L, quote.getTipAmount());
|
|
|
assertEquals(167L, quote.getAmount());
|
|
|
- verify(fixture.pricingMapper).selectAtTime("16:30");
|
|
|
+ verify(fixture.pricingMapper).selectAtTime(eq("16:30"), anyInt());
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
void createRejectsChangedQuoteAndReturnsLatestQuoteWithoutInsert() {
|
|
|
Fixture fixture = new Fixture();
|
|
|
- when(fixture.pricingMapper.selectAtTime(anyString())).thenReturn(List.of(pricing()));
|
|
|
- when(fixture.routeService.calculate(any(), any())).thenReturn(new RouteDistance(3200, 600, "ROUTE"));
|
|
|
+ when(fixture.pricingMapper.selectAtTime(anyString(), anyInt())).thenReturn(List.of(pricing()));
|
|
|
+ when(fixture.routeService.calculate(any(GeoPoint.class), any(GeoPoint.class), anyInt())).thenReturn(new RouteDistance(3200, 600, "ROUTE"));
|
|
|
FlashDeliveryCreateRequest request = createRequest();
|
|
|
request.setQuotedAmount(91L);
|
|
|
|
|
|
@@ -826,8 +829,8 @@ class FlashDeliveryApplicationServiceTest {
|
|
|
@Test
|
|
|
void createDefaultsPayTypeToCashAndStoresTransferSelection() {
|
|
|
Fixture fixture = new Fixture();
|
|
|
- when(fixture.pricingMapper.selectAtTime(anyString())).thenReturn(List.of(pricing()));
|
|
|
- when(fixture.routeService.calculate(any(), any())).thenReturn(new RouteDistance(3200, 600, "ROUTE"));
|
|
|
+ when(fixture.pricingMapper.selectAtTime(anyString(), anyInt())).thenReturn(List.of(pricing()));
|
|
|
+ when(fixture.routeService.calculate(any(GeoPoint.class), any(GeoPoint.class), anyInt())).thenReturn(new RouteDistance(3200, 600, "ROUTE"));
|
|
|
doAnswer(invocation -> {
|
|
|
FlashDeliveryOrder order = invocation.getArgument(0);
|
|
|
order.setId(99L);
|
|
|
@@ -852,8 +855,8 @@ class FlashDeliveryApplicationServiceTest {
|
|
|
@Test
|
|
|
void createRejectsUnsupportedPayType() {
|
|
|
Fixture fixture = new Fixture();
|
|
|
- when(fixture.pricingMapper.selectAtTime(anyString())).thenReturn(List.of(pricing()));
|
|
|
- when(fixture.routeService.calculate(any(), any())).thenReturn(new RouteDistance(3200, 600, "ROUTE"));
|
|
|
+ when(fixture.pricingMapper.selectAtTime(anyString(), anyInt())).thenReturn(List.of(pricing()));
|
|
|
+ when(fixture.routeService.calculate(any(GeoPoint.class), any(GeoPoint.class), anyInt())).thenReturn(new RouteDistance(3200, 600, "ROUTE"));
|
|
|
FlashDeliveryCreateRequest request = createRequest();
|
|
|
request.setPayType("2");
|
|
|
|
|
|
@@ -884,8 +887,8 @@ class FlashDeliveryApplicationServiceTest {
|
|
|
@Test
|
|
|
void quoteAcceptsAllFourWeightRanges() {
|
|
|
Fixture fixture = new Fixture();
|
|
|
- when(fixture.pricingMapper.selectAtTime(anyString())).thenReturn(List.of(pricing()));
|
|
|
- when(fixture.routeService.calculate(any(), any())).thenReturn(new RouteDistance(3200, 600, "ROUTE"));
|
|
|
+ when(fixture.pricingMapper.selectAtTime(anyString(), anyInt())).thenReturn(List.of(pricing()));
|
|
|
+ when(fixture.routeService.calculate(any(GeoPoint.class), any(GeoPoint.class), anyInt())).thenReturn(new RouteDistance(3200, 600, "ROUTE"));
|
|
|
|
|
|
for (String weightRange : List.of("UP_TO_5_KG", "OVER_5_TO_10_KG",
|
|
|
"OVER_10_TO_15_KG", "OVER_15_TO_20_KG")) {
|
|
|
@@ -901,8 +904,8 @@ class FlashDeliveryApplicationServiceTest {
|
|
|
for (String weightRange : List.of("UP_TO_5_KG", "OVER_5_TO_10_KG",
|
|
|
"OVER_10_TO_15_KG", "OVER_15_TO_20_KG")) {
|
|
|
Fixture fixture = new Fixture();
|
|
|
- when(fixture.pricingMapper.selectAtTime(anyString())).thenReturn(List.of(pricing()));
|
|
|
- when(fixture.routeService.calculate(any(), any())).thenReturn(new RouteDistance(3200, 600, "ROUTE"));
|
|
|
+ when(fixture.pricingMapper.selectAtTime(anyString(), anyInt())).thenReturn(List.of(pricing()));
|
|
|
+ when(fixture.routeService.calculate(any(GeoPoint.class), any(GeoPoint.class), anyInt())).thenReturn(new RouteDistance(3200, 600, "ROUTE"));
|
|
|
doAnswer(invocation -> {
|
|
|
FlashDeliveryOrder order = invocation.getArgument(0);
|
|
|
order.setId(99L);
|
|
|
@@ -923,9 +926,22 @@ class FlashDeliveryApplicationServiceTest {
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
- void quoteRejectsMissingAndUnknownWeightRanges() {
|
|
|
+ void quoteAllowsMissingWeightRange() {
|
|
|
Fixture fixture = new Fixture();
|
|
|
- for (String weightRange : new String[]{null, "", "SMALL", "OVER_20_KG"}) {
|
|
|
+ when(fixture.pricingMapper.selectAtTime(anyString(), anyInt())).thenReturn(List.of(pricing()));
|
|
|
+ when(fixture.routeService.calculate(any(GeoPoint.class), any(GeoPoint.class), anyInt()))
|
|
|
+ .thenReturn(new RouteDistance(3200, 600, "ROUTE"));
|
|
|
+
|
|
|
+ FlashDeliveryQuoteRequest request = request();
|
|
|
+ request.setWeightRange(null);
|
|
|
+
|
|
|
+ assertDoesNotThrow(() -> fixture.service.quote(request));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Test
|
|
|
+ void quoteRejectsUnknownWeightRangeWhenProvided() {
|
|
|
+ Fixture fixture = new Fixture();
|
|
|
+ for (String weightRange : new String[]{"", "SMALL", "OVER_20_KG"}) {
|
|
|
FlashDeliveryQuoteRequest request = request();
|
|
|
request.setWeightRange(weightRange);
|
|
|
assertThrows(ServiceException.class, () -> fixture.service.quote(request), String.valueOf(weightRange));
|
|
|
@@ -936,6 +952,7 @@ class FlashDeliveryApplicationServiceTest {
|
|
|
FlashDeliveryQuoteRequest request = new FlashDeliveryQuoteRequest();
|
|
|
request.setServiceType("HELP_SEND");
|
|
|
request.setDeliveryType("NORMAL");
|
|
|
+ request.setVehicleType(1);
|
|
|
request.setPackageType("DOCUMENT");
|
|
|
request.setQuantity(1);
|
|
|
request.setWeightRange("UP_TO_5_KG");
|
|
|
@@ -953,6 +970,7 @@ class FlashDeliveryApplicationServiceTest {
|
|
|
FlashDeliveryQuoteRequest quote = request();
|
|
|
request.setServiceType(quote.getServiceType());
|
|
|
request.setDeliveryType(quote.getDeliveryType());
|
|
|
+ request.setVehicleType(quote.getVehicleType());
|
|
|
request.setPackageType(quote.getPackageType());
|
|
|
request.setQuantity(quote.getQuantity());
|
|
|
request.setWeightRange(quote.getWeightRange());
|
|
|
@@ -1004,6 +1022,7 @@ class FlashDeliveryApplicationServiceTest {
|
|
|
|
|
|
private FlashDeliveryPricingRequest pricingRequest() {
|
|
|
FlashDeliveryPricingRequest request = new FlashDeliveryPricingRequest();
|
|
|
+ request.setVehicleType(1);
|
|
|
request.setStartTime("00:00");
|
|
|
request.setEndTime("24:00");
|
|
|
request.setStartingDistance(new BigDecimal("3.00"));
|
|
|
@@ -1123,14 +1142,15 @@ class FlashDeliveryApplicationServiceTest {
|
|
|
assertEquals(4500, quote.getDistanceMeters());
|
|
|
assertEquals(900, quote.getEstimatedDurationSeconds());
|
|
|
assertEquals(23L, quote.getDistanceFee());
|
|
|
- assertEquals(113L, quote.getBaseDeliveryFee());
|
|
|
+ // 基础配送费只表示起步价,距离附加费单独返回。
|
|
|
+ assertEquals(90L, quote.getBaseDeliveryFee());
|
|
|
assertEquals(10L, quote.getTipAmount());
|
|
|
assertEquals(123L, quote.getAmount());
|
|
|
assertEquals(2, quote.getOrderVersion());
|
|
|
assertEquals(1, quote.getPricingVersion());
|
|
|
assertEquals("pickup road", order.getPickupAddress());
|
|
|
// 地址变化只重算路线,不查询最新运价。
|
|
|
- verify(fixture.pricingMapper, never()).selectAtTime(anyString());
|
|
|
+ verify(fixture.pricingMapper, never()).selectAtTime(anyString(), anyInt());
|
|
|
verify(fixture.orderMapper, never()).updateWaitingAddress(any(), any());
|
|
|
verify(fixture.logMapper, never()).insert(any(com.ruoyi.system.domain.flash.FlashDeliveryOrderLog.class));
|
|
|
}
|
|
|
@@ -1212,7 +1232,7 @@ class FlashDeliveryApplicationServiceTest {
|
|
|
assertThrows(ServiceException.class, () -> fixture.service.updateAddress(user, 10L, new FlashDeliveryAddressConfirmRequest()));
|
|
|
assertThrows(ServiceException.class, () -> fixture.service.addTip(user, 10L, tipRequest(5L, 2)));
|
|
|
}
|
|
|
- verify(fixture.routeService, never()).calculate(any(), any());
|
|
|
+ verify(fixture.routeService, never()).calculate(any(GeoPoint.class), any(GeoPoint.class), anyInt());
|
|
|
verify(fixture.orderMapper, never()).updateWaitingTip(any(), any());
|
|
|
}
|
|
|
|
|
|
@@ -1256,7 +1276,7 @@ class FlashDeliveryApplicationServiceTest {
|
|
|
input.setDelivery(request().getDelivery());
|
|
|
input.getPickup().setPhone("");
|
|
|
assertThrows(ServiceException.class, () -> fixture.service.quoteAddress(7L, 10L, input));
|
|
|
- when(fixture.routeService.calculate(any(), any())).thenReturn(new RouteDistance(40001, 1000, "GOOGLE"));
|
|
|
+ when(fixture.routeService.calculate(any(GeoPoint.class), any(GeoPoint.class), anyInt())).thenReturn(new RouteDistance(40001, 1000, "GOOGLE"));
|
|
|
assertThrows(ServiceException.class, () -> fixture.service.quoteAddress(7L, 10L, addressChange()));
|
|
|
verify(fixture.orderMapper, never()).updateWaitingAddress(any(), any());
|
|
|
}
|
|
|
@@ -1287,8 +1307,8 @@ class FlashDeliveryApplicationServiceTest {
|
|
|
assertThrows(ServiceException.class, () -> fixture.service.addTip(7L, 10L, tipRequest(20L, 2)));
|
|
|
assertEquals(30L, order.getTipAmount());
|
|
|
verify(fixture.orderMapper).updateWaitingTip(any(), eq(2));
|
|
|
- verify(fixture.routeService, never()).calculate(any(), any());
|
|
|
- verify(fixture.pricingMapper, never()).selectAtTime(anyString());
|
|
|
+ verify(fixture.routeService, never()).calculate(any(GeoPoint.class), any(GeoPoint.class), anyInt());
|
|
|
+ verify(fixture.pricingMapper, never()).selectAtTime(anyString(), anyInt());
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
@@ -1360,9 +1380,9 @@ class FlashDeliveryApplicationServiceTest {
|
|
|
order.setDistance(new BigDecimal("1.00"));
|
|
|
order.setFreight(15L);
|
|
|
when(fixture.orderMapper.selectById(10L)).thenReturn(order);
|
|
|
- when(fixture.routeService.calculate(any(), any())).thenReturn(new RouteDistance(4500, 900, "GOOGLE"));
|
|
|
+ when(fixture.routeService.calculate(any(GeoPoint.class), any(GeoPoint.class), anyInt())).thenReturn(new RouteDistance(4500, 900, "GOOGLE"));
|
|
|
// 后台现价与快照不同;改址仍以订单保存的价格计算。
|
|
|
- when(fixture.pricingMapper.selectAtTime(anyString())).thenReturn(List.of(pricing()));
|
|
|
+ when(fixture.pricingMapper.selectAtTime(anyString(), anyInt())).thenReturn(List.of(pricing()));
|
|
|
return order;
|
|
|
}
|
|
|
|