Skip to content

Commit

Permalink
Fix VaadinBootBaseTest
Browse files Browse the repository at this point in the history
  • Loading branch information
mvysny committed Sep 15, 2024
1 parent bacd1ff commit 30a2f14
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void testContextRootParsedCorrectlyFromSystemProperty() {

@Test
public void testContextRootParsedCorrectlyFromSystemEnv() {
env.put("SERVER_SERVLET_CONTEXT-PATH", "/foo");
env.put("SERVER_SERVLET_CONTEXT_PATH", "/foo");
assertEquals("/foo", new VaadinBoot().contextRoot);
// system property takes precedence
System.setProperty("server.servlet.context-path", "/bar");
Expand All @@ -118,6 +118,18 @@ public void testContextRootParsedCorrectlyFromSystemEnv() {
assertEquals("", new VaadinBoot().withContextRoot("/").contextRoot);
}

@Test
public void contextRootPostprocessedCorrectly() {
env.put("SERVER_SERVLET_CONTEXT_PATH", "/foo");
assertEquals("/foo", new VaadinBoot().contextRoot);
env.put("SERVER_SERVLET_CONTEXT_PATH", "/");
assertEquals("", new VaadinBoot().contextRoot);
env.put("SERVER_SERVLET_CONTEXT_PATH", "foo/bar");
assertEquals("/foo/bar", new VaadinBoot().contextRoot);
env.put("SERVER_SERVLET_CONTEXT_PATH", "foo/bar/");
assertEquals("/foo/bar", new VaadinBoot().contextRoot);
}

@Test
public void failureToStartPropagatedProperly() throws Exception {
final DummyWebServer.FailsToStart webServer = new DummyWebServer.FailsToStart();
Expand Down

0 comments on commit 30a2f14

Please sign in to comment.