summaryrefslogtreecommitdiffstats
path: root/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/config/data/adaptor/dao/ConfigTransactionLogDaoTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/config/data/adaptor/dao/ConfigTransactionLogDaoTest.java')
-rw-r--r--blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/config/data/adaptor/dao/ConfigTransactionLogDaoTest.java37
1 files changed, 20 insertions, 17 deletions
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/config/data/adaptor/dao/ConfigTransactionLogDaoTest.java b/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/config/data/adaptor/dao/ConfigTransactionLogDaoTest.java
index 1fceccebf..ba150d510 100644
--- a/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/config/data/adaptor/dao/ConfigTransactionLogDaoTest.java
+++ b/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/config/data/adaptor/dao/ConfigTransactionLogDaoTest.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.dao;
@@ -36,41 +39,41 @@ import com.att.eelf.configuration.EELFManager;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class ConfigTransactionLogDaoTest {
private static EELFLogger logger = EELFManager.getInstance().getLogger(ConfigTransactionLogDaoTest.class);
-
+
@Autowired
private TransactionLogDao transactionLogDao;
-
+
@Autowired
private NamedQueryExecutorDao namedQueryExecutorDao;
-
+
@Before
public void initialise() {
-
+
}
-
+
@Test
public void testQueryExecution() throws Exception {
String requestId = "12345";
-
+
transactionLogDao
.save(new TransactionLog(requestId, DataAdaptorConstants.LOG_MESSAGE_TYPE_LOG, "Received Request"));
-
+
List<TransactionLog> result = transactionLogDao.getTransactionsByRequestId(requestId);
logger.info("DB ArtifactReference :" + result);
Assert.assertNotNull("Failed to get Query Result", result);
-
+
List<TransactionLog> result2 =
transactionLogDao.getTransactionsByRequestId(requestId, DataAdaptorConstants.LOG_MESSAGE_TYPE_LOG);
logger.info("DB ArtifactReference :" + result2);
Assert.assertNotNull("Failed to get Query Result", result2);
-
+
String namedsql = "SELECT * FROM CONFIG_TRANSACTION_LOG WHERE request_id = :request_id";
Map<String, Object> parameters = new HashMap<>();
parameters.put("request_id", "12345");
List<Map<String, Object>> namedresult = namedQueryExecutorDao.query(namedsql, parameters);
logger.info("DB ArtifactReference :" + namedresult);
Assert.assertNotNull("Failed to get Query Result", namedresult);
-
+
}
-
+
}