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