summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVarun Gudisena <vg411h@att.com>2017-10-03 23:09:26 -0500
committerVarun Gudisena <vg411h@att.com>2017-10-03 23:09:37 -0500
commit628ae319ab0d982bc4d4f2b0725de2bcc03b40a5 (patch)
tree61a7e6135792c32219d1ac7e7e07661e3276f5e0
parent04436cbfd38b0b021d4b25287a540b31146ec209 (diff)
Add unit test cases
Add unit test cases Issue-Id: DMAAP-151 Change-Id: Id8b99db8cc1be1ee173dca7955edd6bb42de6a8e Signed-off-by: Varun Gudisena <vg411h@att.com>
-rw-r--r--src/test/java/com/att/nsa/dmaap/util/ContentLengthInterceptorTest.java10
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() {