Public method to register RSocket handler methods

Closes gh-25639
This commit is contained in:
Rossen Stoyanchev
2020-08-26 08:21:30 +01:00
parent 874574513c
commit 9c7b4ff9ba
2 changed files with 15 additions and 17 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -77,8 +77,10 @@ public class MethodMessageHandlerTests {
public void bestMatch() throws NoSuchMethodException {
TestMethodMessageHandler handler = new TestMethodMessageHandler();
TestController controller = new TestController();
handler.register(controller, TestController.class.getMethod("handleMessageMatch1"), "/bestmatch/{foo}/path");
handler.register(controller, TestController.class.getMethod("handleMessageMatch2"), "/bestmatch/*/*");
handler.registerHandlerMethod(controller,
TestController.class.getMethod("handleMessageMatch1"), "/bestmatch/{foo}/path");
handler.registerHandlerMethod(controller,
TestController.class.getMethod("handleMessageMatch2"), "/bestmatch/*/*");
handler.afterPropertiesSet();
Message<?> message = new GenericMessage<>("body", Collections.singletonMap(
@@ -221,10 +223,6 @@ public class MethodMessageHandlerTests {
return this.returnValueHandler.getLastReturnValue();
}
public void register(Object handler, Method method, String mapping) {
super.registerHandlerMethod(handler, method, mapping);
}
@Override
protected String getMappingForMethod(Method method, Class<?> handlerType) {
String methodName = method.getName();