### Question:
ConnectionServiceImpl extends PentahoBase implements IConnectionService { public List<IDatabaseConnection> getConnections() throws ConnectionServiceException { return getConnections( false ); } ConnectionServiceImpl(); Log getLogger(); boolean hasDataAccessPermission(); void ensureDataAccessPermission(); List<IDatabaseConnection> getConnections(); List<IDatabaseConnection> getConnections( boolean hidePassword ); IDatabaseConnection getConnectionByName( String name ); IDatabaseConnection getConnectionByName( String name, boolean doUnsanitize ); IDatabaseConnection getConnectionById( String id ); boolean addConnection( IDatabaseConnection connection ); boolean updateConnection( IDatabaseConnection connection ); boolean deleteConnection( IDatabaseConnection connection ); boolean deleteConnection( String name ); boolean testConnection( IDatabaseConnection connection ); boolean isConnectionExist( String connectionName );  }### Answer:
@Test public void testGetConnections() throws Exception { doNothing().when( connectionServiceImpl ).ensureDataAccessPermission(); List<IDatabaseConnection> mockConnectionList = Collections.emptyList(); doReturn( mockConnectionList ).when( connectionServiceImpl.datasourceMgmtSvc ).getDatasources(); List<IDatabaseConnection> connectionList = connectionServiceImpl.getConnections(); verify( connectionServiceImpl ).getConnections(); assertEquals( connectionList, mockConnectionList ); }