mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-19 16:03:07 +00:00
[DS-4409] Don't use live GeoLite database for testing -- there might not be one.
This commit is contained in:
@@ -10,9 +10,7 @@ package org.dspace.statistics;
|
||||
import java.io.File;
|
||||
|
||||
import com.maxmind.geoip2.DatabaseReader;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* Mock service that uses an embedded SOLR server for the statistics core.
|
||||
@@ -21,9 +19,6 @@ public class MockSolrLoggerServiceImpl
|
||||
extends SolrLoggerServiceImpl
|
||||
implements InitializingBean {
|
||||
|
||||
@Autowired(required = true)
|
||||
private ConfigurationService configurationService;
|
||||
|
||||
public MockSolrLoggerServiceImpl() {
|
||||
}
|
||||
|
||||
@@ -34,9 +29,8 @@ public class MockSolrLoggerServiceImpl
|
||||
|
||||
new FakeDatabaseReader(); // Activate fake
|
||||
new FakeDatabaseReader.Builder(); // Activate fake
|
||||
String locationDbPath = configurationService.getProperty("usage-statistics.dbfile");
|
||||
File locationDb = new File(locationDbPath);
|
||||
locationDb.createNewFile();
|
||||
File locationDb = File.createTempFile("GeoIP", ".db");
|
||||
locationDb.deleteOnExit();
|
||||
locationService = new DatabaseReader.Builder(locationDb).build();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user