diff options
Diffstat (limited to 'adaptors/sql-resource/provider')
-rwxr-xr-x | adaptors/sql-resource/provider/pom.xml | 14 | ||||
-rwxr-xr-x | adaptors/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResourceProviderTest.java | 21 |
2 files changed, 15 insertions, 20 deletions
diff --git a/adaptors/sql-resource/provider/pom.xml b/adaptors/sql-resource/provider/pom.xml index 4a53413cb..c6d256d34 100755 --- a/adaptors/sql-resource/provider/pom.xml +++ b/adaptors/sql-resource/provider/pom.xml @@ -79,4 +79,18 @@ <scope>provided</scope> </dependency> </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <systemPropertyVariables> + <SDNC_CONFIG_DIR>${basedir}/src/test/resources</SDNC_CONFIG_DIR> + </systemPropertyVariables> + </configuration> + </plugin> + </plugins> + </build> </project> diff --git a/adaptors/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResourceProviderTest.java b/adaptors/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResourceProviderTest.java index 6436f1ef1..4b97e1d5a 100755 --- a/adaptors/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResourceProviderTest.java +++ b/adaptors/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResourceProviderTest.java @@ -36,16 +36,7 @@ public class SqlResourceProviderTest { @Test public void testSqlResourceProvider() { - try{ - Map<String, String> env = System.getenv(); - Class<?> cl = env.getClass(); - Field field = cl.getDeclaredField("m"); - field.setAccessible(true); - Map<String, String> writableEnv = (Map<String, String>) field.get(env); - writableEnv.put(SDNC_CONFIG_DIR, "./src/test/resources"); - } catch (Exception e) { - throw new IllegalStateException("Failed to set environment variable", e); - } + provider = new SqlResourcePropertiesProviderImpl(); assertNotNull(provider); @@ -59,16 +50,6 @@ public class SqlResourceProviderTest { @Test public void testReportSuccess() { - try{ - Map<String, String> env = System.getenv(); - Class<?> cl = env.getClass(); - Field field = cl.getDeclaredField("m"); - field.setAccessible(true); - Map<String, String> writableEnv = (Map<String, String>) field.get(env); - writableEnv.put(SDNC_CONFIG_DIR, "./src/test/resources"); - } catch (Exception e) { - throw new IllegalStateException("Failed to set environment variable", e); - } provider = new SqlResourcePropertiesProviderImpl(); Properties properties = provider.getProperties(); |