aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/com/juick/server/tests
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2023-01-14 12:22:53 +0300
committerGravatar Vitaly Takmazov2023-01-14 13:59:24 +0300
commit834fef2a7794d769144c7c087a8b1fa0a2a9bb21 (patch)
treef44d2139be62ed7382c83ff234a557be66a9bde5 /src/test/java/com/juick/server/tests
parent456f2a28efc72809c4ac7dd7ee838e0e5b0a061f (diff)
DB: merge ios, android, winphone tables to user_services
Diffstat (limited to 'src/test/java/com/juick/server/tests')
-rw-r--r--src/test/java/com/juick/server/tests/ServerTests.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java
index 8956c721..a6c840bf 100644
--- a/src/test/java/com/juick/server/tests/ServerTests.java
+++ b/src/test/java/com/juick/server/tests/ServerTests.java
@@ -280,6 +280,8 @@ public class ServerTests {
private User archiveUser;
@Inject
private ConversionService conversionService;
+ @Inject
+ private PushQueriesService pushQueriesService;
private static User ugnich, freefd;
static String ugnichName, ugnichPassword, freefdName, freefdPassword;
@@ -2753,6 +2755,19 @@ public class ServerTests {
public void getLastRepliesShouldNotCrash() {
messagesService.getLastMessages(48);
}
+ @Test
+ public void userServicesTest() throws Exception {
+ jdbcTemplate.execute("DELETE FROM user_services");
+ pushQueriesService.addToken(ugnich.getUid(), "fcm", "12345");
+ pushQueriesService.addToken(ugnich.getUid(), "mpns", "23456");
+ pushQueriesService.addToken(ugnich.getUid(), "xmpp", "234567");
+ pushQueriesService.addToken(ugnich.getUid(), "durov", "345678");
+ assertThat(pushQueriesService.getTokens(List.of(ugnich.getUid())).size(), is(4));
+ mockMvc.perform(get("/api/notifications")
+ .with(httpBasic(serviceUser.getName(), serviceUser.getCredentials()))
+ .param("uid", String.valueOf(ugnich.getUid())))
+ .andExpect(status().isOk());
+ }
/*
@Test
public void tokenAuth() throws Exception {