aboutsummaryrefslogtreecommitdiff
path: root/juick-server
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server')
-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();