disable PasswordConversionEnforcer in tests

This commit is contained in:
Vladimir Krivosheev
2019-01-18 10:02:40 +01:00
parent ec926e80f4
commit f40430f381
2 changed files with 7 additions and 4 deletions
@@ -64,8 +64,6 @@ internal class DoNotSaveDefaultsTest {
}
private suspend fun doTest(componentManager: ComponentManagerImpl) {
val useModCountOldValue = System.getProperty("store.save.use.modificationCount")
// wake up (edt, some configurables want read action)
withContext(AppUIExecutor.onUiThread().coroutineDispatchingContext()) {
val picoContainer = componentManager.picoContainer
@@ -90,8 +88,8 @@ internal class DoNotSaveDefaultsTest {
propertyComponent.unsetValue("CommitChangeListDialog.DETAILS_SPLITTER_PROPORTION_2")
propertyComponent.unsetValue("ts.lib.d.ts.version")
propertyComponent.unsetValue("nodejs_interpreter_path.stuck_in_default_project")
propertyComponent.unsetValue("tasks.pass.word.conversion.enforced")
val useModCountOldValue = System.getProperty("store.save.use.modificationCount")
try {
System.setProperty("store.save.use.modificationCount", "false")
componentManager.stateStore.save(isForceSavingAllSettings = true)
@@ -3,12 +3,17 @@ package com.intellij.tasks.config;
import com.intellij.ide.ApplicationInitializedListener;
import com.intellij.ide.util.PropertiesComponent;
import com.intellij.openapi.application.ApplicationManager;
public class PasswordConversionEnforcer implements ApplicationInitializedListener {
final class PasswordConversionEnforcer implements ApplicationInitializedListener {
private static final String ENFORCED = "tasks.pass.word.conversion.enforced";
@Override
public void componentsInitialized() {
if (ApplicationManager.getApplication().isUnitTestMode()) {
return;
}
if (!PropertiesComponent.getInstance().isValueSet(ENFORCED)) {
RecentTaskRepositories.getInstance().getState();
PropertiesComponent.getInstance().setValue(ENFORCED, true);