[Minor] Fixing broken tests
This commit is contained in:
parent
22b326de80
commit
c67025761f
|
@ -18,7 +18,7 @@ public abstract class PerformanceTest {
|
||||||
@Test
|
@Test
|
||||||
public void runPerformanceTestCached() {
|
public void runPerformanceTestCached() {
|
||||||
|
|
||||||
Certificate certificate = runtime().getPrivilegeHandler().authenticate("cached", "test".toCharArray());
|
Certificate certificate = runtime().getPrivilegeHandler().authenticate("cached", "cached".toCharArray());
|
||||||
|
|
||||||
ServiceHandler svcHandler = runtime().getServiceHandler();
|
ServiceHandler svcHandler = runtime().getServiceHandler();
|
||||||
svcHandler.doService(certificate, new PerformanceTestService(), argInstance());
|
svcHandler.doService(certificate, new PerformanceTestService(), argInstance());
|
||||||
|
@ -27,7 +27,7 @@ public abstract class PerformanceTest {
|
||||||
@Test
|
@Test
|
||||||
public void runPerformanceTestTransactional() {
|
public void runPerformanceTestTransactional() {
|
||||||
|
|
||||||
Certificate certificate = runtime().getPrivilegeHandler().authenticate("transactional", "test".toCharArray());
|
Certificate certificate = runtime().getPrivilegeHandler().authenticate("transactional", "transactional".toCharArray());
|
||||||
|
|
||||||
ServiceHandler svcHandler = runtime().getServiceHandler();
|
ServiceHandler svcHandler = runtime().getServiceHandler();
|
||||||
svcHandler.doService(certificate, new PerformanceTestService(), argInstance());
|
svcHandler.doService(certificate, new PerformanceTestService(), argInstance());
|
||||||
|
|
|
@ -50,7 +50,7 @@ public class PerformanceTransientTest {
|
||||||
@Test
|
@Test
|
||||||
public void runPerformanceTest() {
|
public void runPerformanceTest() {
|
||||||
|
|
||||||
Certificate certificate = runtimeMock.getPrivilegeHandler().authenticate("transient", "test".toCharArray());
|
Certificate certificate = runtimeMock.getPrivilegeHandler().authenticate("transient", "transient".toCharArray());
|
||||||
|
|
||||||
ServiceHandler svcHandler = runtimeMock.getServiceHandler();
|
ServiceHandler svcHandler = runtimeMock.getServiceHandler();
|
||||||
svcHandler.doService(certificate, new PerformanceTestService(), new PerformanceTestArgument());
|
svcHandler.doService(certificate, new PerformanceTestService(), new PerformanceTestArgument());
|
||||||
|
|
|
@ -75,7 +75,7 @@ public class DefaultEncryptionHandler implements EncryptionHandler {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String nextToken() {
|
public String nextToken() {
|
||||||
byte[] bytes = new byte[16];
|
byte[] bytes = new byte[32];
|
||||||
this.secureRandom.nextBytes(bytes);
|
this.secureRandom.nextBytes(bytes);
|
||||||
return StringHelper.getHexString(bytes);
|
return StringHelper.getHexString(bytes);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1286,10 +1286,6 @@ public class DefaultPrivilegeHandler implements PrivilegeHandler {
|
||||||
// we only work with hashed passwords
|
// we only work with hashed passwords
|
||||||
byte[] passwordHash = this.encryptionHandler.hashPassword(password, salt);
|
byte[] passwordHash = this.encryptionHandler.hashPassword(password, salt);
|
||||||
|
|
||||||
logger.info("New hash: " + StringHelper.getHexString(passwordHash));
|
|
||||||
logger.info("User hash: " + StringHelper.getHexString(pwHash));
|
|
||||||
logger.info("User salt: " + StringHelper.getHexString(salt));
|
|
||||||
|
|
||||||
// validate password
|
// validate password
|
||||||
if (!Arrays.equals(passwordHash, pwHash))
|
if (!Arrays.equals(passwordHash, pwHash))
|
||||||
throw new InvalidCredentialsException(MessageFormat.format("Password is incorrect for {0}", username)); //$NON-NLS-1$
|
throw new InvalidCredentialsException(MessageFormat.format("Password is incorrect for {0}", username)); //$NON-NLS-1$
|
||||||
|
|
Loading…
Reference in New Issue