@@ -74,8 +74,10 @@ public void simpleMessageListener() throws Exception {
74
74
assertEquals ("Wrong endpoint type" , MethodJmsListenerEndpoint .class , endpoint .getClass ());
75
75
MethodJmsListenerEndpoint methodEndpoint = (MethodJmsListenerEndpoint ) endpoint ;
76
76
assertEquals (SimpleMessageListenerTestBean .class , methodEndpoint .getBean ().getClass ());
77
- assertEquals (SimpleMessageListenerTestBean .class .getMethod ("handleIt" , String .class ), methodEndpoint .getMethod ());
78
- assertEquals (SimpleMessageListenerTestBean .class .getMethod ("handleIt" , String .class ), methodEndpoint .getMostSpecificMethod ());
77
+ assertEquals (SimpleMessageListenerTestBean .class .getMethod ("handleIt" , String .class ),
78
+ methodEndpoint .getMethod ());
79
+ assertEquals (SimpleMessageListenerTestBean .class .getMethod ("handleIt" , String .class ),
80
+ methodEndpoint .getMostSpecificMethod ());
79
81
80
82
SimpleMessageListenerContainer listenerContainer = new SimpleMessageListenerContainer ();
81
83
methodEndpoint .setupListenerContainer (listenerContainer );
@@ -99,8 +101,10 @@ public void metaAnnotationIsDiscovered() throws Exception {
99
101
assertEquals ("Wrong endpoint type" , MethodJmsListenerEndpoint .class , endpoint .getClass ());
100
102
MethodJmsListenerEndpoint methodEndpoint = (MethodJmsListenerEndpoint ) endpoint ;
101
103
assertEquals (MetaAnnotationTestBean .class , methodEndpoint .getBean ().getClass ());
102
- assertEquals (MetaAnnotationTestBean .class .getMethod ("handleIt" , String .class ), methodEndpoint .getMethod ());
103
- assertEquals (MetaAnnotationTestBean .class .getMethod ("handleIt" , String .class ), methodEndpoint .getMostSpecificMethod ());
104
+ assertEquals (MetaAnnotationTestBean .class .getMethod ("handleIt" , String .class ),
105
+ methodEndpoint .getMethod ());
106
+ assertEquals (MetaAnnotationTestBean .class .getMethod ("handleIt" , String .class ),
107
+ methodEndpoint .getMostSpecificMethod ());
104
108
assertEquals ("metaTestQueue" , ((AbstractJmsListenerEndpoint ) endpoint ).getDestination ());
105
109
}
106
110
finally {
@@ -121,12 +125,14 @@ public void sendToAnnotationFoundOnInterfaceProxy() throws Exception {
121
125
MethodJmsListenerEndpoint methodEndpoint = (MethodJmsListenerEndpoint ) endpoint ;
122
126
assertTrue (AopUtils .isJdkDynamicProxy (methodEndpoint .getBean ()));
123
127
assertTrue (methodEndpoint .getBean () instanceof SimpleService );
124
- assertEquals (SimpleService .class .getMethod ("handleIt" , String .class , String .class ), methodEndpoint .getMethod ());
125
- assertEquals (InterfaceProxyTestBean .class .getMethod ("handleIt" , String .class , String .class ), methodEndpoint .getMostSpecificMethod ());
126
-
127
- Method m = ReflectionUtils .findMethod (endpoint .getClass (), "getDefaultResponseDestination" );
128
- ReflectionUtils .makeAccessible (m );
129
- Object destination = ReflectionUtils .invokeMethod (m , endpoint );
128
+ assertEquals (SimpleService .class .getMethod ("handleIt" , String .class , String .class ),
129
+ methodEndpoint .getMethod ());
130
+ assertEquals (InterfaceProxyTestBean .class .getMethod ("handleIt" , String .class , String .class ),
131
+ methodEndpoint .getMostSpecificMethod ());
132
+
133
+ Method method = ReflectionUtils .findMethod (endpoint .getClass (), "getDefaultResponseDestination" );
134
+ ReflectionUtils .makeAccessible (method );
135
+ Object destination = ReflectionUtils .invokeMethod (method , endpoint );
130
136
assertEquals ("SendTo annotation not found on proxy" , "foobar" , destination );
131
137
}
132
138
finally {
@@ -147,12 +153,14 @@ public void sendToAnnotationFoundOnCglibProxy() throws Exception {
147
153
MethodJmsListenerEndpoint methodEndpoint = (MethodJmsListenerEndpoint ) endpoint ;
148
154
assertTrue (AopUtils .isCglibProxy (methodEndpoint .getBean ()));
149
155
assertTrue (methodEndpoint .getBean () instanceof ClassProxyTestBean );
150
- assertEquals (ClassProxyTestBean .class .getMethod ("handleIt" , String .class , String .class ), methodEndpoint .getMethod ());
151
- assertEquals (ClassProxyTestBean .class .getMethod ("handleIt" , String .class , String .class ), methodEndpoint .getMostSpecificMethod ());
152
-
153
- Method m = ReflectionUtils .findMethod (endpoint .getClass (), "getDefaultResponseDestination" );
154
- ReflectionUtils .makeAccessible (m );
155
- Object destination = ReflectionUtils .invokeMethod (m , endpoint );
156
+ assertEquals (ClassProxyTestBean .class .getMethod ("handleIt" , String .class , String .class ),
157
+ methodEndpoint .getMethod ());
158
+ assertEquals (ClassProxyTestBean .class .getMethod ("handleIt" , String .class , String .class ),
159
+ methodEndpoint .getMostSpecificMethod ());
160
+
161
+ Method method = ReflectionUtils .findMethod (endpoint .getClass (), "getDefaultResponseDestination" );
162
+ ReflectionUtils .makeAccessible (method );
163
+ Object destination = ReflectionUtils .invokeMethod (method , endpoint );
156
164
assertEquals ("SendTo annotation not found on proxy" , "foobar" , destination );
157
165
}
158
166
finally {
@@ -201,8 +209,8 @@ static class Config {
201
209
@ Bean
202
210
public JmsListenerAnnotationBeanPostProcessor postProcessor () {
203
211
JmsListenerAnnotationBeanPostProcessor postProcessor = new JmsListenerAnnotationBeanPostProcessor ();
204
- postProcessor .setEndpointRegistry (jmsListenerEndpointRegistry ());
205
212
postProcessor .setContainerFactoryBeanName ("testFactory" );
213
+ postProcessor .setEndpointRegistry (jmsListenerEndpointRegistry ());
206
214
return postProcessor ;
207
215
}
208
216
0 commit comments