summaryrefslogtreecommitdiffstats
path: root/main/src/test
diff options
context:
space:
mode:
authorRashmi Pujar <rashmi.pujar1@bell.ca>2022-02-23 11:27:07 -0500
committerRam Krishna Verma <ram_krishna.verma@bell.ca>2022-02-24 17:16:17 +0000
commitb2e669ed9a55fea534e01262b04b4529fa2e998d (patch)
treeaab49977dab5038d12e70fbd7b826cb6b5af9f0d /main/src/test
parentb9a8400bb36952c2cc3c706399b3863a52ab006a (diff)
Migrate API DB provider to springboot data jpa
PolicyProviders and PolicyTypeProvider will be removed once the NodeTemplateController migration is complete. Issue-ID: POLICY-3924 Signed-off-by: Rashmi Pujar <rashmi.pujar1@bell.ca> Change-Id: I01a7491c9a09d78a79a4c887f5a49024af648b8b
Diffstat (limited to 'main/src/test')
-rw-r--r--main/src/test/java/org/onap/policy/api/main/rest/TestApiStatisticsManager.java3
-rw-r--r--main/src/test/resources/application-test.yaml14
2 files changed, 16 insertions, 1 deletions
diff --git a/main/src/test/java/org/onap/policy/api/main/rest/TestApiStatisticsManager.java b/main/src/test/java/org/onap/policy/api/main/rest/TestApiStatisticsManager.java
index bc67d21c..48484d6e 100644
--- a/main/src/test/java/org/onap/policy/api/main/rest/TestApiStatisticsManager.java
+++ b/main/src/test/java/org/onap/policy/api/main/rest/TestApiStatisticsManager.java
@@ -26,6 +26,7 @@ package org.onap.policy.api.main.rest;
import static org.junit.Assert.assertEquals;
+import lombok.RequiredArgsConstructor;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.onap.policy.api.main.PolicyApiApplication;
@@ -40,7 +41,7 @@ import org.springframework.test.context.junit4.SpringRunner;
public class TestApiStatisticsManager {
@Autowired
- private ApiStatisticsManager mgr = new ApiStatisticsManager();
+ private ApiStatisticsManager mgr;
@Test
public void testUpdateMethods() {
diff --git a/main/src/test/resources/application-test.yaml b/main/src/test/resources/application-test.yaml
index 240d3640..6ed69ea0 100644
--- a/main/src/test/resources/application-test.yaml
+++ b/main/src/test/resources/application-test.yaml
@@ -1,3 +1,17 @@
+spring:
+ datasource:
+ url: jdbc:h2:mem:testdb
+ driverClassName: org.h2.Driver
+ jpa:
+ properties:
+ hibernate:
+ dialect: org.hibernate.dialect.H2Dialect
+ hibernate:
+ ddl-auto: update
+ naming:
+ physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
+ implicit-strategy: org.onap.policy.common.spring.utils.CustomImplicitNamingStrategy
+
database:
name: PolicyProviderParameterGroup
implementation: org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl