Add dependency on NetworkModule in AuditTrailModuleTests

Original commit: elastic/x-pack-elasticsearch@d5c0429d33
This commit is contained in:
Daniel Mitterdorfer 2015-11-27 15:52:51 +01:00
parent 75d66dfa95
commit f1b32117ac
1 changed files with 11 additions and 1 deletions

View File

@ -8,6 +8,8 @@ package org.elasticsearch.shield.audit;
import org.elasticsearch.Version;
import org.elasticsearch.common.inject.Guice;
import org.elasticsearch.common.inject.Injector;
import org.elasticsearch.common.network.NetworkModule;
import org.elasticsearch.common.network.NetworkService;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsFilter;
import org.elasticsearch.common.settings.SettingsModule;
@ -51,7 +53,15 @@ public class AuditTrailModuleTests extends ESTestCase {
.build();
ThreadPool pool = new ThreadPool("testLogFile");
try {
Injector injector = Guice.createInjector(new SettingsModule(settings, new SettingsFilter(settings)), new AuditTrailModule(settings), new TransportModule(settings), new CircuitBreakerModule(settings), new ThreadPoolModule(pool), new Version.Module(Version.CURRENT));
Injector injector = Guice.createInjector(
new SettingsModule(settings, new SettingsFilter(settings)),
new AuditTrailModule(settings),
new TransportModule(settings),
new CircuitBreakerModule(settings),
new ThreadPoolModule(pool),
new Version.Module(Version.CURRENT),
new NetworkModule(new NetworkService(settings))
);
AuditTrail auditTrail = injector.getInstance(AuditTrail.class);
assertThat(auditTrail, instanceOf(AuditTrailService.class));
AuditTrailService service = (AuditTrailService) auditTrail;