From b36f4c2800e88f8c5060ae926d3eb25d4bcb69c0 Mon Sep 17 00:00:00 2001
From: shinnosuke <tantao@1hoper.com>
Date: 星期五, 11 九月 2026 11:06:36 +0800
Subject: [PATCH] 又又更新
---
talent-card-server/src/test/java/com/talentcard/server/business/portal/PortalServiceTests.java | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/talent-card-server/src/test/java/com/talentcard/server/business/portal/PortalServiceTests.java b/talent-card-server/src/test/java/com/talentcard/server/business/portal/PortalServiceTests.java
index ea75ae9..6812ae2 100644
--- a/talent-card-server/src/test/java/com/talentcard/server/business/portal/PortalServiceTests.java
+++ b/talent-card-server/src/test/java/com/talentcard/server/business/portal/PortalServiceTests.java
@@ -88,5 +88,34 @@
assertThat(foodTags).containsExactly("券", "8.5折");
assertThat(cinemaTags).isEmpty();
+
+ List<String> scenicTags = (List<String>) method.invoke(service,
+ Map.of("merchantType", "scenic", "couponAvailable", true, "discountText", "8.8折"),
+ Map.of(), null);
+ List<String> cultureTags = (List<String>) method.invoke(service,
+ Map.of("merchantType", "culture", "couponAvailable", true, "discountText", ""),
+ Map.of(), null);
+ assertThat(scenicTags).containsExactly("券", "8.8折");
+ assertThat(cultureTags).containsExactly("券");
+ }
+
+ @Test
+ @SuppressWarnings("unchecked")
+ void merchantDetailHeaderTagsDriveListTags() throws Exception {
+ Method method = PortalService.class.getDeclaredMethod(
+ "merchantBenefitTags", String.class, boolean.class, String.class, Map.class);
+ method.setAccessible(true);
+
+ List<String> foodTags = (List<String>) method.invoke(service, "food", true, "8.8折", null);
+ List<String> hotelTags = (List<String>) method.invoke(service, "hotel", true, "7折", Map.of(
+ "freeVoucherEnabled", true,
+ "freeVoucherTimes", "2",
+ "storeConsume", true,
+ "consumeEnabled", true,
+ "consumeType", "折扣",
+ "consumeDiscount", "8.5"));
+
+ assertThat(foodTags).containsExactly("券", "8.8折");
+ assertThat(hotelTags).containsExactly("券", "免费2次", "8.5折");
}
}
--
Gitblit v1.7.1