polishing
This commit is contained in:
parent
3a419872c8
commit
4a1a622004
|
|
@ -155,7 +155,7 @@ public class JmsListenerEndpointRegistrar implements BeanFactoryAware, Initializ
|
|||
*/
|
||||
public void registerEndpoint(JmsListenerEndpoint endpoint, JmsListenerContainerFactory<?> factory) {
|
||||
Assert.notNull(endpoint, "Endpoint must be set");
|
||||
Assert.notNull(endpoint.getId(), "Endpoint id must be set");
|
||||
Assert.hasText(endpoint.getId(), "Endpoint id must be set");
|
||||
// Factory may be null, we defer the resolution right before actually creating the container
|
||||
this.endpointDescriptors.add(new JmsListenerEndpointDescriptor(endpoint, factory));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,6 +58,15 @@ public class JmsListenerEndpointRegistrarTests {
|
|||
registrar.registerEndpoint(new SimpleJmsListenerEndpoint(), containerFactory);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void registerEmptyEndpointId() {
|
||||
SimpleJmsListenerEndpoint endpoint = new SimpleJmsListenerEndpoint();
|
||||
endpoint.setId("");
|
||||
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
registrar.registerEndpoint(endpoint, containerFactory);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void registerNullContainerFactoryIsAllowed() throws Exception {
|
||||
SimpleJmsListenerEndpoint endpoint = new SimpleJmsListenerEndpoint();
|
||||
|
|
|
|||
Loading…
Reference in New Issue