shinnosuke
2026-09-17 5a4da0dd1db1727a039bbefc40551525eff6d0fb
talent-card-server/src/test/java/com/talentcard/server/business/portal/ParkingMerchantPortalServiceTests.java
@@ -43,4 +43,27 @@
      assertThat(freeTags).containsExactly("免费");
      assertThat(paidTags).containsExactly("8.5折");
   }
   @Test
   void parkingScopeDecidesWhetherThePlatePageNeedsAParkingLot() throws Exception {
      Method method = ParkingMerchantPortalService.class.getDeclaredMethod(
            "requiresParkingLotSelection", Map.class, Map.class);
      method.setAccessible(true);
      // 后台选“停车场全部可选”时只需要填车牌,不再让小程序挑停车场。
      assertThat(method.invoke(service, Map.of("parkingScope", "all"), Map.of("plateFormMode", "withParking")))
            .isEqualTo(false);
      assertThat(method.invoke(service, Map.of("parkingScope", "ALL"), Map.of()))
            .isEqualTo(false);
      // 后台选“停车场只选其一”时保留停车场搜索。
      assertThat(method.invoke(service, Map.of("parkingScope", "selected"), Map.of("plateFormMode", "simple")))
            .isEqualTo(true);
      assertThat(method.invoke(service, Map.of("parkingScope", "ONE"), Map.of()))
            .isEqualTo(true);
      // 老数据没配范围时沿用停车权益表的 plate_form_mode。
      assertThat(method.invoke(service, Map.of(), Map.of("plateFormMode", "withParking")))
            .isEqualTo(true);
      assertThat(method.invoke(service, Map.of(), Map.of("plateFormMode", "simple")))
            .isEqualTo(false);
   }
}