diff options
author | Tony Hansen <tony@att.com> | 2019-02-19 17:08:45 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-02-19 17:08:45 +0000 |
commit | 7f82227820362daa3050a04620ca77faa5c52c1a (patch) | |
tree | b381e29bfe9c3d7d8d8a79f0edde9a7c38b25561 /src/test/java | |
parent | 4d4dc481af71692a15dc66e0504ed7e8dcbe94af (diff) | |
parent | 8e2c338d0195f31269811ba4ff3f1214a60907d1 (diff) |
Merge "Fix DataRouter Subscriber NPE on No Metadata"
Diffstat (limited to 'src/test/java')
-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); |