Fix NPE (Mock Message with no Headers)

This commit is contained in:
Gary Russell
2017-05-31 12:10:27 -04:00
parent d90d4e4d8f
commit 492246eb13

View File

@@ -21,6 +21,7 @@ import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.mockito.Mockito.mock;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
@@ -71,6 +72,7 @@ public class MessagingGatewayTests {
this.messagingGateway.afterPropertiesSet();
this.messagingGateway.start();
applicationContext.refresh();
Mockito.when(this.messageMock.getHeaders()).thenReturn(new MessageHeaders(Collections.emptyMap()));
}