aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/com/juick/tests
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-01-11 13:05:15 +0300
committerGravatar Vitaly Takmazov2017-01-11 13:05:15 +0300
commit76fe67690fc6f365ada652d546900112d382ee66 (patch)
tree8542731b15e53cdad4fdc135038866315848cc05 /src/test/java/com/juick/tests
parent2f682b5e3cfc3fc5f961b60129be7bc90e0d6a03 (diff)
fix tests
Diffstat (limited to 'src/test/java/com/juick/tests')
-rw-r--r--src/test/java/com/juick/tests/ApiTests.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/test/java/com/juick/tests/ApiTests.java b/src/test/java/com/juick/tests/ApiTests.java
index 53a8fd7c..c1a1bb35 100644
--- a/src/test/java/com/juick/tests/ApiTests.java
+++ b/src/test/java/com/juick/tests/ApiTests.java
@@ -74,6 +74,11 @@ public class ApiTests {
}
@Bean
+ public PageTemplates templates() {
+ return new PageTemplates();
+ }
+
+ @Bean
public PlatformTransactionManager transactionManager() {
return new DataSourceTransactionManager(dataSource());
}
@@ -124,6 +129,8 @@ public class ApiTests {
JdbcTemplate jdbcTemplate;
@Inject
JuickProtocol juickProtocol;
+ @Inject
+ PageTemplates templates;
@Mock
ProtocolListener listener;
@@ -144,7 +151,7 @@ public class ApiTests {
assertEquals("yo", msg.getText());
Calendar calendar = Calendar.getInstance();
calendar.setTime(msg.getDate());
- assertEquals(2016, calendar.get(Calendar.YEAR));
+ assertEquals(2017, calendar.get(Calendar.YEAR));
User me = msg.getUser();
assertEquals("mmmme", me.getName());
assertEquals("mmmme", messagesService.getMessageAuthor(mid).getName());
@@ -177,7 +184,7 @@ public class ApiTests {
assertNotEquals("db tags should be escaped", dbTagName, htmlTag.getName());
assertEquals("object tags should unescaped", htmlTag.getName(), StringEscapeUtils.unescapeHtml4(dbTagName));
assertEquals("template should encode escaped tag in url and show escaped tag in name",
- "<a href=\"/tag/%3E_%3C\" rel=\"nofollow\">&gt;_&lt;</a>", PageTemplates.formatTags(Collections.singletonList(htmlTagStats)));
+ "<a href=\"/tag/%3E_%3C\" rel=\"nofollow\">&gt;_&lt;</a>", templates.formatTags(Collections.singletonList(htmlTagStats)));
}
@Test