### Question:
DbNodeServiceImpl extends AbstractBaseService<DbNodeEntity> implements CacheUpdateService, DbNodeService, TimerService, PortalTimerService { @Override public void forceUpdateCache() { doForceUpdateCache(); updateQueueCache(); }  @Override void start(); @Override void updateCache(); @Override void checkDataSource(DbNodeEntity dbNodeEntity); @Override boolean hasSlave(DbNodeEntity dbNodeEntity); @Override void createDataSource(DbNodeEntity t1); void initDataSource(DbNodeEntity t1, String key, Map<String, DataSource> dataMap, boolean isMaster,
							   Transaction transaction); @Override Map<Long, DbNodeEntity> getCache(); @Override Map<String, List<DbNodeEntity>> getCacheByIp(); @Override void forceUpdateCache(); @PreDestroy @Override void stop(); @Override DataSource getDataSource(long id, boolean isMaster); @Override String info(); @Override Map<String, DataSource> getDataSource(); @Override void startPortal(); @Override void stopPortal(); @Override String getCacheJson();  }### Answer:
@Test public void forceUpdateCacheTest() { DruidDataSource dataSource = mock(DruidDataSource.class); DbNodeServiceImpl.DataSourceFactory dataSourceFactory = new DbNodeServiceImpl.DataSourceFactory() { @Override public DruidDataSource createDataSource() { return dataSource; } }; dbNodeServiceImpl.setDataSourceFactory(dataSourceFactory); DbNodeEntity dbNodeEntity = new DbNodeEntity(); dbNodeEntity.setIp("fasaf"); dbNodeEntity.setDbUserName("faf"); dbNodeEntity.setDbPass("aff"); dbNodeEntity.setPort(2342); dbNodeEntity.setIpBak("faf"); dbNodeEntity.setDbUserNameBak("fa"); dbNodeEntity.setDbPassBak("faf"); dbNodeEntity.setPortBak(3); dbNodeEntity.setId(1); DbNodeEntity dbNodeEntity1 = new DbNodeEntity(); dbNodeEntity1.setIp("fasaf"); dbNodeEntity1.setDbUserName("fa34f"); dbNodeEntity1.setDbPass("af234f"); dbNodeEntity1.setPort(2342); dbNodeEntity1.setIpBak("faf"); dbNodeEntity1.setDbUserNameBak("f234a"); dbNodeEntity1.setDbPassBak("fa234f"); dbNodeEntity1.setPortBak(3); dbNodeEntity1.setId(2); when(dbNodeRepository.getAll()).thenReturn(Arrays.asList(dbNodeEntity)); dbNodeServiceImpl.forceUpdateCache(); }