fix tests
This commit is contained in:
@@ -16,6 +16,8 @@ public class UploadManager {
|
|||||||
private final EventBus eventBus
|
private final EventBus eventBus
|
||||||
private final FileManager fileManager
|
private final FileManager fileManager
|
||||||
|
|
||||||
|
public UploadManager() {}
|
||||||
|
|
||||||
public UploadManager(EventBus eventBus, FileManager fileManager) {
|
public UploadManager(EventBus eventBus, FileManager fileManager) {
|
||||||
this.eventBus = eventBus
|
this.eventBus = eventBus
|
||||||
this.fileManager = fileManager
|
this.fileManager = fileManager
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import com.muwire.core.MuWireSettings
|
|||||||
import com.muwire.core.hostcache.HostCache
|
import com.muwire.core.hostcache.HostCache
|
||||||
import com.muwire.core.trust.TrustLevel
|
import com.muwire.core.trust.TrustLevel
|
||||||
import com.muwire.core.trust.TrustService
|
import com.muwire.core.trust.TrustService
|
||||||
|
import com.muwire.core.upload.UploadManager
|
||||||
import com.muwire.core.search.SearchManager
|
import com.muwire.core.search.SearchManager
|
||||||
|
|
||||||
import groovy.json.JsonSlurper
|
import groovy.json.JsonSlurper
|
||||||
@@ -40,6 +41,9 @@ class ConnectionAcceptorTest {
|
|||||||
def searchManagerMock
|
def searchManagerMock
|
||||||
SearchManager searchManager
|
SearchManager searchManager
|
||||||
|
|
||||||
|
def uploadManagerMock
|
||||||
|
UploadManager uploadManager
|
||||||
|
|
||||||
ConnectionAcceptor acceptor
|
ConnectionAcceptor acceptor
|
||||||
List<ConnectionEvent> connectionEvents
|
List<ConnectionEvent> connectionEvents
|
||||||
InputStream inputStream
|
InputStream inputStream
|
||||||
@@ -52,6 +56,7 @@ class ConnectionAcceptorTest {
|
|||||||
hostCacheMock = new MockFor(HostCache.class)
|
hostCacheMock = new MockFor(HostCache.class)
|
||||||
trustServiceMock = new MockFor(TrustService.class)
|
trustServiceMock = new MockFor(TrustService.class)
|
||||||
searchManagerMock = new MockFor(SearchManager.class)
|
searchManagerMock = new MockFor(SearchManager.class)
|
||||||
|
uploadManagerMock = new MockFor(UploadManager.class)
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
@After
|
||||||
@@ -62,6 +67,7 @@ class ConnectionAcceptorTest {
|
|||||||
hostCacheMock.verify hostCache
|
hostCacheMock.verify hostCache
|
||||||
trustServiceMock.verify trustService
|
trustServiceMock.verify trustService
|
||||||
searchManagerMock.verify searchManager
|
searchManagerMock.verify searchManager
|
||||||
|
uploadManagerMock.verify uploadManager
|
||||||
Thread.sleep(100)
|
Thread.sleep(100)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,8 +86,9 @@ class ConnectionAcceptorTest {
|
|||||||
hostCache = hostCacheMock.proxyInstance()
|
hostCache = hostCacheMock.proxyInstance()
|
||||||
trustService = trustServiceMock.proxyInstance()
|
trustService = trustServiceMock.proxyInstance()
|
||||||
searchManager = searchManagerMock.proxyInstance()
|
searchManager = searchManagerMock.proxyInstance()
|
||||||
|
uploadManager = uploadManagerMock.proxyInstance()
|
||||||
|
|
||||||
acceptor = new ConnectionAcceptor(eventBus, connectionManager, settings, i2pAcceptor, hostCache, trustService, searchManager)
|
acceptor = new ConnectionAcceptor(eventBus, connectionManager, settings, i2pAcceptor, hostCache, trustService, searchManager, uploadManager)
|
||||||
acceptor.start()
|
acceptor.start()
|
||||||
Thread.sleep(100)
|
Thread.sleep(100)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user