From 635383a18e2531a0d070a0deb0a7090346c0084d Mon Sep 17 00:00:00 2001 From: frolov Date: Mon, 7 Sep 2020 14:52:16 +0300 Subject: [PATCH] ORBR-1068 - fix filter for date --- .../core/util/filter/provider/impl/DateValueProvider.java | 3 +-- .../test/java/io/tesler/core/dao/SearchSpecificationTest.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tesler-core/src/main/java/io/tesler/core/util/filter/provider/impl/DateValueProvider.java b/tesler-core/src/main/java/io/tesler/core/util/filter/provider/impl/DateValueProvider.java index aa7a1d902e..9c710824b7 100644 --- a/tesler-core/src/main/java/io/tesler/core/util/filter/provider/impl/DateValueProvider.java +++ b/tesler-core/src/main/java/io/tesler/core/util/filter/provider/impl/DateValueProvider.java @@ -34,7 +34,6 @@ import java.lang.reflect.Field; import java.time.LocalDateTime; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import static io.tesler.core.controller.param.SearchOperation.CONTAINS_ONE_OF; @@ -63,7 +62,7 @@ protected List getProviderParameterValues(Field dtoField, } else { setClassifyDateParameterDateValue(dataParameter, filterParam, FieldDTO.isTzAware(dtoField), searchParam, result); } - result = Collections.singletonList(dataParameter); + result.add(dataParameter); return result; } diff --git a/tesler-core/src/test/java/io/tesler/core/dao/SearchSpecificationTest.java b/tesler-core/src/test/java/io/tesler/core/dao/SearchSpecificationTest.java index a6f6000c20..4ba75a47b8 100644 --- a/tesler-core/src/test/java/io/tesler/core/dao/SearchSpecificationTest.java +++ b/tesler-core/src/test/java/io/tesler/core/dao/SearchSpecificationTest.java @@ -91,7 +91,7 @@ void setUp() { @Test void searchSpecTest() { FilterParameters fp = FilterParameters.fromMap(successMap); - Assertions.assertEquals(MetadataUtils.mapSearchParamsToPOJO(TestResponseDto.class, fp, providers).size(), 30); + Assertions.assertEquals(MetadataUtils.mapSearchParamsToPOJO(TestResponseDto.class, fp, providers).size(), 31); } @Test