Inject token manager into LoadTestAction constructor

Inject into constructor instead of an instance variable, since it gets used
in the constructor before the instance variables get injected.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=149452717
This commit is contained in:
mmuller 2017-03-07 12:43:34 -08:00 committed by Ben McIlwain
parent ce4f3c0d56
commit 4eef02f17f

View file

@ -146,8 +146,6 @@ public class LoadTestAction implements Runnable {
@Inject
TaskEnqueuer taskEnqueuer;
@Inject XsrfTokenManager xsrfTokenManager;
private final String xmlContactCreateTmpl;
private final String xmlContactCreateFail;
private final String xmlContactInfo;
@ -168,7 +166,7 @@ public class LoadTestAction implements Runnable {
private final String xsrfToken;
@Inject
LoadTestAction(@Parameter("tld") String tld) {
LoadTestAction(@Parameter("tld") String tld, XsrfTokenManager xsrfTokenManager) {
xmlContactCreateTmpl = loadXml("contact_create");
xmlContactCreateFail = xmlContactCreateTmpl.replace("%contact%", EXISTING_CONTACT);
xmlContactInfo = loadXml("contact_info").replace("%contact%", EXISTING_CONTACT);