2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2019 Nordix Foundation.
4 * Modifications Copyright (C) 2019 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.pdp.persistence.provider;
24 import static org.assertj.core.api.Assertions.assertThatThrownBy;
25 import static org.junit.Assert.assertEquals;
26 import static org.junit.Assert.assertNotEquals;
27 import static org.junit.Assert.assertTrue;
29 import java.util.ArrayList;
30 import java.util.List;
31 import java.util.Properties;
33 import org.eclipse.persistence.config.PersistenceUnitProperties;
34 import org.junit.After;
35 import org.junit.Before;
36 import org.junit.Test;
37 import org.onap.policy.common.utils.coder.StandardCoder;
38 import org.onap.policy.common.utils.resources.ResourceUtils;
39 import org.onap.policy.models.base.PfModelException;
40 import org.onap.policy.models.dao.DaoParameters;
41 import org.onap.policy.models.dao.PfDao;
42 import org.onap.policy.models.dao.PfDaoFactory;
43 import org.onap.policy.models.dao.impl.DefaultPfDao;
44 import org.onap.policy.models.pdp.concepts.Pdp;
45 import org.onap.policy.models.pdp.concepts.PdpGroup;
46 import org.onap.policy.models.pdp.concepts.PdpGroupFilter;
47 import org.onap.policy.models.pdp.concepts.PdpGroups;
48 import org.onap.policy.models.pdp.concepts.PdpStatistics;
49 import org.onap.policy.models.pdp.concepts.PdpSubGroup;
50 import org.onap.policy.models.pdp.enums.PdpHealthStatus;
51 import org.onap.policy.models.pdp.enums.PdpState;
52 import org.onap.policy.models.pdp.persistence.provider.PdpProvider;
53 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyIdentifier;
54 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeIdentifier;
55 import org.onap.policy.models.tosca.simple.provider.SimpleToscaProvider;
58 * Test the {@link SimpleToscaProvider} class.
60 * @author Liam Fallon (liam.fallon@est.tech)
62 public class PdpProviderTest {
64 private StandardCoder standardCoder;
68 * Set up the DAO towards the database.
70 * @throws Exception on database errors
73 public void setupDao() throws Exception {
74 final DaoParameters daoParameters = new DaoParameters();
75 daoParameters.setPluginClass(DefaultPfDao.class.getCanonicalName());
77 daoParameters.setPersistenceUnit("ToscaConceptTest");
79 Properties jdbcProperties = new Properties();
80 jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_USER, "policy");
81 jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_PASSWORD, "P01icY");
83 // H2, use "org.mariadb.jdbc.Driver" and "jdbc:mariadb://localhost:3306/policy" for locally installed MariaDB
84 jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_DRIVER, "org.h2.Driver");
85 jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_URL, "jdbc:h2:mem:testdb");
87 daoParameters.setJdbcProperties(jdbcProperties );
89 pfDao = new PfDaoFactory().createPfDao(daoParameters);
90 pfDao.init(daoParameters);
97 public void setupGson() {
98 standardCoder = new StandardCoder();
102 public void teardown() throws Exception {
107 public void testGroupsGet() throws Exception {
108 assertThatThrownBy(() -> {
109 new PdpProvider().getPdpGroups(null, null);
110 }).hasMessage("dao is marked @NonNull but is null");
112 assertThatThrownBy(() -> {
113 new PdpProvider().getPdpGroups(null, "name");
114 }).hasMessage("dao is marked @NonNull but is null");
116 String originalJson = ResourceUtils.getResourceAsString("testdata/PdpGroups0.json");
117 PdpGroups pdpGroups0 = standardCoder.decode(originalJson, PdpGroups.class);
119 PdpGroups createdPdpGroups0 = new PdpGroups();
120 createdPdpGroups0.setGroups(new PdpProvider().createPdpGroups(pfDao, pdpGroups0.getGroups()));
121 String createdJson = standardCoder.encode(createdPdpGroups0);
122 assertEquals(originalJson.replaceAll("\\s+", ""), createdJson.replaceAll("\\s+", ""));
124 PdpGroups gotPdpGroups0 = new PdpGroups();
125 gotPdpGroups0.setGroups(new PdpProvider().getPdpGroups(pfDao, "PdpGroup0"));
127 String gotJson = standardCoder.encode(gotPdpGroups0);
129 assertEquals(originalJson.replaceAll("\\s+", ""), gotJson.replaceAll("\\s+", ""));
133 public void testFilteredPdpGroupGet() throws Exception {
134 assertThatThrownBy(() -> {
135 new PdpProvider().getFilteredPdpGroups(null, null);
136 }).hasMessage("dao is marked @NonNull but is null");
138 assertThatThrownBy(() -> {
139 new PdpProvider().getFilteredPdpGroups(null, PdpGroupFilter.builder().build());
140 }).hasMessage("dao is marked @NonNull but is null");
142 assertThatThrownBy(() -> {
143 new PdpProvider().getFilteredPdpGroups(pfDao, null);
144 }).hasMessage("filter is marked @NonNull but is null");
146 String originalJson = ResourceUtils.getResourceAsString("testdata/PdpGroupsForFiltering.json");
147 PdpGroups pdpGroups0 = standardCoder.decode(originalJson, PdpGroups.class);
149 assertEquals(5, new PdpProvider().createPdpGroups(pfDao, pdpGroups0.getGroups()).size());
151 List<ToscaPolicyTypeIdentifier> policyTypeList = new ArrayList<>();
152 policyTypeList.add(new ToscaPolicyTypeIdentifier("policy.type.0", "1.2.3"));
154 List<ToscaPolicyIdentifier> policyList = new ArrayList<>();
155 policyList.add(new ToscaPolicyIdentifier("Policy0", "4.5.6"));
158 final PdpGroupFilter filter = PdpGroupFilter.builder()
159 .groupState(PdpState.PASSIVE)
161 .matchPoliciesExactly(false)
162 .matchPolicyTypesExactly(false)
163 .pdpState(PdpState.PASSIVE)
165 .policyTypeList(policyTypeList)
166 .policyList(policyList)
169 assertEquals(1, new PdpProvider().getFilteredPdpGroups(pfDao, filter).size());
173 public void testGroupsCreate() throws Exception {
174 assertThatThrownBy(() -> {
175 new PdpProvider().createPdpGroups(null, null);
176 }).hasMessage("dao is marked @NonNull but is null");
178 assertThatThrownBy(() -> {
179 new PdpProvider().createPdpGroups(null, new ArrayList<>());
180 }).hasMessage("dao is marked @NonNull but is null");
182 assertThatThrownBy(() -> {
183 new PdpProvider().createPdpGroups(pfDao, null);
184 }).hasMessage("pdpGroups is marked @NonNull but is null");
186 String originalJson = ResourceUtils.getResourceAsString("testdata/PdpGroups0.json");
187 PdpGroups pdpGroups0 = standardCoder.decode(originalJson, PdpGroups.class);
189 PdpGroups createdPdpGroups0 = new PdpGroups();
190 createdPdpGroups0.setGroups(new PdpProvider().createPdpGroups(pfDao, pdpGroups0.getGroups()));
191 String createdJson = standardCoder.encode(createdPdpGroups0);
192 assertEquals(originalJson.replaceAll("\\s+", ""), createdJson.replaceAll("\\s+", ""));
194 PdpGroups gotPdpGroups0 = new PdpGroups();
195 gotPdpGroups0.setGroups(new PdpProvider().getPdpGroups(pfDao, "PdpGroup0"));
197 String gotJson = standardCoder.encode(gotPdpGroups0);
198 assertEquals(originalJson.replaceAll("\\s+", ""), gotJson.replaceAll("\\s+", ""));
200 pdpGroups0.getGroups().get(0).setPdpGroupState(null);
201 assertThatThrownBy(() -> {
202 new PdpProvider().createPdpGroups(pfDao, pdpGroups0.getGroups());
203 }).hasMessageContaining("INVALID:pdpGroupState may not be null");
207 public void testGroupsCreateNoPdp() throws Exception {
208 String originalJson = ResourceUtils.getResourceAsString("testdata/PdpGroupsNoPDPs.json");
210 PdpGroups pdpGroups0 = standardCoder.decode(originalJson, PdpGroups.class);
212 PdpGroups createdPdpGroups0 = new PdpGroups();
213 createdPdpGroups0.setGroups(new PdpProvider().createPdpGroups(pfDao, pdpGroups0.getGroups()));
214 assertNotEquals(pdpGroups0, createdPdpGroups0);
215 pdpGroups0.getGroups().get(0).getPdpSubgroups().get(0).setPdpInstances(new ArrayList<>());
216 String originalTweakedJson = standardCoder.encode(pdpGroups0);
217 String createdJson = standardCoder.encode(createdPdpGroups0);
218 assertEquals(originalTweakedJson.replaceAll("\\s+", ""), createdJson.replaceAll("\\s+", ""));
220 PdpGroups gotPdpGroups0 = new PdpGroups();
221 gotPdpGroups0.setGroups(new PdpProvider().getPdpGroups(pfDao, "TestPdpGroup"));
223 String gotJson = standardCoder.encode(gotPdpGroups0);
224 assertEquals(originalTweakedJson.replaceAll("\\s+", ""), gotJson.replaceAll("\\s+", ""));
228 public void testGroupsUpdate() throws Exception {
229 assertThatThrownBy(() -> {
230 new PdpProvider().updatePdpGroups(null, null);
231 }).hasMessage("dao is marked @NonNull but is null");
233 assertThatThrownBy(() -> {
234 new PdpProvider().updatePdpGroups(null, new ArrayList<>());
235 }).hasMessage("dao is marked @NonNull but is null");
237 assertThatThrownBy(() -> {
238 new PdpProvider().updatePdpGroups(pfDao, null);
239 }).hasMessage("pdpGroups is marked @NonNull but is null");
241 String originalJson = ResourceUtils.getResourceAsString("testdata/PdpGroups0.json");
242 PdpGroups pdpGroups0 = standardCoder.decode(originalJson, PdpGroups.class);
244 PdpGroups createdPdpGroups0 = new PdpGroups();
245 createdPdpGroups0.setGroups(new PdpProvider().createPdpGroups(pfDao, pdpGroups0.getGroups()));
246 String createdJson = standardCoder.encode(createdPdpGroups0);
247 assertEquals(originalJson.replaceAll("\\s+", ""), createdJson.replaceAll("\\s+", ""));
249 PdpGroups gotPdpGroups0 = new PdpGroups();
250 gotPdpGroups0.setGroups(new PdpProvider().getPdpGroups(pfDao, "PdpGroup0"));
252 String gotJson = standardCoder.encode(gotPdpGroups0);
253 assertEquals(originalJson.replaceAll("\\s+", ""), gotJson.replaceAll("\\s+", ""));
255 String updateJson = ResourceUtils.getResourceAsString("testdata/PdpGroups0Update.json");
256 PdpGroups updatePdpGroups0 = standardCoder.decode(updateJson, PdpGroups.class);
258 PdpGroups updatedPdpGroups0 = new PdpGroups();
259 updatedPdpGroups0.setGroups(new PdpProvider().updatePdpGroups(pfDao, updatePdpGroups0.getGroups()));
261 List<Pdp> beforePdpInstances = updatePdpGroups0.getGroups().get(0).getPdpSubgroups().get(0).getPdpInstances();
262 List<Pdp> afterPdpInstances = updatedPdpGroups0.getGroups().get(0).getPdpSubgroups().get(0).getPdpInstances();
263 assertTrue(beforePdpInstances.containsAll(afterPdpInstances));
265 pdpGroups0.getGroups().get(0).setPdpGroupState(null);
266 assertThatThrownBy(() -> {
267 new PdpProvider().updatePdpGroups(pfDao, pdpGroups0.getGroups());
268 }).hasMessageContaining("INVALID:pdpGroupState may not be null");
272 public void testPoliciesDelete() throws Exception {
273 assertThatThrownBy(() -> {
274 new PdpProvider().deletePdpGroup(null, null);
275 }).hasMessage("dao is marked @NonNull but is null");
277 assertThatThrownBy(() -> {
278 new PdpProvider().deletePdpGroup(null, "name");
279 }).hasMessage("dao is marked @NonNull but is null");
281 assertThatThrownBy(() -> {
282 new PdpProvider().deletePdpGroup(pfDao, null);
283 }).hasMessage("name is marked @NonNull but is null");
285 assertThatThrownBy(() -> {
286 new PdpProvider().deletePdpGroup(pfDao, "name");
287 }).hasMessage("delete of PDP group \"name:0.0.0\" failed, PDP group does not exist");
289 String originalJson = ResourceUtils.getResourceAsString("testdata/PdpGroups0.json");
290 PdpGroups pdpGroups0 = standardCoder.decode(originalJson, PdpGroups.class);
292 PdpGroups createdPdpGroups0 = new PdpGroups();
293 createdPdpGroups0.setGroups(new PdpProvider().createPdpGroups(pfDao, pdpGroups0.getGroups()));
294 String createdJson = standardCoder.encode(createdPdpGroups0);
295 assertEquals(originalJson.replaceAll("\\s+", ""), createdJson.replaceAll("\\s+", ""));
297 PdpGroups gotPdpGroups0 = new PdpGroups();
298 gotPdpGroups0.setGroups(new PdpProvider().getPdpGroups(pfDao, "PdpGroup0"));
300 String gotJson = standardCoder.encode(gotPdpGroups0);
301 assertEquals(originalJson.replaceAll("\\s+", ""), gotJson.replaceAll("\\s+", ""));
303 PdpGroup deletedPdpGroup = new PdpProvider().deletePdpGroup(pfDao, "PdpGroup0");
305 assertEquals(createdPdpGroups0.getGroups().get(0), deletedPdpGroup);
307 assertEquals(0, new PdpProvider().getPdpGroups(pfDao, "PdpGroup0").size());
309 assertThatThrownBy(() -> {
310 new PdpProvider().deletePdpGroup(pfDao, "PdpGroup0");
311 }).hasMessage("delete of PDP group \"PdpGroup0:0.0.0\" failed, PDP group does not exist");
315 public void testPdpSubgroupUpdate() throws Exception {
316 assertThatThrownBy(() -> {
317 new PdpProvider().updatePdpSubGroup(null, null, null);
318 }).hasMessage("dao is marked @NonNull but is null");
320 assertThatThrownBy(() -> {
321 new PdpProvider().updatePdpSubGroup(null, null, new PdpSubGroup());
322 }).hasMessage("dao is marked @NonNull but is null");
324 assertThatThrownBy(() -> {
325 new PdpProvider().updatePdpSubGroup(null, "name", null);
326 }).hasMessage("dao is marked @NonNull but is null");
328 assertThatThrownBy(() -> {
329 new PdpProvider().updatePdpSubGroup(null, "name", new PdpSubGroup());
330 }).hasMessage("dao is marked @NonNull but is null");
332 assertThatThrownBy(() -> {
333 new PdpProvider().updatePdpSubGroup(pfDao, null, null);
334 }).hasMessage("pdpGroupName is marked @NonNull but is null");
336 assertThatThrownBy(() -> {
337 new PdpProvider().updatePdpSubGroup(pfDao, null, new PdpSubGroup());
338 }).hasMessage("pdpGroupName is marked @NonNull but is null");
340 assertThatThrownBy(() -> {
341 new PdpProvider().updatePdpSubGroup(pfDao, "name", null);
342 }).hasMessage("pdpSubGroup is marked @NonNull but is null");
344 assertThatThrownBy(() -> {
345 new PdpProvider().updatePdpSubGroup(pfDao, "name", new PdpSubGroup());
346 }).hasMessage("parameter \"localName\" is null");
348 String originalJson = ResourceUtils.getResourceAsString("testdata/PdpGroups0.json");
349 PdpGroups pdpGroups0 = standardCoder.decode(originalJson, PdpGroups.class);
351 PdpGroups createdPdpGroups0 = new PdpGroups();
352 createdPdpGroups0.setGroups(new PdpProvider().createPdpGroups(pfDao, pdpGroups0.getGroups()));
353 String createdJson = standardCoder.encode(createdPdpGroups0);
354 assertEquals(originalJson.replaceAll("\\s+", ""), createdJson.replaceAll("\\s+", ""));
356 PdpGroups gotPdpGroups0 = new PdpGroups();
357 gotPdpGroups0.setGroups(new PdpProvider().getPdpGroups(pfDao, "PdpGroup0"));
359 String gotJson = standardCoder.encode(gotPdpGroups0);
360 assertEquals(originalJson.replaceAll("\\s+", ""), gotJson.replaceAll("\\s+", ""));
362 PdpSubGroup existingSubGroup = gotPdpGroups0.getGroups().get(0).getPdpSubgroups().get(0);
363 existingSubGroup.setCurrentInstanceCount(10);
364 existingSubGroup.setDesiredInstanceCount(10);
365 new PdpProvider().updatePdpSubGroup(pfDao, "PdpGroup0", existingSubGroup);
367 List<PdpGroup> afterUpdatePdpGroups = new PdpProvider().getPdpGroups(pfDao, "PdpGroup0");
368 assertEquals(10, afterUpdatePdpGroups.get(0).getPdpSubgroups().get(0).getCurrentInstanceCount());
369 assertEquals(10, afterUpdatePdpGroups.get(0).getPdpSubgroups().get(0).getDesiredInstanceCount());
371 existingSubGroup.setDesiredInstanceCount(-1);
372 assertThatThrownBy(() -> {
373 new PdpProvider().updatePdpSubGroup(pfDao, "PdpGroup0", existingSubGroup);
374 }).hasMessageContaining("INVALID:the desired instance count of a PDP sub group may not be negative");
375 existingSubGroup.setDesiredInstanceCount(10);
379 public void testPdpUpdate() throws Exception {
380 assertThatThrownBy(() -> {
381 new PdpProvider().updatePdp(null, null, null, null);
382 }).hasMessage("dao is marked @NonNull but is null");
384 assertThatThrownBy(() -> {
385 new PdpProvider().updatePdp(null, null, null, new Pdp());
386 }).hasMessage("dao is marked @NonNull but is null");
388 assertThatThrownBy(() -> {
389 new PdpProvider().updatePdp(null, null, "TYPE", null);
390 }).hasMessage("dao is marked @NonNull but is null");
392 assertThatThrownBy(() -> {
393 new PdpProvider().updatePdp(null, null, "TYPE", new Pdp());
394 }).hasMessage("dao is marked @NonNull but is null");
396 assertThatThrownBy(() -> {
397 new PdpProvider().updatePdp(null, "name", null, null);
398 }).hasMessage("dao is marked @NonNull but is null");
400 assertThatThrownBy(() -> {
401 new PdpProvider().updatePdp(null, "name", null, new Pdp());
402 }).hasMessage("dao is marked @NonNull but is null");
404 assertThatThrownBy(() -> {
405 new PdpProvider().updatePdp(null, "name", "TYPE", null);
406 }).hasMessage("dao is marked @NonNull but is null");
408 assertThatThrownBy(() -> {
409 new PdpProvider().updatePdp(null, "name", "TYPE", new Pdp());
410 }).hasMessage("dao is marked @NonNull but is null");
412 assertThatThrownBy(() -> {
413 new PdpProvider().updatePdp(pfDao, null, null, null);
414 }).hasMessage("pdpGroupName is marked @NonNull but is null");
416 assertThatThrownBy(() -> {
417 new PdpProvider().updatePdp(pfDao, null, null, new Pdp());
418 }).hasMessage("pdpGroupName is marked @NonNull but is null");
420 assertThatThrownBy(() -> {
421 new PdpProvider().updatePdp(pfDao, null, "TYPE", null);
422 }).hasMessage("pdpGroupName is marked @NonNull but is null");
424 assertThatThrownBy(() -> {
425 new PdpProvider().updatePdp(pfDao, null, "TYPE", new Pdp());
426 }).hasMessage("pdpGroupName is marked @NonNull but is null");
428 assertThatThrownBy(() -> {
429 new PdpProvider().updatePdp(pfDao, "name", null, null);
430 }).hasMessage("pdpSubGroup is marked @NonNull but is null");
432 assertThatThrownBy(() -> {
433 new PdpProvider().updatePdp(pfDao, "name", null, new Pdp());
434 }).hasMessage("pdpSubGroup is marked @NonNull but is null");
436 assertThatThrownBy(() -> {
437 new PdpProvider().updatePdp(pfDao, "name", "TYPE", null);
438 }).hasMessage("pdp is marked @NonNull but is null");
440 assertThatThrownBy(() -> {
441 new PdpProvider().updatePdp(pfDao, "name", "TYPE", new Pdp());
442 }).hasMessage("parameter \"localName\" is null");
444 String originalJson = ResourceUtils.getResourceAsString("testdata/PdpGroups0.json");
445 PdpGroups pdpGroups0 = standardCoder.decode(originalJson, PdpGroups.class);
447 PdpGroups createdPdpGroups0 = new PdpGroups();
448 createdPdpGroups0.setGroups(new PdpProvider().createPdpGroups(pfDao, pdpGroups0.getGroups()));
449 String createdJson = standardCoder.encode(createdPdpGroups0);
450 assertEquals(originalJson.replaceAll("\\s+", ""), createdJson.replaceAll("\\s+", ""));
452 PdpGroups gotPdpGroups0 = new PdpGroups();
453 gotPdpGroups0.setGroups(new PdpProvider().getPdpGroups(pfDao, "PdpGroup0"));
455 String gotJson = standardCoder.encode(gotPdpGroups0);
456 assertEquals(originalJson.replaceAll("\\s+", ""), gotJson.replaceAll("\\s+", ""));
458 Pdp existingPdp = gotPdpGroups0.getGroups().get(0).getPdpSubgroups().get(0).getPdpInstances().get(0);
459 existingPdp.setPdpState(PdpState.TEST);
460 existingPdp.setHealthy(PdpHealthStatus.TEST_IN_PROGRESS);
461 new PdpProvider().updatePdp(pfDao, "PdpGroup0", "APEX", existingPdp);
463 List<PdpGroup> afterUpdatePdpGroups = new PdpProvider().getPdpGroups(pfDao, "PdpGroup0");
464 assertEquals(PdpState.TEST,
465 afterUpdatePdpGroups.get(0).getPdpSubgroups().get(0).getPdpInstances().get(0).getPdpState());
466 assertEquals(PdpHealthStatus.TEST_IN_PROGRESS,
467 afterUpdatePdpGroups.get(0).getPdpSubgroups().get(0).getPdpInstances().get(0).getHealthy());
469 existingPdp.setMessage("");
470 assertThatThrownBy(() -> {
471 new PdpProvider().updatePdp(pfDao, "PdpGroup0", "APEX", existingPdp);
472 }).hasMessageContaining("INVALID:message may not be blank");
473 existingPdp.setMessage("A Message");
477 public void testGetPdpStatistics() throws PfModelException {
478 assertThatThrownBy(() -> {
479 new PdpProvider().getPdpStatistics(null, null);
480 }).hasMessage("dao is marked @NonNull but is null");
482 assertThatThrownBy(() -> {
483 new PdpProvider().getPdpStatistics(null, "name");
484 }).hasMessage("dao is marked @NonNull but is null");
486 assertEquals(0, new PdpProvider().getPdpStatistics(pfDao, "name").size());
490 public void testUpdatePdpStatistics() throws PfModelException {
491 assertThatThrownBy(() -> {
492 new PdpProvider().updatePdpStatistics(null, null, null, null, null);
493 }).hasMessage("dao is marked @NonNull but is null");
495 assertThatThrownBy(() -> {
496 new PdpProvider().updatePdpStatistics(null, null, null, null, new PdpStatistics());
497 }).hasMessage("dao is marked @NonNull but is null");
499 assertThatThrownBy(() -> {
500 new PdpProvider().updatePdpStatistics(null, null, null, "inst", null);
501 }).hasMessage("dao is marked @NonNull but is null");
503 assertThatThrownBy(() -> {
504 new PdpProvider().updatePdpStatistics(null, null, null, "inst", new PdpStatistics());
505 }).hasMessage("dao is marked @NonNull but is null");
507 assertThatThrownBy(() -> {
508 new PdpProvider().updatePdpStatistics(null, null, "TYPE", null, null);
509 }).hasMessage("dao is marked @NonNull but is null");
511 assertThatThrownBy(() -> {
512 new PdpProvider().updatePdpStatistics(null, null, "TYPE", null, new PdpStatistics());
513 }).hasMessage("dao is marked @NonNull but is null");
515 assertThatThrownBy(() -> {
516 new PdpProvider().updatePdpStatistics(null, null, "TYPE", "inst", null);
517 }).hasMessage("dao is marked @NonNull but is null");
519 assertThatThrownBy(() -> {
520 new PdpProvider().updatePdpStatistics(null, null, "TYPE", "inst", new PdpStatistics());
521 }).hasMessage("dao is marked @NonNull but is null");
523 assertThatThrownBy(() -> {
524 new PdpProvider().updatePdpStatistics(null, "name", null, null, null);
525 }).hasMessage("dao is marked @NonNull but is null");
527 assertThatThrownBy(() -> {
528 new PdpProvider().updatePdpStatistics(null, "name", null, null, new PdpStatistics());
529 }).hasMessage("dao is marked @NonNull but is null");
531 assertThatThrownBy(() -> {
532 new PdpProvider().updatePdpStatistics(null, "name", null, "inst", null);
533 }).hasMessage("dao is marked @NonNull but is null");
535 assertThatThrownBy(() -> {
536 new PdpProvider().updatePdpStatistics(null, "name", null, "inst", new PdpStatistics());
537 }).hasMessage("dao is marked @NonNull but is null");
539 assertThatThrownBy(() -> {
540 new PdpProvider().updatePdpStatistics(null, "name", "TYPE", null, null);
541 }).hasMessage("dao is marked @NonNull but is null");
543 assertThatThrownBy(() -> {
544 new PdpProvider().updatePdpStatistics(null, "name", "TYPE", null, new PdpStatistics());
545 }).hasMessage("dao is marked @NonNull but is null");
547 assertThatThrownBy(() -> {
548 new PdpProvider().updatePdpStatistics(null, "name", "TYPE", "inst", null);
549 }).hasMessage("dao is marked @NonNull but is null");
551 assertThatThrownBy(() -> {
552 new PdpProvider().updatePdpStatistics(null, "name", "TYPE", "inst", new PdpStatistics());
553 }).hasMessage("dao is marked @NonNull but is null");
555 assertThatThrownBy(() -> {
556 new PdpProvider().updatePdpStatistics(pfDao, null, null, null, null);
557 }).hasMessage("pdpGroupName is marked @NonNull but is null");
559 assertThatThrownBy(() -> {
560 new PdpProvider().updatePdpStatistics(pfDao, null, null, null, new PdpStatistics());
561 }).hasMessage("pdpGroupName is marked @NonNull but is null");
563 assertThatThrownBy(() -> {
564 new PdpProvider().updatePdpStatistics(pfDao, null, null, "inst", null);
565 }).hasMessage("pdpGroupName is marked @NonNull but is null");
567 assertThatThrownBy(() -> {
568 new PdpProvider().updatePdpStatistics(pfDao, null, null, "inst", new PdpStatistics());
569 }).hasMessage("pdpGroupName is marked @NonNull but is null");
571 assertThatThrownBy(() -> {
572 new PdpProvider().updatePdpStatistics(pfDao, null, "TYPE", null, null);
573 }).hasMessage("pdpGroupName is marked @NonNull but is null");
575 assertThatThrownBy(() -> {
576 new PdpProvider().updatePdpStatistics(pfDao, null, "TYPE", null, new PdpStatistics());
577 }).hasMessage("pdpGroupName is marked @NonNull but is null");
579 assertThatThrownBy(() -> {
580 new PdpProvider().updatePdpStatistics(pfDao, null, "TYPE", "inst", null);
581 }).hasMessage("pdpGroupName is marked @NonNull but is null");
583 assertThatThrownBy(() -> {
584 new PdpProvider().updatePdpStatistics(pfDao, null, "TYPE", "inst", new PdpStatistics());
585 }).hasMessage("pdpGroupName is marked @NonNull but is null");
587 assertThatThrownBy(() -> {
588 new PdpProvider().updatePdpStatistics(pfDao, "name", null, null, null);
589 }).hasMessage("pdpType is marked @NonNull but is null");
591 assertThatThrownBy(() -> {
592 new PdpProvider().updatePdpStatistics(pfDao, "name", null, null, new PdpStatistics());
593 }).hasMessage("pdpType is marked @NonNull but is null");
595 assertThatThrownBy(() -> {
596 new PdpProvider().updatePdpStatistics(pfDao, "name", null, "inst", null);
597 }).hasMessage("pdpType is marked @NonNull but is null");
599 assertThatThrownBy(() -> {
600 new PdpProvider().updatePdpStatistics(pfDao, "name", null, "inst", new PdpStatistics());
601 }).hasMessage("pdpType is marked @NonNull but is null");
603 assertThatThrownBy(() -> {
604 new PdpProvider().updatePdpStatistics(pfDao, "name", "TYPE", null, null);
605 }).hasMessage("pdpInstanceId is marked @NonNull but is null");
607 assertThatThrownBy(() -> {
608 new PdpProvider().updatePdpStatistics(pfDao, "name", "TYPE", null, new PdpStatistics());
609 }).hasMessage("pdpInstanceId is marked @NonNull but is null");
611 assertThatThrownBy(() -> {
612 new PdpProvider().updatePdpStatistics(pfDao, "name", "TYPE", "inst", null);
613 }).hasMessage("pdpStatistics is marked @NonNull but is null");
615 new PdpProvider().updatePdpStatistics(pfDao, "name", "TYPE", "inst", new PdpStatistics());