File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
main/java/org/springframework/amqp/rabbit/listener/adapter
test/java/org/springframework/amqp/rabbit/annotation Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2021 the original author or authors.
2
+ * Copyright 2021-2023 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -34,6 +34,10 @@ static boolean isMono(Object result) {
34
34
return result instanceof Mono ;
35
35
}
36
36
37
+ static boolean isMono (Class <?> resultType ) {
38
+ return Mono .class .isAssignableFrom (resultType );
39
+ }
40
+
37
41
@ SuppressWarnings ("unchecked" )
38
42
static void subscribe (Object returnValue , Consumer <? super Object > success ,
39
43
Consumer <? super Throwable > failure , Runnable completeConsumer ) {
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2018-2022 the original author or authors.
2
+ * Copyright 2018-2023 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -104,7 +104,7 @@ public class AsyncListenerTests {
104
104
private RabbitListenerEndpointRegistry registry ;
105
105
106
106
@ Test
107
- public void testAsyncListener () throws Exception {
107
+ public void testAsyncListener (@ Autowired RabbitListenerEndpointRegistry registry ) throws Exception {
108
108
assertThat (this .rabbitTemplate .convertSendAndReceive (this .queue1 .getName (), "foo" )).isEqualTo ("FOO" );
109
109
RabbitConverterFuture <Object > future = this .asyncTemplate .convertSendAndReceive (this .queue1 .getName (), "foo" );
110
110
assertThat (future .get (10 , TimeUnit .SECONDS )).isEqualTo ("FOO" );
@@ -118,6 +118,10 @@ public void testAsyncListener() throws Exception {
118
118
assertThat (this .config .contentTypeId ).isEqualTo ("java.lang.String" );
119
119
this .rabbitTemplate .convertAndSend (this .queue4 .getName (), "foo" );
120
120
assertThat (listener .latch4 .await (10 , TimeUnit .SECONDS ));
121
+ assertThat (TestUtils .getPropertyValue (registry .getListenerContainer ("foo" ), "asyncReplies" , Boolean .class ))
122
+ .isTrue ();
123
+ assertThat (TestUtils .getPropertyValue (registry .getListenerContainer ("bar" ), "asyncReplies" , Boolean .class ))
124
+ .isTrue ();
121
125
}
122
126
123
127
@ Test
You can’t perform that action at this time.
0 commit comments