From 9c0f37b2fd7535a46c324ff7eb89ed9454aee88f Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 18 Aug 2017 13:58:34 +0300 Subject: www: no more ugnich templates --- src/test/java/com/juick/tests/ApiTests.java | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src/test/java/com') diff --git a/src/test/java/com/juick/tests/ApiTests.java b/src/test/java/com/juick/tests/ApiTests.java index bd8547a2..03204957 100644 --- a/src/test/java/com/juick/tests/ApiTests.java +++ b/src/test/java/com/juick/tests/ApiTests.java @@ -32,7 +32,9 @@ import com.juick.service.TagService; import com.juick.service.UserService; import com.juick.service.search.SearchService; import com.juick.www.WebApp; -import com.juick.www.controllers.PageTemplates; +import com.mitchellbosecke.pebble.PebbleEngine; +import com.mitchellbosecke.pebble.loader.StringLoader; +import com.mitchellbosecke.pebble.template.PebbleTemplate; import org.apache.commons.dbcp2.BasicDataSource; import org.apache.commons.lang3.StringUtils; import org.junit.Before; @@ -92,11 +94,6 @@ public class ApiTests { } } - @Bean - public PageTemplates templates() { - return new PageTemplates(); - } - @Bean public PlatformTransactionManager transactionManager() { return new DataSourceTransactionManager(dataSource()); @@ -156,8 +153,6 @@ public class ApiTests { JdbcTemplate jdbcTemplate; @Inject JuickProtocol juickProtocol; - @Inject - PageTemplates templates; @Mock ProtocolListener listener; @@ -209,8 +204,6 @@ public class ApiTests { htmlTagStats.setTag(htmlTag); String dbTagName = jdbcTemplate.queryForObject("select name from tags where name=?", String.class, htmlTagName); assertEquals("db tags should not be escaped", dbTagName, htmlTag.getName()); - assertEquals("template should encode escaped tag in url and show escaped tag in name", - ">_<", templates.formatTags(Collections.singletonList(htmlTagStats))); int mid4 = messagesService.createMessage(user_id, "yoyoyo", null, null); Message msg4 = messagesService.getMessage(mid4); assertEquals("tags string should be empty", StringUtils.EMPTY, msg4.getTagsString()); -- cgit v1.2.3