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;
32 import org.eclipse.persistence.config.PersistenceUnitProperties;
33 import org.junit.After;
34 import org.junit.Before;
35 import org.junit.Test;
36 import org.onap.policy.common.utils.coder.StandardCoder;
37 import org.onap.policy.common.utils.resources.ResourceUtils;
38 import org.onap.policy.models.base.PfModelException;
39 import org.onap.policy.models.dao.DaoParameters;
40 import org.onap.policy.models.dao.PfDao;
41 import org.onap.policy.models.dao.PfDaoFactory;
42 import org.onap.policy.models.dao.impl.DefaultPfDao;
43 import org.onap.policy.models.pdp.concepts.Pdp;
44 import org.onap.policy.models.pdp.concepts.PdpGroup;
45 import org.onap.policy.models.pdp.concepts.PdpGroupFilter;
46 import org.onap.policy.models.pdp.concepts.PdpGroups;
47 import org.onap.policy.models.pdp.concepts.PdpStatistics;
48 import org.onap.policy.models.pdp.concepts.PdpSubGroup;
49 import org.onap.policy.models.pdp.enums.PdpHealthStatus;
50 import org.onap.policy.models.pdp.enums.PdpState;
51 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyIdentifier;
52 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeIdentifier;
53 import org.onap.policy.models.tosca.simple.provider.SimpleToscaProvider;
56 * Test the {@link SimpleToscaProvider} class.
58 * @author Liam Fallon (liam.fallon@est.tech)
60 public class PdpProviderTest {
62 private StandardCoder standardCoder;
66 * Set up the DAO towards the database.
68 * @throws Exception on database errors
71 public void setupDao() throws Exception {
72 final DaoParameters daoParameters = new DaoParameters();
73 daoParameters.setPluginClass(DefaultPfDao.class.getCanonicalName());
75 daoParameters.setPersistenceUnit("ToscaConceptTest");
77 Properties jdbcProperties = new Properties();
78 jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_USER, "policy");
79 jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_PASSWORD, "P01icY");
81 // H2, use "org.mariadb.jdbc.Driver" and "jdbc:mariadb://localhost:3306/policy" for locally installed MariaDB
82 jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_DRIVER, "org.h2.Driver");
83 jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_URL, "jdbc:h2:mem:testdb");
85 daoParameters.setJdbcProperties(jdbcProperties );
87 pfDao = new PfDaoFactory().createPfDao(daoParameters);
88 pfDao.init(daoParameters);
95 public void setupGson() {
96 standardCoder = new StandardCoder();
100 public void teardown() {
105 public void testGroupsGet() throws Exception {
106 assertThatThrownBy(() -> {
107 new PdpProvider().getPdpGroups(null, null);
108 }).hasMessage("dao is marked @NonNull but is null");
110 assertThatThrownBy(() -> {
111 new PdpProvider().getPdpGroups(null, "name");
112 }).hasMessage("dao is marked @NonNull but is null");
114 String originalJson = ResourceUtils.getResourceAsString("testdata/PdpGroups0.json");
115 PdpGroups pdpGroups0 = standardCoder.decode(originalJson, PdpGroups.class);
117 PdpGroups createdPdpGroups0 = new PdpGroups();
118 createdPdpGroups0.setGroups(new PdpProvider().createPdpGroups(pfDao, pdpGroups0.getGroups()));
119 String createdJson = standardCoder.encode(createdPdpGroups0);
120 assertEquals(originalJson.replaceAll("\\s+", ""), createdJson.replaceAll("\\s+", ""));
122 PdpGroups gotPdpGroups0 = new PdpGroups();
123 gotPdpGroups0.setGroups(new PdpProvider().getPdpGroups(pfDao, "PdpGroup0"));
125 String gotJson = standardCoder.encode(gotPdpGroups0);
127 assertEquals(originalJson.replaceAll("\\s+", ""), gotJson.replaceAll("\\s+", ""));
131 public void testFilteredPdpGroupGet() throws Exception {
132 assertThatThrownBy(() -> {
133 new PdpProvider().getFilteredPdpGroups(null, null);
134 }).hasMessage("dao is marked @NonNull but is null");
136 assertThatThrownBy(() -> {
137 new PdpProvider().getFilteredPdpGroups(null, PdpGroupFilter.builder().build());
138 }).hasMessage("dao is marked @NonNull but is null");
140 assertThatThrownBy(() -> {
141 new PdpProvider().getFilteredPdpGroups(pfDao, null);
142 }).hasMessage("filter is marked @NonNull but is null");
144 String originalJson = ResourceUtils.getResourceAsString("testdata/PdpGroupsForFiltering.json");
145 PdpGroups pdpGroups0 = standardCoder.decode(originalJson, PdpGroups.class);
147 assertEquals(5, new PdpProvider().createPdpGroups(pfDao, pdpGroups0.getGroups()).size());
149 List<ToscaPolicyTypeIdentifier> policyTypeList = new ArrayList<>();
150 policyTypeList.add(new ToscaPolicyTypeIdentifier("policy.type.0", "1.2.3"));
152 List<ToscaPolicyIdentifier> policyList = new ArrayList<>();
153 policyList.add(new ToscaPolicyIdentifier("Policy0", "4.5.6"));
156 final PdpGroupFilter filter = PdpGroupFilter.builder()
157 .groupState(PdpState.PASSIVE)
159 .matchPoliciesExactly(false)
160 .matchPolicyTypesExactly(false)
161 .pdpState(PdpState.PASSIVE)
163 .policyTypeList(policyTypeList)
164 .policyList(policyList)
167 assertEquals(1, new PdpProvider().getFilteredPdpGroups(pfDao, filter).size());
171 public void testGroupsCreate() throws Exception {
172 assertThatThrownBy(() -> {
173 new PdpProvider().createPdpGroups(null, null);
174 }).hasMessage("dao is marked @NonNull but is null");
176 assertThatThrownBy(() -> {
177 new PdpProvider().createPdpGroups(null, new ArrayList<>());
178 }).hasMessage("dao is marked @NonNull but is null");
180 assertThatThrownBy(() -> {
181 new PdpProvider().createPdpGroups(pfDao, null);
182 }).hasMessage("pdpGroups is marked @NonNull but is null");
184 String originalJson = ResourceUtils.getResourceAsString("testdata/PdpGroups0.json");
185 PdpGroups pdpGroups0 = standardCoder.decode(originalJson, PdpGroups.class);
187 PdpGroups createdPdpGroups0 = new PdpGroups();
188 createdPdpGroups0.setGroups(new PdpProvider().createPdpGroups(pfDao, pdpGroups0.getGroups()));
189 String createdJson = standardCoder.encode(createdPdpGroups0);
190 assertEquals(originalJson.replaceAll("\\s+", ""), createdJson.replaceAll("\\s+", ""));
192 PdpGroups gotPdpGroups0 = new PdpGroups();
193 gotPdpGroups0.setGroups(new PdpProvider().getPdpGroups(pfDao, "PdpGroup0"));
195 String gotJson = standardCoder.encode(gotPdpGroups0);
196 assertEquals(originalJson.replaceAll("\\s+", ""), gotJson.replaceAll("\\s+", ""));
198 pdpGroups0.getGroups().get(0).setPdpGroupState(null);
199 assertThatThrownBy(() -> {
200 new PdpProvider().createPdpGroups(pfDao, pdpGroups0.getGroups());
201 }).hasMessageContaining("INVALID:pdpGroupState may not be null");
205 public void testGroupsCreateNoPdp() throws Exception {
206 String originalJson = ResourceUtils.getResourceAsString("testdata/PdpGroupsNoPDPs.json");
208 PdpGroups pdpGroups0 = standardCoder.decode(originalJson, PdpGroups.class);
210 PdpGroups createdPdpGroups0 = new PdpGroups();
211 createdPdpGroups0.setGroups(new PdpProvider().createPdpGroups(pfDao, pdpGroups0.getGroups()));
212 assertNotEquals(pdpGroups0, createdPdpGroups0);
213 pdpGroups0.getGroups().get(0).getPdpSubgroups().get(0).setPdpInstances(new ArrayList<>());
214 String originalTweakedJson = standardCoder.encode(pdpGroups0);
215 String createdJson = standardCoder.encode(createdPdpGroups0);
216 assertEquals(originalTweakedJson.replaceAll("\\s+", ""), createdJson.replaceAll("\\s+", ""));
218 PdpGroups gotPdpGroups0 = new PdpGroups();
219 gotPdpGroups0.setGroups(new PdpProvider().getPdpGroups(pfDao, "TestPdpGroup"));
221 String gotJson = standardCoder.encode(gotPdpGroups0);
222 assertEquals(originalTweakedJson.replaceAll("\\s+", ""), gotJson.replaceAll("\\s+", ""));
226 public void testGroupsUpdate() throws Exception {
227 assertThatThrownBy(() -> {
228 new PdpProvider().updatePdpGroups(null, null);
229 }).hasMessage("dao is marked @NonNull but is null");
231 assertThatThrownBy(() -> {
232 new PdpProvider().updatePdpGroups(null, new ArrayList<>());
233 }).hasMessage("dao is marked @NonNull but is null");
235 assertThatThrownBy(() -> {
236 new PdpProvider().updatePdpGroups(pfDao, null);
237 }).hasMessage("pdpGroups is marked @NonNull but is null");
239 String originalJson = ResourceUtils.getResourceAsString("testdata/PdpGroups0.json");
240 PdpGroups pdpGroups0 = standardCoder.decode(originalJson, PdpGroups.class);
242 PdpGroups createdPdpGroups0 = new PdpGroups();
243 createdPdpGroups0.setGroups(new PdpProvider().createPdpGroups(pfDao, pdpGroups0.getGroups()));
244 String createdJson = standardCoder.encode(createdPdpGroups0);
245 assertEquals(originalJson.replaceAll("\\s+", ""), createdJson.replaceAll("\\s+", ""));
247 PdpGroups gotPdpGroups0 = new PdpGroups();
248 gotPdpGroups0.setGroups(new PdpProvider().getPdpGroups(pfDao, "PdpGroup0"));
250 String gotJson = standardCoder.encode(gotPdpGroups0);
251 assertEquals(originalJson.replaceAll("\\s+", ""), gotJson.replaceAll("\\s+", ""));
253 String updateJson = ResourceUtils.getResourceAsString("testdata/PdpGroups0Update.json");
254 PdpGroups updatePdpGroups0 = standardCoder.decode(updateJson, PdpGroups.class);
256 PdpGroups updatedPdpGroups0 = new PdpGroups();
257 updatedPdpGroups0.setGroups(new PdpProvider().updatePdpGroups(pfDao, updatePdpGroups0.getGroups()));
259 List<Pdp> beforePdpInstances = updatePdpGroups0.getGroups().get(0).getPdpSubgroups().get(0).getPdpInstances();
260 List<Pdp> afterPdpInstances = updatedPdpGroups0.getGroups().get(0).getPdpSubgroups().get(0).getPdpInstances();
261 assertTrue(beforePdpInstances.containsAll(afterPdpInstances));
263 pdpGroups0.getGroups().get(0).setPdpGroupState(null);
264 assertThatThrownBy(() -> {
265 new PdpProvider().updatePdpGroups(pfDao, pdpGroups0.getGroups());
266 }).hasMessageContaining("INVALID:pdpGroupState may not be null");
270 public void testPoliciesDelete() throws Exception {
271 assertThatThrownBy(() -> {
272 new PdpProvider().deletePdpGroup(null, null);
273 }).hasMessage("dao is marked @NonNull but is null");
275 assertThatThrownBy(() -> {
276 new PdpProvider().deletePdpGroup(null, "name");
277 }).hasMessage("dao is marked @NonNull but is null");
279 assertThatThrownBy(() -> {
280 new PdpProvider().deletePdpGroup(pfDao, null);
281 }).hasMessage("name is marked @NonNull but is null");
283 assertThatThrownBy(() -> {
284 new PdpProvider().deletePdpGroup(pfDao, "name");
285 }).hasMessage("delete of PDP group \"name:0.0.0\" failed, PDP group does not exist");
287 String originalJson = ResourceUtils.getResourceAsString("testdata/PdpGroups0.json");
288 PdpGroups pdpGroups0 = standardCoder.decode(originalJson, PdpGroups.class);
290 PdpGroups createdPdpGroups0 = new PdpGroups();
291 createdPdpGroups0.setGroups(new PdpProvider().createPdpGroups(pfDao, pdpGroups0.getGroups()));
292 String createdJson = standardCoder.encode(createdPdpGroups0);
293 assertEquals(originalJson.replaceAll("\\s+", ""), createdJson.replaceAll("\\s+", ""));
295 PdpGroups gotPdpGroups0 = new PdpGroups();
296 gotPdpGroups0.setGroups(new PdpProvider().getPdpGroups(pfDao, "PdpGroup0"));
298 String gotJson = standardCoder.encode(gotPdpGroups0);
299 assertEquals(originalJson.replaceAll("\\s+", ""), gotJson.replaceAll("\\s+", ""));
301 PdpGroup deletedPdpGroup = new PdpProvider().deletePdpGroup(pfDao, "PdpGroup0");
303 assertEquals(createdPdpGroups0.getGroups().get(0), deletedPdpGroup);
305 assertEquals(0, new PdpProvider().getPdpGroups(pfDao, "PdpGroup0").size());
307 assertThatThrownBy(() -> {
308 new PdpProvider().deletePdpGroup(pfDao, "PdpGroup0");
309 }).hasMessage("delete of PDP group \"PdpGroup0:0.0.0\" failed, PDP group does not exist");
313 public void testPdpSubgroupUpdate() throws Exception {
314 assertThatThrownBy(() -> {
315 new PdpProvider().updatePdpSubGroup(null, null, null);
316 }).hasMessage("dao is marked @NonNull but is null");
318 assertThatThrownBy(() -> {
319 new PdpProvider().updatePdpSubGroup(null, null, new PdpSubGroup());
320 }).hasMessage("dao is marked @NonNull but is null");
322 assertThatThrownBy(() -> {
323 new PdpProvider().updatePdpSubGroup(null, "name", null);
324 }).hasMessage("dao is marked @NonNull but is null");
326 assertThatThrownBy(() -> {
327 new PdpProvider().updatePdpSubGroup(null, "name", new PdpSubGroup());
328 }).hasMessage("dao is marked @NonNull but is null");
330 assertThatThrownBy(() -> {
331 new PdpProvider().updatePdpSubGroup(pfDao, null, null);
332 }).hasMessage("pdpGroupName is marked @NonNull but is null");
334 assertThatThrownBy(() -> {
335 new PdpProvider().updatePdpSubGroup(pfDao, null, new PdpSubGroup());
336 }).hasMessage("pdpGroupName is marked @NonNull but is null");
338 assertThatThrownBy(() -> {
339 new PdpProvider().updatePdpSubGroup(pfDao, "name", null);
340 }).hasMessage("pdpSubGroup is marked @NonNull but is null");
342 assertThatThrownBy(() -> {
343 new PdpProvider().updatePdpSubGroup(pfDao, "name", new PdpSubGroup());
344 }).hasMessage("parameter \"localName\" is null");
346 String originalJson = ResourceUtils.getResourceAsString("testdata/PdpGroups0.json");
347 PdpGroups pdpGroups0 = standardCoder.decode(originalJson, PdpGroups.class);
349 PdpGroups createdPdpGroups0 = new PdpGroups();
350 createdPdpGroups0.setGroups(new PdpProvider().createPdpGroups(pfDao, pdpGroups0.getGroups()));
351 String createdJson = standardCoder.encode(createdPdpGroups0);
352 assertEquals(originalJson.replaceAll("\\s+", ""), createdJson.replaceAll("\\s+", ""));
354 PdpGroups gotPdpGroups0 = new PdpGroups();
355 gotPdpGroups0.setGroups(new PdpProvider().getPdpGroups(pfDao, "PdpGroup0"));
357 String gotJson = standardCoder.encode(gotPdpGroups0);
358 assertEquals(originalJson.replaceAll("\\s+", ""), gotJson.replaceAll("\\s+", ""));
360 PdpSubGroup existingSubGroup = gotPdpGroups0.getGroups().get(0).getPdpSubgroups().get(0);
361 existingSubGroup.setCurrentInstanceCount(10);
362 existingSubGroup.setDesiredInstanceCount(10);
363 new PdpProvider().updatePdpSubGroup(pfDao, "PdpGroup0", existingSubGroup);
365 List<PdpGroup> afterUpdatePdpGroups = new PdpProvider().getPdpGroups(pfDao, "PdpGroup0");
366 assertEquals(10, afterUpdatePdpGroups.get(0).getPdpSubgroups().get(0).getCurrentInstanceCount());
367 assertEquals(10, afterUpdatePdpGroups.get(0).getPdpSubgroups().get(0).getDesiredInstanceCount());
369 existingSubGroup.setDesiredInstanceCount(-1);
370 assertThatThrownBy(() -> {
371 new PdpProvider().updatePdpSubGroup(pfDao, "PdpGroup0", existingSubGroup);
372 }).hasMessageContaining("INVALID:the desired instance count of a PDP sub group may not be negative");
373 existingSubGroup.setDesiredInstanceCount(10);
377 public void testPdpUpdate() throws Exception {
378 assertThatThrownBy(() -> {
379 new PdpProvider().updatePdp(null, null, null, null);
380 }).hasMessage("dao is marked @NonNull but is null");
382 assertThatThrownBy(() -> {
383 new PdpProvider().updatePdp(null, null, null, new Pdp());
384 }).hasMessage("dao is marked @NonNull but is null");
386 assertThatThrownBy(() -> {
387 new PdpProvider().updatePdp(null, null, "TYPE", null);
388 }).hasMessage("dao is marked @NonNull but is null");
390 assertThatThrownBy(() -> {
391 new PdpProvider().updatePdp(null, null, "TYPE", new Pdp());
392 }).hasMessage("dao is marked @NonNull but is null");
394 assertThatThrownBy(() -> {
395 new PdpProvider().updatePdp(null, "name", null, null);
396 }).hasMessage("dao is marked @NonNull but is null");
398 assertThatThrownBy(() -> {
399 new PdpProvider().updatePdp(null, "name", null, new Pdp());
400 }).hasMessage("dao is marked @NonNull but is null");
402 assertThatThrownBy(() -> {
403 new PdpProvider().updatePdp(null, "name", "TYPE", null);
404 }).hasMessage("dao is marked @NonNull but is null");
406 assertThatThrownBy(() -> {
407 new PdpProvider().updatePdp(null, "name", "TYPE", new Pdp());
408 }).hasMessage("dao is marked @NonNull but is null");
410 assertThatThrownBy(() -> {
411 new PdpProvider().updatePdp(pfDao, null, null, null);
412 }).hasMessage("pdpGroupName is marked @NonNull but is null");
414 assertThatThrownBy(() -> {
415 new PdpProvider().updatePdp(pfDao, null, null, new Pdp());
416 }).hasMessage("pdpGroupName is marked @NonNull but is null");
418 assertThatThrownBy(() -> {
419 new PdpProvider().updatePdp(pfDao, null, "TYPE", null);
420 }).hasMessage("pdpGroupName is marked @NonNull but is null");
422 assertThatThrownBy(() -> {
423 new PdpProvider().updatePdp(pfDao, null, "TYPE", new Pdp());
424 }).hasMessage("pdpGroupName is marked @NonNull but is null");
426 assertThatThrownBy(() -> {
427 new PdpProvider().updatePdp(pfDao, "name", null, null);
428 }).hasMessage("pdpSubGroup is marked @NonNull but is null");
430 assertThatThrownBy(() -> {
431 new PdpProvider().updatePdp(pfDao, "name", null, new Pdp());
432 }).hasMessage("pdpSubGroup is marked @NonNull but is null");
434 assertThatThrownBy(() -> {
435 new PdpProvider().updatePdp(pfDao, "name", "TYPE", null);
436 }).hasMessage("pdp is marked @NonNull but is null");
438 assertThatThrownBy(() -> {
439 new PdpProvider().updatePdp(pfDao, "name", "TYPE", new Pdp());
440 }).hasMessage("parameter \"localName\" is null");
442 String originalJson = ResourceUtils.getResourceAsString("testdata/PdpGroups0.json");
443 PdpGroups pdpGroups0 = standardCoder.decode(originalJson, PdpGroups.class);
445 PdpGroups createdPdpGroups0 = new PdpGroups();
446 createdPdpGroups0.setGroups(new PdpProvider().createPdpGroups(pfDao, pdpGroups0.getGroups()));
447 String createdJson = standardCoder.encode(createdPdpGroups0);
448 assertEquals(originalJson.replaceAll("\\s+", ""), createdJson.replaceAll("\\s+", ""));
450 PdpGroups gotPdpGroups0 = new PdpGroups();
451 gotPdpGroups0.setGroups(new PdpProvider().getPdpGroups(pfDao, "PdpGroup0"));
453 String gotJson = standardCoder.encode(gotPdpGroups0);
454 assertEquals(originalJson.replaceAll("\\s+", ""), gotJson.replaceAll("\\s+", ""));
456 Pdp existingPdp = gotPdpGroups0.getGroups().get(0).getPdpSubgroups().get(0).getPdpInstances().get(0);
457 existingPdp.setPdpState(PdpState.TEST);
458 existingPdp.setHealthy(PdpHealthStatus.TEST_IN_PROGRESS);
459 new PdpProvider().updatePdp(pfDao, "PdpGroup0", "APEX", existingPdp);
461 List<PdpGroup> afterUpdatePdpGroups = new PdpProvider().getPdpGroups(pfDao, "PdpGroup0");
462 assertEquals(PdpState.TEST,
463 afterUpdatePdpGroups.get(0).getPdpSubgroups().get(0).getPdpInstances().get(0).getPdpState());
464 assertEquals(PdpHealthStatus.TEST_IN_PROGRESS,
465 afterUpdatePdpGroups.get(0).getPdpSubgroups().get(0).getPdpInstances().get(0).getHealthy());
467 existingPdp.setMessage("");
468 assertThatThrownBy(() -> {
469 new PdpProvider().updatePdp(pfDao, "PdpGroup0", "APEX", existingPdp);
470 }).hasMessageContaining("INVALID:message may not be blank");
471 existingPdp.setMessage("A Message");
475 public void testGetPdpStatistics() throws PfModelException {
476 assertThatThrownBy(() -> {
477 new PdpProvider().getPdpStatistics(null, null);
478 }).hasMessage("dao is marked @NonNull but is null");
480 assertThatThrownBy(() -> {
481 new PdpProvider().getPdpStatistics(null, "name");
482 }).hasMessage("dao is marked @NonNull but is null");
484 assertEquals(0, new PdpProvider().getPdpStatistics(pfDao, "name").size());
488 public void testUpdatePdpStatistics() throws PfModelException {
489 assertThatThrownBy(() -> {
490 new PdpProvider().updatePdpStatistics(null, null, null, null, null);
491 }).hasMessage("dao is marked @NonNull but is null");
493 assertThatThrownBy(() -> {
494 new PdpProvider().updatePdpStatistics(null, null, null, null, new PdpStatistics());
495 }).hasMessage("dao is marked @NonNull but is null");
497 assertThatThrownBy(() -> {
498 new PdpProvider().updatePdpStatistics(null, null, null, "inst", null);
499 }).hasMessage("dao is marked @NonNull but is null");
501 assertThatThrownBy(() -> {
502 new PdpProvider().updatePdpStatistics(null, null, null, "inst", new PdpStatistics());
503 }).hasMessage("dao is marked @NonNull but is null");
505 assertThatThrownBy(() -> {
506 new PdpProvider().updatePdpStatistics(null, null, "TYPE", null, null);
507 }).hasMessage("dao is marked @NonNull but is null");
509 assertThatThrownBy(() -> {
510 new PdpProvider().updatePdpStatistics(null, null, "TYPE", null, new PdpStatistics());
511 }).hasMessage("dao is marked @NonNull but is null");
513 assertThatThrownBy(() -> {
514 new PdpProvider().updatePdpStatistics(null, null, "TYPE", "inst", null);
515 }).hasMessage("dao is marked @NonNull but is null");
517 assertThatThrownBy(() -> {
518 new PdpProvider().updatePdpStatistics(null, null, "TYPE", "inst", new PdpStatistics());
519 }).hasMessage("dao is marked @NonNull but is null");
521 assertThatThrownBy(() -> {
522 new PdpProvider().updatePdpStatistics(null, "name", null, null, null);
523 }).hasMessage("dao is marked @NonNull but is null");
525 assertThatThrownBy(() -> {
526 new PdpProvider().updatePdpStatistics(null, "name", null, null, new PdpStatistics());
527 }).hasMessage("dao is marked @NonNull but is null");
529 assertThatThrownBy(() -> {
530 new PdpProvider().updatePdpStatistics(null, "name", null, "inst", null);
531 }).hasMessage("dao is marked @NonNull but is null");
533 assertThatThrownBy(() -> {
534 new PdpProvider().updatePdpStatistics(null, "name", null, "inst", new PdpStatistics());
535 }).hasMessage("dao is marked @NonNull but is null");
537 assertThatThrownBy(() -> {
538 new PdpProvider().updatePdpStatistics(null, "name", "TYPE", null, null);
539 }).hasMessage("dao is marked @NonNull but is null");
541 assertThatThrownBy(() -> {
542 new PdpProvider().updatePdpStatistics(null, "name", "TYPE", null, new PdpStatistics());
543 }).hasMessage("dao is marked @NonNull but is null");
545 assertThatThrownBy(() -> {
546 new PdpProvider().updatePdpStatistics(null, "name", "TYPE", "inst", null);
547 }).hasMessage("dao is marked @NonNull but is null");
549 assertThatThrownBy(() -> {
550 new PdpProvider().updatePdpStatistics(null, "name", "TYPE", "inst", new PdpStatistics());
551 }).hasMessage("dao is marked @NonNull but is null");
553 assertThatThrownBy(() -> {
554 new PdpProvider().updatePdpStatistics(pfDao, null, null, null, null);
555 }).hasMessage("pdpGroupName is marked @NonNull but is null");
557 assertThatThrownBy(() -> {
558 new PdpProvider().updatePdpStatistics(pfDao, null, null, null, new PdpStatistics());
559 }).hasMessage("pdpGroupName is marked @NonNull but is null");
561 assertThatThrownBy(() -> {
562 new PdpProvider().updatePdpStatistics(pfDao, null, null, "inst", null);
563 }).hasMessage("pdpGroupName is marked @NonNull but is null");
565 assertThatThrownBy(() -> {
566 new PdpProvider().updatePdpStatistics(pfDao, null, null, "inst", new PdpStatistics());
567 }).hasMessage("pdpGroupName is marked @NonNull but is null");
569 assertThatThrownBy(() -> {
570 new PdpProvider().updatePdpStatistics(pfDao, null, "TYPE", null, null);
571 }).hasMessage("pdpGroupName is marked @NonNull but is null");
573 assertThatThrownBy(() -> {
574 new PdpProvider().updatePdpStatistics(pfDao, null, "TYPE", null, new PdpStatistics());
575 }).hasMessage("pdpGroupName is marked @NonNull but is null");
577 assertThatThrownBy(() -> {
578 new PdpProvider().updatePdpStatistics(pfDao, null, "TYPE", "inst", null);
579 }).hasMessage("pdpGroupName is marked @NonNull but is null");
581 assertThatThrownBy(() -> {
582 new PdpProvider().updatePdpStatistics(pfDao, null, "TYPE", "inst", new PdpStatistics());
583 }).hasMessage("pdpGroupName is marked @NonNull but is null");
585 assertThatThrownBy(() -> {
586 new PdpProvider().updatePdpStatistics(pfDao, "name", null, null, null);
587 }).hasMessage("pdpType is marked @NonNull but is null");
589 assertThatThrownBy(() -> {
590 new PdpProvider().updatePdpStatistics(pfDao, "name", null, null, new PdpStatistics());
591 }).hasMessage("pdpType is marked @NonNull but is null");
593 assertThatThrownBy(() -> {
594 new PdpProvider().updatePdpStatistics(pfDao, "name", null, "inst", null);
595 }).hasMessage("pdpType is marked @NonNull but is null");
597 assertThatThrownBy(() -> {
598 new PdpProvider().updatePdpStatistics(pfDao, "name", null, "inst", new PdpStatistics());
599 }).hasMessage("pdpType is marked @NonNull but is null");
601 assertThatThrownBy(() -> {
602 new PdpProvider().updatePdpStatistics(pfDao, "name", "TYPE", null, null);
603 }).hasMessage("pdpInstanceId is marked @NonNull but is null");
605 assertThatThrownBy(() -> {
606 new PdpProvider().updatePdpStatistics(pfDao, "name", "TYPE", null, new PdpStatistics());
607 }).hasMessage("pdpInstanceId is marked @NonNull but is null");
609 assertThatThrownBy(() -> {
610 new PdpProvider().updatePdpStatistics(pfDao, "name", "TYPE", "inst", null);
611 }).hasMessage("pdpStatistics is marked @NonNull but is null");
613 new PdpProvider().updatePdpStatistics(pfDao, "name", "TYPE", "inst", new PdpStatistics());