优化
This commit is contained in:
+18
@@ -4,6 +4,7 @@ import com.baiyue.common.core.api.PageResult;
|
||||
import com.baiyue.common.security.AuthenticatedUser;
|
||||
import com.baiyue.lastleg.inboundplan.dto.InboundPlanRequests;
|
||||
import com.baiyue.lastleg.inboundplan.dto.ConvertInboundPlanRequest;
|
||||
import com.baiyue.lastleg.inboundplan.dto.ConvertContainerInboundPlanRequest;
|
||||
import com.baiyue.lastleg.inboundplan.dto.UpdateFbaAppointmentRequest;
|
||||
import com.baiyue.lastleg.inboundplan.service.InboundFbaAppointmentService;
|
||||
import com.baiyue.lastleg.inboundplan.service.InboundPlanService;
|
||||
@@ -87,6 +88,23 @@ class InboundPlanControllerTest {
|
||||
verify(service).convert("100", 2L);
|
||||
}
|
||||
|
||||
@Test
|
||||
void platformContainerConversionUsesStableBookingIdentity() {
|
||||
controller.convertContainer(platform(), new ConvertContainerInboundPlanRequest(" BOOKING-1 "));
|
||||
|
||||
verify(service).convertContainer(" BOOKING-1 ");
|
||||
}
|
||||
|
||||
@Test
|
||||
void merchantCannotConvertAWholeContainer() {
|
||||
AuthenticatedUser customer = new AuthenticatedUser(8L, 100L, 100L, 9L, "customer", "MERCHANT", "WEB", Set.of());
|
||||
|
||||
assertThatThrownBy(() -> controller.convertContainer(customer,
|
||||
new ConvertContainerInboundPlanRequest("BOOKING-1")))
|
||||
.isInstanceOf(ResponseStatusException.class);
|
||||
verify(service, never()).convertContainer(org.mockito.ArgumentMatchers.any());
|
||||
}
|
||||
|
||||
private static AuthenticatedUser platform() {
|
||||
return new AuthenticatedUser(7L, 0L, 0L, 8L, "operator", "PLATFORM", "WEB",
|
||||
Set.of("platform:overseas-warehouse:inbound-order:list"));
|
||||
|
||||
Reference in New Issue
Block a user