Changes for Checkstyle 8.32
[policy/models.git] / models-pdp / src / test / java / org / onap / policy / models / pdp / persistence / provider / PdpProviderTest.java
index bc77e4b..7dc5d3a 100644 (file)
@@ -26,11 +26,10 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertTrue;
 
-import java.sql.Connection;
-import java.sql.DriverManager;
 import java.util.ArrayList;
 import java.util.List;
-
+import java.util.Properties;
+import org.eclipse.persistence.config.PersistenceUnitProperties;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -49,7 +48,6 @@ import org.onap.policy.models.pdp.concepts.PdpStatistics;
 import org.onap.policy.models.pdp.concepts.PdpSubGroup;
 import org.onap.policy.models.pdp.enums.PdpHealthStatus;
 import org.onap.policy.models.pdp.enums.PdpState;
-import org.onap.policy.models.pdp.persistence.provider.PdpProvider;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyIdentifier;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeIdentifier;
 import org.onap.policy.models.tosca.simple.provider.SimpleToscaProvider;
@@ -60,7 +58,12 @@ import org.onap.policy.models.tosca.simple.provider.SimpleToscaProvider;
  * @author Liam Fallon (liam.fallon@est.tech)
  */
 public class PdpProviderTest {
-    private Connection connection;
+    private static final String PDP_GROUPS0_JSON = "testdata/PdpGroups0.json";
+    private static final String PDP_TYPE_IS_NULL = "pdpType is marked .*ull but is null";
+    private static final String SUBGROUP_IS_NULL = "pdpSubGroup is marked .*ull but is null";
+    private static final String GROUP_IS_NULL = "pdpGroupName is marked .*ull but is null";
+    private static final String DAO_IS_NULL = "dao is marked .*ull but is null";
+    private static final String PDP_GROUP0 = "PdpGroup0";
     private PfDao pfDao;
     private StandardCoder standardCoder;
 
@@ -72,17 +75,21 @@ public class PdpProviderTest {
      */
     @Before
     public void setupDao() throws Exception {
-        // Use the JDBC UI "jdbc:h2:mem:testdb" to test towards the h2 database
-        // Use the JDBC UI "jdbc:mariadb://localhost:3306/policy" to test towards a locally installed mariadb instance
-        connection = DriverManager.getConnection("jdbc:h2:mem:testdb", "policy", "P01icY");
-
         final DaoParameters daoParameters = new DaoParameters();
-        daoParameters.setPluginClass(DefaultPfDao.class.getCanonicalName());
+        daoParameters.setPluginClass(DefaultPfDao.class.getName());
 
-        // Use the persistence unit ToscaConceptTest to test towards the h2 database
-        // Use the persistence unit ToscaConceptMariaDBTest to test towards a locally installed mariadb instance
         daoParameters.setPersistenceUnit("ToscaConceptTest");
 
+        Properties jdbcProperties = new Properties();
+        jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_USER, "policy");
+        jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_PASSWORD, "P01icY");
+
+        // H2, use "org.mariadb.jdbc.Driver" and "jdbc:mariadb://localhost:3306/policy" for locally installed MariaDB
+        jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_DRIVER, "org.h2.Driver");
+        jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_URL, "jdbc:h2:mem:testdb");
+
+        daoParameters.setJdbcProperties(jdbcProperties);
+
         pfDao = new PfDaoFactory().createPfDao(daoParameters);
         pfDao.init(daoParameters);
     }
@@ -96,26 +103,21 @@ public class PdpProviderTest {
     }
 
     @After
-    public void teardown() throws Exception {
+    public void teardown() {
         pfDao.close();
-        connection.close();
     }
 
     @Test
     public void testGroupsGet() throws Exception {
         assertThatThrownBy(() -> {
-            new PdpProvider().getPdpGroups(null, null, null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().getPdpGroups(null, null, "version");
-        }).hasMessage("dao is marked @NonNull but is null");
+            new PdpProvider().getPdpGroups(null, null);
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().getPdpGroups(null, "name", "version");
-        }).hasMessage("dao is marked @NonNull but is null");
+            new PdpProvider().getPdpGroups(null, "name");
+        }).hasMessageMatching(DAO_IS_NULL);
 
-        String originalJson = ResourceUtils.getResourceAsString("testdata/PdpGroups0.json");
+        String originalJson = ResourceUtils.getResourceAsString(PDP_GROUPS0_JSON);
         PdpGroups pdpGroups0 = standardCoder.decode(originalJson, PdpGroups.class);
 
         PdpGroups createdPdpGroups0 = new PdpGroups();
