Commit c8853725 authored by Ard Schrijvers's avatar Ard Schrijvers

REPO-2180 [Backport 11.2] Do not reuse credentials object in different repository

You can only login multiple times with the exact same credentials instance
to a single repository, not to multiple ones

(cherry picked from commit d40edad9)
(cherry picked from commit ffc402f6)
parent ccd812a1
* Copyright 2014-2016 Hippo B.V. (
* Copyright 2014-2019 Hippo B.V. (
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -75,8 +75,7 @@ public abstract class ClusterTest {
private static final String repo1Config = "/org/onehippo/repository/clustering/node1-repository-" + dbtype + ".xml";
private static final String repo2Config = "/org/onehippo/repository/clustering/node2-repository-" + dbtype + ".xml";
protected static final Credentials CREDENTIALS = new SimpleCredentials("admin", "admin".toCharArray());
private static File tmpdir;
private static String repo1Path;
private static String repo2Path;
......@@ -333,7 +332,8 @@ public abstract class ClusterTest {
protected Session loginSession(Object repo) {
try {
return (Session) repo.getClass().getMethod("login", Credentials.class).invoke(repo, CREDENTIALS);
return (Session) repo.getClass().getMethod("login", Credentials.class).invoke(repo,
new SimpleCredentials("admin", "admin".toCharArray()));
} catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
log.error("Failed to log in session: " + e);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment