diff options
author | Sai Gandham <sg481n@att.com> | 2019-08-05 08:41:06 -0500 |
---|---|---|
committer | Sai Gandham <sg481n@att.com> | 2019-08-05 08:41:17 -0500 |
commit | b40351eb57ab13a696aeae2ecf041366c445e127 (patch) | |
tree | 78c79b1c2c0f683ac061be9fd5cc3ac4e467abb7 /auth/auth-cass/src/test/java | |
parent | 8a789ae732bf8a718f0a34291f0f772743cf3954 (diff) |
Add junits to batch & cass modules
Issue-ID: AAF-111
Change-Id: I8067dcb4a57192cf0ac273d7364a60d03f300ba6
Signed-off-by: Sai Gandham <sg481n@att.com>
Diffstat (limited to 'auth/auth-cass/src/test/java')
-rw-r--r-- | auth/auth-cass/src/test/java/org/onap/aaf/auth/dao/JU_DAOException.java | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/auth/auth-cass/src/test/java/org/onap/aaf/auth/dao/JU_DAOException.java b/auth/auth-cass/src/test/java/org/onap/aaf/auth/dao/JU_DAOException.java index 0e9d199d..0ee0ce8f 100644 --- a/auth/auth-cass/src/test/java/org/onap/aaf/auth/dao/JU_DAOException.java +++ b/auth/auth-cass/src/test/java/org/onap/aaf/auth/dao/JU_DAOException.java @@ -31,20 +31,36 @@ import org.onap.aaf.auth.dao.DAOException; import org.powermock.api.mockito.PowerMockito; import org.powermock.modules.junit4.PowerMockRunner; -@RunWith(PowerMockRunner.class) public class JU_DAOException { -DAOException daoException; + DAOException daoException; - //DAOException daoException = new DAOException(); String message = "message"; Throwable cause; @Before public void setUp(){ - daoException = new DAOException(); + daoException = new DAOException(); } @Test - public void test(){ - assertTrue(true); + public void testNoArgConstructor(){ + assertNull(daoException.getMessage()); + } + + @Test + public void testOneArgConstructorMsg(){ + daoException = new DAOException("test message"); + assertTrue("test message".equalsIgnoreCase(daoException.getMessage())); + } + + @Test + public void testOneArgConstructorThrowable(){ + daoException = new DAOException(new Throwable()); + assertTrue("java.lang.Throwable".equalsIgnoreCase(daoException.getMessage())); + } + + @Test + public void testTwoArgConstructor(){ + daoException = new DAOException("test message", new Throwable()); + assertTrue("test message".equalsIgnoreCase(daoException.getMessage())); } } |