Fix config files to remove outdated configuration for hibernate
[policy/models.git] / models-tosca / src / test / java / org / onap / policy / models / tosca / authorative / provider / AuthorativeToscaProviderNodeTemplateTest.java
index 2370779..69c4704 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2022 Nordix Foundation.
+ *  Copyright (C) 2022-2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -29,7 +29,6 @@ import static org.junit.Assert.assertTrue;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
-import org.eclipse.persistence.config.PersistenceUnitProperties;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -37,7 +36,6 @@ import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.coder.StandardCoder;
 import org.onap.policy.common.utils.coder.YamlJsonTranslator;
 import org.onap.policy.common.utils.resources.ResourceUtils;
-import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.base.PfModelException;
 import org.onap.policy.models.dao.DaoParameters;
 import org.onap.policy.models.dao.PfDao;
@@ -65,8 +63,8 @@ public class AuthorativeToscaProviderNodeTemplateTest {
     private static ToscaServiceTemplate createToscaNodeTemplate;
     private PfDao pfDao;
     private StandardCoder standardCoder;
-    private AuthorativeToscaProvider authorativeToscaProvider = new AuthorativeToscaProvider();
-    private YamlJsonTranslator yamlJsonTranslator = new YamlJsonTranslator();
+    private final AuthorativeToscaProvider authorativeToscaProvider = new AuthorativeToscaProvider();
+    private final YamlJsonTranslator yamlJsonTranslator = new YamlJsonTranslator();
 
     /**
      * Read policy metadataSet input json.
@@ -97,18 +95,16 @@ public class AuthorativeToscaProviderNodeTemplateTest {
         daoParameters.setPersistenceUnit("ToscaConceptTest");
 
         Properties jdbcProperties = new Properties();
-        jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_USER, "policy");
-        jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_PASSWORD, "P01icY");
-
+        jdbcProperties.setProperty("jakarta.persistence.jdbc.user", "policy");
+        jdbcProperties.setProperty("jakarta.persistence.jdbc.password", "P01icY");
         if (System.getProperty("USE-MARIADB") != null) {
-            jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_DRIVER, "org.mariadb.jdbc.Driver");
-            jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_URL, "jdbc:mariadb://localhost:3306/policy");
+            jdbcProperties.setProperty("jakarta.persistence.jdbc.driver", "org.mariadb.jdbc.Driver");
+            jdbcProperties.setProperty("jakarta.persistence.jdbc.url", "jdbc:mariadb://localhost:3306/policy");
         } else {
-            jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_DRIVER, "org.h2.Driver");
-            jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_URL,
+            jdbcProperties.setProperty("jakarta.persistence.jdbc.driver", "org.h2.Driver");
+            jdbcProperties.setProperty("jakarta.persistence.jdbc.url",
                 "jdbc:h2:mem:AuthorativeToscaProviderNodeTemplatesTest");
         }
-
         daoParameters.setJdbcProperties(jdbcProperties);
 
         pfDao = new PfDaoFactory().createPfDao(daoParameters);
@@ -234,7 +230,7 @@ public class AuthorativeToscaProviderNodeTemplateTest {
     }
 
     @Test
-    public void testToscaNodeTemplatetDelete() throws Exception {
+    public void testToscaNodeTemplateDelete() throws Exception {
         assertThatThrownBy(() -> {
             authorativeToscaProvider.deleteToscaNodeTemplate(null, null, null);
         }).hasMessageMatching(DAO_IS_NULL);