Add test for servletMapping()
This commit is contained in:
parent
96a0d672af
commit
4999d41145
|
|
@ -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>();
|
||||
|
|
|
|||
Loading…
Reference in New Issue