@@ -124,7 +126,7 @@ public class PdpProviderTest {
         assertEquals(originalJson.replaceAll("\\s+", ""), createdJson.replaceAll("\\s+", ""));
 
         PdpGroups gotPdpGroups0 = new PdpGroups();
-        gotPdpGroups0.setGroups(new PdpProvider().getPdpGroups(pfDao, "PdpGroup0", "1.2.3"));
+        gotPdpGroups0.setGroups(new PdpProvider().getPdpGroups(pfDao, PDP_GROUP0));
 
         String gotJson = standardCoder.encode(gotPdpGroups0);
 
@@ -135,15 +137,15 @@ public class PdpProviderTest {
     public void testFilteredPdpGroupGet() throws Exception {
         assertThatThrownBy(() -> {
             new PdpProvider().getFilteredPdpGroups(null, null);
-        }).hasMessage("dao is marked @NonNull but is null");
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
             new PdpProvider().getFilteredPdpGroups(null, PdpGroupFilter.builder().build());
-        }).hasMessage("dao is marked @NonNull but is null");
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
             new PdpProvider().getFilteredPdpGroups(pfDao, null);
-        }).hasMessage("filter is marked @NonNull but is null");
+        }).hasMessageMatching("filter is marked .*ull but is null");
 
         String originalJson = ResourceUtils.getResourceAsString("testdata/PdpGroupsForFiltering.json");
         PdpGroups pdpGroups0 = standardCoder.decode(originalJson, PdpGroups.class);
@@ -159,8 +161,7 @@ public class PdpProviderTest {
         // @formatter:off
         final PdpGroupFilter filter = PdpGroupFilter.builder()
                 .groupState(PdpState.PASSIVE)
-                .name("PdpGroup0")
-                .version("1.2.3")
+                .name(PDP_GROUP0)
                 .matchPoliciesExactly(false)
                 .matchPolicyTypesExactly(false)
                 .pdpState(PdpState.PASSIVE)
@@ -176,17 +177,17 @@ public class PdpProviderTest {
     public void testGroupsCreate() throws Exception {
         assertThatThrownBy(() -> {
             new PdpProvider().createPdpGroups(null, null);
-        }).hasMessage("dao is marked @NonNull but is null");
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
             new PdpProvider().createPdpGroups(null, new ArrayList<>());
-        }).hasMessage("dao is marked @NonNull but is null");
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
             new PdpProvider().createPdpGroups(pfDao, null);
-        }).hasMessage("pdpGroups is marked @NonNull but is null");
+        }).hasMessageMatching("pdpGroups is marked .*ull but is null");
 
-        String originalJson = ResourceUtils.getResourceAsString("testdata/PdpGroups0.json");
+        String originalJson = ResourceUtils.getResourceAsString(PDP_GROUPS0_JSON);
         PdpGroups pdpGroups0 = standardCoder.decode(originalJson, PdpGroups.class);
 
         PdpGroups createdPdpGroups0 = new PdpGroups();
@@ -195,7 +196,7 @@ public class PdpProviderTest {
         assertEquals(originalJson.replaceAll("\\s+", ""), createdJson.replaceAll("\\s+", ""));
 
         PdpGroups gotPdpGroups0 = new PdpGroups();
-        gotPdpGroups0.setGroups(new PdpProvider().getPdpGroups(pfDao, "PdpGroup0", "1.2.3"));
+        gotPdpGroups0.setGroups(new PdpProvider().getPdpGroups(pfDao, PDP_GROUP0));
 
         String gotJson = standardCoder.encode(gotPdpGroups0);
         assertEquals(originalJson.replaceAll("\\s+", ""), gotJson.replaceAll("\\s+", ""));
@@ -221,7 +222,7 @@ public class PdpProviderTest {
         assertEquals(originalTweakedJson.replaceAll("\\s+", ""), createdJson.replaceAll("\\s+", ""));
 
         PdpGroups gotPdpGroups0 = new PdpGroups();
-        gotPdpGroups0.setGroups(new PdpProvider().getPdpGroups(pfDao, "TestPdpGroup", "1.2.3"));
+        gotPdpGroups0.setGroups(new PdpProvider().getPdpGroups(pfDao, "TestPdpGroup"));
 
         String gotJson = standardCoder.encode(gotPdpGroups0);
         assertEquals(originalTweakedJson.replaceAll("\\s+", ""), gotJson.replaceAll("\\s+", ""));
@@ -231,17 +232,17 @@ public class PdpProviderTest {
     public void testGroupsUpdate() throws Exception {
         assertThatThrownBy(() -> {
             new PdpProvider().updatePdpGroups(null, null);
-        }).hasMessage("dao is marked @NonNull but is null");
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
             new PdpProvider().updatePdpGroups(null, new ArrayList<>());
-        }).hasMessage("dao is marked @NonNull but is null");
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
             new PdpProvider().updatePdpGroups(pfDao, null);
-        }).hasMessage("pdpGroups is marked @NonNull but is null");
+        }).hasMessageMatching("pdpGroups is marked .*ull but is null");
 
