|
|
|
|
@ -58,6 +58,26 @@ public class ServerPropertiesTests {
@@ -58,6 +58,26 @@ public class ServerPropertiesTests {
|
|
|
|
|
assertEquals(9000, this.properties.getPort().intValue()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void testServletPathAsMapping() throws Exception { |
|
|
|
|
RelaxedDataBinder binder = new RelaxedDataBinder(this.properties, "server"); |
|
|
|
|
binder.bind(new MutablePropertyValues(Collections.singletonMap( |
|
|
|
|
"server.servletPath", "/foo/*"))); |
|
|
|
|
assertFalse(binder.getBindingResult().hasErrors()); |
|
|
|
|
assertEquals("/foo/*", this.properties.getServletMapping()); |
|
|
|
|
assertEquals("/foo", this.properties.getServletPrefix()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void testServletPathAsPrefix() throws Exception { |
|
|
|
|
RelaxedDataBinder binder = new RelaxedDataBinder(this.properties, "server"); |
|
|
|
|
binder.bind(new MutablePropertyValues(Collections.singletonMap( |
|
|
|
|
"server.servletPath", "/foo"))); |
|
|
|
|
assertFalse(binder.getBindingResult().hasErrors()); |
|
|
|
|
assertEquals("/foo/*", this.properties.getServletMapping()); |
|
|
|
|
assertEquals("/foo", this.properties.getServletPrefix()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void testTomcatBinding() throws Exception { |
|
|
|
|
Map<String, String> map = new HashMap<String, String>(); |
|
|
|
|
|