Skip to content

Commit

Permalink
DPO-2612 RestTemplaten poiston myötä testit eivät sammu nätisti (#133)
Browse files Browse the repository at this point in the history
- added tomcat ip to make shutdown faster in tests
  • Loading branch information
jouniso authored May 29, 2024
1 parent 9818050 commit 4d2e9b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 3 additions & 1 deletion src/test/java/fi/livi/digitraffic/tie/AbstractTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"roadConditions.baseUrl=https://roadConditions/",
"roadConditions.suid=suid",
"roadConditions.user=user",
"roadConditions.pass=pass"
"roadConditions.pass=pass",
// https://github.com/spring-projects/spring-boot/issues/39735 as default Tomcat listens 0.0.0.0 and stopping takes ages
"server.address=127.0.0.1"
})
public abstract class AbstractTest {

Expand Down
7 changes: 0 additions & 7 deletions src/test/java/fi/livi/digitraffic/tie/SwaggerUiWebTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;

import fi.livi.digitraffic.tie.controller.beta.BetaController;
import fi.livi.digitraffic.tie.controller.tms.TmsControllerV1;
Expand All @@ -25,11 +23,6 @@ public class SwaggerUiWebTest extends AbstractRestWebTest {

private final MediaType restContentType = MediaType.APPLICATION_JSON;

@BeforeEach
public void setup() {
this.mockMvc = MockMvcBuilders.webAppContextSetup(wac).build();
}

@Test
public void testSwaggerHome() throws Exception {
this.mockMvc.perform(get("/swagger-ui/index.html")).andExpect(status().isOk())
Expand Down

0 comments on commit 4d2e9b8

Please sign in to comment.