-        String originalJson = ResourceUtils.getResourceAsString("testdata/PdpGroups0.json");
+        String originalJson = ResourceUtils.getResourceAsString(PDP_GROUPS0_JSON);
         PdpGroups pdpGroups0 = standardCoder.decode(originalJson, PdpGroups.class);
 
         PdpGroups createdPdpGroups0 = new PdpGroups();
@@ -250,7 +251,7 @@ public class PdpProviderTest {
         assertEquals(originalJson.replaceAll("\\s+", ""), createdJson.replaceAll("\\s+", ""));
 
         PdpGroups gotPdpGroups0 = new PdpGroups();
-        gotPdpGroups0.setGroups(new PdpProvider().getPdpGroups(pfDao, "PdpGroup0", "1.2.3"));
+        gotPdpGroups0.setGroups(new PdpProvider().getPdpGroups(pfDao, PDP_GROUP0));
 
         String gotJson = standardCoder.encode(gotPdpGroups0);
         assertEquals(originalJson.replaceAll("\\s+", ""), gotJson.replaceAll("\\s+", ""));
@@ -274,34 +275,22 @@ public class PdpProviderTest {
     @Test
     public void testPoliciesDelete() throws Exception {
         assertThatThrownBy(() -> {
-            new PdpProvider().deletePdpGroup(null, null, null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().deletePdpGroup(null, null, "version");
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().deletePdpGroup(null, "name", null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().deletePdpGroup(null, "name", "version");
-        }).hasMessage("dao is marked @NonNull but is null");
+            new PdpProvider().deletePdpGroup(null, null);
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().deletePdpGroup(pfDao, null, "version");
-        }).hasMessage("name is marked @NonNull but is null");
+            new PdpProvider().deletePdpGroup(null, "name");
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().deletePdpGroup(pfDao, "name", null);
-        }).hasMessage("version is marked @NonNull but is null");
+            new PdpProvider().deletePdpGroup(pfDao, null);
+        }).hasMessageMatching("name is marked .*ull but is null");
 
         assertThatThrownBy(() -> {
-            new PdpProvider().deletePdpGroup(pfDao, "name", "version");
-        }).hasMessage("delete of PDP group \"name:version\" failed, PDP group does not exist");
+            new PdpProvider().deletePdpGroup(pfDao, "name");
+        }).hasMessage("delete of PDP group \"name:0.0.0\" failed, PDP group does not exist");
 
-        String originalJson = ResourceUtils.getResourceAsString("testdata/PdpGroups0.json");
+        String originalJson = ResourceUtils.getResourceAsString(PDP_GROUPS0_JSON);
         PdpGroups pdpGroups0 = standardCoder.decode(originalJson, PdpGroups.class);
 
         PdpGroups createdPdpGroups0 = new PdpGroups();
