This commit is contained in:
root
2025-12-20 23:19:44 +05:00
parent 00b291d47e
commit c4484cfafd
2 changed files with 27 additions and 5 deletions
@@ -171,4 +171,23 @@ class MarketingAnalysisServiceChartPlacementTest {
assertTrue(Pattern.compile("(?m)^```json:segmentsChannelMatrix$").matcher(out).find(),
"Opening fence line must be exactly ```json:<key> with no leading spaces");
}
@Test
void replaceChartPlaceholders_shouldRemoveGenericChartDotsPlaceholder() throws Exception {
Method m = MarketingAnalysisService.class.getDeclaredMethod("replaceChartPlaceholders", String.class,
Map.class);
m.setAccessible(true);
String report = ""
+ "## I. Краткое резюме\n"
+ "Текст перед.\n"
+ "[[CHART_...]]\n"
+ "Текст после.\n";
// Even if chartsData is empty, generic placeholders must be removed.
String out = (String) m.invoke(marketingAnalysisService, report, new HashMap<String, Object>());
assertFalse(out.contains("[[CHART_...]]"),
"Generic placeholder [[CHART_...]] must be removed from fullAnalysis");
}
}