diff options
author | Vitaly Takmazov | 2017-10-12 12:55:15 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2017-10-12 12:55:15 +0300 |
commit | 5439a0fa2fd0d778561e20f089af7dd9de7a5511 (patch) | |
tree | 3579c8bd3814f64374034ae9a232c9b0bcf8d417 /juick-server-jdbc/src/test/java/com/juick | |
parent | 753d79d6bbabfdac33c6c382717fe0acaec2a3bd (diff) |
api: fill uname in /pm
Diffstat (limited to 'juick-server-jdbc/src/test/java/com/juick')
-rw-r--r-- | juick-server-jdbc/src/test/java/com/juick/service/MessageServiceTest.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/juick-server-jdbc/src/test/java/com/juick/service/MessageServiceTest.java b/juick-server-jdbc/src/test/java/com/juick/service/MessageServiceTest.java index 44e46b70..47699dbc 100644 --- a/juick-server-jdbc/src/test/java/com/juick/service/MessageServiceTest.java +++ b/juick-server-jdbc/src/test/java/com/juick/service/MessageServiceTest.java @@ -17,6 +17,7 @@ package com.juick.service; +import com.juick.Message; import com.juick.Tag; import com.juick.User; import com.juick.configuration.RepositoryConfiguration; @@ -53,6 +54,8 @@ public class MessageServiceTest extends AbstractJUnit4SpringContextTests { private JdbcTemplate jdbcTemplate; @Inject private CrosspostService crosspostService; + @Inject + private PMQueriesService pmQueriesService; int ugnichId, freefdId, mid; @@ -105,4 +108,11 @@ public class MessageServiceTest extends AbstractJUnit4SpringContextTests { tagService.blacklistTag(freefd, yoTag); assertThat(subscriptionService.getSubscribedUsers(ugnichId, mid).size(), equalTo(1)); } + @Test + public void pmTests() { + pmQueriesService.createPM(freefdId, ugnichId, "hello"); + Message pm = pmQueriesService.getPMMessages(ugnichId, freefdId).get(0); + assertThat(pm.getText(), equalTo("hello")); + assertThat(pm.getUser().getUid(), equalTo(freefdId)); + } } |