2 * Copyright © 2017-2018 AT&T Intellectual Property.
\r
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
\r
5 * in compliance with the License. You may obtain a copy of the License at
\r
7 * http://www.apache.org/licenses/LICENSE-2.0
\r
9 * Unless required by applicable law or agreed to in writing, software distributed under the License
\r
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
\r
11 * or implied. See the License for the specific language governing permissions and limitations under
\r
15 package org.onap.ccsdk.config.data.adaptor.dao;
\r
17 import org.junit.Assert;
\r
18 import org.junit.FixMethodOrder;
\r
19 import org.junit.Test;
\r
20 import org.junit.runner.RunWith;
\r
21 import org.junit.runners.MethodSorters;
\r
22 import org.springframework.beans.factory.annotation.Autowired;
\r
23 import org.springframework.test.context.ContextConfiguration;
\r
24 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
\r
26 @RunWith(SpringJUnit4ClassRunner.class)
\r
27 @ContextConfiguration(locations = {"classpath:test-context-h2db.xml"})
\r
28 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
\r
29 public class ConfigPropertyMapDaoTest {
\r
32 private ConfigPropertyMapDao configPropertyMapDao;
\r
35 private QueryExecutorDao queryExecutorDao;
\r
38 public void testConfigResourcesData() throws Exception {
\r
39 String sql = "INSERT INTO CONFIG_PROPERTY_MAP (reference_key, reference_value) VALUES ( ?, ?)";
\r
40 Object[] data = new Object[] {"dummy123", "username123"};
\r
41 int result = queryExecutorDao.update(sql, data);
\r
42 Assert.assertNotNull("Failed to get Query Result", result);
\r
44 String propKeyValye = configPropertyMapDao.getConfigPropertyByKey("org.onap.ccsdk.config.rest.adaptors.test");
\r
45 Assert.assertNull("propKeyValue is null", propKeyValye);
\r