tamaya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pottlin...@apache.org
Subject incubator-tamaya git commit: Fix tests
Date Mon, 30 Oct 2017 21:17:14 GMT
Repository: incubator-tamaya
Updated Branches:
  refs/heads/master 2e44ea50e -> 35f3b45a1


Fix tests

and eliminate warnings.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/35f3b45a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/35f3b45a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/35f3b45a

Branch: refs/heads/master
Commit: 35f3b45a1a6382593ad145f86b3866c30a3b8e25
Parents: 2e44ea5
Author: Phil Ottlinger <pottlinger@apache.org>
Authored: Mon Oct 30 22:17:00 2017 +0100
Committer: Phil Ottlinger <pottlinger@apache.org>
Committed: Mon Oct 30 22:17:00 2017 +0100

----------------------------------------------------------------------
 .../core/propertysource/CLIPropertySourceTest.java  | 14 +++++++-------
 .../EnvironmentPropertySourceTest.java              | 16 +++++++---------
 2 files changed, 14 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/35f3b45a/code/core/src/test/java/org/apache/tamaya/core/propertysource/CLIPropertySourceTest.java
----------------------------------------------------------------------
diff --git a/code/core/src/test/java/org/apache/tamaya/core/propertysource/CLIPropertySourceTest.java
b/code/core/src/test/java/org/apache/tamaya/core/propertysource/CLIPropertySourceTest.java
index 20126f3..bd6468b 100644
--- a/code/core/src/test/java/org/apache/tamaya/core/propertysource/CLIPropertySourceTest.java
+++ b/code/core/src/test/java/org/apache/tamaya/core/propertysource/CLIPropertySourceTest.java
@@ -40,19 +40,19 @@ public class CLIPropertySourceTest {
         assertEquals(ps.getProperties().get("c").getValue(), "c");
         CLIPropertySource.initMainArgs("sss");
         assertFalse(ps.getProperties().isEmpty());
-        assertEquals(ps.getProperties().get("sss").getValue(), "sss");
+        assertEquals("sss", ps.getProperties().get("sss").getValue());
         CLIPropertySource.initMainArgs("-a", "b", "--c", "sss", "--val=vvv");
         assertFalse(ps.getProperties().isEmpty());
-        assertEquals(ps.getProperties().get("a").getValue(), "b");
-        assertEquals(ps.getProperties().get("c").getValue(), "c");
-        assertEquals(ps.getProperties().get("sss").getValue(), "sss");
+        assertEquals("b", ps.getProperties().get("a").getValue());
+        assertEquals("c", ps.getProperties().get("c").getValue());
+        assertEquals("sss", ps.getProperties().get("sss").getValue());
     // getProperties() throws Exception {
         System.setProperty("main.args", "-a b\t--c sss  ");
         ps = new CLIPropertySource();
         assertFalse(ps.getProperties().isEmpty());
         System.clearProperty("main.args");
-        assertEquals(ps.getProperties().get("a").getValue(), "b");
-        assertEquals(ps.getProperties().get("c").getValue(), "c");
-        assertEquals(ps.getProperties().get("sss").getValue(), "sss");
+        assertEquals("b", ps.getProperties().get("a").getValue());
+        assertEquals("c", ps.getProperties().get("c").getValue());
+        assertEquals("sss", ps.getProperties().get("sss").getValue());
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/35f3b45a/code/core/src/test/java/org/apache/tamaya/core/propertysource/EnvironmentPropertySourceTest.java
----------------------------------------------------------------------
diff --git a/code/core/src/test/java/org/apache/tamaya/core/propertysource/EnvironmentPropertySourceTest.java
b/code/core/src/test/java/org/apache/tamaya/core/propertysource/EnvironmentPropertySourceTest.java
index 80c4a65..477ffb2 100644
--- a/code/core/src/test/java/org/apache/tamaya/core/propertysource/EnvironmentPropertySourceTest.java
+++ b/code/core/src/test/java/org/apache/tamaya/core/propertysource/EnvironmentPropertySourceTest.java
@@ -107,12 +107,13 @@ public class EnvironmentPropertySourceTest {
             mock(EnvironmentPropertySource.SystemPropertiesProvider.class);
 
         when(provider.getEnvPropsPrefix()).thenReturn("zzz");
-        when(provider.getenv()).thenReturn(new HashMap<String, String>() {{
-            put("zzz.A", "aaa");
-            put("zzz.B", "bbb");
-            put("C", "ccc");
-            put("D", "ddd");
-        }});
+        HashMap<String, String> configuredValues = new HashMap<String, String>();
+        configuredValues.put("zzz.A", "aaa");
+        configuredValues.put("zzz.B", "bbb");
+        configuredValues.put("C", "ccc");
+        configuredValues.put("D", "ddd");
+
+        when(provider.getenv()).thenReturn(configuredValues);
 
         envPropertySource.setPropertiesProvider(provider);
 
@@ -176,7 +177,4 @@ public class EnvironmentPropertySourceTest {
 
         assertThat(envPropertySource.isDisabled()).isTrue();
     }
-
-
-
 }
\ No newline at end of file


Mime
View raw message