1
|
package eu.dnetlib.resolver.store;
|
2
|
|
3
|
import java.net.UnknownHostException;
|
4
|
|
5
|
import com.mongodb.MongoClient;
|
6
|
|
7
|
import eu.dnetlib.pid.resolver.store.ResolverStore;
|
8
|
import org.springframework.context.annotation.Bean;
|
9
|
import org.springframework.context.annotation.Configuration;
|
10
|
|
11
|
@Configuration
|
12
|
public class ConfigurationResolverStoreTestConfig {
|
13
|
|
14
|
@Bean
|
15
|
public MongoClient client() throws UnknownHostException {
|
16
|
final MongoClient mongo = new MongoClient("localhost", 27017);
|
17
|
return mongo;
|
18
|
}
|
19
|
|
20
|
@Bean
|
21
|
public ResolverStore resolverStore() throws UnknownHostException {
|
22
|
|
23
|
ResolverStore store = new ResolverStore();
|
24
|
store.setMongoClient(client());
|
25
|
store.setDatabaseName("mdstore_test");
|
26
|
store.setCollectionName("resolverStore");
|
27
|
|
28
|
return store;
|
29
|
}
|
30
|
|
31
|
}
|