TAMAYA-171: Fixed consul tests.

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

Branch: refs/heads/master
Commit: 30c4144499082f98d4e3ace9c2766a05eb452712
Parents: 717a4bf
Author: anatole <anat...@apache.org>
Authored: Fri Aug 26 18:39:39 2016 +0200
Committer: anatole <anat...@apache.org>
Committed: Fri Aug 26 18:39:39 2016 +0200

----------------------------------------------------------------------
 .../org/apache/tamaya/etcd/ConsulWriteTest.java     | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/30c41444/integration/consul/src/test/java/org/apache/tamaya/etcd/ConsulWriteTest.java
----------------------------------------------------------------------
diff --git 
a/integration/consul/src/test/java/org/apache/tamaya/etcd/ConsulWriteTest.java 
b/integration/consul/src/test/java/org/apache/tamaya/etcd/ConsulWriteTest.java
index 202d0e3..ec930b9 100644
--- 
a/integration/consul/src/test/java/org/apache/tamaya/etcd/ConsulWriteTest.java
+++ 
b/integration/consul/src/test/java/org/apache/tamaya/etcd/ConsulWriteTest.java
@@ -20,6 +20,7 @@ package org.apache.tamaya.etcd;
 
 import com.google.common.net.HostAndPort;
 import org.apache.tamaya.consul.ConsulPropertySource;
+import org.apache.tamaya.mutableconfig.spi.ConfigChangeRequest;
 import org.junit.BeforeClass;
 
 import java.net.MalformedURLException;
@@ -49,8 +50,9 @@ public class ConsulWriteTest {
     public void testSetNormal() throws Exception {
         if (!execute) return;
         String taID = UUID.randomUUID().toString();
-        propertySource.put(taID, "testSetNormal", taID.toString());
-        propertySource.commitTransaction(taID);
+        ConfigChangeRequest request = new ConfigChangeRequest("testSetNormal");
+        request.put(taID, "testSetNormal");
+        propertySource.applyChange(request);
     }
 
 
@@ -58,12 +60,14 @@ public class ConsulWriteTest {
     public void testDelete() throws Exception {
         if(!execute)return;
         String taID = UUID.randomUUID().toString();
-        propertySource.put(taID, "testDelete", taID.toString());
-        propertySource.commitTransaction(taID);
+        ConfigChangeRequest request = new ConfigChangeRequest("testDelete");
+        request.put(taID, "testDelete");
+        propertySource.applyChange(request);
         assertEquals(propertySource.get("testDelete").getValue(), 
taID.toString());
         assertNotNull(propertySource.get("_testDelete.createdIndex"));
-        propertySource.remove(taID, "testDelete");
-        propertySource.commitTransaction(taID);
+        request = new ConfigChangeRequest("testDelete2");
+        request.remove("testDelete");
+        propertySource.applyChange(request);
         assertNull(propertySource.get("testDelete"));
     }
 

Reply via email to