fix: align HTTP acceptance fixtures and pallet permissions

This commit is contained in:
2026-09-14 12:40:40 +08:00
parent e55ab73e61
commit a2ea0ba9e6
15 changed files with 205 additions and 50 deletions
@@ -12,6 +12,21 @@ import java.nio.file.Path;
import static org.assertj.core.api.Assertions.assertThat;
class DropshipPalletizationSqlContractTest {
@Test
void inboundPalletReadAndPrintUseTheRegisteredPlatformInboundPermission() throws Exception {
var controller = com.baiyue.firstleg.controller.PlatformDropshipPalletizationController.class;
for (var method : controller.getDeclaredMethods()) {
if (method.getName().equals("inboundPallets") || method.getName().equals("printPallet")) {
assertThat(method.getAnnotation(org.springframework.security.access.prepost.PreAuthorize.class).value())
.isEqualTo("hasAuthority('platform:firstleg:inbound:list')");
}
}
String api = new ClassPathResource("openapi/dropship-palletization-v1.yaml")
.getContentAsString(StandardCharsets.UTF_8);
assertThat(api).contains("x-required-authority: platform:firstleg:inbound:list")
.doesNotContain("x-required-authority: firstleg:inbound:list");
}
@Test
void pendingPdaTasksAreScopedByTheSelectedWarehouse() throws Exception {
String sql = DropshipPalletizationMapper.class