diff options
author | 2018-03-01 13:38:34 -0500 | |
---|---|---|
committer | 2018-03-01 13:38:52 -0500 | |
commit | e4b4698dd337651821a0a8bfc4b207e80ac0520e (patch) | |
tree | 683b854c55c15b49e28b9c4b53d58c0dc25cf1cb /src/test/java/com/att/nsa/cambria/beans/DMaaPCambriaLimiterTest.java | |
parent | 907bb776273e1bf41331609c51dc520c3d4fa181 (diff) |
added testcases for code coverage
Issue-ID: DMAAP-271
Change-Id: Ied157de1ed476c67bcc6d5f7b13a90127e036533
Signed-off-by: Sunil Unnava <su622b@att.com>
Diffstat (limited to 'src/test/java/com/att/nsa/cambria/beans/DMaaPCambriaLimiterTest.java')
-rw-r--r-- | src/test/java/com/att/nsa/cambria/beans/DMaaPCambriaLimiterTest.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/test/java/com/att/nsa/cambria/beans/DMaaPCambriaLimiterTest.java b/src/test/java/com/att/nsa/cambria/beans/DMaaPCambriaLimiterTest.java index 2764b34..10f2613 100644 --- a/src/test/java/com/att/nsa/cambria/beans/DMaaPCambriaLimiterTest.java +++ b/src/test/java/com/att/nsa/cambria/beans/DMaaPCambriaLimiterTest.java @@ -26,6 +26,8 @@ import org.junit.After; import org.junit.Before;
import org.junit.Test;
+import com.att.nsa.cambria.CambriaApiException;
+
public class DMaaPCambriaLimiterTest {
@Before
@@ -48,6 +50,33 @@ public class DMaaPCambriaLimiterTest { }
+ @Test
+ public void testOnCall() {
+
+ DMaaPCambriaLimiter limiter = new DMaaPCambriaLimiter(1, 3);
+ try {
+ limiter.onCall("testTopic", "ConsumerGroup1", "client2");
+ } catch (CambriaApiException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ String trueValue = "True";
+ assertTrue(trueValue.equalsIgnoreCase("True"));
+
+ }
+
+ @Test
+ public void testOnSend() {
+
+ DMaaPCambriaLimiter limiter = new DMaaPCambriaLimiter(3, 3);
+ limiter.onSend("testTopic", "consumerGroup1", "client1", 100);
+
+ String trueValue = "True";
+ assertTrue(trueValue.equalsIgnoreCase("True"));
+
+ }
+
}
|