aboutsummaryrefslogtreecommitdiffstats
path: root/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/config/data/adaptor/service/ConfigResourceNodeTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/config/data/adaptor/service/ConfigResourceNodeTest.java')
-rw-r--r--blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/config/data/adaptor/service/ConfigResourceNodeTest.java39
1 files changed, 21 insertions, 18 deletions
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/config/data/adaptor/service/ConfigResourceNodeTest.java b/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/config/data/adaptor/service/ConfigResourceNodeTest.java
index 847d5ed42..b2f24bf60 100644
--- a/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/config/data/adaptor/service/ConfigResourceNodeTest.java
+++ b/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/config/data/adaptor/service/ConfigResourceNodeTest.java
@@ -1,15 +1,18 @@
/*
* Copyright © 2017-2018 AT&T Intellectual Property.
+ * Modifications Copyright © 2018 IBM.
*
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package org.onap.ccsdk.config.data.adaptor.service;
@@ -35,33 +38,33 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:test-context-h2db.xml"})
public class ConfigResourceNodeTest {
-
+
ConfigResourceNode configResourceNode;
-
+
ConfigResourceService configResourceService;
-
+
@Autowired
TransactionLogDao transactionLogDao;
-
+
@Autowired
ConfigResourceDao configResourceDao;
-
+
@Autowired
QueryExecutorDao queryExecutorDao;
-
+
@Autowired
NamedQueryExecutorDao namedQueryExecutorDao;
-
+
@Autowired
ConfigPropertyMapDao configPropertyMapDao;
-
+
@Before
public void before() {
configResourceService = new ConfigResourceServiceImpl(transactionLogDao, configResourceDao, queryExecutorDao,
namedQueryExecutorDao, configPropertyMapDao);
configResourceNode = new ConfigResourceNode(configResourceService);
}
-
+
@Test
public void testSaveConfigTransactionLog() throws Exception {
Map<String, String> inParams = new HashMap<>();
@@ -69,12 +72,12 @@ public class ConfigResourceNodeTest {
inParams.put(DataAdaptorConstants.INPUT_PARAM_MESSAGE, "message");
SvcLogicContext ctx = new SvcLogicContext();
ctx.setAttribute("request-id", "requestId12345");
-
+
configResourceNode.saveConfigTransactionLog(inParams, ctx);
-
+
Assert.assertTrue(!transactionLogDao.getTransactionsByRequestId("requestId12345").isEmpty());
}
-
+
@Test(expected = SvcLogicException.class)
public void testSaveConfigTransactionLogException() throws Exception {
configResourceNode = new ConfigResourceNode(null);