|
@@ -22,23 +22,34 @@
|
22
|
22
|
|
23
|
23
|
package com.dmdirc.addons.nickkeep;
|
24
|
24
|
|
|
25
|
+import com.dmdirc.plugins.PluginInfo;
|
|
26
|
+
|
25
|
27
|
import org.junit.Before;
|
26
|
28
|
import org.junit.Test;
|
27
|
29
|
import org.junit.runner.RunWith;
|
28
|
30
|
import org.mockito.Mock;
|
29
|
31
|
import org.mockito.runners.MockitoJUnitRunner;
|
30
|
32
|
|
|
33
|
+import dagger.ObjectGraph;
|
|
34
|
+
|
|
35
|
+import static org.mockito.Matchers.any;
|
31
|
36
|
import static org.mockito.Mockito.verify;
|
|
37
|
+import static org.mockito.Mockito.when;
|
32
|
38
|
|
33
|
39
|
@RunWith(MockitoJUnitRunner.class)
|
34
|
40
|
public class NickKeepPluginTest {
|
35
|
41
|
|
36
|
42
|
@Mock private NickKeepManager nickKeepManager;
|
|
43
|
+ @Mock private PluginInfo pluginInfo;
|
|
44
|
+ @Mock private ObjectGraph objectGraph;
|
37
|
45
|
private NickKeepPlugin instance;
|
38
|
46
|
|
39
|
47
|
@Before
|
40
|
48
|
public void setUp() throws Exception {
|
|
49
|
+ when(objectGraph.<NickKeepManager>get(any())).thenReturn(nickKeepManager);
|
|
50
|
+ when(objectGraph.plus(any())).thenReturn(objectGraph);
|
41
|
51
|
instance = new NickKeepPlugin();
|
|
52
|
+ instance.load(pluginInfo, objectGraph);
|
42
|
53
|
}
|
43
|
54
|
|
44
|
55
|
@Test
|