SEC-2819 SimpDestinationMessageMatcher(String pattern, SimpMessageType

type) never passes type param to this() constructor
This commit is contained in:
Pascal Gehl
2015-01-18 14:55:08 -05:00
parent 93d967cb27
commit d834554a8a
3 changed files with 41 additions and 4 deletions

View File

@@ -15,14 +15,14 @@
*/
package org.springframework.security.messaging.util.matcher;
import static org.fest.assertions.Assertions.assertThat;
import org.junit.Before;
import org.junit.Test;
import org.springframework.messaging.simp.SimpMessageHeaderAccessor;
import org.springframework.messaging.simp.SimpMessageType;
import org.springframework.messaging.support.MessageBuilder;
import static org.fest.assertions.Assertions.assertThat;
public class SimpDestinationMessageMatcherTests {
MessageBuilder<String> messageBuilder;
@@ -99,5 +99,14 @@ public class SimpDestinationMessageMatcherTests {
assertThat(matcher.matches(messageBuilder.build())).isTrue();
}
@Test
public void typeConstructorParameterIsTransmitted() throws Exception {
matcher = new SimpDestinationMessageMatcher("/match", SimpMessageType.MESSAGE);
MessageMatcher<Object> expectedTypeMatcher = new SimpMessageTypeMatcher(SimpMessageType.MESSAGE);
assertThat(matcher.getMessageTypeMatcher()).isEqualTo(expectedTypeMatcher);
}
}