#707 Convert sync processes into services

This commit is contained in:
ljacqu
2016-05-20 19:42:30 +02:00
parent f5c89e897f
commit 3f039d641a
20 changed files with 303 additions and 278 deletions
@@ -5,8 +5,6 @@ import fr.xephi.authme.datasource.DataSource;
import fr.xephi.authme.hooks.PluginHooks;
import fr.xephi.authme.output.MessageKey;
import fr.xephi.authme.output.Messages;
import fr.xephi.authme.security.PasswordSecurity;
import fr.xephi.authme.security.crypts.HashedPassword;
import fr.xephi.authme.settings.NewSetting;
import fr.xephi.authme.settings.SpawnLoader;
import fr.xephi.authme.settings.properties.SecuritySettings;
@@ -40,8 +38,6 @@ public class ProcessServiceTest {
@Mock
private Messages messages;
@Mock
private PasswordSecurity passwordSecurity;
@Mock
private AuthMe authMe;
@Mock
private DataSource dataSource;
@@ -140,22 +136,6 @@ public class ProcessServiceTest {
assertThat(result, equalTo(authMe));
}
@Test
public void shouldComputeHash() {
// given
String password = "test123";
String username = "Username";
HashedPassword hashedPassword = new HashedPassword("hashedResult", "salt12342");
given(passwordSecurity.computeHash(password, username)).willReturn(hashedPassword);
// when
HashedPassword result = processService.computeHash(password, username);
// then
assertThat(result, equalTo(hashedPassword));
verify(passwordSecurity).computeHash(password, username);
}
@Test
public void shouldValidatePassword() {
// given