| | |
| | | |
| | | assertThat(discount).isEqualTo("8.5折"); |
| | | } |
| | | |
| | | @Test |
| | | @SuppressWarnings("unchecked") |
| | | void recommendedMerchantTagsFollowCategoryListRules() throws Exception { |
| | | Method method = PortalService.class.getDeclaredMethod( |
| | | "merchantListBenefitTags", Map.class, Map.class, Long.class); |
| | | method.setAccessible(true); |
| | | |
| | | List<String> foodTags = (List<String>) method.invoke(service, |
| | | Map.of("merchantType", "food", "couponAvailable", true, "discountText", "8.5折"), |
| | | Map.of(), null); |
| | | List<String> cinemaTags = (List<String>) method.invoke(service, |
| | | Map.of("merchantType", "cinema", "couponAvailable", false, "discountText", "7折"), |
| | | Map.of(), null); |
| | | |
| | | assertThat(foodTags).containsExactly("券", "8.5折"); |
| | | assertThat(cinemaTags).isEmpty(); |
| | | } |
| | | } |