aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/test/java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-09-25 16:49:07 +0300
committerGravatar Vitaly Takmazov2018-09-25 16:49:07 +0300
commitf0deeb7d56e3a1cbdb9a809e93855c0c571c8bc0 (patch)
treeb844fa0545148d77872a51c58e6eb4659a17ab62 /juick-server/src/test/java
parent0d663c5503fdda0da5f7adaef31f67fe673dc6f2 (diff)
fix tests
Diffstat (limited to 'juick-server/src/test/java')
-rw-r--r--juick-server/src/test/java/com/juick/server/tests/ServerTests.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/juick-server/src/test/java/com/juick/server/tests/ServerTests.java b/juick-server/src/test/java/com/juick/server/tests/ServerTests.java
index 56434d1e..3bdf5b3b 100644
--- a/juick-server/src/test/java/com/juick/server/tests/ServerTests.java
+++ b/juick-server/src/test/java/com/juick/server/tests/ServerTests.java
@@ -220,6 +220,7 @@ public class ServerTests {
int juickId = userService.createUser(juickName, juickPassword);
juick = userService.getUserByUID(juickId).orElseThrow(IllegalStateException::new);
subscriptionService.subscribeUser(freefd, ugnich);
+ webClient.getOptions().setJavaScriptEnabled(false);
isSetUp = true;
}
}
@@ -1218,14 +1219,14 @@ public class ServerTests {
result = mockMvc.perform(post("/api/comment").with(httpBasic(freefdName, freefdPassword))
.param("mid", String.valueOf(original.getMid()))
.param("body", "HEY")).andExpect(status().is2xxSuccessful()).andReturn();
- Message comment = jsonMapper.readValue(result.getResponse().getContentAsString(), Message.class);
- assertThat(comment.getText(), is("HEY"));
- assertThat(comment.getUpdatedAt(), is(comment.getTimestamp()));
+ CommandResult comment = jsonMapper.readValue(result.getResponse().getContentAsString(), CommandResult.class);
+ assertThat(comment.getNewMessage().get().getText(), is("HEY"));
+ assertThat(comment.getNewMessage().get().getUpdatedAt(), is(comment.getNewMessage().get().getTimestamp()));
// to have updated_at greater than ts
Thread.sleep(1000);
result = mockMvc.perform(post("/api/update").with(httpBasic(freefdName, freefdPassword))
- .param("mid", String.valueOf(comment.getMid()))
- .param("rid", String.valueOf(comment.getRid()))
+ .param("mid", String.valueOf(comment.getNewMessage().get().getMid()))
+ .param("rid", String.valueOf(comment.getNewMessage().get().getRid()))
.param("body", "HEY, JOE")).andExpect(status().is2xxSuccessful()).andReturn();
Message editedComment = jsonMapper.readValue(result.getResponse().getContentAsString(), CommandResult.class)
.getNewMessage().get();