Use Set (again) for enumerating MvcEndpoints
This reverts a change that I assume was orphaned from work in progress to address #1353, but is no longer needed. Anyway there is no reason to restrict MvcEndpoints to be unique by path since they can declare their own @RequestMappings (and if there are duplicates they will be detected when those are scanned). Fixes gh-1911
This commit is contained in:
@@ -133,6 +133,21 @@ public class EndpointHandlerMappingTests {
|
||||
nullValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void duplicatePath() throws Exception {
|
||||
TestMvcEndpoint endpoint = new TestMvcEndpoint(new TestEndpoint("/a"));
|
||||
TestActionEndpoint other = new TestActionEndpoint(new TestEndpoint("/a"));
|
||||
EndpointHandlerMapping mapping = new EndpointHandlerMapping(Arrays.asList(
|
||||
endpoint, other));
|
||||
mapping.setDisabled(true);
|
||||
mapping.setApplicationContext(this.context);
|
||||
mapping.afterPropertiesSet();
|
||||
assertThat(mapping.getHandler(new MockHttpServletRequest("GET", "/a")),
|
||||
nullValue());
|
||||
assertThat(mapping.getHandler(new MockHttpServletRequest("POST", "/a")),
|
||||
nullValue());
|
||||
}
|
||||
|
||||
private static class TestEndpoint extends AbstractEndpoint<Object> {
|
||||
|
||||
public TestEndpoint(String path) {
|
||||
|
||||
Reference in New Issue
Block a user