@@ -310,85 +299,57 @@ public class PdpProviderTest {
         assertEquals(originalJson.replaceAll("\\s+", ""), createdJson.replaceAll("\\s+", ""));
 
         PdpGroups gotPdpGroups0 = new PdpGroups();
-        gotPdpGroups0.setGroups(new PdpProvider().getPdpGroups(pfDao, "PdpGroup0", "1.2.3"));
+        gotPdpGroups0.setGroups(new PdpProvider().getPdpGroups(pfDao, PDP_GROUP0));
 
         String gotJson = standardCoder.encode(gotPdpGroups0);
         assertEquals(originalJson.replaceAll("\\s+", ""), gotJson.replaceAll("\\s+", ""));
 
-        PdpGroup deletedPdpGroup = new PdpProvider().deletePdpGroup(pfDao, "PdpGroup0", "1.2.3");
+        PdpGroup deletedPdpGroup = new PdpProvider().deletePdpGroup(pfDao, PDP_GROUP0);
 
         assertEquals(createdPdpGroups0.getGroups().get(0), deletedPdpGroup);
 
-        assertEquals(0, new PdpProvider().getPdpGroups(pfDao, "PdpGroup0", "1.2.3").size());
+        assertEquals(0, new PdpProvider().getPdpGroups(pfDao, PDP_GROUP0).size());
 
         assertThatThrownBy(() -> {
-            new PdpProvider().deletePdpGroup(pfDao, "PdpGroup0", "1.2.3");
-        }).hasMessage("delete of PDP group \"PdpGroup0:1.2.3\" failed, PDP group does not exist");
+            new PdpProvider().deletePdpGroup(pfDao, PDP_GROUP0);
+        }).hasMessage("delete of PDP group \"PdpGroup0:0.0.0\" failed, PDP group does not exist");
     }
 
     @Test
     public void testPdpSubgroupUpdate() throws Exception {
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpSubGroup(null, null, null, null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpSubGroup(null, null, null, new PdpSubGroup());
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpSubGroup(null, null, "version", null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpSubGroup(null, null, "version", new PdpSubGroup());
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpSubGroup(null, "name", null, null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpSubGroup(null, "name", null, new PdpSubGroup());
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpSubGroup(null, "name", "version", null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpSubGroup(null, "name", "version", new PdpSubGroup());
-        }).hasMessage("dao is marked @NonNull but is null");
+            new PdpProvider().updatePdpSubGroup(null, null, null);
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpSubGroup(pfDao, null, null, new PdpSubGroup());
-        }).hasMessage("pdpGroupName is marked @NonNull but is null");
+            new PdpProvider().updatePdpSubGroup(null, null, new PdpSubGroup());
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpSubGroup(pfDao, null, "version", null);
-        }).hasMessage("pdpGroupName is marked @NonNull but is null");
+            new PdpProvider().updatePdpSubGroup(null, "name", null);
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpSubGroup(pfDao, null, "version", new PdpSubGroup());
-        }).hasMessage("pdpGroupName is marked @NonNull but is null");
+            new PdpProvider().updatePdpSubGroup(null, "name", new PdpSubGroup());
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpSubGroup(pfDao, "name", null, null);
-        }).hasMessage("pdpGroupVersion is marked @NonNull but is null");
+            new PdpProvider().updatePdpSubGroup(pfDao, null, null);
+        }).hasMessageMatching(GROUP_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpSubGroup(pfDao, "name", null, new PdpSubGroup());
-        }).hasMessage("pdpGroupVersion is marked @NonNull but is null");
+            new PdpProvider().updatePdpSubGroup(pfDao, null, new PdpSubGroup());
+        }).hasMessageMatching(GROUP_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpSubGroup(pfDao, "name", "version", null);
-        }).hasMessage("pdpSubGroup is marked @NonNull but is null");
+            new PdpProvider().updatePdpSubGroup(pfDao, "name", null);
+        }).hasMessageMatching(SUBGROUP_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpSubGroup(pfDao, "name", "version", new PdpSubGroup());
+            new PdpProvider().updatePdpSubGroup(pfDao, "name", new PdpSubGroup());
         }).hasMessage("parameter \"localName\" is null");
 
-        String originalJson = ResourceUtils.getResourceAsString("testdata/PdpGroups0.json");
+        String originalJson = ResourceUtils.getResourceAsString(PDP_GROUPS0_JSON);
         PdpGroups pdpGroups0 = standardCoder.decode(originalJson, PdpGroups.class);
 
         PdpGroups createdPdpGroups0 = new PdpGroups();
