diff options
author | sg481n <sg481n@att.com> | 2017-10-01 21:06:52 +0000 |
---|---|---|
committer | sg481n <sg481n@att.com> | 2017-10-01 22:07:06 +0000 |
commit | b5985fb5667b3ee9b6a4a0675fb57f55e7a288b7 (patch) | |
tree | 451b6146944e489348a922d552f150ff91e85480 /core/src/test/java/org/onap/aaf/cadi/CadiExceptionTest.java | |
parent | 7bc6ef245901a83da234c7765d76a7f7eb34540a (diff) |
Improve code coverage for aaf cadi modules
Updated few testcases.
Issue-ID: AAF-79
Change-Id: If0760b6f3e74d52fa5132224bf1e6f5e3099f0e4
Signed-off-by: sg481n <sg481n@att.com>
Diffstat (limited to 'core/src/test/java/org/onap/aaf/cadi/CadiExceptionTest.java')
-rw-r--r-- | core/src/test/java/org/onap/aaf/cadi/CadiExceptionTest.java | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/core/src/test/java/org/onap/aaf/cadi/CadiExceptionTest.java b/core/src/test/java/org/onap/aaf/cadi/CadiExceptionTest.java index 29a0a8b..f994b60 100644 --- a/core/src/test/java/org/onap/aaf/cadi/CadiExceptionTest.java +++ b/core/src/test/java/org/onap/aaf/cadi/CadiExceptionTest.java @@ -22,6 +22,10 @@ ******************************************************************************/
package org.onap.aaf.cadi;
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.*;
@@ -57,5 +61,65 @@ public class CadiExceptionTest { assertThat(exception.getMessage(), is("New Exception"));
}
+
+ @Test
+ public void testCadiException1() {
+ CadiException exception = new CadiException();
+
+ assertNotNull(exception);
+ }
+
+ @Test
+ public void testCadiExceptionString1() {
+ CadiException exception = new CadiException("New Exception");
+ assertNotNull(exception);
+ assertThat(exception.getMessage(), is("New Exception"));
+ }
+
+ @Test
+ public void testCadiExceptionThrowable1() {
+ CadiException exception = new CadiException(new Throwable("New Exception"));
+ assertNotNull(exception);
+ assertThat(exception.getMessage(), is("java.lang.Throwable: New Exception"));
+ }
+
+ @Test
+ public void testCadiExceptionStringThrowable1() {
+ CadiException exception = new CadiException("New Exception",new Throwable("New Exception"));
+ assertNotNull(exception);
+ assertThat(exception.getMessage(), is("New Exception"));
+
+ }
+
+ @Test
+ public void testCadiException2() {
+ CadiException exception = new CadiException();
+
+ assertNotNull(exception);
+ }
+
+ @Test
+ public void testCadiExceptionString2() {
+ CadiException exception = new CadiException("New Exception");
+ assertNotNull(exception);
+ assertThat(exception.getMessage(), is("New Exception"));
+ }
+
+ @Test
+ public void testCadiExceptionThrowable2() {
+ CadiException exception = new CadiException(new Throwable("New Exception"));
+ assertNotNull(exception);
+ assertThat(exception.getMessage(), is("java.lang.Throwable: New Exception"));
+ }
+
+ @Test
+ public void testCadiExceptionStringThrowable2() {
+ CadiException exception = new CadiException("New Exception",new Throwable("New Exception"));
+ assertNotNull(exception);
+ assertThat(exception.getMessage(), is("New Exception"));
+
+ }
+
+
}
|