TSK-1428: fixed tests for QueryClassificationHistory due to current date issue

This commit is contained in:
Mustapha Zorgati 2020-10-26 23:15:23 +01:00
parent ef2c3da954
commit fe393ca51c
2 changed files with 2 additions and 3 deletions

View File

@ -30,7 +30,7 @@ public interface ClassificationHistoryQuery
* Add your created TimeInterval to your query. * Add your created TimeInterval to your query.
* *
* @param createdWithin the {@link TimeInterval} within which the searched-for classifications * @param createdWithin the {@link TimeInterval} within which the searched-for classifications
* were created. * were created. Both borders in each {@link TimeInterval} are inclusive.
* @return the query * @return the query
*/ */
ClassificationHistoryQuery createdWithin(TimeInterval... createdWithin); ClassificationHistoryQuery createdWithin(TimeInterval... createdWithin);

View File

@ -4,7 +4,6 @@ import static org.assertj.core.api.Assertions.assertThat;
import acceptance.AbstractAccTest; import acceptance.AbstractAccTest;
import java.time.Instant; import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -135,7 +134,7 @@ class QueryClassificationHistoryAccTest extends AbstractAccTest {
assertThat(returnValues).hasSize(6); assertThat(returnValues).hasSize(6);
TimeInterval timeInterval = TimeInterval timeInterval =
new TimeInterval(Instant.now().minus(1000L, ChronoUnit.DAYS), Instant.now()); new TimeInterval(Instant.parse("2018-01-28T14:55:00Z"), Instant.now());
returnValues = returnValues =
historyService.createClassificationHistoryQuery().createdWithin(timeInterval).list(); historyService.createClassificationHistoryQuery().createdWithin(timeInterval).list();
assertThat(returnValues).hasSize(11); assertThat(returnValues).hasSize(11);