Use injection in and for LimboCache, migrate some legacy settings, remove setGroup from Utils

- New injector method allows to retrieve services if they've already been instantiated -> useful for onDisable() which might be run after aborted initialization
- Deprecate various methods that need to be removed
This commit is contained in:
ljacqu
2016-06-12 16:14:06 +02:00
parent 347d7bcf46
commit d6e1fd5ceb
19 changed files with 226 additions and 198 deletions
@@ -27,7 +27,7 @@ public class HashAlgorithmIntegrationTest {
private static AuthMeServiceInitializer initializer;
@BeforeClass
public static void setUpWrapper() {
public static void setUpConfigAndInjector() {
NewSetting settings = mock(NewSetting.class);
given(settings.getProperty(HooksSettings.BCRYPT_LOG2_ROUND)).willReturn(8);
given(settings.getProperty(SecuritySettings.DOUBLE_MD5_SALT_LENGTH)).willReturn(16);
@@ -52,7 +52,7 @@ public class HashAlgorithmIntegrationTest {
}
@Test
public void shouldBeAbleToInstantiateEncryptionAlgorithms() throws InstantiationException, IllegalAccessException {
public void shouldBeAbleToInstantiateEncryptionAlgorithms() {
// given / when / then
for (HashAlgorithm algorithm : HashAlgorithm.values()) {
if (!HashAlgorithm.CUSTOM.equals(algorithm) && !HashAlgorithm.PLAINTEXT.equals(algorithm)) {