diff options
Diffstat (limited to 'src/test/java/org/onap/dcae/ApplicationExceptionTest.java')
-rw-r--r-- | src/test/java/org/onap/dcae/ApplicationExceptionTest.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/test/java/org/onap/dcae/ApplicationExceptionTest.java b/src/test/java/org/onap/dcae/ApplicationExceptionTest.java index 289c472..98edbe4 100644 --- a/src/test/java/org/onap/dcae/ApplicationExceptionTest.java +++ b/src/test/java/org/onap/dcae/ApplicationExceptionTest.java @@ -20,18 +20,24 @@ package org.onap.dcae; +import org.apache.commons.configuration.ConfigurationException; import org.junit.Test; -import javax.naming.ConfigurationException; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; public class ApplicationExceptionTest { @Test public void TestApplicationException() { - Exception ex = new Exception(); ConfigurationException confEx = new ConfigurationException(); - ApplicationException example = new ApplicationException("Exception"); + ApplicationException example3 = new ApplicationException(confEx); + Exception ex = new Exception(); ApplicationException example1 = new ApplicationException("Exception", ex); ApplicationException example2 = new ApplicationException(ex); - ApplicationException example3 = new ApplicationException(confEx); + ApplicationException example = new ApplicationException("Exception"); + assertTrue(example3.getMessage().contains("ConfigurationException")); + assertEquals(example1.getMessage(), "Exception"); + assertEquals(example2.getMessage(), "java.lang.Exception"); + assertEquals(example.getMessage(), "Exception"); } } |