diff options
author | Dan Timoney <dtimoney@att.com> | 2023-01-31 08:15:34 -0500 |
---|---|---|
committer | Dan Timoney <dtimoney@att.com> | 2023-02-07 10:24:42 -0500 |
commit | 72aef3a6324c78a62d0eff65217d4861440841f5 (patch) | |
tree | 7a208d5d4630a046e05768e004956c4c9cffa253 /adaptors/sql-resource/provider/src/test | |
parent | 8393d347d303d70e4ff4c7c91b7454467545cab3 (diff) |
Fix Java 17 jUnit errors
Add explicit lombok dependency to resolve compile error when compiling
under java 17
Fixed code issues in jUnit tests due to restrictions on reflection
in Java 17, which disallow jUnit from setting system properties
or environment variables.
Issue-ID: CCSDK-3813
Signed-off-by: Dan Timoney <dtimoney@att.com>
Change-Id: I278ee869d2ce0568b29ecc29c37d00d7fce757a8
Diffstat (limited to 'adaptors/sql-resource/provider/src/test')
-rwxr-xr-x | adaptors/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResourceProviderTest.java | 21 |
1 files changed, 1 insertions, 20 deletions
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(); |