import domain.WordCloudCreator; import org.junit.jupiter.api.Test; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.Map; import static org.junit.jupiter.api.Assertions.*; class WordCloudCreatorTest { @Test void testInsertWordsIntoTemplate_success() throws IOException { // Prepare a simple HTML template with placeholder File template = new File("wordcloud.html"); try (FileWriter fw = new FileWriter(template)) { fw.write(""); } WordCloudCreator creator = new WordCloudCreator(); Map words = Map.of("Test", 3, "Java", 2); assertTrue(creator.insertWordsIntoTemplate(words)); File output = new File("createdHTML.html"); assertTrue(output.exists()); assertTrue(output.length() > 0); } }