/*
 * Copyright (c) 2006-2015 DMDirc Developers
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

package com.dmdirc.addons.nickkeep;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;

import static org.mockito.Mockito.verify;

@RunWith(MockitoJUnitRunner.class)
public class NickKeepPluginTest {

    @Mock private NickKeepManager nickKeepManager;
    private NickKeepPlugin instance;

    @Before
    public void setUp() throws Exception {
        instance = new NickKeepPlugin();
    }

    @Test
    public void testOnLoad() throws Exception {
        instance.onLoad();
        verify(nickKeepManager).load();
    }

    @Test
    public void testOnUnload() throws Exception {
        instance.onUnload();
        verify(nickKeepManager).unload();
    }
}
@@ -1158,16 +1158,55 @@
 kkeep;%0A%0A
+import com.dmdirc.plugins.PluginInfo;%0A%0A
 import o
@@ -1222,16 +1222,16 @@
 Before;%0A
-
 import o
@@ -1351,16 +1351,84 @@
 unner;%0A%0A
+import dagger.ObjectGraph;%0A%0Aimport static org.mockito.Matchers.any;%0A
 import s
@@ -1460,16 +1460,56 @@
 .verify;
+%0Aimport static org.mockito.Mockito.when;
 %0A%0A@RunWi
@@ -1623,16 +1623,100 @@
 anager;%0A
+    @Mock private PluginInfo pluginInfo;%0A    @Mock private ObjectGraph objectGraph;%0A
     priv
@@ -1812,38 +1812,232 @@
     
-instance = new NickKeepPlugin(
+when(objectGraph.%3CNickKeepManager%3Eget(any())).thenReturn(nickKeepManager);%0A        when(objectGraph.plus(any())).thenReturn(objectGraph);%0A        instance = new NickKeepPlugin();%0A        instance.load(pluginInfo, objectGraph
 );%0A 

Fix unit test.