|
21 | 21 | import static org.hamcrest.CoreMatchers.not; |
22 | 22 | import static org.hamcrest.Matchers.containsInAnyOrder; |
23 | 23 | import static org.hamcrest.Matchers.containsString; |
| 24 | +import static org.hamcrest.Matchers.sameInstance; |
24 | 25 | import static org.junit.Assert.assertEquals; |
25 | 26 | import static org.junit.Assert.assertFalse; |
26 | 27 | import static org.junit.Assert.assertNotNull; |
27 | | -import static org.junit.Assert.assertNotSame; |
28 | 28 | import static org.junit.Assert.assertNull; |
29 | 29 | import static org.junit.Assert.assertSame; |
30 | 30 | import static org.junit.Assert.assertThat; |
@@ -462,7 +462,7 @@ public void testMessagingGateway() throws InterruptedException { |
462 | 462 | assertThat(result, containsString("SpelExpression")); |
463 | 463 | this.testGateway.sendAsync("foo"); |
464 | 464 | assertTrue(this.asyncAnnotationProcessLatch.await(1, TimeUnit.SECONDS)); |
465 | | - assertNotSame(Thread.currentThread(), this.asyncAnnotationProcessThread.get()); |
| 465 | + assertThat(this.asyncAnnotationProcessThread.get(), not(sameInstance(Thread.currentThread()))); |
466 | 466 | } |
467 | 467 |
|
468 | 468 | @Test |
@@ -1001,8 +1001,8 @@ public MessageHandler sendAsyncHandler() { |
1001 | 1001 |
|
1002 | 1002 | @Override |
1003 | 1003 | public void handleMessage(Message<?> message) throws MessagingException { |
1004 | | - asyncAnnotationProcessLatch().countDown(); |
1005 | 1004 | asyncAnnotationProcessThread().set(Thread.currentThread()); |
| 1005 | + asyncAnnotationProcessLatch().countDown(); |
1006 | 1006 | } |
1007 | 1007 |
|
1008 | 1008 | }; |
|
0 commit comments