diff options
author | Jim Hahn <jrh3@att.com> | 2020-06-29 11:53:42 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2020-06-29 12:41:54 -0400 |
commit | c3e5e80e820936b7b0732333211f135c42ee8e53 (patch) | |
tree | 392588e92df797d2bc937e6ba545668bfe5805c9 /main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupDeployProvider.java | |
parent | 81bfcc1729235abebfa4cd2c35cf37aedcadc376 (diff) |
Fix issues in pap for new sonar rules
Addressed issues reported due to updates to the sonar rules:
- invoke only one method in a junit lambda
Issue-ID: POLICY-2679
Change-Id: I422856527b191a45b30a78bb8520f679ca2e7896
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupDeployProvider.java')
-rw-r--r-- | main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupDeployProvider.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupDeployProvider.java b/main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupDeployProvider.java index daa0504a..db320b5c 100644 --- a/main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupDeployProvider.java +++ b/main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupDeployProvider.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP PAP * ================================================================================ - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -594,7 +594,8 @@ public class TestPdpGroupDeployProvider extends ProviderSuper { // subgroup has a different version of the Policy when(dao.getFilteredPdpGroups(any())).thenReturn(loadGroups("upgradeGroupDao_DiffVers.json")); - assertThatThrownBy(() -> prov.deployPolicies(loadRequest())).isInstanceOf(PfModelRuntimeException.class) + PdpDeployPolicies req = loadRequest(); + assertThatThrownBy(() -> prov.deployPolicies(req)).isInstanceOf(PfModelRuntimeException.class) .hasMessageContaining("pdpTypeC").hasMessageContaining("different version already deployed"); verify(dao, never()).createPdpGroups(any()); @@ -608,7 +609,8 @@ public class TestPdpGroupDeployProvider extends ProviderSuper { // subgroup has no PDPs when(dao.getFilteredPdpGroups(any())).thenReturn(loadGroups("upgradeGroup_NoPdpsDao.json")); - assertThatThrownBy(() -> prov.deployPolicies(loadRequest())).isInstanceOf(PfModelRuntimeException.class) + PdpDeployPolicies req = loadRequest(); + assertThatThrownBy(() -> prov.deployPolicies(req)).isInstanceOf(PfModelRuntimeException.class) .hasMessage("group " + GROUP1_NAME + " subgroup " + PDP1_TYPE + " has no active PDPs"); verify(dao, never()).createPdpGroups(any()); |