diff options
author | Vitaly Takmazov | 2020-10-21 07:31:55 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2020-10-21 07:31:55 +0300 |
commit | 2223e6b85e4be0f4d0eda4000989ec0fe31002c9 (patch) | |
tree | 0f941de388491b950ae9f41bb5099e8c112e50b3 /src/test/java/com/juick/server/tests | |
parent | a2452f24e40751d12748e8f6aacfb113d1933298 (diff) |
Drop actuator tests
Diffstat (limited to 'src/test/java/com/juick/server/tests')
-rw-r--r-- | src/test/java/com/juick/server/tests/ServerTests.java | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java index 03f52623..320ba6fd 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -159,8 +159,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) @TestPropertySource(properties = { - "ios_app_id=12345678.com.juick.ExampleApp", - "juick.admin_users=ugnich" + "ios_app_id=12345678.com.juick.ExampleApp" }) @AutoConfigureMockMvc public class ServerTests { @@ -2398,31 +2397,6 @@ public class ServerTests { assertThat(claims.get("sub"), is("com.example.app")); assertThat(claims.get("aud"), is("https://appleid.apple.com")); } - - @Test - public void adminsTest() throws Exception { - assertThat(userService.isAdminUser(ugnich), is(true)); - assertThat(userService.isAdminUser(freefd), is(false)); - MvcResult formLoginResult = mockMvc.perform(post("/login") - .param("username", ugnichName) - .param("password", ugnichPassword)) - .andExpect(status().is3xxRedirection()).andReturn(); - Cookie ugnichLogin = formLoginResult.getResponse().getCookie("juick-remember-me"); - - formLoginResult = mockMvc.perform(post("/login") - .param("username", freefdName) - .param("password", freefdPassword)) - .andExpect(status().is3xxRedirection()).andReturn(); - Cookie freefdLogin = formLoginResult.getResponse().getCookie("juick-remember-me"); - - mockMvc.perform(get("/actuator/health") - .cookie(ugnichLogin)) - .andExpect(status().isOk()); - mockMvc.perform(get("/actuator/health") - .cookie(freefdLogin)) - .andExpect(status().is3xxRedirection()) - .andExpect(redirectedUrl("http://localhost/login")); - } @Test public void linksTest() throws IOException, ParserConfigurationException, SAXException { |