From 76fe67690fc6f365ada652d546900112d382ee66 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 11 Jan 2017 13:05:15 +0300 Subject: fix tests --- src/test/java/com/juick/tests/ApiTests.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/test/java/com/juick/tests') 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 @@ -73,6 +73,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", - ">_<", PageTemplates.formatTags(Collections.singletonList(htmlTagStats))); + ">_<", templates.formatTags(Collections.singletonList(htmlTagStats))); } @Test -- cgit v1.2.3