File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed
spring-rabbit/src/test/java/org/springframework/amqp/rabbit Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ subprojects { subproject ->
85
85
rabbitmqVersion = project. hasProperty(' rabbitmqVersion' ) ? project. rabbitmqVersion : ' 5.3.0'
86
86
rabbitmqHttpClientVersion = ' 2.1.0.RELEASE'
87
87
88
- springVersion = project. hasProperty(' springVersion' ) ? project. springVersion : ' 5.1.0.RC1 '
88
+ springVersion = project. hasProperty(' springVersion' ) ? project. springVersion : ' 5.1.0.BUILD-SNAPSHOT '
89
89
90
90
springRetryVersion = ' 1.2.2.RELEASE'
91
91
}
Original file line number Diff line number Diff line change 45
45
import org .springframework .context .annotation .Bean ;
46
46
import org .springframework .context .annotation .Configuration ;
47
47
import org .springframework .context .event .EventListener ;
48
+ import org .springframework .stereotype .Component ;
48
49
import org .springframework .test .annotation .DirtiesContext ;
49
50
import org .springframework .test .context .ContextConfiguration ;
50
51
import org .springframework .test .context .junit4 .SpringJUnit4ClassRunner ;
@@ -131,6 +132,7 @@ public Listener listener() {
131
132
132
133
}
133
134
135
+ @ Component
134
136
public static class Listener {
135
137
136
138
private final Log logger = LogFactory .getLog (this .getClass ());
Original file line number Diff line number Diff line change 35
35
import org .springframework .amqp .rabbit .junit .RabbitAvailable ;
36
36
import org .springframework .amqp .rabbit .junit .RabbitAvailableCondition ;
37
37
import org .springframework .beans .factory .annotation .Autowired ;
38
+ import org .springframework .context .ApplicationListener ;
38
39
import org .springframework .context .annotation .Bean ;
39
40
import org .springframework .context .annotation .Configuration ;
40
- import org .springframework .context .event .EventListener ;
41
41
import org .springframework .test .annotation .DirtiesContext ;
42
42
import org .springframework .test .context .junit .jupiter .SpringJUnitConfig ;
43
43
@@ -88,7 +88,7 @@ private void doTestEvents() throws Exception {
88
88
}
89
89
90
90
@ Configuration
91
- public static class Config {
91
+ public static class Config implements ApplicationListener < BrokerEvent > {
92
92
93
93
private final CountDownLatch latch = new CountDownLatch (3 );
94
94
@@ -104,8 +104,8 @@ public ConnectionFactory connectionFactory() {
104
104
return new CachingConnectionFactory (RabbitAvailableCondition .getBrokerRunning ().getConnectionFactory ());
105
105
}
106
106
107
- @ EventListener
108
- public void listener (BrokerEvent event ) {
107
+ @ Override
108
+ public void onApplicationEvent (BrokerEvent event ) {
109
109
this .events .put (event .getEventType (), event .getEventProperties ());
110
110
this .latch .countDown ();
111
111
}
You can’t perform that action at this time.
0 commit comments