AbstractHandlerMethodMapping refactoring

Remove convenience Map that is to avoid. The only downside is that
getHandlerMethods requires a transformation but that should not be used frequently.

See gh-22961
This commit is contained in:
Rossen Stoyanchev
2020-07-09 12:11:15 +03:00
parent 0584c289ab
commit 4d7418841c
3 changed files with 31 additions and 39 deletions

View File

@@ -112,8 +112,7 @@ public class HandlerMethodMappingTests {
this.mapping.registerMapping(key1, this.handler, this.method1);
this.mapping.registerMapping(key2, this.handler, this.method2);
assertThat(this.mapping.getMappingRegistry().getMappings())
.containsKeys(key1, key2);
assertThat(this.mapping.getMappingRegistry().getRegistrations()).containsKeys(key1, key2);
}
@Test
@@ -125,8 +124,7 @@ public class HandlerMethodMappingTests {
this.mapping.registerMapping(key1, handler1, this.method1);
this.mapping.registerMapping(key2, handler2, this.method1);
assertThat(this.mapping.getMappingRegistry().getMappings())
.containsKeys(key1, key2);
assertThat(this.mapping.getMappingRegistry().getRegistrations()).containsKeys(key1, key2);
}
@Test
@@ -141,7 +139,7 @@ public class HandlerMethodMappingTests {
result = this.mapping.getHandler(MockServerWebExchange.from(MockServerHttpRequest.get(key)));
assertThat(result.block()).isNull();
assertThat(this.mapping.getMappingRegistry().getMappings().keySet()).doesNotContain(key);
assertThat(this.mapping.getMappingRegistry().getRegistrations().keySet()).doesNotContain(key);
}