TransactionStoreDatabase implements TransactionStore { @Override public boolean insertIntoTransactionRepo(TransactionRepo transactionRepo) { boolean inserted = false; if (dao != null) { inserted = dao.insertIntoTransactionRepo(transactionRepo); } return inserted; } TransactionStoreDatabase(); @Override boolean insertIntoTransactionRepo(TransactionRepo transactionRepo); @Override String getTransactionId(String messageId);  }
@Test public void testWithNullDao() { transactionDAO = mock(TransactionDAO.class); TransactionStoreDatabase store = getMockTransactionStoreDb(); assertEquals(false, store.insertIntoTransactionRepo(null)); }