Fix failing tests
This commit is contained in:
parent
b3c7c18c1b
commit
02949fc4a7
|
|
@ -61,6 +61,7 @@ import org.springframework.messaging.support.converter.MessageConverter;
|
|||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.ReflectionUtils.MethodFilter;
|
||||
|
||||
|
||||
|
|
@ -270,11 +271,12 @@ public class AnnotationMethodMessageHandler implements MessageHandler, Applicati
|
|||
}
|
||||
|
||||
private boolean checkDestinationPrefix(String destination) {
|
||||
if ((destination != null) && (this.destinationPrefixes != null)) {
|
||||
for (String prefix : this.destinationPrefixes) {
|
||||
if (destination.startsWith(prefix)) {
|
||||
return true;
|
||||
}
|
||||
if ((destination == null) || CollectionUtils.isEmpty(this.destinationPrefixes)) {
|
||||
return true;
|
||||
}
|
||||
for (String prefix : this.destinationPrefixes) {
|
||||
if (destination.startsWith(prefix)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import org.springframework.messaging.simp.SimpMessageHeaderAccessor;
|
|||
import org.springframework.messaging.simp.SimpMessageType;
|
||||
import org.springframework.messaging.support.MessageBuilder;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
|
||||
|
||||
|
|
@ -103,11 +104,12 @@ public class SimpleBrokerMessageHandler implements MessageHandler {
|
|||
}
|
||||
|
||||
private boolean checkDestinationPrefix(String destination) {
|
||||
if ((destination != null) && (this.destinationPrefixes != null)) {
|
||||
for (String prefix : this.destinationPrefixes) {
|
||||
if (destination.startsWith(prefix)) {
|
||||
return true;
|
||||
}
|
||||
if ((destination == null) || CollectionUtils.isEmpty(this.destinationPrefixes)) {
|
||||
return true;
|
||||
}
|
||||
for (String prefix : this.destinationPrefixes) {
|
||||
if (destination.startsWith(prefix)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ import static org.mockito.Mockito.*;
|
|||
* @author Rossen Stoyanchev
|
||||
* @since 4.0
|
||||
*/
|
||||
public class SimpleBrokerWebMessageHandlerTests {
|
||||
public class SimpleBrokerMessageHandlerTests {
|
||||
|
||||
private SimpleBrokerMessageHandler messageHandler;
|
||||
|
||||
Loading…
Reference in New Issue