1 package org.onap.ccsdk.sli.adaptors.resource.sql;
3 import static org.junit.Assert.assertNotNull;
4 import java.lang.reflect.Field;
6 import java.util.Properties;
10 public class SqlResourceProviderTest {
12 private static SqlResourcePropertiesProvider provider;
13 private static final String SDNC_CONFIG_DIR = "SDNC_CONFIG_DIR";
16 public void testSqlResourceProvider() {
18 Map<String, String> env = System.getenv();
19 Class<?> cl = env.getClass();
20 Field field = cl.getDeclaredField("m");
21 field.setAccessible(true);
22 Map<String, String> writableEnv = (Map<String, String>) field.get(env);
23 writableEnv.put(SDNC_CONFIG_DIR, "./src/test/resources");
24 } catch (Exception e) {
25 throw new IllegalStateException("Failed to set environment variable", e);
28 provider = new SqlResourcePropertiesProviderImpl();
29 assertNotNull(provider);
33 public void testGetProperties() {
34 Properties properties = provider.getProperties();
35 assertNotNull(properties);