浏览代码

Fix unit test.

pull/361/head
Greg Holmes 9 年前
父节点
当前提交
63eea28251

+ 3
- 1
channelwho/src/com/dmdirc/addons/channelwho/ConnectionHandler.java 查看文件

@@ -32,9 +32,11 @@ import com.dmdirc.interfaces.GroupChat;
32 32
 public class ConnectionHandler {
33 33
 
34 34
     private final Connection connection;
35
+    private final String domain;
35 36
 
36
-    public ConnectionHandler(final Connection connection) {
37
+    public ConnectionHandler(final Connection connection, final String domain) {
37 38
         this.connection = connection;
39
+        this.domain = domain;
38 40
     }
39 41
 
40 42
     public void load() {

+ 6
- 2
channelwho/src/com/dmdirc/addons/channelwho/ConnectionHandlerFactory.java 查看文件

@@ -23,6 +23,7 @@
23 23
 package com.dmdirc.addons.channelwho;
24 24
 
25 25
 import com.dmdirc.interfaces.Connection;
26
+import com.dmdirc.plugins.PluginDomain;
26 27
 
27 28
 import javax.inject.Inject;
28 29
 
@@ -31,12 +32,15 @@ import javax.inject.Inject;
31 32
  */
32 33
 public class ConnectionHandlerFactory {
33 34
 
35
+    private final String domain;
36
+
34 37
     @Inject
35
-    public ConnectionHandlerFactory() {
38
+    public ConnectionHandlerFactory(@PluginDomain(ChannelWhoPlugin.class) final String domain) {
39
+        this.domain = domain;
36 40
     }
37 41
 
38 42
     public ConnectionHandler get(final Connection connection) {
39
-        final ConnectionHandler handler = new ConnectionHandler(connection);
43
+        final ConnectionHandler handler = new ConnectionHandler(connection, domain);
40 44
         handler.load();
41 45
         return handler;
42 46
     }

+ 2
- 1
channelwho/test/com/dmdirc/addons/channelwho/ChannelWhoManagerTest.java 查看文件

@@ -34,6 +34,7 @@ import org.mockito.runners.MockitoJUnitRunner;
34 34
 @RunWith(MockitoJUnitRunner.class)
35 35
 public class ChannelWhoManagerTest {
36 36
 
37
+    @Mock private ConnectionHandlerFactory connectionHandlerFactory;
37 38
     @Mock private ConnectionManager connectionManager;
38 39
     @Mock private DMDircMBassador eventBus;
39 40
 
@@ -41,7 +42,7 @@ public class ChannelWhoManagerTest {
41 42
 
42 43
     @Before
43 44
     public void setUp() throws Exception {
44
-        instance = new ChannelWhoManager("test", connectionManager, eventBus);
45
+        instance = new ChannelWhoManager(connectionHandlerFactory, connectionManager, eventBus);
45 46
     }
46 47
 
47 48
     @Test

正在加载...
取消
保存