diff options
-rw-r--r-- | src/test/java/com/att/nsa/dmaap/util/ContentLengthInterceptorTest.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/java/com/att/nsa/dmaap/util/ContentLengthInterceptorTest.java b/src/test/java/com/att/nsa/dmaap/util/ContentLengthInterceptorTest.java index 36d52e0..84ea98c 100644 --- a/src/test/java/com/att/nsa/dmaap/util/ContentLengthInterceptorTest.java +++ b/src/test/java/com/att/nsa/dmaap/util/ContentLengthInterceptorTest.java @@ -65,9 +65,19 @@ public class ContentLengthInterceptorTest { public void testAllowOrReject() throws Exception {
PowerMockito.when(req.getHeader("Transfer-Encoding")).thenReturn("UTF-8");
PowerMockito.when(req.getHeader("Content-Length")).thenReturn("1027");
+
+ interceptor.allowOrReject(req, res, map);
+ assertTrue(true);
+ }
+
+ @Test
+ (expected = NullPointerException.class)
+ public void testAllowOrRejectWithException() throws Exception {
+ PowerMockito.when(req.getHeader("Transfer-Encoding")).thenThrow(new NumberFormatException());
interceptor.allowOrReject(req, res, map);
assertTrue(true);
}
+
@Test
public void testGetDefLength() {
|