Merged in bugfix/restart_after_migration (pull request #384)

Create mock subject to satisfy legman
This commit is contained in:
Sebastian Sdorra
2020-01-13 13:16:02 +00:00

View File

@@ -5,6 +5,9 @@ import com.github.mustachejava.Mustache;
import com.github.mustachejava.MustacheFactory;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Strings;
import org.apache.shiro.mgt.DefaultSecurityManager;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.util.ThreadContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sonia.scm.event.ScmEventBus;
@@ -116,6 +119,8 @@ class MigrationWizardServlet extends HttpServlet {
respondWithTemplate(resp, model, "templates/repository-migration-restart.mustache");
ThreadContext.bind(new Subject.Builder(new DefaultSecurityManager()).authenticated(false).buildSubject());
ScmEventBus.getInstance().post(new RestartEvent(MigrationWizardServlet.class, "wrote migration data"));
}