|
57 | 57 | import org.springframework.messaging.handler.annotation.Payload;
|
58 | 58 | import org.springframework.messaging.handler.annotation.SendTo;
|
59 | 59 | import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory;
|
60 |
| -import org.springframework.messaging.handler.annotation.support.MethodArgumentTypeMismatchException; |
61 | 60 | import org.springframework.util.ReflectionUtils;
|
62 | 61 | import org.springframework.validation.Errors;
|
63 | 62 | import org.springframework.validation.Validator;
|
64 | 63 | import org.springframework.validation.annotation.Validated;
|
65 | 64 |
|
66 |
| -import static org.junit.Assert.*; |
67 |
| -import static org.mockito.BDDMockito.*; |
| 65 | +import static org.junit.Assert.assertEquals; |
| 66 | +import static org.junit.Assert.assertNotNull; |
| 67 | +import static org.junit.Assert.assertSame; |
| 68 | +import static org.junit.Assert.assertTrue; |
| 69 | +import static org.mockito.BDDMockito.given; |
| 70 | +import static org.mockito.BDDMockito.mock; |
| 71 | +import static org.mockito.BDDMockito.verify; |
68 | 72 |
|
69 | 73 | /**
|
70 | 74 | * @author Stephane Nicoll
|
@@ -407,7 +411,7 @@ public void invalidMessagePayloadType() throws JMSException {
|
407 | 411 | Session session = mock(Session.class);
|
408 | 412 |
|
409 | 413 | thrown.expect(ListenerExecutionFailedException.class);
|
410 |
| - thrown.expectCause(Matchers.isA(MethodArgumentTypeMismatchException.class)); |
| 414 | + thrown.expectCause(Matchers.isA(MessageConversionException.class)); |
411 | 415 | listener.onMessage(createSimpleJmsTextMessage("test"), session); // Message<String> as Message<Integer>
|
412 | 416 | }
|
413 | 417 |
|
@@ -478,10 +482,10 @@ private Method getTestMethod() {
|
478 | 482 | }
|
479 | 483 |
|
480 | 484 |
|
481 |
| - @SendTo("defaultReply") |
| 485 | + @SendTo("defaultReply") @SuppressWarnings("unused") |
482 | 486 | static class JmsEndpointSampleBean {
|
483 | 487 |
|
484 |
| - private final Map<String, Boolean> invocations = new HashMap<String, Boolean>(); |
| 488 | + private final Map<String, Boolean> invocations = new HashMap<>(); |
485 | 489 |
|
486 | 490 | public void resolveMessageAndSession(javax.jms.Message message, Session session) {
|
487 | 491 | invocations.put("resolveMessageAndSession", true);
|
|
0 commit comments