#707 Convert sync processes into services
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user