RED-8702: Explore document databases to store entityLog
This commit is contained in:
parent
b2b6aa1ffd
commit
0545fdb24b
@ -34,7 +34,6 @@ public class EntityLogDocument {
|
|||||||
|
|
||||||
private long analysisVersion;
|
private long analysisVersion;
|
||||||
|
|
||||||
//@Indexed(direction = IndexDirection.DESCENDING)
|
|
||||||
private int analysisNumber;
|
private int analysisNumber;
|
||||||
|
|
||||||
@DBRef
|
@DBRef
|
||||||
|
|||||||
@ -29,9 +29,6 @@ import lombok.experimental.FieldDefaults;
|
|||||||
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
|
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
|
||||||
@FieldDefaults(level = AccessLevel.PRIVATE)
|
@FieldDefaults(level = AccessLevel.PRIVATE)
|
||||||
@Document(collection = "entity-log-entries")
|
@Document(collection = "entity-log-entries")
|
||||||
//@CompoundIndexes({
|
|
||||||
//@CompoundIndex(name = "changes_analysisNumber", def = "{ 'changes.analysisNumber': 1 }")
|
|
||||||
// })
|
|
||||||
public class EntityLogEntryDocument {
|
public class EntityLogEntryDocument {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
|
|||||||
@ -0,0 +1,41 @@
|
|||||||
|
package com.iqser.red.service.persistence.server.integration.tests;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Disabled;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.core.io.ClassPathResource;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||||
|
import com.iqser.red.service.persistence.management.v1.processor.service.mongo.EntityLogMongoService;
|
||||||
|
import com.iqser.red.service.persistence.server.integration.utils.AbstractPersistenceServerServiceTest;
|
||||||
|
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.EntityLog;
|
||||||
|
|
||||||
|
import lombok.SneakyThrows;
|
||||||
|
|
||||||
|
public class EntityLogMongoServiceTest extends AbstractPersistenceServerServiceTest {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EntityLogMongoService entityLogMongoService;
|
||||||
|
|
||||||
|
private final String ENTITY_LOG = "sample.ENTITY_LOG.json";
|
||||||
|
|
||||||
|
private static final String TEST_DOSSIER_ID = "6f2a9d4b5d4e11211fc0d7732fd45b78";
|
||||||
|
private static final String TEST_FILE_ID = "b2cbdd4dca0aa1aa0ebbfc5cc1462df0";
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@SneakyThrows
|
||||||
|
@Disabled
|
||||||
|
public void testInsertEntityLogDocument() {
|
||||||
|
|
||||||
|
var file = new ClassPathResource(String.format(ENTITY_LOG));
|
||||||
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
objectMapper.registerModule(new JavaTimeModule());
|
||||||
|
|
||||||
|
EntityLog entityLog = objectMapper.readValue(file.getInputStream(), EntityLog.class);
|
||||||
|
|
||||||
|
entityLogMongoService.insertEntityLog(TEST_DOSSIER_ID, TEST_FILE_ID, entityLog);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user