Fix Checkstyle violations
- Mostly missing Javadoc on large methods - CommandInitializer: split command building method into multiple methods
This commit is contained in:
@@ -25,7 +25,7 @@ public class TwoFactorTest {
|
||||
String secret = "3AK6Y4KWGRLJMEQW";
|
||||
|
||||
// when
|
||||
String url = TwoFactor.getQRBarcodeURL(user, host, secret);
|
||||
String url = TwoFactor.getQrBarcodeUrl(user, host, secret);
|
||||
|
||||
// then
|
||||
String expected = "https://www.google.com/chart?chs=130x130&chld=M%7C0&cht=qr"
|
||||
|
||||
@@ -28,7 +28,6 @@ import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||
import static org.mockito.hamcrest.MockitoHamcrest.argThat;
|
||||
import static fr.xephi.authme.AuthMeMatchers.equalToHash;
|
||||
|
||||
/**
|
||||
* Test for {@link MigrationService}.
|
||||
|
||||
@@ -178,6 +178,19 @@ public class CommandManagerTest {
|
||||
verifyZeroInteractions(bukkitService, geoIpService);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldExecuteCommandOnUnregister() {
|
||||
// given
|
||||
copyJarFileAsCommandsYml(TEST_FILES_FOLDER + "commands.incomplete.yml");
|
||||
initManager();
|
||||
|
||||
// when
|
||||
manager.runCommandsOnUnregister(player);
|
||||
|
||||
// then
|
||||
verify(bukkitService).dispatchConsoleCommand("msg Bobby sad to see you go!");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldHaveHiddenConstructorInSettingsHolderClass() {
|
||||
// given / when / then
|
||||
|
||||
@@ -30,7 +30,7 @@ import static org.mockito.Mockito.when;
|
||||
*/
|
||||
public class EncryptionMethodInfoGatherer {
|
||||
|
||||
private final static Set<Class<? extends Annotation>> RELEVANT_ANNOTATIONS =
|
||||
private static final Set<Class<? extends Annotation>> RELEVANT_ANNOTATIONS =
|
||||
ImmutableSet.of(HasSalt.class, Recommendation.class, AsciiRestricted.class);
|
||||
|
||||
private static Injector injector = createInitializer();
|
||||
@@ -104,6 +104,9 @@ public class EncryptionMethodInfoGatherer {
|
||||
/**
|
||||
* Returns the super class of the given encryption method if it is also of EncryptionMethod type.
|
||||
* (Anything beyond EncryptionMethod is not of interest.)
|
||||
*
|
||||
* @param methodClass the class to process
|
||||
* @return the super class of the given class if it is also an EncryptionMethod type, otherwise null
|
||||
*/
|
||||
private static Class<?> getSuperClass(Class<?> methodClass) {
|
||||
Class<?> zuper = methodClass.getSuperclass();
|
||||
|
||||
@@ -18,3 +18,7 @@ doesNotExist:
|
||||
wrongEntry:
|
||||
command: 'should be ignored'
|
||||
executor: PLAYER
|
||||
onUnregister:
|
||||
farewell:
|
||||
command: 'msg %p sad to see you go!'
|
||||
executor: CONSOLE
|
||||
|
||||
Reference in New Issue
Block a user