-
-
Notifications
You must be signed in to change notification settings - Fork 391
Expand file tree
/
Copy pathMongoE2EWithCustomHeadCollectionNameTest.groovy
More file actions
31 lines (25 loc) · 1.1 KB
/
MongoE2EWithCustomHeadCollectionNameTest.groovy
File metadata and controls
31 lines (25 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package org.javers.repository.mongo
import org.javers.core.model.SnapshotEntity
import org.javers.repository.api.JaversRepository
import static org.javers.repository.mongo.MongoRepositoryConfigurationBuilder.mongoRepositoryConfiguration
class MongoE2EWithCustomHeadCollectionNameTest extends MongoE2ETest {
@Override
protected JaversRepository prepareJaversRepository() {
def mongoRepository = new MongoRepository(getMongoDb(),
mongoRepositoryConfiguration()
.withSnapshotCollectionName("jv_custom_snapshots")
.withHeadCollectionName("jv_custom_head_id")
.build())
mongoRepository.clean()
mongoRepository
}
def "get commit head id from another mongo database collection name"() {
when:
javers.commit('author', new SnapshotEntity())
def find = mongoClient.getDatabase("test")
.getCollection("jv_custom_head_id").find();
then:
find.size() == 1
find.iterator().next().getAt("id") != null
}
}