@Test public void managedSdk_choice_disableAutomaticUpdates_apply_validSettings() { ApplicationManager.getApplication() .invokeAndWait( () -> { // use non-spy panel as spy messes up with UI event thread field updates. CloudSdkPanel sdkPanel = new CloudSdkPanel(); sdkPanel.reset(); sdkPanel.getManagedRadioButton().doClick(); sdkPanel.getEnableAutomaticUpdatesCheckbox().setSelected(false); try { sdkPanel.apply(); } catch (ConfigurationException e) { throw new AssertionError(e); } verifyCloudSdkSettings( CloudSdkServiceType.MANAGED_SDK, false, /* no auto-updates */ null /* no custom path */); }); }
@Test public void managedSdk_choice_apply_validSettings() { ApplicationManager.getApplication() .invokeAndWait( () -> { // use non-spy panel as spy messes up with UI event thread field updates. CloudSdkPanel sdkPanel = new CloudSdkPanel(); sdkPanel.reset(); sdkPanel.getManagedRadioButton().doClick(); try { sdkPanel.apply(); } catch (ConfigurationException e) { throw new AssertionError(e); } verifyCloudSdkSettings( CloudSdkServiceType.MANAGED_SDK, CloudSdkServiceUserSettings.DEFAULT_MANAGED_SDK_AUTOMATIC_UPDATES, null /* no custom path */); }); }
@Test public void customSdk_choice_apply_validSettings() { ApplicationManager.getApplication() .invokeAndWait( () -> { // use non-spy panel as spy messes up with UI event thread field updates. CloudSdkPanel sdkPanel = new CloudSdkPanel(); sdkPanel.reset(); sdkPanel.getCustomRadioButton().doClick(); String customSdkPath = "/home/gcloud"; sdkPanel.getCloudSdkDirectoryField().setText(customSdkPath); try { sdkPanel.apply(); } catch (ConfigurationException e) { throw new AssertionError(e); } verifyCloudSdkSettings( CloudSdkServiceType.CUSTOM_SDK, CloudSdkServiceUserSettings.DEFAULT_MANAGED_SDK_AUTOMATIC_UPDATES, customSdkPath); }); }