[Task 72498] implemented the Sort option for the Process Search and added tests

This commit is contained in:
Raf Ponsaerts
2020-08-14 15:26:04 +02:00
parent 4c605cfff3
commit 67d04b2254
5 changed files with 280 additions and 1 deletions

View File

@@ -9,6 +9,8 @@ package org.dspace.builder;
import java.io.IOException;
import java.sql.SQLException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;
import org.dspace.authorize.AuthorizeException;
@@ -48,6 +50,13 @@ public class ProcessBuilder extends AbstractBuilder<Process, ProcessService> {
return this;
}
public ProcessBuilder withStartAndEndTime(String startTime, String endTime) throws ParseException {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy");
process.setStartTime(simpleDateFormat.parse(startTime));
process.setFinishedTime(simpleDateFormat.parse(endTime));
return this;
}
@Override
public void cleanup() throws Exception {
try (Context c = new Context()) {