<artifactId>moo-moo</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.10</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <version>1.10.19</version>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.inject.extensions</groupId>
+ <artifactId>guice-testlib</artifactId>
+ </dependency>
</dependencies>
<build>
import net.rizon.moo.Command;
import net.rizon.moo.CommandSource;
-import net.rizon.moo.Plugin;
class CommandRand extends Command
{
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
package net.rizon.moo.plugin.core;
+import com.google.inject.Guice;
+import com.google.inject.Inject;
+import com.google.inject.testing.fieldbinder.BoundFieldModule;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import net.rizon.moo.CommandSource;
-import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
public class CommandRandTest
{
private static final String COMMAND_NAME = "!rand";
+
+ @Inject
private CommandRand testCommand;
+
@Mock
private CommandSource source;
- ArgumentCaptor<String> commandSourceCaptor = ArgumentCaptor.forClass(String.class);
-
- public CommandRandTest()
- {
- }
+
+ private final ArgumentCaptor<String> commandSourceCaptor = ArgumentCaptor.forClass(String.class);
@Before
public void setUp()
{
- testCommand = new CommandRand();
- }
-
- @After
- public void tearDown()
- {
- testCommand = null;
+ Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this);
}
/**
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>4.10</version>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
- <version>1.10.19</version>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-testlib</artifactId>
- <version>4.0</version>
- <scope>test</scope>
</dependency>
</dependencies>
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
package net.rizon.moo.plugin.dnsblstats;
import static org.junit.Assert.assertEquals;
import net.rizon.moo.irc.Protocol;
import net.rizon.moo.irc.Server;
import net.rizon.moo.irc.ServerManager;
-import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
* @author Orillion {@literal <orillion@rizon.net>}
*/
@RunWith(MockitoJUnitRunner.class)
-public class CommandDnsblStatsTest// extends AbstractModule
+public class CommandDnsblStatsTest
{
private static final String COMMAND_NAME = "!dnsblstats";
private static final String COMMAND_ARGUMENT = "server";
@Mock
private Config mockConfig;
- private ArgumentCaptor<String> stringCaptor = ArgumentCaptor.forClass(String.class);
-
- public CommandDnsblStatsTest()
- {
- }
+ private final ArgumentCaptor<String> stringCaptor = ArgumentCaptor.forClass(String.class);
@Before
public void setUp()
{
- //MockitoAnnotations.initMocks(this);
-
mockConfig.admin_channels = REQUIRED_CHANNELS;
mockConfig.oper_channels = REQUIRED_CHANNELS;
mockConfig.staff_channels = REQUIRED_CHANNELS;
-
-
Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this);
}
- @After
- public void tearDown()
- {
- testCommand = null;
- }
-
/**
* Test of execute method, of class CommandDnsblStats.
*/
<artifactId>gson</artifactId>
<version>${gson.version}</version>
</dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.10</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <version>1.10.19</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.inject.extensions</groupId>
+ <artifactId>guice-testlib</artifactId>
+ <version>4.0</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</dependencyManagement>