|
|
|
@ -335,20 +335,18 @@ public class MvcUriComponentsBuilderTests { |
|
|
|
assertThat(uriComponents.toUriString()).isEqualTo("http://localhost/something/custom/1/foo"); |
|
|
|
assertThat(uriComponents.toUriString()).isEqualTo("http://localhost/something/custom/1/foo"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test // gh-35348
|
|
|
|
void fromMethodNameConfigurablePathSpEL() { |
|
|
|
void fromMethodNameConfigurablePathSpEL() { |
|
|
|
try { |
|
|
|
try { |
|
|
|
System.setProperty("customMapping", "custom"); |
|
|
|
System.setProperty("customMapping", "custom"); |
|
|
|
StandardEnvironment environment = new StandardEnvironment(); |
|
|
|
StandardEnvironment environment = new StandardEnvironment(); |
|
|
|
initWebApplicationContext(WebConfig.class, environment); |
|
|
|
initWebApplicationContext(WebConfig.class, environment); |
|
|
|
UriComponents uriComponents = fromMethodName(ControllerWithMethods.class, |
|
|
|
UriComponents uric = fromMethodName(ControllerWithMethods.class, "methodWithSpEL", "1").build(); |
|
|
|
"methodWithConfigurableMappingThroughSpEL", "1").build(); |
|
|
|
assertThat(uric.toUriString()).isEqualTo("http://localhost/something/custom/1/foo"); |
|
|
|
assertThat(uriComponents.toUriString()).isEqualTo("http://localhost/something/custom/1/foo"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
finally { |
|
|
|
finally { |
|
|
|
System.clearProperty("customMapping"); |
|
|
|
System.clearProperty("customMapping"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
@ -721,7 +719,7 @@ public class MvcUriComponentsBuilderTests { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/#{systemProperties.customMapping}/{id}/foo") |
|
|
|
@RequestMapping("/#{systemProperties.customMapping}/{id}/foo") |
|
|
|
HttpEntity<Void> methodWithConfigurableMappingThroughSpEL(@PathVariable String id) { |
|
|
|
HttpEntity<Void> methodWithSpEL(@PathVariable String id) { |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|