Browse Source

Remove ConfigManager references.

Change-Id: I583aea35418847062f4b529d9eda809d2e932760
Reviewed-on: http://gerrit.dmdirc.com/2780
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Greg Holmes <greg@dmdirc.com>
tags/0.8
Chris Smith 10 years ago
parent
commit
9b258533c7

+ 2
- 1
src/com/dmdirc/addons/serverlistdialog/Settings.java View File

@@ -28,6 +28,7 @@ import com.dmdirc.addons.ui_swing.SwingController;
28 28
 import com.dmdirc.addons.ui_swing.components.expandingsettings.SettingsPanel;
29 29
 import com.dmdirc.config.ConfigManager;
30 30
 import com.dmdirc.config.prefs.PreferencesManager;
31
+import com.dmdirc.interfaces.config.AggregateConfigProvider;
31 32
 import com.dmdirc.interfaces.config.ConfigProvider;
32 33
 
33 34
 import java.util.HashMap;
@@ -155,7 +156,7 @@ public class Settings extends JPanel implements ServerListListener {
155 156
      * @param identity The provider to write settings to.
156 157
      */
157 158
     private void addSettings(final SettingsPanel settingsPanel,
158
-            final ConfigManager manager, final ConfigProvider identity) {
159
+            final AggregateConfigProvider manager, final ConfigProvider identity) {
159 160
         settingsPanel.addOption(PreferencesManager.getPreferencesManager()
160 161
                 .getServerSettings(manager, identity));
161 162
     }

+ 82
- 98
test/com/dmdirc/addons/identd/IdentClientTest.java View File

@@ -24,7 +24,7 @@ package com.dmdirc.addons.identd;
24 24
 
25 25
 import com.dmdirc.Server;
26 26
 import com.dmdirc.ServerManager;
27
-import com.dmdirc.config.ConfigManager;
27
+import com.dmdirc.interfaces.config.AggregateConfigProvider;
28 28
 import com.dmdirc.parser.irc.IRCClientInfo;
29 29
 import com.dmdirc.parser.irc.IRCParser;
30 30
 
@@ -32,19 +32,25 @@ import java.util.ArrayList;
32 32
 import java.util.List;
33 33
 
34 34
 import org.junit.Test;
35
+import org.junit.runner.RunWith;
36
+import org.mockito.Mock;
37
+import org.mockito.runners.MockitoJUnitRunner;
35 38
 
36 39
 import static org.junit.Assert.*;
37 40
 import static org.mockito.Mockito.*;
38 41
 
42
+@RunWith(MockitoJUnitRunner.class)
39 43
 public class IdentClientTest {
40 44
 
45
+    @Mock private AggregateConfigProvider acp;
46
+    @Mock private IdentdPlugin plugin;
47
+    @Mock private ServerManager sm;
48
+    @Mock private Server server;
49
+    @Mock private IRCParser parser;
50
+    @Mock private IRCClientInfo client;
51
+
41 52
     protected IdentClient getClient() {
42
-        IdentdPlugin plugin = mock(IdentdPlugin.class);
43
-        ServerManager sm = mock(ServerManager.class);
44
-        Server server = mock(Server.class);
45
-        IRCParser parser = mock(IRCParser.class);
46
-        IRCClientInfo client = mock(IRCClientInfo.class);
47
-        final List<Server> servers = new ArrayList<Server>();
53
+        final List<Server> servers = new ArrayList<>();
48 54
         servers.add(server);
49 55
 
50 56
         when(plugin.getDomain()).thenReturn("plugin-Identd");
@@ -60,8 +66,7 @@ public class IdentClientTest {
60 66
 
61 67
     @Test
62 68
     public void testInvalidIdent() {
63
-        final ConfigManager cm = mock(ConfigManager.class);
64
-        final String response = getClient().getIdentResponse("invalid request!", cm);
69
+        final String response = getClient().getIdentResponse("invalid request!", acp);
65 70
 
66 71
         assertContains("Illegal requests must result in an ERROR response",
67 72
                 response, "ERROR");
@@ -69,8 +74,7 @@ public class IdentClientTest {
69 74
 
70 75
     @Test
71 76
     public void testQuoting() {
72
-        final ConfigManager cm = mock(ConfigManager.class);
73
-        final String response = getClient().getIdentResponse("in\\valid:invalid", cm);
77
+        final String response = getClient().getIdentResponse("in\\valid:invalid", acp);
74 78
 
75 79
         assertStartsWith("Special chars in illegal requests must be quoted",
76 80
                 response, "in\\\\valid\\:invalid");
@@ -78,8 +82,7 @@ public class IdentClientTest {
78 82
 
79 83
     @Test
80 84
     public void testQuoting2() {
81
-        final ConfigManager cm = mock(ConfigManager.class);
82
-        final String response = getClient().getIdentResponse("in\\\\valid\\ inv\\:alid", cm);
85
+        final String response = getClient().getIdentResponse("in\\\\valid\\ inv\\:alid", acp);
83 86
 
84 87
         assertStartsWith("Escaped characters in illegal requests shouldn't be doubly-escaped",
85 88
                 response, "in\\\\valid\\ inv\\:alid");
@@ -87,8 +90,7 @@ public class IdentClientTest {
87 90
 
88 91
     @Test
89 92
     public void testNonNumericPort() {
90
-        final ConfigManager cm = mock(ConfigManager.class);
91
-        final String response = getClient().getIdentResponse("abc, def", cm);
93
+        final String response = getClient().getIdentResponse("abc, def", acp);
92 94
 
93 95
         assertContains("Non-numeric ports must result in an ERROR response",
94 96
                 response, "ERROR");
@@ -97,8 +99,7 @@ public class IdentClientTest {
97 99
     }
98 100
 
99 101
     private void doPortTest(final String ports) {
100
-        final ConfigManager cm = mock(ConfigManager.class);
101
-        final String response = getClient().getIdentResponse(ports, cm);
102
+        final String response = getClient().getIdentResponse(ports, acp);
102 103
 
103 104
         assertContains("Illegal ports must result in an ERROR response",
104 105
                 response, "ERROR");
@@ -118,10 +119,9 @@ public class IdentClientTest {
118 119
 
119 120
     @Test
120 121
     public void testAlwaysOn() {
121
-        final ConfigManager cm = mock(ConfigManager.class);
122
-        when(cm.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(false);
122
+        when(acp.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(false);
123 123
 
124
-        final String response = getClient().getIdentResponse("50, 50", cm);
124
+        final String response = getClient().getIdentResponse("50, 50", acp);
125 125
         assertContains("Unknown port requests must return an ERROR response",
126 126
                 response, "ERROR");
127 127
         assertContains("Unknown port requests must return a NO-USER response",
@@ -130,11 +130,10 @@ public class IdentClientTest {
130 130
 
131 131
     @Test
132 132
     public void testHidden() {
133
-        final ConfigManager cm = mock(ConfigManager.class);
134
-        when(cm.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(true);
135
-        when(cm.getOptionBool("plugin-Identd", "advanced.isHiddenUser")).thenReturn(true);
133
+        when(acp.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(true);
134
+        when(acp.getOptionBool("plugin-Identd", "advanced.isHiddenUser")).thenReturn(true);
136 135
 
137
-        final String response = getClient().getIdentResponse("50, 50", cm);
136
+        final String response = getClient().getIdentResponse("50, 50", acp);
138 137
         assertContains("Hidden requests must return an ERROR response",
139 138
                 response, "ERROR");
140 139
         assertContains("Hidden requests must return a HIDDEN-USER response",
@@ -143,45 +142,42 @@ public class IdentClientTest {
143 142
 
144 143
     @Test
145 144
     public void testSystemNameQuoting() {
146
-        final ConfigManager cm = mock(ConfigManager.class);
147
-        when(cm.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(true);
148
-        when(cm.getOptionBool("plugin-Identd", "advanced.isHiddenUser")).thenReturn(false);
149
-        when(cm.getOptionBool("plugin-Identd", "advanced.useCustomSystem")).thenReturn(true);
150
-        when(cm.getOption("plugin-Identd", "advanced.customSystem")).thenReturn("a:b\\c,d");
151
-        when(cm.getOptionBool("plugin-Identd", "general.useCustomName")).thenReturn(false);
152
-        when(cm.getOption("plugin-Identd", "general.customName")).thenReturn("");
153
-
154
-        final String response = getClient().getIdentResponse("50, 50", cm);
145
+        when(acp.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(true);
146
+        when(acp.getOptionBool("plugin-Identd", "advanced.isHiddenUser")).thenReturn(false);
147
+        when(acp.getOptionBool("plugin-Identd", "advanced.useCustomSystem")).thenReturn(true);
148
+        when(acp.getOption("plugin-Identd", "advanced.customSystem")).thenReturn("a:b\\c,d");
149
+        when(acp.getOptionBool("plugin-Identd", "general.useCustomName")).thenReturn(false);
150
+        when(acp.getOption("plugin-Identd", "general.customName")).thenReturn("");
151
+
152
+        final String response = getClient().getIdentResponse("50, 50", acp);
155 153
         assertContains("Special characters must be quoted in system names",
156 154
                 response, "a\\:b\\\\c\\,d");
157 155
     }
158 156
 
159 157
     @Test
160 158
     public void testCustomNameQuoting() {
161
-        final ConfigManager cm = mock(ConfigManager.class);
162
-        when(cm.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(true);
163
-        when(cm.getOptionBool("plugin-Identd", "advanced.isHiddenUser")).thenReturn(false);
164
-        when(cm.getOptionBool("plugin-Identd", "advanced.useCustomSystem")).thenReturn(false);
165
-        when(cm.getOption("plugin-Identd", "advanced.customSystem")).thenReturn("");
166
-        when(cm.getOptionBool("plugin-Identd", "general.useCustomName")).thenReturn(true);
167
-        when(cm.getOption("plugin-Identd", "general.customName")).thenReturn("a:b\\c,d");
168
-
169
-        final String response = getClient().getIdentResponse("50, 50", cm);
159
+        when(acp.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(true);
160
+        when(acp.getOptionBool("plugin-Identd", "advanced.isHiddenUser")).thenReturn(false);
161
+        when(acp.getOptionBool("plugin-Identd", "advanced.useCustomSystem")).thenReturn(false);
162
+        when(acp.getOption("plugin-Identd", "advanced.customSystem")).thenReturn("");
163
+        when(acp.getOptionBool("plugin-Identd", "general.useCustomName")).thenReturn(true);
164
+        when(acp.getOption("plugin-Identd", "general.customName")).thenReturn("a:b\\c,d");
165
+
166
+        final String response = getClient().getIdentResponse("50, 50", acp);
170 167
         assertContains("Special characters must be quoted in custom names",
171 168
                 response, "a\\:b\\\\c\\,d");
172 169
     }
173 170
 
174 171
     @Test
175 172
     public void testCustomNames() {
176
-        final ConfigManager cm = mock(ConfigManager.class);
177
-        when(cm.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(true);
178
-        when(cm.getOptionBool("plugin-Identd", "advanced.isHiddenUser")).thenReturn(false);
179
-        when(cm.getOptionBool("plugin-Identd", "advanced.useCustomSystem")).thenReturn(true);
180
-        when(cm.getOption("plugin-Identd", "advanced.customSystem")).thenReturn("system");
181
-        when(cm.getOptionBool("plugin-Identd", "general.useCustomName")).thenReturn(true);
182
-        when(cm.getOption("plugin-Identd", "general.customName")).thenReturn("name");
183
-
184
-        final String response = getClient().getIdentResponse("50, 60", cm);
173
+        when(acp.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(true);
174
+        when(acp.getOptionBool("plugin-Identd", "advanced.isHiddenUser")).thenReturn(false);
175
+        when(acp.getOptionBool("plugin-Identd", "advanced.useCustomSystem")).thenReturn(true);
176
+        when(acp.getOption("plugin-Identd", "advanced.customSystem")).thenReturn("system");
177
+        when(acp.getOptionBool("plugin-Identd", "general.useCustomName")).thenReturn(true);
178
+        when(acp.getOption("plugin-Identd", "general.customName")).thenReturn("name");
179
+
180
+        final String response = getClient().getIdentResponse("50, 60", acp);
185 181
         final String[] bits = response.split(":");
186 182
 
187 183
         assertTrue("Responses must include port pair",
@@ -194,144 +190,132 @@ public class IdentClientTest {
194 190
 
195 191
     @Test
196 192
     public void testOSWindows() {
197
-        final ConfigManager cm = mock(ConfigManager.class);
198
-        when(cm.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(true);
199
-        when(cm.getOptionBool("plugin-Identd", "advanced.useCustomSystem")).thenReturn(false);
193
+        when(acp.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(true);
194
+        when(acp.getOptionBool("plugin-Identd", "advanced.useCustomSystem")).thenReturn(false);
200 195
         System.setProperty("user.name", "test");
201 196
         System.setProperty("os.name", "windows");
202 197
 
203
-        final String response = getClient().getIdentResponse("50, 50", cm);
198
+        final String response = getClient().getIdentResponse("50, 50", acp);
204 199
         assertEquals("50 , 50 : USERID : WIN32 : test", response);
205 200
     }
206 201
 
207 202
     @Test
208 203
     public void testOSMac() {
209
-        final ConfigManager cm = mock(ConfigManager.class);
210
-        when(cm.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(true);
211
-        when(cm.getOptionBool("plugin-Identd", "advanced.useCustomSystem")).thenReturn(false);
204
+        when(acp.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(true);
205
+        when(acp.getOptionBool("plugin-Identd", "advanced.useCustomSystem")).thenReturn(false);
212 206
         System.setProperty("user.name", "test");
213 207
         System.setProperty("os.name", "mac");
214 208
 
215
-        final String response = getClient().getIdentResponse("50, 50", cm);
209
+        final String response = getClient().getIdentResponse("50, 50", acp);
216 210
         assertEquals("50 , 50 : USERID : MACOS : test", response);
217 211
     }
218 212
 
219 213
     @Test
220 214
     public void testOSLinux() {
221
-        final ConfigManager cm = mock(ConfigManager.class);
222
-        when(cm.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(true);
223
-        when(cm.getOptionBool("plugin-Identd", "advanced.useCustomSystem")).thenReturn(false);
215
+        when(acp.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(true);
216
+        when(acp.getOptionBool("plugin-Identd", "advanced.useCustomSystem")).thenReturn(false);
224 217
         System.setProperty("user.name", "test");
225 218
         System.setProperty("os.name", "linux");
226 219
 
227
-        final String response = getClient().getIdentResponse("50, 50", cm);
220
+        final String response = getClient().getIdentResponse("50, 50", acp);
228 221
         assertEquals("50 , 50 : USERID : UNIX : test", response);
229 222
     }
230 223
 
231 224
     @Test
232 225
     public void testOSBSD() {
233
-        final ConfigManager cm = mock(ConfigManager.class);
234
-        when(cm.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(true);
235
-        when(cm.getOptionBool("plugin-Identd", "advanced.useCustomSystem")).thenReturn(false);
226
+        when(acp.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(true);
227
+        when(acp.getOptionBool("plugin-Identd", "advanced.useCustomSystem")).thenReturn(false);
236 228
         System.setProperty("user.name", "test");
237 229
         System.setProperty("os.name", "bsd");
238 230
 
239
-        final String response = getClient().getIdentResponse("50, 50", cm);
231
+        final String response = getClient().getIdentResponse("50, 50", acp);
240 232
         assertEquals("50 , 50 : USERID : UNIX-BSD : test", response);
241 233
     }
242 234
 
243 235
     @Test
244 236
     public void testOSOS2() {
245
-        final ConfigManager cm = mock(ConfigManager.class);
246
-        when(cm.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(true);
247
-        when(cm.getOptionBool("plugin-Identd", "advanced.useCustomSystem")).thenReturn(false);
237
+        when(acp.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(true);
238
+        when(acp.getOptionBool("plugin-Identd", "advanced.useCustomSystem")).thenReturn(false);
248 239
         System.setProperty("user.name", "test");
249 240
         System.setProperty("os.name", "os/2");
250 241
 
251
-        final String response = getClient().getIdentResponse("50, 50", cm);
242
+        final String response = getClient().getIdentResponse("50, 50", acp);
252 243
         assertEquals("50 , 50 : USERID : OS/2 : test", response);
253 244
     }
254 245
 
255 246
     @Test
256 247
     public void testOSUnix() {
257
-        final ConfigManager cm = mock(ConfigManager.class);
258
-        when(cm.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(true);
259
-        when(cm.getOptionBool("plugin-Identd", "advanced.useCustomSystem")).thenReturn(false);
248
+        when(acp.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(true);
249
+        when(acp.getOptionBool("plugin-Identd", "advanced.useCustomSystem")).thenReturn(false);
260 250
         System.setProperty("user.name", "test");
261 251
         System.setProperty("os.name", "unix");
262 252
 
263
-        final String response = getClient().getIdentResponse("50, 50", cm);
253
+        final String response = getClient().getIdentResponse("50, 50", acp);
264 254
         assertEquals("50 , 50 : USERID : UNIX : test", response);
265 255
     }
266 256
 
267 257
     @Test
268 258
     public void testOSIrix() {
269
-        final ConfigManager cm = mock(ConfigManager.class);
270
-        when(cm.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(true);
271
-        when(cm.getOptionBool("plugin-Identd", "advanced.useCustomSystem")).thenReturn(false);
259
+        when(acp.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(true);
260
+        when(acp.getOptionBool("plugin-Identd", "advanced.useCustomSystem")).thenReturn(false);
272 261
         System.setProperty("user.name", "test");
273 262
         System.setProperty("os.name", "irix");
274 263
 
275
-        final String response = getClient().getIdentResponse("50, 50", cm);
264
+        final String response = getClient().getIdentResponse("50, 50", acp);
276 265
         assertEquals("50 , 50 : USERID : IRIX : test", response);
277 266
     }
278 267
 
279 268
     @Test
280 269
     public void testOSUnknown() {
281
-        final ConfigManager cm = mock(ConfigManager.class);
282
-        when(cm.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(true);
283
-        when(cm.getOptionBool("plugin-Identd", "advanced.useCustomSystem")).thenReturn(false);
270
+        when(acp.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(true);
271
+        when(acp.getOptionBool("plugin-Identd", "advanced.useCustomSystem")).thenReturn(false);
284 272
         System.setProperty("user.name", "test");
285 273
         System.setProperty("os.name", "test");
286 274
 
287
-        final String response = getClient().getIdentResponse("50, 50", cm);
275
+        final String response = getClient().getIdentResponse("50, 50", acp);
288 276
         assertEquals("50 , 50 : USERID : UNKNOWN : test", response);
289 277
     }
290 278
 
291 279
     @Test
292 280
     public void testNameSystem() {
293
-        final ConfigManager cm = mock(ConfigManager.class);
294
-        when(cm.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(true);
295
-        when(cm.getOptionBool("plugin-Identd", "advanced.useCustomSystem")).thenReturn(false);
281
+        when(acp.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(true);
282
+        when(acp.getOptionBool("plugin-Identd", "advanced.useCustomSystem")).thenReturn(false);
296 283
         System.setProperty("user.name", "test");
297 284
         System.setProperty("os.name", "test");
298 285
 
299
-        final String response = getClient().getIdentResponse("50, 50", cm);
286
+        final String response = getClient().getIdentResponse("50, 50", acp);
300 287
         assertEquals("50 , 50 : USERID : UNKNOWN : test", response);
301 288
     }
302 289
 
303 290
     @Test
304 291
     public void testNameCustom() {
305
-        final ConfigManager cm = mock(ConfigManager.class);
306
-        when(cm.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(true);
307
-        when(cm.getOptionBool("plugin-Identd", "general.useCustomName")).thenReturn(true);
308
-        when(cm.getOption("plugin-Identd", "general.customName")).thenReturn("name");
292
+        when(acp.getOptionBool("plugin-Identd", "advanced.alwaysOn")).thenReturn(true);
293
+        when(acp.getOptionBool("plugin-Identd", "general.useCustomName")).thenReturn(true);
294
+        when(acp.getOption("plugin-Identd", "general.customName")).thenReturn("name");
309 295
         System.setProperty("user.name", "test");
310 296
         System.setProperty("os.name", "test");
311 297
 
312
-        final String response = getClient().getIdentResponse("50, 50", cm);
298
+        final String response = getClient().getIdentResponse("50, 50", acp);
313 299
         assertEquals("50 , 50 : USERID : UNKNOWN : name", response);
314 300
     }
315 301
 
316 302
     @Test
317 303
     public void testNameNickname() {
318
-        final ConfigManager cm = mock(ConfigManager.class);
319
-        when(cm.getOptionBool("plugin-Identd", "general.useNickname")).thenReturn(true);
304
+        when(acp.getOptionBool("plugin-Identd", "general.useNickname")).thenReturn(true);
320 305
         System.setProperty("user.name", "test");
321 306
         System.setProperty("os.name", "test");
322 307
 
323
-        final String response = getClient().getIdentResponse("60, 50", cm);
308
+        final String response = getClient().getIdentResponse("60, 50", acp);
324 309
         assertEquals("60 , 50 : USERID : UNKNOWN : nickname", response);
325 310
     }
326 311
 
327 312
     @Test
328 313
     public void testNameUsername() {
329
-        final ConfigManager cm = mock(ConfigManager.class);
330
-        when(cm.getOptionBool("plugin-Identd", "general.useUsername")).thenReturn(true);
314
+        when(acp.getOptionBool("plugin-Identd", "general.useUsername")).thenReturn(true);
331 315
         System.setProperty("user.name", "test");
332 316
         System.setProperty("os.name", "test");
333 317
 
334
-        final String response = getClient().getIdentResponse("60, 50", cm);
318
+        final String response = getClient().getIdentResponse("60, 50", acp);
335 319
         assertEquals("60 , 50 : USERID : UNKNOWN : username", response);
336 320
     }
337 321
 

+ 5
- 5
test/com/dmdirc/addons/redirect/RedirectCommandTest.java View File

@@ -29,8 +29,8 @@ import com.dmdirc.commandparser.CommandArguments;
29 29
 import com.dmdirc.commandparser.commands.context.ChatCommandContext;
30 30
 import com.dmdirc.commandparser.commands.global.Echo;
31 31
 import com.dmdirc.commandparser.parsers.CommandParser;
32
-import com.dmdirc.config.ConfigManager;
33 32
 import com.dmdirc.interfaces.CommandController;
33
+import com.dmdirc.interfaces.config.AggregateConfigProvider;
34 34
 import com.dmdirc.interfaces.ui.InputWindow;
35 35
 
36 36
 import org.junit.Before;
@@ -50,7 +50,7 @@ public class RedirectCommandTest {
50 50
     @Mock private InputWindow inputWindow;
51 51
     @Mock private CommandController commandController;
52 52
     @Mock private WritableFrameContainer frameContainer;
53
-    @Mock private ConfigManager configManager;
53
+    @Mock private AggregateConfigProvider configProvider;
54 54
     @Mock private CommandParser commandParser;
55 55
 
56 56
     @Before
@@ -58,10 +58,10 @@ public class RedirectCommandTest {
58 58
         when(commandController.getCommandChar()).thenReturn('/');
59 59
         when(commandController.getSilenceChar()).thenReturn('.');
60 60
         when(inputWindow.getContainer()).thenReturn(frameContainer);
61
-        when(target.getConfigManager()).thenReturn(configManager);
61
+        when(target.getConfigManager()).thenReturn(configProvider);
62 62
         when(target.getCommandParser()).thenReturn(commandParser);
63
-        when(configManager.hasOptionString("formatter", "commandOutput")).thenReturn(true);
64
-        when(configManager.getOption("formatter", "commandOutput")).thenReturn("%1$s");
63
+        when(configProvider.hasOptionString("formatter", "commandOutput")).thenReturn(true);
64
+        when(configProvider.getOption("formatter", "commandOutput")).thenReturn("%1$s");
65 65
         doAnswer(new Answer<Void>() {
66 66
             @Override
67 67
             public Void answer(final InvocationOnMock invocation) throws Throwable {

+ 3
- 3
test/com/dmdirc/addons/urlcatcher/UrlCatcherPluginTest.java View File

@@ -24,10 +24,10 @@ package com.dmdirc.addons.urlcatcher;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.actions.CoreActionType;
27
-import com.dmdirc.config.ConfigManager;
28 27
 import com.dmdirc.config.InvalidIdentityFileException;
29 28
 import com.dmdirc.interfaces.ActionController;
30 29
 import com.dmdirc.interfaces.CommandController;
30
+import com.dmdirc.interfaces.config.AggregateConfigProvider;
31 31
 import com.dmdirc.interfaces.config.IdentityController;
32 32
 import com.dmdirc.ui.messages.Styliser;
33 33
 
@@ -43,7 +43,7 @@ import static org.mockito.Mockito.*;
43 43
 public class UrlCatcherPluginTest {
44 44
 
45 45
     @Mock private FrameContainer container;
46
-    @Mock private ConfigManager manager;
46
+    @Mock private AggregateConfigProvider configProvider;
47 47
     @Mock private CommandController controller;
48 48
     @Mock private IdentityController identityController;
49 49
     @Mock private ActionController actionController;
@@ -51,7 +51,7 @@ public class UrlCatcherPluginTest {
51 51
 
52 52
     @Before
53 53
     public void setupClass() {
54
-        when(container.getConfigManager()).thenReturn(manager);
54
+        when(container.getConfigManager()).thenReturn(configProvider);
55 55
         final Styliser styliser = new Styliser(container);
56 56
         when(container.getStyliser()).thenReturn(styliser);
57 57
         plugin = new UrlCatcherPlugin(controller, identityController, actionController);

Loading…
Cancel
Save