Revision 43623
Added by Sandro La Bruzzo over 7 years ago
ConfigurationResolverStoreTestConfig.java | ||
---|---|---|
3 | 3 |
import java.net.UnknownHostException; |
4 | 4 |
|
5 | 5 |
import com.mongodb.MongoClient; |
6 |
import com.mongodb.client.MongoDatabase; |
|
7 | 6 |
import eu.dnetlib.dli.resolver.ResolverStore; |
8 | 7 |
import org.springframework.context.annotation.Bean; |
9 | 8 |
import org.springframework.context.annotation.Configuration; |
... | ... | |
12 | 11 |
public class ConfigurationResolverStoreTestConfig { |
13 | 12 |
|
14 | 13 |
@Bean |
15 |
public MongoDatabase db() throws UnknownHostException {
|
|
14 |
public MongoClient client() throws UnknownHostException {
|
|
16 | 15 |
final MongoClient mongo = new MongoClient("localhost", 27017); |
17 |
return mongo.getDatabase("mdstore_test");
|
|
16 |
return mongo; |
|
18 | 17 |
} |
19 | 18 |
|
20 | 19 |
@Bean |
21 | 20 |
public ResolverStore resolverStore() throws UnknownHostException { |
22 | 21 |
|
23 | 22 |
ResolverStore store = new ResolverStore(); |
24 |
store.setMongoDatabase(db()); |
|
23 |
store.setMongoClient(client()); |
|
24 |
store.setDatabaseName("mdstore_test"); |
|
25 | 25 |
store.setCollectionName("resolverStore"); |
26 |
|
|
26 | 27 |
return store; |
27 | 28 |
} |
28 | 29 |
|
Also available in: Unified diff
implemented new version of Resolver for DLI