|
|
|
|
@ -1,7 +1,6 @@
|
|
|
|
|
package com.iqser.red.service.search.v1.server.service;
|
|
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
|
import com.iqser.red.service.persistence.service.v1.api.model.dossiertemplate.dossier.DossierStatus;
|
|
|
|
|
import com.iqser.red.service.persistence.service.v1.api.model.dossiertemplate.dossier.file.WorkflowStatus;
|
|
|
|
|
import com.iqser.red.service.search.v1.model.MatchedDocument;
|
|
|
|
|
import com.iqser.red.service.search.v1.model.SearchResult;
|
|
|
|
|
@ -71,11 +70,11 @@ public class SearchTest extends AbstractElasticsearchIntegrationTest {
|
|
|
|
|
ClassPathResource textResource = new ClassPathResource("files/Text2.json");
|
|
|
|
|
Text text = objectMapper.readValue(textResource.getInputStream(), Text.class);
|
|
|
|
|
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", "S-Metolachlor_RAR_01_Volume_1_2018-09-06-1.pdf", text, "UserId", DossierStatus.ACTIVE, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
documentIndexService.indexDocument("template2", "dossierId2", "fileId2", "S-Metolachlor_RAR_01_Volume_1_2018-09-06-2.pdf", text, "UserId2", DossierStatus.ACTIVE, WorkflowStatus.NEW, Map.of("F2Key", "F2Value"));
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", "S-Metolachlor_RAR_01_Volume_1_2018-09-06-1.pdf", text, "UserId", false, false, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
documentIndexService.indexDocument("template2", "dossierId2", "fileId2", "S-Metolachlor_RAR_01_Volume_1_2018-09-06-2.pdf", text, "UserId2", false, false, WorkflowStatus.NEW, Map.of("F2Key", "F2Value"));
|
|
|
|
|
|
|
|
|
|
// Act & Assert 1
|
|
|
|
|
SearchResult result = searchService.search("F1Value", null, null, null, null, null, null, null, 0, 10, false);
|
|
|
|
|
SearchResult result = searchService.search("F1Value", null, null, null, null, false, false, null, null, 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(1);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
@ -87,10 +86,10 @@ public class SearchTest extends AbstractElasticsearchIntegrationTest {
|
|
|
|
|
ClassPathResource textResource = new ClassPathResource("files/Text2.json");
|
|
|
|
|
Text text = objectMapper.readValue(textResource.getInputStream(), Text.class);
|
|
|
|
|
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", "S-Metolachlor_RAR_01_Volume_1_2018-09-06-1.pdf", text, "UserId", DossierStatus.ACTIVE, WorkflowStatus.NEW, Map.of("F1Key", "F1Value", "F2Key", "F2Value"));
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", "S-Metolachlor_RAR_01_Volume_1_2018-09-06-1.pdf", text, "UserId", false, false, WorkflowStatus.NEW, Map.of("F1Key", "F1Value", "F2Key", "F2Value"));
|
|
|
|
|
|
|
|
|
|
// Act & Assert 1
|
|
|
|
|
SearchResult result = searchService.search("S-Metolachlor", List.of("template1"), List.of("dossierId1"), "fileId1", "UserId", List.of(DossierStatus.ACTIVE.name(), DossierStatus.DELETED.name()), WorkflowStatus.NEW.name(), Map.of("F1Key", "F1Value"), 0, 10, false);
|
|
|
|
|
SearchResult result = searchService.search("S-Metolachlor", List.of("template1"), List.of("dossierId1"), "fileId1", "UserId", false, false, WorkflowStatus.NEW.name(), Map.of("F1Key", "F1Value"), 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(1);
|
|
|
|
|
System.out.println(result);
|
|
|
|
|
|
|
|
|
|
@ -107,30 +106,30 @@ public class SearchTest extends AbstractElasticsearchIntegrationTest {
|
|
|
|
|
ClassPathResource textResource = new ClassPathResource("files/Text2.json");
|
|
|
|
|
Text text = objectMapper.readValue(textResource.getInputStream(), Text.class);
|
|
|
|
|
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", "S-Metolachlor_RAR_01_Volume_1_2018-09-06-1.pdf", text, "UserId", DossierStatus.ACTIVE, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
documentIndexService.indexDocument("template2", "dossierId2", "fileId2", "S-Metolachlor_RAR_01_Volume_1_2018-09-06-2.pdf", text, "UserId2", DossierStatus.ACTIVE, WorkflowStatus.NEW, Map.of("F2Key", "F2Value"));
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", "S-Metolachlor_RAR_01_Volume_1_2018-09-06-1.pdf", text, "UserId", false, false, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
documentIndexService.indexDocument("template2", "dossierId2", "fileId2", "S-Metolachlor_RAR_01_Volume_1_2018-09-06-2.pdf", text, "UserId2", false, false, WorkflowStatus.NEW, Map.of("F2Key", "F2Value"));
|
|
|
|
|
|
|
|
|
|
// Act & Assert 1
|
|
|
|
|
SearchResult result = searchService.search("S-Metolachlor", null, null, null, null, List.of(DossierStatus.ACTIVE.name()), WorkflowStatus.APPROVED.name(), null, 0, 10, false);
|
|
|
|
|
SearchResult result = searchService.search("S-Metolachlor", null, null, null, null, false, false, WorkflowStatus.APPROVED.name(), null, 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(0);
|
|
|
|
|
|
|
|
|
|
// Act & Assert 2
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, List.of(DossierStatus.ACTIVE.name()), WorkflowStatus.NEW.name(), null, -1, 0, false);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, false, false, WorkflowStatus.NEW.name(), null, -1, 0, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(2);
|
|
|
|
|
assertThat(result.getMatchedDocuments().stream().map(MatchedDocument::getFileId)).contains("fileId1");
|
|
|
|
|
assertThat(result.getMatchedDocuments().stream().map(MatchedDocument::getFileId)).contains("fileId2");
|
|
|
|
|
|
|
|
|
|
// Act & Assert 3
|
|
|
|
|
documentUpdateService.updateDocument("fileId1", "UserId2", DossierStatus.ACTIVE, WorkflowStatus.APPROVED.name(), Map.of("F2Key", "F2Value"));
|
|
|
|
|
documentUpdateService.updateDocument("fileId1", "UserId2", false, false, WorkflowStatus.APPROVED.name(), Map.of("F2Key", "F2Value"));
|
|
|
|
|
Thread.sleep(UPDATE_TIMER);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, "UserId2", List.of(DossierStatus.ACTIVE.name()), WorkflowStatus.NEW.name(), Map.of("F2Key", "F2Value"), 0, 10, false);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, "UserId2", false, false, WorkflowStatus.NEW.name(), Map.of("F2Key", "F2Value"), 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(1);
|
|
|
|
|
assertThat(result.getMatchedDocuments().stream().map(MatchedDocument::getFileId)).contains("fileId2");
|
|
|
|
|
|
|
|
|
|
// Act & Assert 4
|
|
|
|
|
documentUpdateService.updateDocument("fileId2", "UserId2", DossierStatus.ACTIVE, WorkflowStatus.APPROVED.name(), Map.of("F2Key", "F2Value"));
|
|
|
|
|
documentUpdateService.updateDocument("fileId2", "UserId2", false, false, WorkflowStatus.APPROVED.name(), Map.of("F2Key", "F2Value"));
|
|
|
|
|
Thread.sleep(UPDATE_TIMER);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, "UserId2", List.of(DossierStatus.ACTIVE.name()), WorkflowStatus.APPROVED.name(), Map.of("F2Key", "F2Value"), 0, 10, false);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, "UserId2", false, false, WorkflowStatus.APPROVED.name(), Map.of("F2Key", "F2Value"), 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(2);
|
|
|
|
|
assertThat(result.getMatchedDocuments().stream().map(MatchedDocument::getFileId)).contains("fileId1");
|
|
|
|
|
assertThat(result.getMatchedDocuments().stream().map(MatchedDocument::getFileId)).contains("fileId2");
|
|
|
|
|
@ -146,18 +145,18 @@ public class SearchTest extends AbstractElasticsearchIntegrationTest {
|
|
|
|
|
ClassPathResource textResource = new ClassPathResource("files/Text2.json");
|
|
|
|
|
Text text = objectMapper.readValue(textResource.getInputStream(), Text.class);
|
|
|
|
|
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", "S-Metolachlor_RAR_01_Volume_1_2018-09-06-1.pdf", text, "UserId", DossierStatus.ACTIVE, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
documentIndexService.indexDocument("template2", "dossierId2", "fileId2", "S-Metolachlor_RAR_01_Volume_1_2018-09-06-2.pdf", text, "UserId2", DossierStatus.ACTIVE, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", "S-Metolachlor_RAR_01_Volume_1_2018-09-06-1.pdf", text, "UserId", false, false, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
documentIndexService.indexDocument("template2", "dossierId2", "fileId2", "S-Metolachlor_RAR_01_Volume_1_2018-09-06-2.pdf", text, "UserId2", false, false, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
|
|
|
|
|
// Act & Assert 1
|
|
|
|
|
SearchResult result = searchService.search("S-Metolachlor", null, null, null, "UserId2", null, null, null, 0, 10, false);
|
|
|
|
|
SearchResult result = searchService.search("S-Metolachlor", null, null, null, "UserId2", false, false, null, null, 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(1);
|
|
|
|
|
assertThat(result.getMatchedDocuments().stream().map(MatchedDocument::getFileId)).contains("fileId2");
|
|
|
|
|
|
|
|
|
|
// Act & Assert 2
|
|
|
|
|
documentUpdateService.updateDocument("fileId1", "UserId2", DossierStatus.ACTIVE, WorkflowStatus.APPROVED.name(), Map.of("U2Key", "U2Value"));
|
|
|
|
|
documentUpdateService.updateDocument("fileId1", "UserId2", false, false, WorkflowStatus.APPROVED.name(), Map.of("U2Key", "U2Value"));
|
|
|
|
|
Thread.sleep(UPDATE_TIMER);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, "UserId2", null, null, null, 0, 10, false);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, "UserId2", false, false, null, null, 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(2);
|
|
|
|
|
assertThat(result.getMatchedDocuments().stream().map(MatchedDocument::getFileId)).contains("fileId1");
|
|
|
|
|
assertThat(result.getMatchedDocuments().stream().map(MatchedDocument::getFileId)).contains("fileId2");
|
|
|
|
|
@ -174,35 +173,35 @@ public class SearchTest extends AbstractElasticsearchIntegrationTest {
|
|
|
|
|
ClassPathResource textResource = new ClassPathResource("files/Text2.json");
|
|
|
|
|
Text text = objectMapper.readValue(textResource.getInputStream(), Text.class);
|
|
|
|
|
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", "S-Metolachlor_RAR_01_Volume_1_2018-09-06-1.pdf", text, "UserId", DossierStatus.ACTIVE, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
documentIndexService.indexDocument("template2", "dossierId2", "fileId2", "S-Metolachlor_RAR_01_Volume_1_2018-09-06-2.pdf", text, "UserId2", DossierStatus.ACTIVE, WorkflowStatus.NEW, Map.of("F2Key", "F2Value"));
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", "S-Metolachlor_RAR_01_Volume_1_2018-09-06-1.pdf", text, "UserId", false, false, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
documentIndexService.indexDocument("template2", "dossierId2", "fileId2", "S-Metolachlor_RAR_01_Volume_1_2018-09-06-2.pdf", text, "UserId2", false, false, WorkflowStatus.NEW, Map.of("F2Key", "F2Value"));
|
|
|
|
|
|
|
|
|
|
// Act & Assert 1
|
|
|
|
|
SearchResult result = searchService.search("S-Metolachlor", null, null, null, null, List.of(DossierStatus.ACTIVE.name()), WorkflowStatus.APPROVED.name(), null, 0, 10, false);
|
|
|
|
|
SearchResult result = searchService.search("S-Metolachlor", null, null, null, null, false, false, WorkflowStatus.APPROVED.name(), null, 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(0);
|
|
|
|
|
|
|
|
|
|
// Act & Assert 2
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, List.of(DossierStatus.ACTIVE.name()), WorkflowStatus.NEW.name(), null, 0, 10, false);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, false, false, WorkflowStatus.NEW.name(), null, 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(2);
|
|
|
|
|
assertThat(result.getMatchedDocuments().stream().map(MatchedDocument::getFileId)).contains("fileId1");
|
|
|
|
|
assertThat(result.getMatchedDocuments().stream().map(MatchedDocument::getFileId)).contains("fileId2");
|
|
|
|
|
|
|
|
|
|
// Act & Assert 3
|
|
|
|
|
documentUpdateService.updateDocument("fileId1", "UserId2", DossierStatus.ACTIVE, WorkflowStatus.APPROVED.name(), Map.of("U2Key", "U2Value"));
|
|
|
|
|
documentUpdateService.updateDocument("fileId1", "UserId2", false, false, WorkflowStatus.APPROVED.name(), Map.of("U2Key", "U2Value"));
|
|
|
|
|
Thread.sleep(UPDATE_TIMER);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, List.of(DossierStatus.ACTIVE.name()), WorkflowStatus.APPROVED.name(), null, 0, 10, false);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, false, false, WorkflowStatus.APPROVED.name(), null, 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(1);
|
|
|
|
|
assertThat(result.getMatchedDocuments().stream().map(MatchedDocument::getFileId)).contains("fileId1");
|
|
|
|
|
|
|
|
|
|
// Act & Assert 4
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, List.of(DossierStatus.ACTIVE.name()), WorkflowStatus.NEW.name(), null, 0, 10, false);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, false, false, WorkflowStatus.NEW.name(), null, 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(1);
|
|
|
|
|
assertThat(result.getMatchedDocuments().stream().map(MatchedDocument::getFileId)).contains("fileId2");
|
|
|
|
|
|
|
|
|
|
// Act & Assert 5
|
|
|
|
|
documentUpdateService.updateDocument("fileId2", "UserId2", DossierStatus.ACTIVE, WorkflowStatus.APPROVED.name(), Map.of("U2Key", "U2Value"));
|
|
|
|
|
documentUpdateService.updateDocument("fileId2", "UserId2", false, false, WorkflowStatus.APPROVED.name(), Map.of("U2Key", "U2Value"));
|
|
|
|
|
Thread.sleep(UPDATE_TIMER);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, List.of(DossierStatus.ACTIVE.name()), WorkflowStatus.APPROVED.name(), null, 0, 10, false);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, false, false, WorkflowStatus.APPROVED.name(), null, 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(2);
|
|
|
|
|
assertThat(result.getMatchedDocuments().stream().map(MatchedDocument::getFileId)).contains("fileId1");
|
|
|
|
|
assertThat(result.getMatchedDocuments().stream().map(MatchedDocument::getFileId)).contains("fileId2");
|
|
|
|
|
@ -219,46 +218,44 @@ public class SearchTest extends AbstractElasticsearchIntegrationTest {
|
|
|
|
|
ClassPathResource textResource = new ClassPathResource("files/Text2.json");
|
|
|
|
|
Text text = objectMapper.readValue(textResource.getInputStream(), Text.class);
|
|
|
|
|
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", "S-Metolachlor_RAR_01_Volume_1_2018-09-06-1.pdf", text, "UserId", DossierStatus.ACTIVE, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
documentIndexService.indexDocument("template2", "dossierId2", "fileId2", "S-Metolachlor_RAR_01_Volume_1_2018-09-06-2.pdf", text, "UserId2", DossierStatus.ACTIVE, WorkflowStatus.NEW, Map.of("F2Key", "F2Value"));
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", "S-Metolachlor_RAR_01_Volume_1_2018-09-06-1.pdf", text, "UserId", false, false, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
documentIndexService.indexDocument("template2", "dossierId2", "fileId2", "S-Metolachlor_RAR_01_Volume_1_2018-09-06-2.pdf", text, "UserId2", false, false, WorkflowStatus.NEW, Map.of("F2Key", "F2Value"));
|
|
|
|
|
|
|
|
|
|
// Act & Assert 1
|
|
|
|
|
SearchResult result = searchService.search("S-Metolachlor", null, null, null, null, List.of(DossierStatus.DELETED.name()), null, null, 0, 10, false);
|
|
|
|
|
SearchResult result = searchService.search("S-Metolachlor", null, null, null, null, true, false, null, null, 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(0);
|
|
|
|
|
|
|
|
|
|
// Act & Assert 2
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, List.of(DossierStatus.ACTIVE.name()), null, null, 0, 10, false);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, false, false, null, null, 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(2);
|
|
|
|
|
assertThat(result.getMatchedDocuments().stream().map(MatchedDocument::getFileId)).contains("fileId1");
|
|
|
|
|
assertThat(result.getMatchedDocuments().stream().map(MatchedDocument::getFileId)).contains("fileId2");
|
|
|
|
|
|
|
|
|
|
// Act & Assert 2
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, List.of(DossierStatus.ACTIVE.name(), DossierStatus.ARCHIVED.name()), null, null, 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(2);
|
|
|
|
|
assertThat(result.getMatchedDocuments().stream().map(MatchedDocument::getFileId)).contains("fileId1");
|
|
|
|
|
assertThat(result.getMatchedDocuments().stream().map(MatchedDocument::getFileId)).contains("fileId2");
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, false, true, null, null, 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(0);
|
|
|
|
|
|
|
|
|
|
// Act & Assert 3
|
|
|
|
|
documentUpdateService.updateDocument("fileId1", "UserId2", DossierStatus.ARCHIVED, WorkflowStatus.APPROVED.name(), Map.of("U2Key", "U2Value"));
|
|
|
|
|
documentUpdateService.updateDocument("fileId1", "UserId2", false, true, WorkflowStatus.APPROVED.name(), Map.of("U2Key", "U2Value"));
|
|
|
|
|
Thread.sleep(UPDATE_TIMER);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, List.of(DossierStatus.ACTIVE.name(), DossierStatus.DELETED.name()), null, null, 0, 10, false);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, false, false, null, null, 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(1);
|
|
|
|
|
assertThat(result.getMatchedDocuments().stream().map(MatchedDocument::getFileId)).contains("fileId2");
|
|
|
|
|
|
|
|
|
|
// Act & Assert 4
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, List.of(DossierStatus.ARCHIVED.name()), null, null, 0, 10, false);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, false, true, null, null, 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(1);
|
|
|
|
|
assertThat(result.getMatchedDocuments().stream().map(MatchedDocument::getFileId)).contains("fileId1");
|
|
|
|
|
|
|
|
|
|
// Act & Assert 5
|
|
|
|
|
documentUpdateService.updateDocument("fileId2", "UserId2", DossierStatus.DELETED, WorkflowStatus.APPROVED.name(), Map.of("U2Key", "U2Value"));
|
|
|
|
|
documentUpdateService.updateDocument("fileId2", "UserId2", true, false, WorkflowStatus.APPROVED.name(), Map.of("U2Key", "U2Value"));
|
|
|
|
|
Thread.sleep(UPDATE_TIMER);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, List.of(DossierStatus.ACTIVE.name()), null, null, 0, 10, false);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, false, false, null, null, 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(0);
|
|
|
|
|
|
|
|
|
|
// Act & Assert 6
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, List.of(DossierStatus.ARCHIVED.name(), DossierStatus.DELETED.name()), null, null, 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(2);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, false, true, null, null, 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -272,53 +269,53 @@ public class SearchTest extends AbstractElasticsearchIntegrationTest {
|
|
|
|
|
ClassPathResource textResource = new ClassPathResource("files/Text2.json");
|
|
|
|
|
Text text = objectMapper.readValue(textResource.getInputStream(), Text.class);
|
|
|
|
|
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", "S-Metolachlor_RAR_01_Volume_1_2018-09-06-1.pdf", text, "UserId", DossierStatus.ACTIVE, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
documentIndexService.indexDocument("template2", "dossierId2", "fileId2", "S-Metolachlor_RAR_01_Volume_1_2018-09-06-2.pdf", text, "UserId2", DossierStatus.ACTIVE, WorkflowStatus.NEW, Map.of("F2Key", "F2Value"));
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", "S-Metolachlor_RAR_01_Volume_1_2018-09-06-1.pdf", text, "UserId", false, false, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
documentIndexService.indexDocument("template2", "dossierId2", "fileId2", "S-Metolachlor_RAR_01_Volume_1_2018-09-06-2.pdf", text, "UserId2", false, false, WorkflowStatus.NEW, Map.of("F2Key", "F2Value"));
|
|
|
|
|
|
|
|
|
|
// Act & Assert 1
|
|
|
|
|
SearchResult result = searchService.search("S-Metolachlor", null, null, null, null, null, null, Map.of("F1Key", "F1Value"), 0, 10, false);
|
|
|
|
|
SearchResult result = searchService.search("S-Metolachlor", null, null, null, null, false, false, null, Map.of("F1Key", "F1Value"), 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(1);
|
|
|
|
|
assertThat(result.getMatchedDocuments().stream().map(MatchedDocument::getFileId)).contains("fileId1");
|
|
|
|
|
|
|
|
|
|
// Act & Assert 2
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, null, null, Map.of("F2Key", "F2Value"), 0, 10, false);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, false, false, null, Map.of("F2Key", "F2Value"), 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(1);
|
|
|
|
|
assertThat(result.getMatchedDocuments().stream().map(MatchedDocument::getFileId)).contains("fileId2");
|
|
|
|
|
|
|
|
|
|
// Act & Assert 3
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, null, null, Map.of("F2Key", "does-not-exist"), 0, 10, false);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, false, false, null, Map.of("F2Key", "does-not-exist"), 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(0);
|
|
|
|
|
|
|
|
|
|
// Act & Assert 4
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, null, null, Map.of("Key-does-not-exist", "F1Value"), 0, 10, false);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, false, false, null, Map.of("Key-does-not-exist", "F1Value"), 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(0);
|
|
|
|
|
|
|
|
|
|
// Act & Assert 5
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, null, null, Map.of("F1Key", "F1Value", "F2Key", "F2Value"), 0, 10, false);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, false, false, null, Map.of("F1Key", "F1Value", "F2Key", "F2Value"), 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(0);
|
|
|
|
|
|
|
|
|
|
// Act & Assert 6
|
|
|
|
|
documentUpdateService.updateDocument("fileId1", "UserId", DossierStatus.ACTIVE, WorkflowStatus.NEW.name(), Map.of("F1Key", "F1ValueNEW"));
|
|
|
|
|
documentUpdateService.updateDocument("fileId1", "UserId", false, false, WorkflowStatus.NEW.name(), Map.of("F1Key", "F1ValueNEW"));
|
|
|
|
|
Thread.sleep(UPDATE_TIMER);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, null, null, Map.of("F1Key", "F1Value"), 0, 10, false);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, false, false, null, Map.of("F1Key", "F1Value"), 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(0);
|
|
|
|
|
|
|
|
|
|
// Act & Assert 7
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, null, null, Map.of("F1Key", "F1ValueNEW"), 0, 10, false);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, false, false, null, Map.of("F1Key", "F1ValueNEW"), 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(1);
|
|
|
|
|
assertThat(result.getMatchedDocuments().stream().map(MatchedDocument::getFileId)).contains("fileId1");
|
|
|
|
|
|
|
|
|
|
// Act & Assert 8
|
|
|
|
|
documentUpdateService.updateDocument("fileId1", "UserId", DossierStatus.ACTIVE, WorkflowStatus.NEW.name(), Map.of("F1Key", "F1Value", "F2Key", "F2Value"));
|
|
|
|
|
documentUpdateService.updateDocument("fileId1", "UserId", false, false, WorkflowStatus.NEW.name(), Map.of("F1Key", "F1Value", "F2Key", "F2Value"));
|
|
|
|
|
Thread.sleep(UPDATE_TIMER);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, null, null, Map.of("F1Key", "F1Value", "F2Key", "F2Value"), 0, 10, false);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, false, false, null, Map.of("F1Key", "F1Value", "F2Key", "F2Value"), 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(1);
|
|
|
|
|
assertThat(result.getMatchedDocuments().stream().map(MatchedDocument::getFileId)).contains("fileId1");
|
|
|
|
|
|
|
|
|
|
// Act & Assert 9
|
|
|
|
|
documentUpdateService.updateDocument("fileId1", "UserId", DossierStatus.ACTIVE, WorkflowStatus.NEW.name(), null);
|
|
|
|
|
documentUpdateService.updateDocument("fileId1", "UserId", false, false, WorkflowStatus.NEW.name(), null);
|
|
|
|
|
Thread.sleep(UPDATE_TIMER);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, null, null, Map.of("F1Key", "F1Value"), 0, 10, false);
|
|
|
|
|
result = searchService.search("S-Metolachlor", null, null, null, null, false, false, null, Map.of("F1Key", "F1Value"), 0, 10, false);
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -332,11 +329,11 @@ public class SearchTest extends AbstractElasticsearchIntegrationTest {
|
|
|
|
|
ClassPathResource textResource2 = new ClassPathResource("files/Text2.json");
|
|
|
|
|
Text text2 = objectMapper.readValue(textResource2.getInputStream(), Text.class);
|
|
|
|
|
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", "Single Study - Oral (Gavage) Mouse.pdf", text, "UserId", DossierStatus.ACTIVE, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
documentIndexService.indexDocument("template2", "dossierId2", "fileId2", "S-Metolachlor_RAR_01_Volume_1_2018-09-06.pdf", text2, "UserId", DossierStatus.ACTIVE, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", "Single Study - Oral (Gavage) Mouse.pdf", text, "UserId", false, false, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
documentIndexService.indexDocument("template2", "dossierId2", "fileId2", "S-Metolachlor_RAR_01_Volume_1_2018-09-06.pdf", text2, "UserId", false, false, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
|
|
|
|
|
// Act & Assert 1
|
|
|
|
|
SearchResult result = searchService.search("S-Metolachlor", null, Arrays.asList("dossierId1", "dossierId2"), null, null, null, null, null, 0, 10, false);
|
|
|
|
|
SearchResult result = searchService.search("S-Metolachlor", null, Arrays.asList("dossierId1", "dossierId2"), null, null, false, false, null, null, 0, 10, false);
|
|
|
|
|
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(1);
|
|
|
|
|
|
|
|
|
|
@ -344,17 +341,17 @@ public class SearchTest extends AbstractElasticsearchIntegrationTest {
|
|
|
|
|
documentDeleteService.deleteDocument("fileId1");
|
|
|
|
|
|
|
|
|
|
// Act & Assert 2
|
|
|
|
|
result = searchService.search("hans klaus single", null, Arrays.asList("dossierId1", "dossierId2"), null, null, null, null, null, 0, 10, true);
|
|
|
|
|
result = searchService.search("hans klaus single", null, Arrays.asList("dossierId1", "dossierId2"), null, null, false, false, null, null, 0, 10, true);
|
|
|
|
|
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(1);
|
|
|
|
|
|
|
|
|
|
// Act & Assert 3
|
|
|
|
|
result = searchService.search("hans klaus single", null, Arrays.asList("dossierId3", "dossierId4"), null, null, null, null, null, 0, 10, true);
|
|
|
|
|
result = searchService.search("hans klaus single", null, Arrays.asList("dossierId3", "dossierId4"), null, null, false, false, null, null, 0, 10, true);
|
|
|
|
|
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(0);
|
|
|
|
|
|
|
|
|
|
// Act & Assert 4
|
|
|
|
|
result = searchService.search("hans klaus single", Arrays.asList("template1", "template2"), null, null, null, null, null, null, 0, 10, true);
|
|
|
|
|
result = searchService.search("hans klaus single", Arrays.asList("template1", "template2"), null, null, null, false, false, null, null, 0, 10, true);
|
|
|
|
|
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(1);
|
|
|
|
|
|
|
|
|
|
@ -371,10 +368,10 @@ public class SearchTest extends AbstractElasticsearchIntegrationTest {
|
|
|
|
|
Text text = objectMapper.readValue(textResource.getInputStream(), Text.class);
|
|
|
|
|
String fileName = "luke-skywalker-42.pdf";
|
|
|
|
|
String searchString = "szedhsegkekhglghserlkghrsdvkerxyfdbvkrdjgh";
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", fileName, text, "UserId", DossierStatus.ACTIVE, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", fileName, text, "UserId", false, false, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
|
|
|
|
|
// Act
|
|
|
|
|
SearchResult result = searchService.search(searchString, null, Arrays.asList("dossierId1"), null, null, null, null, null, 1, 10, true);
|
|
|
|
|
SearchResult result = searchService.search(searchString, null, Arrays.asList("dossierId1"), null, null, false, false, null, null, 1, 10, true);
|
|
|
|
|
|
|
|
|
|
// Assert
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(0);
|
|
|
|
|
@ -391,10 +388,10 @@ public class SearchTest extends AbstractElasticsearchIntegrationTest {
|
|
|
|
|
Text text = objectMapper.readValue(textResource.getInputStream(), Text.class);
|
|
|
|
|
String fileName = "luke-skywalker-42.pdf";
|
|
|
|
|
String searchString = fileName;
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", fileName, text, "UserId", DossierStatus.ACTIVE, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", fileName, text, "UserId", false, false, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
|
|
|
|
|
// Act
|
|
|
|
|
SearchResult result = searchService.search(searchString, null, Arrays.asList("dossierId1"), null, null, null, null, null, 0, 10, true);
|
|
|
|
|
SearchResult result = searchService.search(searchString, null, Arrays.asList("dossierId1"), null, null, false, false, null, null, 0, 10, true);
|
|
|
|
|
|
|
|
|
|
// Assert
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(1);
|
|
|
|
|
@ -413,10 +410,10 @@ public class SearchTest extends AbstractElasticsearchIntegrationTest {
|
|
|
|
|
Text text = objectMapper.readValue(textResource.getInputStream(), Text.class);
|
|
|
|
|
String fileName = "luke-blankwalker 42.pdf";
|
|
|
|
|
String searchString = fileName;
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", fileName, text, "UserId", DossierStatus.ACTIVE, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", fileName, text, "UserId", false, false, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
|
|
|
|
|
// Act
|
|
|
|
|
SearchResult result = searchService.search(searchString, null, Arrays.asList("dossierId1"), null, null, null, null, null, 0, 10, true);
|
|
|
|
|
SearchResult result = searchService.search(searchString, null, Arrays.asList("dossierId1"), null, null, false, false, null, null, 0, 10, true);
|
|
|
|
|
|
|
|
|
|
// Assert
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(1);
|
|
|
|
|
@ -436,10 +433,10 @@ public class SearchTest extends AbstractElasticsearchIntegrationTest {
|
|
|
|
|
Text text = objectMapper.readValue(textResource.getInputStream(), Text.class);
|
|
|
|
|
String fileName = "luke-skywalker-42.pdf";
|
|
|
|
|
String searchString = "luke";
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", fileName, text, "UserId", DossierStatus.ACTIVE, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", fileName, text, "UserId", false, false, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
|
|
|
|
|
// Act
|
|
|
|
|
SearchResult result = searchService.search(searchString, null, Arrays.asList("dossierId1"), null, null, null, null, null, 0, 10, true);
|
|
|
|
|
SearchResult result = searchService.search(searchString, null, Arrays.asList("dossierId1"), null, null, false, false, null, null, 0, 10, true);
|
|
|
|
|
|
|
|
|
|
// Assert
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(1);
|
|
|
|
|
@ -458,10 +455,10 @@ public class SearchTest extends AbstractElasticsearchIntegrationTest {
|
|
|
|
|
Text text = objectMapper.readValue(textResource.getInputStream(), Text.class);
|
|
|
|
|
String fileName = "luke-skywalker-42.pdf";
|
|
|
|
|
String searchString = "luke-skywalker-42";
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", fileName, text, "UserId", DossierStatus.ACTIVE, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", fileName, text, "UserId", false, false, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
|
|
|
|
|
// Act
|
|
|
|
|
SearchResult result = searchService.search(searchString, null, Arrays.asList("dossierId1"), null, null, null, null, null, 0, 10, true);
|
|
|
|
|
SearchResult result = searchService.search(searchString, null, Arrays.asList("dossierId1"), null, null, false, false, null, null, 0, 10, true);
|
|
|
|
|
|
|
|
|
|
// Assert
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(1);
|
|
|
|
|
@ -481,10 +478,10 @@ public class SearchTest extends AbstractElasticsearchIntegrationTest {
|
|
|
|
|
String fileName = "luke-skywalker-42.pdf";
|
|
|
|
|
String matchedString = fileName;
|
|
|
|
|
String searchString = "\"" + matchedString + "\"";
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", fileName, text, "UserId", DossierStatus.ACTIVE, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", fileName, text, "UserId", false, false, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
|
|
|
|
|
// Act
|
|
|
|
|
SearchResult result = searchService.search(searchString, null, Arrays.asList("dossierId1"), null, null, null, null, null, 0, 10, true);
|
|
|
|
|
SearchResult result = searchService.search(searchString, null, Arrays.asList("dossierId1"), null, null, false, false, null, null, 0, 10, true);
|
|
|
|
|
|
|
|
|
|
// Assert
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(1);
|
|
|
|
|
@ -504,10 +501,10 @@ public class SearchTest extends AbstractElasticsearchIntegrationTest {
|
|
|
|
|
String fileName = "luke-skywalker-42.pdf";
|
|
|
|
|
String matchedString = "luke";
|
|
|
|
|
String searchString = "\"" + matchedString + "\"";
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", fileName, text, "UserId", DossierStatus.ACTIVE, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", fileName, text, "UserId", false, false, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
|
|
|
|
|
// Act
|
|
|
|
|
SearchResult result = searchService.search(searchString, null, Arrays.asList("dossierId1"), null, null, null, null, null, 0, 10, true);
|
|
|
|
|
SearchResult result = searchService.search(searchString, null, Arrays.asList("dossierId1"), null, null, false, false, null, null, 0, 10, true);
|
|
|
|
|
|
|
|
|
|
// Assert
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(1);
|
|
|
|
|
@ -527,10 +524,10 @@ public class SearchTest extends AbstractElasticsearchIntegrationTest {
|
|
|
|
|
String fileName = "luke-skywalker-42.pdf";
|
|
|
|
|
String matchedString = "luke-skywalker-42";
|
|
|
|
|
String searchString = "\"luke-skywalker-42\"";
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", fileName, text, "UserId", DossierStatus.ACTIVE, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", fileName, text, "UserId", false, false, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
|
|
|
|
|
// Act
|
|
|
|
|
SearchResult result = searchService.search(searchString, null, Arrays.asList("dossierId1"), null, null, null, null, null, 0, 10, true);
|
|
|
|
|
SearchResult result = searchService.search(searchString, null, Arrays.asList("dossierId1"), null, null, false, false, null, null, 0, 10, true);
|
|
|
|
|
|
|
|
|
|
// Assert
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(1);
|
|
|
|
|
@ -550,10 +547,10 @@ public class SearchTest extends AbstractElasticsearchIntegrationTest {
|
|
|
|
|
String fileName = "luke-blankwalker 42.pdf";
|
|
|
|
|
String matchedString = fileName;
|
|
|
|
|
String searchString = "\"" + matchedString + "\"";
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", fileName, text, "UserId", DossierStatus.ACTIVE, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", fileName, text, "UserId", false, false, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
|
|
|
|
|
// Act
|
|
|
|
|
SearchResult result = searchService.search(searchString, null, Arrays.asList("dossierId1"), null, null, null, null, null, 0, 10, true);
|
|
|
|
|
SearchResult result = searchService.search(searchString, null, Arrays.asList("dossierId1"), null, null, false, false, null, null, 0, 10, true);
|
|
|
|
|
|
|
|
|
|
// Assert
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(1);
|
|
|
|
|
@ -572,10 +569,10 @@ public class SearchTest extends AbstractElasticsearchIntegrationTest {
|
|
|
|
|
Text text = objectMapper.readValue(textResource.getInputStream(), Text.class);
|
|
|
|
|
String fileName = "luke-skywalker-42.pdf";
|
|
|
|
|
String searchString = "14C]-SDS-46851";
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", fileName, text, "UserId", DossierStatus.ACTIVE, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
documentIndexService.indexDocument("template1", "dossierId1", "fileId1", fileName, text, "UserId", false, false, WorkflowStatus.NEW, Map.of("F1Key", "F1Value"));
|
|
|
|
|
|
|
|
|
|
// Act
|
|
|
|
|
SearchResult result = searchService.search(searchString, null, Arrays.asList("dossierId1"), null, null, null, null, null, 0, 10, true);
|
|
|
|
|
SearchResult result = searchService.search(searchString, null, Arrays.asList("dossierId1"), null, null, false, false, null, null, 0, 10, true);
|
|
|
|
|
|
|
|
|
|
// Assert
|
|
|
|
|
assertThat(result.getMatchedDocuments().size()).isEqualTo(1);
|
|
|
|
|
|