@@ -397,7 +358,7 @@ public class PdpProviderTest {
         assertEquals(originalJson.replaceAll("\\s+", ""), createdJson.replaceAll("\\s+", ""));
 
         PdpGroups gotPdpGroups0 = new PdpGroups();
-        gotPdpGroups0.setGroups(new PdpProvider().getPdpGroups(pfDao, "PdpGroup0", "1.2.3"));
+        gotPdpGroups0.setGroups(new PdpProvider().getPdpGroups(pfDao, PDP_GROUP0));
 
         String gotJson = standardCoder.encode(gotPdpGroups0);
         assertEquals(originalJson.replaceAll("\\s+", ""), gotJson.replaceAll("\\s+", ""));
@@ -405,157 +366,86 @@ public class PdpProviderTest {
         PdpSubGroup existingSubGroup = gotPdpGroups0.getGroups().get(0).getPdpSubgroups().get(0);
         existingSubGroup.setCurrentInstanceCount(10);
         existingSubGroup.setDesiredInstanceCount(10);
-        new PdpProvider().updatePdpSubGroup(pfDao, "PdpGroup0", "1.2.3", existingSubGroup);
+        new PdpProvider().updatePdpSubGroup(pfDao, PDP_GROUP0, existingSubGroup);
 
-        List<PdpGroup> afterUpdatePdpGroups = new PdpProvider().getPdpGroups(pfDao, "PdpGroup0", "1.2.3");
+        List<PdpGroup> afterUpdatePdpGroups = new PdpProvider().getPdpGroups(pfDao, PDP_GROUP0);
         assertEquals(10, afterUpdatePdpGroups.get(0).getPdpSubgroups().get(0).getCurrentInstanceCount());
         assertEquals(10, afterUpdatePdpGroups.get(0).getPdpSubgroups().get(0).getDesiredInstanceCount());
 
         existingSubGroup.setDesiredInstanceCount(-1);
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpSubGroup(pfDao, "PdpGroup0", "1.2.3", existingSubGroup);
+            new PdpProvider().updatePdpSubGroup(pfDao, PDP_GROUP0, existingSubGroup);
         }).hasMessageContaining("INVALID:the desired instance count of a PDP sub group may not be negative");
         existingSubGroup.setDesiredInstanceCount(10);
-
-        existingSubGroup.setPdpType("Loooooooooooooooooooooooooooooooooooooooo"
-                + "ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongKey");
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpSubGroup(pfDao, "PdpGroup0", "1.2.3", existingSubGroup);
-        }).hasMessageContaining("Value too long for column");
-        existingSubGroup.setPdpType("APEX");
     }
 
     @Test
     public void testPdpUpdate() throws Exception {
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(null, null, null, null, null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(null, null, null, null, new Pdp());
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(null, null, null, "TYPE", null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(null, null, null, "TYPE", new Pdp());
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(null, null, "version", null, null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(null, null, "version", null, new Pdp());
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(null, null, "version", "TYPE", null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(null, null, "version", "TYPE", new Pdp());
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(null, "name", null, null, null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(null, "name", null, null, new Pdp());
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(null, "name", null, "TYPE", null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(null, "name", null, "TYPE", new Pdp());
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(null, "name", "version", null, null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(null, "name", "version", null, new Pdp());
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(null, "name", "version", "TYPE", null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(null, "name", "version", "TYPE", new Pdp());
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(pfDao, null, null, null, null);
-        }).hasMessage("pdpGroupName is marked @NonNull but is null");
+            new PdpProvider().updatePdp(null, null, null, null);
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(pfDao, null, null, null, new Pdp());
-        }).hasMessage("pdpGroupName is marked @NonNull but is null");
+            new PdpProvider().updatePdp(null, null, null, new Pdp());
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(pfDao, null, null, "TYPE", null);
-        }).hasMessage("pdpGroupName is marked @NonNull but is null");
+            new PdpProvider().updatePdp(null, null, "TYPE", null);
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(pfDao, null, null, "TYPE", new Pdp());
-        }).hasMessage("pdpGroupName is marked @NonNull but is null");
+            new PdpProvider().updatePdp(null, null, "TYPE", new Pdp());
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(pfDao, null, "version", null, null);
-        }).hasMessage("pdpGroupName is marked @NonNull but is null");
+            new PdpProvider().updatePdp(null, "name", null, null);
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(pfDao, null, "version", null, new Pdp());
-        }).hasMessage("pdpGroupName is marked @NonNull but is null");
+            new PdpProvider().updatePdp(null, "name", null, new Pdp());
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(pfDao, null, "version", "TYPE", null);
-        }).hasMessage("pdpGroupName is marked @NonNull but is null");
+            new PdpProvider().updatePdp(null, "name", "TYPE", null);
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(pfDao, null, "version", "TYPE", new Pdp());
-        }).hasMessage("pdpGroupName is marked @NonNull but is null");
+            new PdpProvider().updatePdp(null, "name", "TYPE", new Pdp());
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(pfDao, "name", null, null, null);
-        }).hasMessage("pdpGroupVersion is marked @NonNull but is null");
+            new PdpProvider().updatePdp(pfDao, null, null, null);
+        }).hasMessageMatching(GROUP_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(pfDao, "name", null, null, new Pdp());
-        }).hasMessage("pdpGroupVersion is marked @NonNull but is null");
+            new PdpProvider().updatePdp(pfDao, null, null, new Pdp());
+        }).hasMessageMatching(GROUP_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(pfDao, "name", null, "TYPE", null);
-        }).hasMessage("pdpGroupVersion is marked @NonNull but is null");
+            new PdpProvider().updatePdp(pfDao, null, "TYPE", null);
+        }).hasMessageMatching(GROUP_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(pfDao, "name", null, "TYPE", new Pdp());
-        }).hasMessage("pdpGroupVersion is marked @NonNull but is null");
+            new PdpProvider().updatePdp(pfDao, null, "TYPE", new Pdp());
+        }).hasMessageMatching(GROUP_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(pfDao, "name", "version", null, null);
-        }).hasMessage("pdpSubGroup is marked @NonNull but is null");
+            new PdpProvider().updatePdp(pfDao, "name", null, null);
+        }).hasMessageMatching(SUBGROUP_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(pfDao, "name", "version", null, new Pdp());
-        }).hasMessage("pdpSubGroup is marked @NonNull but is null");
+            new PdpProvider().updatePdp(pfDao, "name", null, new Pdp());
+        }).hasMessageMatching(SUBGROUP_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(pfDao, "name", "version", "TYPE", null);
-        }).hasMessage("pdp is marked @NonNull but is null");
+            new PdpProvider().updatePdp(pfDao, "name", "TYPE", null);
+        }).hasMessageMatching("pdp is marked .*ull but is null");
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(pfDao, "name", "version", "TYPE", new Pdp());
+            new PdpProvider().updatePdp(pfDao, "name", "TYPE", new Pdp());
         }).hasMessage("parameter \"localName\" is null");
 
