1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package com.tunyk.mvn.plugins.htmlcompressor;
17
18 import org.apache.maven.plugin.MojoExecutionException;
19 import org.junit.jupiter.api.AfterAll;
20 import org.junit.jupiter.api.BeforeAll;
21 import org.junit.jupiter.api.BeforeEach;
22 import org.junit.jupiter.api.Test;
23 import org.slf4j.Logger;
24 import org.slf4j.LoggerFactory;
25
26
27
28
29 class HtmlCompressorMojoTest {
30
31
32 private static final Logger LOG = LoggerFactory.getLogger(HtmlCompressorMojoTest.class);
33
34
35
36
37 @BeforeAll
38 static void setUpClass() {
39 LOG.info("Setting up class...");
40 }
41
42
43
44
45 @AfterAll
46 static void tearDownClass() {
47 LOG.info("Mojo test finished.");
48 }
49
50
51
52
53 @BeforeEach
54 void setUp() {
55 LOG.info("Setting up data for testing...");
56 }
57
58
59
60
61
62
63
64 @Test
65 void testExecute() throws MojoExecutionException {
66 LOG.info("Testing mojo execution...");
67
68 HtmlCompressorMojo htmlCompressorMojo = new HtmlCompressorMojo();
69 htmlCompressorMojo.setSrcFolder("src/test/resources/html");
70 htmlCompressorMojo.setJavascriptHtmlSpriteIntegrationFile("src/test/resources/html/integration.js");
71 htmlCompressorMojo.setTargetFolder("target/htmlcompressor/html");
72 htmlCompressorMojo.execute();
73
74
75
76 LOG.info("Passed");
77 }
78 }