[cleanup] index names parser
Was bound in guice without a reason. Original commit: elastic/x-pack-elasticsearch@75a9b66946
This commit is contained in:
parent
d46dad18d0
commit
c4dbb8d794
|
@ -71,7 +71,6 @@ public class WatcherModule extends AbstractModule implements SpawnModules {
|
|||
bind(WatcherLifeCycleService.class).asEagerSingleton();
|
||||
bind(TemplateUtils.class).asEagerSingleton();
|
||||
bind(WatcherSettingsValidation.class).asEagerSingleton();
|
||||
bind(DynamicIndexName.Parser.class).asEagerSingleton();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ public class IndexActionFactory extends ActionFactory<IndexAction, ExecutableInd
|
|||
private final DynamicIndexName.Parser indexNamesParser;
|
||||
|
||||
@Inject
|
||||
public IndexActionFactory(Settings settings, ClientProxy client, DynamicIndexName.Parser indexNamesParser) {
|
||||
public IndexActionFactory(Settings settings, ClientProxy client) {
|
||||
super(Loggers.getLogger(ExecutableEmailAction.class, settings));
|
||||
this.client = client;
|
||||
String defaultDateFormat = DynamicIndexName.defaultDateFormat(settings, "watcher.actions.index");
|
||||
|
|
|
@ -199,8 +199,7 @@ public class IndexActionTests extends ElasticsearchIntegrationTest {
|
|||
}
|
||||
builder.endObject();
|
||||
|
||||
DynamicIndexName.Parser indexNameParser = new DynamicIndexName.Parser();
|
||||
IndexActionFactory actionParser = new IndexActionFactory(Settings.EMPTY, ClientProxy.of(client()), indexNameParser);
|
||||
IndexActionFactory actionParser = new IndexActionFactory(Settings.EMPTY, ClientProxy.of(client()));
|
||||
XContentParser parser = JsonXContent.jsonXContent.createParser(builder.bytes());
|
||||
parser.nextToken();
|
||||
|
||||
|
@ -221,8 +220,7 @@ public class IndexActionTests extends ElasticsearchIntegrationTest {
|
|||
.field(IndexAction.Field.DOC_TYPE.getPreferredName(), "test-type")
|
||||
.endObject();
|
||||
|
||||
DynamicIndexName.Parser indexNameParser = new DynamicIndexName.Parser();
|
||||
IndexActionFactory actionParser = new IndexActionFactory(Settings.EMPTY, ClientProxy.of(client()), indexNameParser);
|
||||
IndexActionFactory actionParser = new IndexActionFactory(Settings.EMPTY, ClientProxy.of(client()));
|
||||
XContentParser parser = JsonXContent.jsonXContent.createParser(builder.bytes());
|
||||
parser.nextToken();
|
||||
|
||||
|
@ -249,8 +247,7 @@ public class IndexActionTests extends ElasticsearchIntegrationTest {
|
|||
}
|
||||
}
|
||||
builder.endObject();
|
||||
DynamicIndexName.Parser indexNameParser = new DynamicIndexName.Parser();
|
||||
IndexActionFactory actionParser = new IndexActionFactory(Settings.EMPTY, ClientProxy.of(client()), indexNameParser);
|
||||
IndexActionFactory actionParser = new IndexActionFactory(Settings.EMPTY, ClientProxy.of(client()));
|
||||
XContentParser parser = JsonXContent.jsonXContent.createParser(builder.bytes());
|
||||
parser.nextToken();
|
||||
try {
|
||||
|
|
|
@ -111,7 +111,6 @@ import static org.mockito.Mockito.mock;
|
|||
public class WatchTests extends ElasticsearchTestCase {
|
||||
|
||||
private ScriptServiceProxy scriptService;
|
||||
private DynamicIndexName.Parser indexNamesParser;
|
||||
private ClientProxy client;
|
||||
private HttpClient httpClient;
|
||||
private EmailService emailService;
|
||||
|
@ -127,7 +126,6 @@ public class WatchTests extends ElasticsearchTestCase {
|
|||
@Before
|
||||
public void init() throws Exception {
|
||||
scriptService = mock(ScriptServiceProxy.class);
|
||||
indexNamesParser = new DynamicIndexName.Parser();
|
||||
client = mock(ClientProxy.class);
|
||||
httpClient = mock(HttpClient.class);
|
||||
emailService = mock(EmailService.class);
|
||||
|
@ -416,7 +414,7 @@ public class WatchTests extends ElasticsearchTestCase {
|
|||
parsers.put(EmailAction.TYPE, new EmailActionFactory(settings, emailService, templateEngine, htmlSanitizer));
|
||||
break;
|
||||
case IndexAction.TYPE:
|
||||
parsers.put(IndexAction.TYPE, new IndexActionFactory(settings, client, indexNamesParser));
|
||||
parsers.put(IndexAction.TYPE, new IndexActionFactory(settings, client));
|
||||
break;
|
||||
case WebhookAction.TYPE:
|
||||
parsers.put(WebhookAction.TYPE, new WebhookActionFactory(settings, httpClient,
|
||||
|
|
Loading…
Reference in New Issue