Polishing
This commit is contained in:
@@ -445,27 +445,23 @@ public class MessageBrokerBeanDefinitionParserTests {
|
||||
}
|
||||
|
||||
|
||||
private void testChannel(String channelName, List<Class<? extends MessageHandler>> subscriberTypes,
|
||||
int interceptorCount) {
|
||||
private void testChannel(
|
||||
String channelName, List<Class<? extends MessageHandler>> subscriberTypes, int interceptorCount) {
|
||||
|
||||
AbstractSubscribableChannel channel = this.appContext.getBean(channelName, AbstractSubscribableChannel.class);
|
||||
|
||||
for (Class<? extends MessageHandler> subscriberType : subscriberTypes) {
|
||||
MessageHandler subscriber = this.appContext.getBean(subscriberType);
|
||||
assertNotNull("No subscription for " + subscriberType, subscriber);
|
||||
assertTrue(channel.hasSubscription(subscriber));
|
||||
}
|
||||
|
||||
List<ChannelInterceptor> interceptors = channel.getInterceptors();
|
||||
assertEquals(interceptorCount, interceptors.size());
|
||||
assertEquals(ImmutableMessageChannelInterceptor.class, interceptors.get(interceptors.size()-1).getClass());
|
||||
}
|
||||
|
||||
private void testExecutor(String channelName, int corePoolSize, int maxPoolSize, int keepAliveSeconds) {
|
||||
|
||||
ThreadPoolTaskExecutor taskExecutor =
|
||||
this.appContext.getBean(channelName + "Executor", ThreadPoolTaskExecutor.class);
|
||||
|
||||
assertEquals(corePoolSize, taskExecutor.getCorePoolSize());
|
||||
assertEquals(maxPoolSize, taskExecutor.getMaxPoolSize());
|
||||
assertEquals(keepAliveSeconds, taskExecutor.getKeepAliveSeconds());
|
||||
@@ -483,6 +479,7 @@ public class MessageBrokerBeanDefinitionParserTests {
|
||||
return (handler instanceof WebSocketHandlerDecorator) ?
|
||||
((WebSocketHandlerDecorator) handler).getLastHandler() : handler;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -509,7 +506,6 @@ class CustomReturnValueHandler implements HandlerMethodReturnValueHandler {
|
||||
|
||||
@Override
|
||||
public void handleReturnValue(Object returnValue, MethodParameter returnType, Message<?> message) throws Exception {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -540,12 +536,15 @@ class TestWebSocketHandlerDecorator extends WebSocketHandlerDecorator {
|
||||
class TestStompErrorHandler extends StompSubProtocolErrorHandler {
|
||||
}
|
||||
|
||||
|
||||
class TestValidator implements Validator {
|
||||
|
||||
@Override
|
||||
public boolean supports(Class<?> clazz) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(@Nullable Object target, Errors errors) { }
|
||||
public void validate(@Nullable Object target, Errors errors) {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user