mocking – JAVA mocks a new dependency that does not take

I am new to UT with Mockito and I try to understand why the creation of JDBCOperations () within the DAO class is not taking the drill. I want the new call to return the simulated object while basically doing nothing. I was thinking that this would allow me to pass the = new call JDBCOperations () and pass directly to the rest of the code under test. Two questions. Can I simulate a new object =, if so, how do I do it correctly?

@RunWith (MockitoJUnitRunner.class)

public class DAOTest {

@Before class
static public vacuum configuration () {

}

@Test
public void UpdateDBTest () {

//dice;
boolean featureFound = true;
boolean callSuccessful = true;

TestObject a = new TestObject ();
TOT tot = to.getmarketTestObject ();

JDBCOperations mockJDBC = mock (JDBCOperations.class);

DAO mockDAO = spy (DAO.class);

when (mockDAO.createJDBCOperations ()). thenReturn (mockJDBC);
when (mockJDBC.checkForExistingFeature (anyString ())). thenReturn (featureFound);
when (mockJDBC.maintainFeature ("Test Proc", t2m)). thenReturn (callSuccessful);

//say
assertEquals ("Update DB test", true, mockDAO.updateDB (tot));

}

Here is the code under test:

public class DAO {

static private org.apache.logging.log4j.Logger logger = LogManager.getLogger ("DAO");

static end static String UPDATERUNDATESTMT = "update tDomain set cValue1 =? where cClass = & # 39; Control & # 39; and cName = & # 39; lastRunDate & # 39;";

public boolean updateDB (TOT tot) {

String callProcName;

JDBCOperations jdbc = createJDBCOperations ();

JDBCOperations jdbco = new JDBCOperations ();
featureFound boolean = jdbco.checkForExistingFeature (tot.getObjectUUID ());

if (featureFound) {
callProcName = tot.toStringUpdate ();
} else {
callProcName = tot.toStringInsert ();
}

boolean callSuccessful = jdbco.maintainFeature (callProcName, tot);

yes (! callSuccessful) {
logger.info ("Error in the DB call:" + callProcName);
}

return (callSuccessful);
}

Public JDBCOperations createJDBCOperations () {
return new JDBCOperations ();
}