mirror of
https://github.com/opentripplanner/OpenTripPlanner.git
synced 2026-04-02 21:43:07 +02:00
35 lines
834 B
Java
35 lines
834 B
Java
package org.opentripplanner.generate.doc.framework;
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
import static org.opentripplanner.generate.doc.framework.TemplateUtil.replaceSection;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
/**
|
|
* Replace a text in a file wrapped using HTML comments
|
|
*/
|
|
@SuppressWarnings("NewClassNamingConvention")
|
|
public class TemplateUtilTest {
|
|
|
|
@Test
|
|
public void replaceSectionTest() {
|
|
var body = """
|
|
Expected line 1.
|
|
Expected line 2.
|
|
""";
|
|
var doc = "<!-- INSERT: TEST -->";
|
|
|
|
assertEquals(
|
|
"""
|
|
<!-- TEST BEGIN -->
|
|
<!-- NOTE! This section is auto-generated. Do not change, change doc in code instead. -->
|
|
|
|
Expected line 1.
|
|
Expected line 2.
|
|
|
|
<!-- TEST END -->
|
|
""".trim(),
|
|
replaceSection(doc, "TEST", body)
|
|
);
|
|
}
|
|
}
|