1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package de.aikiit.spamprotector;
19
20 import org.apache.logging.log4j.LogManager;
21 import org.apache.logging.log4j.Logger;
22 import org.junit.Test;
23 import org.junit.experimental.categories.Category;
24
25 import static de.aikiit.spamprotector.util.LocalizationHelper.getParameterizedBundleString;
26 import static org.junit.Assert.*;
27
28
29
30
31 @Category(UITest.class)
32 public class GUITest {
33
34
35
36
37 private static final Logger LOG =
38 LogManager.getLogger(GUITest.class);
39
40 @Test
41 public final void startGui() {
42 GUI gui = new GUI();
43 assertNotNull(gui);
44 }
45
46 @Test
47 public final void ensureYearIs4digits() {
48 String year = String.valueOf(GUI.now.getYear());
49 assertEquals(4, year.length());
50
51 String msg = getParameterizedBundleString("spamschutz.ui.help.text",
52 year,
53 de.aikiit.spamprotector.util.Version.VERSION);
54
55 LOG.debug(msg);
56
57 assertFalse(msg.contains(year.charAt(0) + "."));
58 }
59 }