aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/com
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-12-12 15:12:27 +0300
committerGravatar Vitaly Takmazov2018-12-12 15:12:27 +0300
commit9d493ac966db2e016f73efcdcfb65dfb10bf8114 (patch)
treea809772b66e659f4154dc64d3140c86f76875977 /src/test/java/com
parent2ea41f9dcfdedf247d1d81f7efa050a61c3f5e03 (diff)
UserInfo -> User
Diffstat (limited to 'src/test/java/com')
-rw-r--r--src/test/java/com/juick/server/tests/ServerTests.java20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java
index 01aa298b..d1cdac8b 100644
--- a/src/test/java/com/juick/server/tests/ServerTests.java
+++ b/src/test/java/com/juick/server/tests/ServerTests.java
@@ -27,10 +27,7 @@ import com.gargoylesoftware.htmlunit.html.DomElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.jayway.jsonpath.JsonPath;
import com.juick.*;
-import com.juick.model.AnonymousUser;
-import com.juick.model.CommandResult;
-import com.juick.model.PrivateChats;
-import com.juick.model.TagStats;
+import com.juick.model.*;
import com.juick.server.*;
import com.juick.server.api.activity.model.Context;
import com.juick.server.api.activity.model.activities.Create;
@@ -1896,4 +1893,19 @@ public class ServerTests {
.andExpect(status().isOk())
.andExpect(header().string("Vary", "Accept-Language"));
}
+ @Test
+ public void apiInfo() throws Exception {
+ userService.createUser("tst", "tst");
+ MvcResult result = mockMvc.perform(get("/api/info/tst"))
+ .andExpect(status().isOk())
+ .andReturn();
+ User tst = jsonMapper.readValue(result.getResponse().getContentAsString(), User.class);
+ assertThat(tst.getReaders(), is(nullValue()));
+ commandsManager.processCommand(ugnich, "S @tst", emptyUri);
+ result = mockMvc.perform(get("/api/info/tst"))
+ .andExpect(status().isOk())
+ .andReturn();
+ tst = jsonMapper.readValue(result.getResponse().getContentAsString(), User.class);
+ assertThat(tst.getReaders().size(), is(1));
+ }
}