Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rstoyanchev committed Jul 22, 2013
1 parent b3c7c18 commit 02949fc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
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;


Expand Down Expand Up @@ -270,11 +271,12 @@ private void handleMessageInternal(final Message<?> message, Map<MappingInfo, Ha
}

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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
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;


Expand Down Expand Up @@ -103,11 +104,12 @@ else if (SimpMessageType.DISCONNECT.equals(messageType)) {
}

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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* @author Rossen Stoyanchev
* @since 4.0
*/
public class SimpleBrokerWebMessageHandlerTests {
public class SimpleBrokerMessageHandlerTests {

private SimpleBrokerMessageHandler messageHandler;

Expand Down

0 comments on commit 02949fc

Please sign in to comment.