Example usage for org.springframework.boot.web.servlet.server AbstractServletWebServerFactory setContextPath

List of usage examples for org.springframework.boot.web.servlet.server AbstractServletWebServerFactory setContextPath

Introduction

In this page you can find the example usage for org.springframework.boot.web.servlet.server AbstractServletWebServerFactory setContextPath.

Prototype

@Override
    public void setContextPath(String contextPath) 

Source Link

Usage

From source file:org.springframework.boot.web.servlet.server.AbstractServletWebServerFactoryTests.java

@Test
public void specificContextRoot() throws Exception {
    AbstractServletWebServerFactory factory = getFactory();
    factory.setContextPath("/say");
    this.webServer = factory.getWebServer(exampleServletRegistration());
    this.webServer.start();
    assertThat(getResponse(getLocalUrl("/say/hello"))).isEqualTo("Hello World");
}