-        String originalJson = ResourceUtils.getResourceAsString("testdata/PdpGroups0.json");
+        String originalJson = ResourceUtils.getResourceAsString(PDP_GROUPS0_JSON);
         PdpGroups pdpGroups0 = standardCoder.decode(originalJson, PdpGroups.class);
 
         PdpGroups createdPdpGroups0 = new PdpGroups();
@@ -564,7 +454,7 @@ public class PdpProviderTest {
         assertEquals(originalJson.replaceAll("\\s+", ""), createdJson.replaceAll("\\s+", ""));
 
         PdpGroups gotPdpGroups0 = new PdpGroups();
-        gotPdpGroups0.setGroups(new PdpProvider().getPdpGroups(pfDao, "PdpGroup0", "1.2.3"));
+        gotPdpGroups0.setGroups(new PdpProvider().getPdpGroups(pfDao, PDP_GROUP0));
 
         String gotJson = standardCoder.encode(gotPdpGroups0);
         assertEquals(originalJson.replaceAll("\\s+", ""), gotJson.replaceAll("\\s+", ""));
@@ -572,9 +462,9 @@ public class PdpProviderTest {
         Pdp existingPdp = gotPdpGroups0.getGroups().get(0).getPdpSubgroups().get(0).getPdpInstances().get(0);
         existingPdp.setPdpState(PdpState.TEST);
         existingPdp.setHealthy(PdpHealthStatus.TEST_IN_PROGRESS);
-        new PdpProvider().updatePdp(pfDao, "PdpGroup0", "1.2.3", "APEX", existingPdp);
+        new PdpProvider().updatePdp(pfDao, PDP_GROUP0, "APEX", existingPdp);
 
-        List<PdpGroup> afterUpdatePdpGroups = new PdpProvider().getPdpGroups(pfDao, "PdpGroup0", "1.2.3");
+        List<PdpGroup> afterUpdatePdpGroups = new PdpProvider().getPdpGroups(pfDao, PDP_GROUP0);
         assertEquals(PdpState.TEST,
                 afterUpdatePdpGroups.get(0).getPdpSubgroups().get(0).getPdpInstances().get(0).getPdpState());
         assertEquals(PdpHealthStatus.TEST_IN_PROGRESS,
@@ -582,7 +472,7 @@ public class PdpProviderTest {
 
         existingPdp.setMessage("");
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdp(pfDao, "PdpGroup0", "1.2.3", "APEX", existingPdp);
+            new PdpProvider().updatePdp(pfDao, PDP_GROUP0, "APEX", existingPdp);
         }).hasMessageContaining("INVALID:message may not be blank");
         existingPdp.setMessage("A Message");
     }
@@ -590,274 +480,142 @@ public class PdpProviderTest {
     @Test
     public void testGetPdpStatistics() throws PfModelException {
         assertThatThrownBy(() -> {
-            new PdpProvider().getPdpStatistics(null, null, null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().getPdpStatistics(null, null, "version");
-        }).hasMessage("dao is marked @NonNull but is null");
+            new PdpProvider().getPdpStatistics(null, null);
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().getPdpStatistics(null, "name", null);
-        }).hasMessage("dao is marked @NonNull but is null");
+            new PdpProvider().getPdpStatistics(null, "name");
+        }).hasMessageMatching(DAO_IS_NULL);
 
