diff options
author | liamfallon <liam.fallon@est.tech> | 2019-04-12 12:44:22 +0000 |
---|---|---|
committer | liamfallon <liam.fallon@est.tech> | 2019-04-12 12:44:22 +0000 |
commit | 8a26f57269caf7a559deb46077050048da92dca8 (patch) | |
tree | 160dcaa0ffb7916aea2a657a2319ded94ac82a17 /models-pdp/src/test/java/org/onap | |
parent | ad2f809ab6e723a79d633aacc2239b17e010e843 (diff) |
UNit test and minor fixes for DB pars
Add unit test for the new database provider driver parameter.
Address the comments raised in the last review.
Issue-ID: POLICY-1095
Change-Id: I9f629d9f4446d12bfb492e00e49e07b97ef5a490
Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'models-pdp/src/test/java/org/onap')
-rw-r--r-- | models-pdp/src/test/java/org/onap/policy/models/pdp/persistence/provider/PdpProviderTest.java | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/models-pdp/src/test/java/org/onap/policy/models/pdp/persistence/provider/PdpProviderTest.java b/models-pdp/src/test/java/org/onap/policy/models/pdp/persistence/provider/PdpProviderTest.java index 3b3716846..ee9c76b98 100644 --- a/models-pdp/src/test/java/org/onap/policy/models/pdp/persistence/provider/PdpProviderTest.java +++ b/models-pdp/src/test/java/org/onap/policy/models/pdp/persistence/provider/PdpProviderTest.java @@ -30,6 +30,7 @@ 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; @@ -76,16 +77,12 @@ public class PdpProviderTest { daoParameters.setPersistenceUnit("ToscaConceptTest"); Properties jdbcProperties = new Properties(); - jdbcProperties.setProperty("javax.persistence.jdbc.user", "policy"); - jdbcProperties.setProperty("javax.persistence.jdbc.password", "P01icY"); + jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_USER, "policy"); + jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_PASSWORD, "P01icY"); - // H2 - jdbcProperties.setProperty("javax.persistence.jdbc.driver", "org.h2.Driver"); - jdbcProperties.setProperty("javax.persistence.jdbc.url", "jdbc:h2:mem:testdb"); - - // MariaDB - //jdbcProperties.setProperty("javax.persistence.jdbc.driver", "org.mariadb.jdbc.Driver"); - //jdbcProperties.setProperty("javax.persistence.jdbc.url", "jdbc:mariadb://localhost:3306/policy"); + // 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 ); |