test: cleanup static test resources
This commit is contained in:
parent
82ae74071e
commit
2b2552c301
|
@ -23,6 +23,7 @@ import com.maxmind.geoip2.DatabaseReader;
|
|||
import org.elasticsearch.ingest.core.AbstractProcessorFactory;
|
||||
import org.elasticsearch.test.ESTestCase;
|
||||
import org.elasticsearch.test.StreamsUtils;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
|
@ -55,6 +56,14 @@ public class GeoIpProcessorFactoryTests extends ESTestCase {
|
|||
databaseReaders = IngestGeoIpPlugin.loadDatabaseReaders(geoIpConfigDir);
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void closeDatabaseReaders() throws IOException {
|
||||
for (DatabaseReader reader : databaseReaders.values()) {
|
||||
reader.close();
|
||||
}
|
||||
databaseReaders = null;
|
||||
}
|
||||
|
||||
public void testBuildDefaults() throws Exception {
|
||||
GeoIpProcessor.Factory factory = new GeoIpProcessor.Factory(databaseReaders);
|
||||
|
||||
|
|
Loading…
Reference in New Issue