aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/com/juick/tests/ApiTests.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/com/juick/tests/ApiTests.java')
-rw-r--r--src/test/java/com/juick/tests/ApiTests.java13
1 files changed, 3 insertions, 10 deletions
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;
@@ -93,11 +95,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",
- "<a href=\"/tag/%3E_%3C\" rel=\"nofollow\">&gt;_&lt;</a>", 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());