Package br.com.mystudies.powermock.dao

Examples of br.com.mystudies.powermock.dao.Dao.find()


public class ServiceImpl implements Service {

  @Override
  public String find(SGDB sgdb) {
    Dao dao = FactoryDao.create(sgdb);
    return dao.find();
  }

 
}
View Full Code Here


   
    mockStatic(FactoryDao.class);
 
    Dao dao = Mockito.mock(MySqlDao.class);
   
    Mockito.when(dao.find()).thenReturn("mocking the finding in mysql ");
   
    Mockito.when(FactoryDao.create(SGDB.MYSQL)).thenReturn(dao);
   
    assertEquals("mocking the finding in mysql ", serviceImpl.find(SGDB.MYSQL));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.