diff options
author | Vitaly Takmazov | 2023-08-12 02:22:36 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-08-23 15:43:38 +0300 |
commit | e0225bc87f36161090e1954cefd6611e0f534a8a (patch) | |
tree | 61509295c779d1bc1f81ad2e361ed3306f760d53 /src/test | |
parent | bbbb6d762b03c7d42327a71380b531017cbf5ee0 (diff) |
X: add JSON root endpoint
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/com/juick/server/tests/ServerTests.java | 10 |
1 files changed, 10 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 ce9b49d0..5a32c9ef 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -2534,6 +2534,16 @@ public class ServerTests { mockMvc.perform(get(htmlUri)).andExpect(status().isOk()); mockMvc.perform(get(ldUri)).andExpect(status().isOk()); } + @Test + public void jsonRequestToRootShouldRespondWithJsonContent() throws Exception { + var jsonHeader = "application/json"; + mockMvc.perform(get("/").accept(jsonHeader)) + .andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE)); + HtmlPage htmlPage = webClient.getPage("/"); + assertThat(htmlPage.isHtmlPage(), is(true)); + assertThat(htmlPage.getTitleText(), is("Discuss")); + } @Test @Transactional |