91354: Fix test_forceReindexAfterNewVersionInWorkspace

Re-enable commit d549e6e58a
This commit is contained in:
Bruno Roemers
2022-05-31 17:44:40 +02:00
parent 60c8faf234
commit acc968f1ce
2 changed files with 5 additions and 7 deletions

View File

@@ -193,10 +193,9 @@ public class ItemIndexFactoryImpl extends DSpaceObjectIndexFactoryImpl<Indexable
Version latestVersion = versionHistoryService.getLatestVersion(context, history); Version latestVersion = versionHistoryService.getLatestVersion(context, history);
// find the latest version of the given item that is archived // find the latest version of the given item that is archived
// TODO temp disabled while (latestVersion != null && !latestVersion.getItem().isArchived()) {
//while (latestVersion != null && !latestVersion.getItem().isArchived()) { latestVersion = versionHistoryService.getPrevious(context, history, latestVersion);
// latestVersion = versionHistoryService.getPrevious(context, history, latestVersion); }
//}
// could not find an archived version of the given item // could not find an archived version of the given item
if (latestVersion == null) { if (latestVersion == null) {
@@ -206,8 +205,7 @@ public class ItemIndexFactoryImpl extends DSpaceObjectIndexFactoryImpl<Indexable
} }
// sanity check // sanity check
// TODO temp disabled assert latestVersion.getItem().isArchived();
//assert latestVersion.getItem().isArchived();
return item.equals(latestVersion.getItem()); return item.equals(latestVersion.getItem());
} }

View File

@@ -2025,7 +2025,7 @@ public class DiscoveryVersioningIT extends AbstractControllerIntegrationTest {
assertEquals(0, mdvs8.get(0).getPlace()); assertEquals(0, mdvs8.get(0).getPlace());
verifySolrField(pro1_1, "relation.isPublicationOfProject", List.of(pub1_2.getID().toString())); verifySolrField(pro1_1, "relation.isPublicationOfProject", List.of(pub1_2.getID().toString()));
verifySolrField(pro1_1, "archived", List.of("true")); verifySolrField(pro1_1, "archived", List.of("true"));
verifySolrField(pro1_1, "latestVersion", List.of(true));// TODO expect failure here verifySolrField(pro1_1, "latestVersion", List.of(true));
// after create pro 1.2 - test relation.*.latestForDiscovery metadata of project 1.1 // after create pro 1.2 - test relation.*.latestForDiscovery metadata of project 1.1
List<MetadataValue> mdvs8a = itemService List<MetadataValue> mdvs8a = itemService