]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7675 InternalPropertiesImpl must commit
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Tue, 6 Sep 2016 08:21:52 +0000 (10:21 +0200)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Tue, 6 Sep 2016 09:18:02 +0000 (11:18 +0200)
server/sonar-server/src/main/java/org/sonar/server/property/InternalPropertiesImpl.java
server/sonar-server/src/test/java/org/sonar/server/property/InternalPropertiesImplTest.java

index f99002d9dee20b3bafc28397e0da73989147c269..3881c0949dfea5bbbaf191d334af027785a1fa0d 100644 (file)
@@ -55,6 +55,7 @@ public class InternalPropertiesImpl implements InternalProperties {
       } else {
         dbClient.internalPropertiesDao().save(dbSession, propertyKey, value);
       }
+      dbSession.commit();
     }
   }
 
index 20c371ba256602fd5e119ee9ad39c5dd61fdafc4..7abec84773eaf9404f4bedc3a4a011d38d5d6ec3 100644 (file)
@@ -94,6 +94,7 @@ public class InternalPropertiesImplTest {
     underTest.write(SOME_KEY, null);
 
     verify(internalPropertiesDao).saveAsEmpty(dbSession, SOME_KEY);
+    verify(dbSession).commit();
   }
 
   @Test
@@ -101,6 +102,7 @@ public class InternalPropertiesImplTest {
     underTest.write(SOME_KEY, EMPTY_STRING);
 
     verify(internalPropertiesDao).saveAsEmpty(dbSession, SOME_KEY);
+    verify(dbSession).commit();
   }
 
   @Test
@@ -108,6 +110,7 @@ public class InternalPropertiesImplTest {
     underTest.write(SOME_KEY, SOME_VALUE);
 
     verify(internalPropertiesDao).save(dbSession, SOME_KEY, SOME_VALUE);
+    verify(dbSession).commit();
   }
 
   private void expectKeyNullOrEmptyIAE() {