|
@@ -25,6 +25,7 @@ package com.dmdirc.addons.identd;
|
25
|
25
|
import com.dmdirc.DMDircMBassador;
|
26
|
26
|
import com.dmdirc.interfaces.Connection;
|
27
|
27
|
import com.dmdirc.interfaces.ConnectionManager;
|
|
28
|
+import com.dmdirc.interfaces.User;
|
28
|
29
|
import com.dmdirc.interfaces.config.AggregateConfigProvider;
|
29
|
30
|
import com.dmdirc.parser.irc.IRCClientInfo;
|
30
|
31
|
import com.dmdirc.parser.irc.IRCParser;
|
|
@@ -50,6 +51,7 @@ public class IdentClientTest {
|
50
|
51
|
@Mock private Connection connection;
|
51
|
52
|
@Mock private IRCParser parser;
|
52
|
53
|
@Mock private IRCClientInfo client;
|
|
54
|
+ @Mock private User user;
|
53
|
55
|
@Mock private AggregateConfigProvider config;
|
54
|
56
|
@Mock private DMDircMBassador eventBus;
|
55
|
57
|
|
|
@@ -59,10 +61,13 @@ public class IdentClientTest {
|
59
|
61
|
|
60
|
62
|
when(sm.getConnections()).thenReturn(servers);
|
61
|
63
|
when(connection.getParser()).thenReturn(Optional.of(parser));
|
|
64
|
+ when(connection.getLocalUser()).thenReturn(user);
|
62
|
65
|
when(parser.getLocalPort()).thenReturn(60);
|
63
|
66
|
when(parser.getLocalClient()).thenReturn(client);
|
64
|
67
|
when(client.getNickname()).thenReturn("nickname");
|
65
|
68
|
when(client.getUsername()).thenReturn("username");
|
|
69
|
+ when(user.getNickname()).thenReturn("nickname");
|
|
70
|
+ when(user.getUsername()).thenReturn(Optional.of("username"));
|
66
|
71
|
|
67
|
72
|
return new IdentClient(eventBus, null, null, sm, config, "plugin-Identd");
|
68
|
73
|
}
|