use of org.graylog2.plugin.security.PasswordAlgorithm in project graylog2-server by Graylog2.
the class MigrationHelpersTest method newUser.
private User newUser(Permissions permissions) {
final BCryptPasswordAlgorithm passwordAlgorithm = new BCryptPasswordAlgorithm(10);
final PasswordAlgorithmFactory passwordAlgorithmFactory = new PasswordAlgorithmFactory(Collections.emptyMap(), passwordAlgorithm);
return new UserImpl(passwordAlgorithmFactory, permissions, ImmutableMap.of());
}
use of org.graylog2.plugin.security.PasswordAlgorithm in project graylog2-server by Graylog2.
the class PasswordAlgorithmFactoryTest method testDefaultPasswordAlgorithm.
@Test
public void testDefaultPasswordAlgorithm() throws Exception {
final PasswordAlgorithm defaultPasswordAlgorithm = mock(PasswordAlgorithm.class);
final PasswordAlgorithmFactory passwordAlgorithmFactory = new PasswordAlgorithmFactory(Collections.<String, PasswordAlgorithm>emptyMap(), defaultPasswordAlgorithm);
assertThat(passwordAlgorithmFactory.defaultPasswordAlgorithm()).isEqualTo(defaultPasswordAlgorithm);
}
Aggregations