diff options
author | JoeOLeary <joseph.o.leary@est.tech> | 2019-02-18 15:13:16 +0000 |
---|---|---|
committer | JoeOLeary <joseph.o.leary@est.tech> | 2019-02-18 15:13:16 +0000 |
commit | 8e2c338d0195f31269811ba4ff3f1214a60907d1 (patch) | |
tree | f843bbbe774abba173db03b6342dead635ae7268 /src/test/java/org/onap | |
parent | 32ba8905197d61b6a9610d50a57cf4ba31e53a52 (diff) |
Fix DataRouter Subscriber NPE on No Metadata
Issue-ID: DCAEGEN2-1232
Change-Id: I692d65c460f2974535d5b9addc4d889c530cf951
Signed-off-by: JoeOLeary <joseph.o.leary@est.tech>
Diffstat (limited to 'src/test/java/org/onap')
-rw-r--r-- | src/test/java/org/onap/dcaegen2/services/pmmapper/datarouter/DataRouterSubscriberTest.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test/java/org/onap/dcaegen2/services/pmmapper/datarouter/DataRouterSubscriberTest.java b/src/test/java/org/onap/dcaegen2/services/pmmapper/datarouter/DataRouterSubscriberTest.java index a40e28b..ad73b63 100644 --- a/src/test/java/org/onap/dcaegen2/services/pmmapper/datarouter/DataRouterSubscriberTest.java +++ b/src/test/java/org/onap/dcaegen2/services/pmmapper/datarouter/DataRouterSubscriberTest.java @@ -39,6 +39,7 @@ import ch.qos.logback.core.read.ListAppender; import io.undertow.io.Receiver; import io.undertow.io.Sender; import io.undertow.server.HttpServerExchange; +import io.undertow.util.HeaderMap; import io.undertow.util.StatusCodes; import utils.LoggingUtils; @@ -186,8 +187,11 @@ public class DataRouterSubscriberTest { public void testRequestInboundNoMetadata() throws Exception { HttpServerExchange httpServerExchange = mock(HttpServerExchange.class, RETURNS_DEEP_STUBS); Receiver receiver = mock(Receiver.class); + HeaderMap headers = mock(HeaderMap.class); when(httpServerExchange.getRequestReceiver()).thenReturn(receiver); when(httpServerExchange.setStatusCode(anyInt())).thenReturn(httpServerExchange); + when(httpServerExchange.getRequestHeaders()).thenReturn(headers); + when(headers.get(any(String.class))).thenReturn(null); doAnswer((Answer<Void>) invocationOnMock -> { Receiver.FullStringCallback callback = invocationOnMock.getArgument(0); |