Skip to content

Commit 189f291

Browse files
committed
change
1 parent b24f8cc commit 189f291

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

server/src/test/java/com/cloud/vm/UserVmManagerImplTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -478,11 +478,10 @@ private void updateDefaultConfigValue(final ConfigKey configKey, final Object o,
478478
Field f = ConfigKey.class.getDeclaredField(name);
479479
f.setAccessible(true);
480480
String stringVal = String.valueOf(o);
481-
f.set(configKey, stringVal);
482-
if (revert) {
483-
return;
481+
if (!revert) {
482+
originalConfigValues.put(configKey, f.get(configKey));
484483
}
485-
originalConfigValues.put(configKey, f.get(configKey));
484+
f.set(configKey, stringVal);
486485
} catch (IllegalAccessException | NoSuchFieldException e) {
487486
Assert.fail("Failed to mock config " + configKey.key() + " value due to " + e.getMessage());
488487
}

0 commit comments

Comments
 (0)