-        assertEquals(0, new PdpProvider().getPdpStatistics(pfDao, "name", "version").size());
+        assertEquals(0, new PdpProvider().getPdpStatistics(pfDao, "name").size());
     }
 
     @Test
     public void testUpdatePdpStatistics() throws PfModelException {
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, null, null, null, null, null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, null, null, null, null, new PdpStatistics());
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, null, null, null, "inst", null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, null, null, null, "inst", new PdpStatistics());
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, null, null, "TYPE", null, null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, null, null, "TYPE", null, new PdpStatistics());
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, null, null, "TYPE", "inst", null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, null, null, "TYPE", "inst", new PdpStatistics());
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, null, "version", null, null, null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, null, "version", null, null, new PdpStatistics());
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, null, "version", null, "inst", null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, null, "version",  null, "inst", new PdpStatistics());
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, null, "version", "TYPE", null, null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, null, "version", "TYPE", null, new PdpStatistics());
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, null, "version", "TYPE", "inst", null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, null, "version", "TYPE", "inst", new PdpStatistics());
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, "name", null, null, null, null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, "name", null, null, null, new PdpStatistics());
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, "name", null, null, "inst", null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, "name", null, null, "inst", new PdpStatistics());
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, "name", null, "TYPE", null, null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, "name", null, "TYPE", null, new PdpStatistics());
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, "name", null, "TYPE", "inst", null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, "name", null, "TYPE", "inst", new PdpStatistics());
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, "name", "version", null, null, null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, "name", "version", null, null, new PdpStatistics());
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, "name", "version", null, "inst", null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, "name", "version", null, "inst", new PdpStatistics());
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, "name", "version", "TYPE", null, null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, "name", "version", "TYPE", null, new PdpStatistics());
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, "name", "version", "TYPE", "inst", null);
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(null, "name", "version", "TYPE", "inst", new PdpStatistics());
-        }).hasMessage("dao is marked @NonNull but is null");
-
-        assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, null, null, null, null, null);
-        }).hasMessage("pdpGroupName is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(null, null, null, null, null);
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, null, null, null, null, new PdpStatistics());
-        }).hasMessage("pdpGroupName is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(null, null, null, null, new PdpStatistics());
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, null, null, null, "inst", null);
-        }).hasMessage("pdpGroupName is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(null, null, null, "inst", null);
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, null, null, null, "inst", new PdpStatistics());
-        }).hasMessage("pdpGroupName is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(null, null, null, "inst", new PdpStatistics());
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, null, null, "TYPE", null, null);
-        }).hasMessage("pdpGroupName is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(null, null, "TYPE", null, null);
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, null, null, "TYPE", null, new PdpStatistics());
-        }).hasMessage("pdpGroupName is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(null, null, "TYPE", null, new PdpStatistics());
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, null, null, "TYPE", "inst", null);
-        }).hasMessage("pdpGroupName is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(null, null, "TYPE", "inst", null);
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, null, null, "TYPE", "inst", new PdpStatistics());
-        }).hasMessage("pdpGroupName is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(null, null, "TYPE", "inst", new PdpStatistics());
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, null, "version", null, null, null);
-        }).hasMessage("pdpGroupName is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(null, "name", null, null, null);
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, null, "version", null, null, new PdpStatistics());
-        }).hasMessage("pdpGroupName is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(null, "name", null, null, new PdpStatistics());
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, null, "version", null, "inst", null);
-        }).hasMessage("pdpGroupName is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(null, "name", null, "inst", null);
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, null, "version",  null, "inst", new PdpStatistics());
-        }).hasMessage("pdpGroupName is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(null, "name", null, "inst", new PdpStatistics());
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, null, "version", "TYPE", null, null);
-        }).hasMessage("pdpGroupName is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(null, "name", "TYPE", null, null);
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, null, "version", "TYPE", null, new PdpStatistics());
-        }).hasMessage("pdpGroupName is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(null, "name", "TYPE", null, new PdpStatistics());
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, null, "version", "TYPE", "inst", null);
-        }).hasMessage("pdpGroupName is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(null, "name", "TYPE", "inst", null);
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, null, "version", "TYPE", "inst", new PdpStatistics());
-        }).hasMessage("pdpGroupName is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(null, "name", "TYPE", "inst", new PdpStatistics());
+        }).hasMessageMatching(DAO_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, "name", null, null, null, null);
-        }).hasMessage("pdpGroupVersion is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(pfDao, null, null, null, null);
+        }).hasMessageMatching(GROUP_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, "name", null, null, null, new PdpStatistics());
-        }).hasMessage("pdpGroupVersion is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(pfDao, null, null, null, new PdpStatistics());
+        }).hasMessageMatching(GROUP_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, "name", null, null, "inst", null);
-        }).hasMessage("pdpGroupVersion is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(pfDao, null, null, "inst", null);
+        }).hasMessageMatching(GROUP_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, "name", null, null, "inst", new PdpStatistics());
-        }).hasMessage("pdpGroupVersion is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(pfDao, null, null, "inst", new PdpStatistics());
+        }).hasMessageMatching(GROUP_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, "name", null, "TYPE", null, null);
-        }).hasMessage("pdpGroupVersion is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(pfDao, null, "TYPE", null, null);
+        }).hasMessageMatching(GROUP_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, "name", null, "TYPE", null, new PdpStatistics());
-        }).hasMessage("pdpGroupVersion is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(pfDao, null, "TYPE", null, new PdpStatistics());
+        }).hasMessageMatching(GROUP_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, "name", null, "TYPE", "inst", null);
-        }).hasMessage("pdpGroupVersion is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(pfDao, null, "TYPE", "inst", null);
+        }).hasMessageMatching(GROUP_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, "name", null, "TYPE", "inst", new PdpStatistics());
-        }).hasMessage("pdpGroupVersion is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(pfDao, null, "TYPE", "inst", new PdpStatistics());
+        }).hasMessageMatching(GROUP_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, "name", "version", null, null, null);
-        }).hasMessage("pdpType is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(pfDao, "name", null, null, null);
+        }).hasMessageMatching(PDP_TYPE_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, "name", "version", null, null, new PdpStatistics());
-        }).hasMessage("pdpType is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(pfDao, "name", null, null, new PdpStatistics());
+        }).hasMessageMatching(PDP_TYPE_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, "name", "version", null, "inst", null);
-        }).hasMessage("pdpType is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(pfDao, "name", null, "inst", null);
+        }).hasMessageMatching(PDP_TYPE_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, "name", "version", null, "inst", new PdpStatistics());
-        }).hasMessage("pdpType is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(pfDao, "name", null, "inst", new PdpStatistics());
+        }).hasMessageMatching(PDP_TYPE_IS_NULL);
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, "name", "version", "TYPE", null, null);
-        }).hasMessage("pdpInstanceId is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(pfDao, "name", "TYPE", null, null);
+        }).hasMessageMatching("pdpInstanceId is marked .*ull but is null");
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, "name", "version", "TYPE", null, new PdpStatistics());
-        }).hasMessage("pdpInstanceId is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(pfDao, "name", "TYPE", null, new PdpStatistics());
+        }).hasMessageMatching("pdpInstanceId is marked .*ull but is null");
 
         assertThatThrownBy(() -> {
-            new PdpProvider().updatePdpStatistics(pfDao, "name", "version", "TYPE", "inst", null);
-        }).hasMessage("pdpStatistics is marked @NonNull but is null");
+            new PdpProvider().updatePdpStatistics(pfDao, "name", "TYPE", "inst", null);
+        }).hasMessageMatching("pdpStatistics is marked .*ull but is null");
 
-        new PdpProvider().updatePdpStatistics(pfDao, "name", "version", "TYPE", "inst", new PdpStatistics());
+        new PdpProvider().updatePdpStatistics(pfDao, "name", "TYPE", "inst", new PdpStatistics());
     }
 }