use of org.springframework.messaging.MessageHandler in project spring-framework by spring-projects.
the class ExecutorSubscribableChannelTests method failurePropagates.
@Test
public void failurePropagates() throws Exception {
RuntimeException ex = new RuntimeException();
willThrow(ex).given(this.handler).handleMessage(this.message);
MessageHandler secondHandler = mock(MessageHandler.class);
this.channel.subscribe(this.handler);
this.channel.subscribe(secondHandler);
try {
this.channel.send(message);
} catch (MessageDeliveryException actualException) {
assertThat(actualException.getCause(), equalTo(ex));
}
verifyZeroInteractions(secondHandler);
}
use of org.springframework.messaging.MessageHandler in project spring-framework by spring-projects.
the class MessageBrokerConfigurationTests method userBroadcastsDisabledWithSimpleBroker.
@Test
public void userBroadcastsDisabledWithSimpleBroker() throws Exception {
SimpUserRegistry registry = this.simpleBrokerContext.getBean(SimpUserRegistry.class);
assertNotNull(registry);
assertNotEquals(MultiServerUserRegistry.class, registry.getClass());
UserDestinationMessageHandler handler = this.simpleBrokerContext.getBean(UserDestinationMessageHandler.class);
assertNull(handler.getBroadcastDestination());
String name = "userRegistryMessageHandler";
MessageHandler messageHandler = this.simpleBrokerContext.getBean(name, MessageHandler.class);
assertNotEquals(UserRegistryMessageHandler.class, messageHandler.getClass());
}
Aggregations