2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2019-2021 Nordix Foundation.
4 * Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
5 * ================================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 * SPDX-License-Identifier: Apache-2.0
19 * ============LICENSE_END=========================================================
22 package org.onap.policy.models.dao;
24 import static org.assertj.core.api.Assertions.assertThatCode;
25 import static org.assertj.core.api.Assertions.assertThatThrownBy;
26 import static org.junit.Assert.assertEquals;
27 import static org.junit.Assert.assertNotNull;
28 import static org.junit.Assert.assertNull;
30 import java.time.Instant;
31 import java.util.ArrayList;
32 import java.util.HashMap;
33 import java.util.List;
35 import java.util.Properties;
37 import java.util.TreeSet;
38 import java.util.UUID;
39 import org.eclipse.persistence.config.PersistenceUnitProperties;
40 import org.junit.Test;
41 import org.onap.policy.models.base.PfConceptKey;
42 import org.onap.policy.models.base.PfModelException;
43 import org.onap.policy.models.base.PfReferenceKey;
44 import org.onap.policy.models.base.PfTimestampKey;
45 import org.onap.policy.models.dao.impl.DefaultPfDao;
50 public class EntityTest {
51 private static final String DESCRIPTION2 = "key description 2";
52 private static final String DESCRIPTION1 = "key description 1";
53 private static final String DESCRIPTION0 = "key description 0";
54 private static final String ENTITY0 = "Entity0";
55 private static final String UUID2 = "00000000-0000-0000-0000-000000000002";
56 private static final String UUID1 = "00000000-0000-0000-0000-000000000001";
57 private static final String UUID0 = "00000000-0000-0000-0000-000000000000";
58 private static final String VERSION003 = "0.0.3";
59 private static final String VERSION002 = "0.0.2";
60 private static final String VERSION001 = "0.0.1";
61 private static final Instant TIMESTAMP0 = Instant.ofEpochSecond(1613494293);
62 private static final Instant TIMESTAMP1 = Instant.ofEpochSecond(1613494293).plusSeconds(55);
63 private static final Instant TIMESTAMP2 = Instant.ofEpochSecond(1613494293).plusSeconds(90);
67 public void testEntityTestSanity() throws PfModelException {
68 final DaoParameters daoParameters = new DaoParameters();
70 Properties jdbcProperties = new Properties();
72 jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_DRIVER, "org.h2.Driver");
73 jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_URL, "jdbc:h2:mem:EntityTest");
74 jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_USER, "sa");
75 jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_PASSWORD, "");
78 daoParameters.setJdbcProperties(jdbcProperties);
80 pfDao = new PfDaoFactory().createPfDao(daoParameters);
82 assertThatThrownBy(() -> pfDao.init(null)).hasMessage("Policy Framework persistence unit parameter not set");
84 assertThatThrownBy(() -> pfDao.init(daoParameters))
85 .hasMessage("Policy Framework persistence unit parameter not set");
87 daoParameters.setPluginClass("somewhere.over.the.rainbow");
88 daoParameters.setPersistenceUnit("Dorothy");
90 assertThatThrownBy(() -> pfDao.init(daoParameters))
91 .hasMessage("Creation of Policy Framework persistence unit \"Dorothy\" failed");
93 assertThatThrownBy(() -> pfDao.create(new PfConceptKey()))
94 .hasMessage("Policy Framework DAO has not been initialized");
100 public void testEntityTestAllOpsJpa() throws PfModelException {
102 final DaoParameters daoParameters = new DaoParameters();
103 daoParameters.setPluginClass(DefaultPfDao.class.getName());
104 daoParameters.setPersistenceUnit("DaoTest");
106 Properties jdbcProperties = new Properties();
107 jdbcProperties.setProperty("javax.persistence.jdbc.driver", "org.h2.Driver");
108 jdbcProperties.setProperty("javax.persistence.jdbc.url", "jdbc:h2:mem:EntityTest");
109 jdbcProperties.setProperty("javax.persistence.jdbc.user", "sa");
110 jdbcProperties.setProperty("javax.persistence.jdbc.password", "");
112 daoParameters.setJdbcProperties(jdbcProperties);
114 pfDao = new PfDaoFactory().createPfDao(daoParameters);
115 pfDao.init(daoParameters);
121 testgetFilteredOps();
127 public void testEntityTestBadVals() throws PfModelException {
128 final DaoParameters daoParameters = new DaoParameters();
129 daoParameters.setPluginClass(DefaultPfDao.class.getName());
130 daoParameters.setPersistenceUnit("DaoTest");
132 pfDao = new PfDaoFactory().createPfDao(daoParameters);
133 pfDao.init(daoParameters);
135 final PfConceptKey nullKey = null;
136 final PfReferenceKey nullRefKey = null;
137 final PfTimestampKey nullTimeKey = null;
138 final List<PfConceptKey> nullKeyList = null;
139 final List<PfConceptKey> emptyKeyList = new ArrayList<>();
140 final List<PfReferenceKey> nullRKeyList = null;
141 final List<PfReferenceKey> emptyRKeyList = new ArrayList<>();
143 pfDao.create(nullKey);
144 pfDao.createCollection(nullKeyList);
145 pfDao.createCollection(emptyKeyList);
147 pfDao.delete(nullKey);
148 pfDao.deleteCollection(nullKeyList);
149 pfDao.deleteCollection(emptyKeyList);
150 pfDao.delete(PfConceptKey.class, nullKey);
151 pfDao.delete(PfReferenceKey.class, nullRefKey);
152 pfDao.delete(PfTimestampKey.class, nullTimeKey);
153 pfDao.deleteByConceptKey(PfConceptKey.class, nullKeyList);
154 pfDao.deleteByConceptKey(PfConceptKey.class, emptyKeyList);
155 pfDao.deleteByReferenceKey(PfReferenceKey.class, nullRKeyList);
156 pfDao.deleteByReferenceKey(PfReferenceKey.class, emptyRKeyList);
158 pfDao.get(null, nullKey);
159 pfDao.get(null, nullRefKey);
160 pfDao.get(null, nullTimeKey);
162 pfDao.getAll(null, nullKey);
163 pfDao.getConcept(null, nullKey);
164 pfDao.getConcept(PfConceptKey.class, nullKey);
165 pfDao.getConcept(null, nullRefKey);
166 pfDao.getConcept(PfReferenceKey.class, nullRefKey);
169 assertThatCode(() -> pfDao.close()).doesNotThrowAnyException();
172 private void testAllOps() {
173 final PfConceptKey aKey0 = new PfConceptKey("A-KEY0", VERSION001);
174 final PfConceptKey aKey1 = new PfConceptKey("A-KEY1", VERSION001);
175 final PfConceptKey aKey2 = new PfConceptKey("A-KEY2", VERSION001);
176 final DummyConceptEntity keyInfo0 = new DummyConceptEntity(aKey0,
177 UUID.fromString(UUID0), DESCRIPTION0);
178 final DummyConceptEntity keyInfo1 = new DummyConceptEntity(aKey1,
179 UUID.fromString(UUID1), DESCRIPTION1);
180 final DummyConceptEntity keyInfo2 = new DummyConceptEntity(aKey2,
181 UUID.fromString(UUID2), DESCRIPTION2);
183 pfDao.create(keyInfo0);
185 final DummyConceptEntity keyInfoBack0 = pfDao.get(DummyConceptEntity.class, aKey0);
186 assertEquals(keyInfo0, keyInfoBack0);
188 final DummyConceptEntity keyInfoBackNull = pfDao.get(DummyConceptEntity.class, PfConceptKey.getNullKey());
189 assertNull(keyInfoBackNull);
191 final DummyConceptEntity keyInfoBack1 = pfDao.getConcept(DummyConceptEntity.class, aKey0);
192 assertEquals(keyInfoBack0, keyInfoBack1);
194 final DummyConceptEntity keyInfoBack2 =
195 pfDao.getConcept(DummyConceptEntity.class, new PfConceptKey("A-KEY3", VERSION001));
196 assertNull(keyInfoBack2);
198 final Set<DummyConceptEntity> keyInfoSetIn = new TreeSet<>();
199 keyInfoSetIn.add(keyInfo1);
200 keyInfoSetIn.add(keyInfo2);
202 pfDao.createCollection(keyInfoSetIn);
204 Set<DummyConceptEntity> keyInfoSetOut = new TreeSet<>(pfDao.getAll(DummyConceptEntity.class));
206 keyInfoSetIn.add(keyInfo0);
207 assertEquals(keyInfoSetIn, keyInfoSetOut);
209 pfDao.delete(keyInfo1);
210 keyInfoSetIn.remove(keyInfo1);
211 keyInfoSetOut = new TreeSet<>(pfDao.getAll(DummyConceptEntity.class));
212 assertEquals(keyInfoSetIn, keyInfoSetOut);
214 pfDao.deleteCollection(keyInfoSetIn);
215 keyInfoSetOut = new TreeSet<>(pfDao.getAll(DummyConceptEntity.class));
216 assertEquals(0, keyInfoSetOut.size());
218 keyInfoSetIn.add(keyInfo0);
219 keyInfoSetIn.add(keyInfo1);
220 keyInfoSetIn.add(keyInfo0);
221 pfDao.createCollection(keyInfoSetIn);
222 keyInfoSetOut = new TreeSet<>(pfDao.getAll(DummyConceptEntity.class));
223 assertEquals(keyInfoSetIn, keyInfoSetOut);
225 pfDao.delete(DummyConceptEntity.class, aKey0);
226 keyInfoSetOut = new TreeSet<>(pfDao.getAll(DummyConceptEntity.class));
227 assertEquals(2, keyInfoSetOut.size());
228 assertEquals(2, pfDao.size(DummyConceptEntity.class));
230 final Set<PfConceptKey> keySetIn = new TreeSet<>();
234 final int deletedCount = pfDao.deleteByConceptKey(DummyConceptEntity.class, keySetIn);
235 assertEquals(2, deletedCount);
237 keyInfoSetOut = new TreeSet<>(pfDao.getAll(DummyConceptEntity.class));
238 assertEquals(0, keyInfoSetOut.size());
240 keyInfoSetIn.add(keyInfo0);
241 keyInfoSetIn.add(keyInfo1);
242 keyInfoSetIn.add(keyInfo0);
243 pfDao.createCollection(keyInfoSetIn);
244 keyInfoSetOut = new TreeSet<>(pfDao.getAll(DummyConceptEntity.class));
245 assertEquals(keyInfoSetIn, keyInfoSetOut);
247 pfDao.deleteAll(DummyConceptEntity.class);
248 assertEquals(0, pfDao.size(DummyConceptEntity.class));
250 final PfConceptKey owner0Key = new PfConceptKey("Owner0", VERSION001);
251 final PfConceptKey owner1Key = new PfConceptKey("Owner1", VERSION001);
252 final PfConceptKey owner2Key = new PfConceptKey("Owner2", VERSION001);
253 final PfConceptKey owner3Key = new PfConceptKey("Owner3", VERSION001);
254 final PfConceptKey owner4Key = new PfConceptKey("Owner4", VERSION001);
255 final PfConceptKey owner5Key = new PfConceptKey("Owner5", VERSION001);
257 pfDao.create(new DummyReferenceEntity(new PfReferenceKey(owner0Key, ENTITY0), 100.0));
258 pfDao.create(new DummyReferenceEntity(new PfReferenceKey(owner0Key, "Entity1"), 101.0));
259 pfDao.create(new DummyReferenceEntity(new PfReferenceKey(owner0Key, "Entity2"), 102.0));
260 pfDao.create(new DummyReferenceEntity(new PfReferenceKey(owner0Key, "Entity3"), 103.0));
261 pfDao.create(new DummyReferenceEntity(new PfReferenceKey(owner0Key, "Entity4"), 104.0));
262 pfDao.create(new DummyReferenceEntity(new PfReferenceKey(owner1Key, "Entity5"), 105.0));
263 pfDao.create(new DummyReferenceEntity(new PfReferenceKey(owner1Key, "Entity6"), 106.0));
264 pfDao.create(new DummyReferenceEntity(new PfReferenceKey(owner1Key, "Entity7"), 107.0));
265 pfDao.create(new DummyReferenceEntity(new PfReferenceKey(owner2Key, "Entity8"), 108.0));
266 pfDao.create(new DummyReferenceEntity(new PfReferenceKey(owner2Key, "Entity9"), 109.0));
267 pfDao.create(new DummyReferenceEntity(new PfReferenceKey(owner3Key, "EntityA"), 110.0));
268 pfDao.create(new DummyReferenceEntity(new PfReferenceKey(owner4Key, "EntityB"), 111.0));
269 pfDao.create(new DummyReferenceEntity(new PfReferenceKey(owner5Key, "EntityC"), 112.0));
270 pfDao.create(new DummyReferenceEntity(new PfReferenceKey(owner5Key, "EntityD"), 113.0));
271 pfDao.create(new DummyReferenceEntity(new PfReferenceKey(owner5Key, "EntityE"), 114.0));
272 pfDao.create(new DummyReferenceEntity(new PfReferenceKey(owner5Key, "EntityF"), 115.0));
274 TreeSet<DummyReferenceEntity> testEntitySetOut =
275 new TreeSet<>(pfDao.getAll(DummyReferenceEntity.class));
276 assertEquals(16, testEntitySetOut.size());
278 testEntitySetOut = new TreeSet<>(pfDao.getAll(DummyReferenceEntity.class, owner0Key));
279 assertEquals(5, testEntitySetOut.size());
281 testEntitySetOut = new TreeSet<>(pfDao.getAll(DummyReferenceEntity.class, owner1Key));
282 assertEquals(3, testEntitySetOut.size());
284 testEntitySetOut = new TreeSet<>(pfDao.getAll(DummyReferenceEntity.class, owner2Key));
285 assertEquals(2, testEntitySetOut.size());
287 testEntitySetOut = new TreeSet<>(pfDao.getAll(DummyReferenceEntity.class, owner3Key));
288 assertEquals(1, testEntitySetOut.size());
290 testEntitySetOut = new TreeSet<>(pfDao.getAll(DummyReferenceEntity.class, owner4Key));
291 assertEquals(1, testEntitySetOut.size());
293 testEntitySetOut = new TreeSet<>(pfDao.getAll(DummyReferenceEntity.class, owner5Key));
294 assertEquals(4, testEntitySetOut.size());
296 assertNotNull(pfDao.get(DummyReferenceEntity.class, new PfReferenceKey(owner0Key, ENTITY0)));
297 assertNotNull(pfDao.getConcept(DummyReferenceEntity.class, new PfReferenceKey(owner0Key, ENTITY0)));
298 assertNull(pfDao.get(DummyReferenceEntity.class, new PfReferenceKey(owner0Key, "Entity1000")));
299 assertNull(pfDao.getConcept(DummyReferenceEntity.class, new PfReferenceKey(owner0Key, "Entity1000")));
300 pfDao.delete(DummyReferenceEntity.class, new PfReferenceKey(owner0Key, ENTITY0));
302 final Set<PfReferenceKey> rKeySetIn = new TreeSet<>();
303 rKeySetIn.add(new PfReferenceKey(owner4Key, "EntityB"));
304 rKeySetIn.add(new PfReferenceKey(owner5Key, "EntityD"));
306 final int deletedRCount = pfDao.deleteByReferenceKey(DummyReferenceEntity.class, rKeySetIn);
307 assertEquals(2, deletedRCount);
309 pfDao.update(new DummyReferenceEntity(new PfReferenceKey(owner5Key, "EntityF"), 120.0));
311 final PfTimestampKey atKey0 = new PfTimestampKey("AT-KEY0", VERSION001, TIMESTAMP0);
312 final PfTimestampKey atKey1 = new PfTimestampKey("AT-KEY1", VERSION001, TIMESTAMP1);
313 final PfTimestampKey atKey2 = new PfTimestampKey("AT-KEY2", VERSION001, TIMESTAMP2);
314 final DummyTimestampEntity tkeyInfo0 = new DummyTimestampEntity(atKey0, 200.0);
315 final DummyTimestampEntity tkeyInfo1 = new DummyTimestampEntity(atKey1, 200.1);
316 final DummyTimestampEntity tkeyInfo2 = new DummyTimestampEntity(atKey2, 200.2);
318 pfDao.create(tkeyInfo0);
320 final DummyTimestampEntity tkeyInfoBack0 = pfDao.get(DummyTimestampEntity.class, atKey0);
321 assertEquals(tkeyInfo0, tkeyInfoBack0);
323 final DummyTimestampEntity tkeyInfoBackNull =
324 pfDao.get(DummyTimestampEntity.class, PfTimestampKey.getNullKey());
325 assertNull(tkeyInfoBackNull);
329 final Set<DummyTimestampEntity> tkeyInfoSetIn = new TreeSet<>();
330 tkeyInfoSetIn.add(tkeyInfo1);
331 tkeyInfoSetIn.add(tkeyInfo2);
333 pfDao.createCollection(tkeyInfoSetIn);
335 Set<DummyTimestampEntity> tkeyInfoSetOut = new TreeSet<>(pfDao.getAll(DummyTimestampEntity.class));
337 tkeyInfoSetIn.add(tkeyInfo0);
338 assertEquals(tkeyInfoSetIn, tkeyInfoSetOut);
340 pfDao.delete(tkeyInfo1);
341 tkeyInfoSetIn.remove(tkeyInfo1);
342 tkeyInfoSetOut = new TreeSet<>(pfDao.getAll(DummyTimestampEntity.class));
343 assertEquals(tkeyInfoSetIn, tkeyInfoSetOut);
345 pfDao.deleteCollection(tkeyInfoSetIn);
346 tkeyInfoSetOut = new TreeSet<>(pfDao.getAll(DummyTimestampEntity.class));
347 assertEquals(0, tkeyInfoSetOut.size());
349 tkeyInfoSetIn.add(tkeyInfo2);
350 pfDao.createCollection(tkeyInfoSetIn);
351 tkeyInfoSetOut = new TreeSet<>(pfDao.getAll(DummyTimestampEntity.class));
352 assertEquals(keyInfoSetIn, keyInfoSetOut);
354 pfDao.delete(DummyTimestampEntity.class, atKey2);
355 tkeyInfoSetOut = new TreeSet<>(pfDao.getAll(DummyTimestampEntity.class));
356 assertEquals(3, keyInfoSetOut.size());
357 assertEquals(1, pfDao.size(DummyTimestampEntity.class));
359 pfDao.deleteAll(DummyTimestampEntity.class);
360 assertEquals(0, pfDao.size(DummyTimestampEntity.class));
363 private void testVersionOps() {
364 final PfConceptKey aKey0 = new PfConceptKey("AAA0", VERSION001);
365 final PfConceptKey aKey1 = new PfConceptKey("AAA0", VERSION002);
366 final PfConceptKey aKey2 = new PfConceptKey("AAA0", VERSION003);
367 final PfConceptKey bKey0 = new PfConceptKey("BBB0", VERSION001);
368 final PfConceptKey bKey1 = new PfConceptKey("BBB0", VERSION002);
369 final PfConceptKey bKey2 = new PfConceptKey("BBB0", VERSION003);
370 final DummyConceptEntity keyInfo0 = new DummyConceptEntity(aKey0,
371 UUID.fromString(UUID0), DESCRIPTION0);
372 final DummyConceptEntity keyInfo1 = new DummyConceptEntity(aKey1,
373 UUID.fromString(UUID1), DESCRIPTION1);
374 final DummyConceptEntity keyInfo2 = new DummyConceptEntity(aKey2,
375 UUID.fromString(UUID2), DESCRIPTION2);
376 final DummyConceptEntity keyInfo3 = new DummyConceptEntity(bKey0,
377 UUID.fromString(UUID0), DESCRIPTION0);
378 final DummyConceptEntity keyInfo4 = new DummyConceptEntity(bKey1,
379 UUID.fromString(UUID1), DESCRIPTION1);
380 final DummyConceptEntity keyInfo5 = new DummyConceptEntity(bKey2,
381 UUID.fromString(UUID2), DESCRIPTION2);
383 pfDao.create(keyInfo0);
384 pfDao.create(keyInfo1);
385 pfDao.create(keyInfo2);
386 pfDao.create(keyInfo3);
387 pfDao.create(keyInfo4);
388 pfDao.create(keyInfo5);
390 assertEquals(3, pfDao.getAllVersions(DummyConceptEntity.class, "AAA0").size());
391 assertEquals(0, pfDao.getAllVersions(null, "AAA0").size());
392 assertEquals(0, pfDao.getAllVersions(DummyConceptEntity.class, null).size());
395 private void testgetFilteredOps() {
396 final PfConceptKey aKey0 = new PfConceptKey("AAA0", VERSION001);
397 final PfConceptKey aKey1 = new PfConceptKey("AAA0", VERSION002);
398 final PfConceptKey aKey2 = new PfConceptKey("AAA0", VERSION003);
399 final PfConceptKey bKey0 = new PfConceptKey("BBB0", VERSION001);
400 final PfConceptKey bKey1 = new PfConceptKey("BBB0", VERSION002);
401 final PfConceptKey bKey2 = new PfConceptKey("BBB0", VERSION003);
402 final DummyConceptEntity keyInfo0 = new DummyConceptEntity(aKey0,
403 UUID.fromString(UUID0), DESCRIPTION0);
404 final DummyConceptEntity keyInfo1 = new DummyConceptEntity(aKey1,
405 UUID.fromString(UUID1), DESCRIPTION1);
406 final DummyConceptEntity keyInfo2 = new DummyConceptEntity(aKey2,
407 UUID.fromString(UUID2), DESCRIPTION2);
408 final DummyConceptEntity keyInfo3 = new DummyConceptEntity(bKey0,
409 UUID.fromString(UUID0), DESCRIPTION0);
410 final DummyConceptEntity keyInfo4 = new DummyConceptEntity(bKey1,
411 UUID.fromString(UUID1), DESCRIPTION1);
412 final DummyConceptEntity keyInfo5 = new DummyConceptEntity(bKey2,
413 UUID.fromString(UUID2), DESCRIPTION2);
415 pfDao.create(keyInfo0);
416 pfDao.create(keyInfo1);
417 pfDao.create(keyInfo2);
418 pfDao.create(keyInfo3);
419 pfDao.create(keyInfo4);
420 pfDao.create(keyInfo5);
422 assertEquals(6, pfDao.getFiltered(DummyConceptEntity.class, null, null).size());
423 assertEquals(3, pfDao.getFiltered(DummyConceptEntity.class, "AAA0", null).size());
424 assertEquals(3, pfDao.getFiltered(DummyConceptEntity.class, "BBB0", null).size());
425 assertEquals(1, pfDao.getFiltered(DummyConceptEntity.class, "BBB0", VERSION003).size());
426 assertEquals(6, pfDao.getFiltered(DummyConceptEntity.class, null, VERSION003).size());
428 final PfTimestampKey atKey0 = new PfTimestampKey("AT-KEY0", VERSION001, TIMESTAMP0);
429 final PfTimestampKey atKey1 = new PfTimestampKey("AT-KEY1", VERSION001, TIMESTAMP1);
430 final PfTimestampKey atKey2 = new PfTimestampKey("AT-KEY2", VERSION001, TIMESTAMP2);
431 final DummyTimestampEntity tkeyInfo0 = new DummyTimestampEntity(atKey0, 200.0);
432 final DummyTimestampEntity tkeyInfo1 = new DummyTimestampEntity(atKey1, 200.1);
433 final DummyTimestampEntity tkeyInfo2 = new DummyTimestampEntity(atKey2, 200.2);
435 pfDao.create(tkeyInfo0);
436 pfDao.create(tkeyInfo1);
437 pfDao.create(tkeyInfo2);
440 assertEquals(1, pfDao
441 .getFiltered(DummyTimestampEntity.class, "AT-KEY0", VERSION001, null, null, null, "DESC", 0).size());
443 pfDao.getFiltered(DummyTimestampEntity.class, "AT-KEY0", null, null, null, null, "DESC", 0).size());
444 assertEquals(3, pfDao
445 .getFiltered(DummyTimestampEntity.class, null, VERSION001, TIMESTAMP0, TIMESTAMP2, null, "DESC", 0)
447 assertEquals(1, pfDao
448 .getFiltered(DummyTimestampEntity.class, "AT-KEY0", VERSION001, TIMESTAMP0, TIMESTAMP2, null, "DESC", 0)
450 assertEquals(3, pfDao
451 .getFiltered(DummyTimestampEntity.class, null, VERSION001, null, TIMESTAMP2, null, "DESC", 0).size());
452 assertEquals(3, pfDao
453 .getFiltered(DummyTimestampEntity.class, null, VERSION001, TIMESTAMP0, null, null, "DESC", 0).size());
455 pfDao.getFiltered(DummyTimestampEntity.class, null, VERSION001, TIMESTAMP0, TIMESTAMP2, null, "DESC", 2)
458 Map<String, Object> filterMap = new HashMap<>();
459 filterMap.put("doubleValue", 200.1);
461 pfDao.getFiltered(DummyTimestampEntity.class, null, null, null, null, filterMap, "DESC", 0).size());