Skip to content

Commit 4cf5c68

Browse files
committed
Fixed tests.
1 parent 2950c2a commit 4cf5c68

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

com.microsoft.copilot.eclipse.ui.test/src/com/microsoft/copilot/eclipse/ui/preferences/LanguageServerSettingManagerTests.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import com.microsoft.copilot.eclipse.core.lsp.protocol.CopilotLanguageServerSettings;
3030
import com.microsoft.copilot.eclipse.core.lsp.protocol.CopilotLanguageServerSettings.CopilotSettings;
3131
import com.microsoft.copilot.eclipse.ui.CopilotUi;
32+
import com.microsoft.copilot.eclipse.ui.utils.PreferencesUtils;
3233

3334
@ExtendWith(MockitoExtension.class)
3435
class LanguageServerSettingManagerTests {
@@ -47,7 +48,10 @@ void testNoProxy() {
4748
// arrange
4849
when(mockPreferenceStore.getBoolean(Constants.AUTO_SHOW_COMPLETION)).thenReturn(true);
4950
var params = new DidChangeConfigurationParams();
50-
params.setSettings(new CopilotLanguageServerSettings());
51+
var noProxySettings = new CopilotLanguageServerSettings();
52+
noProxySettings.getGithubSettings().getCopilotSettings().getAgent()
53+
.setEnableSkills(PreferencesUtils.isSkillsEnabled());
54+
params.setSettings(noProxySettings);
5155

5256
// act
5357
LanguageServerSettingManager manager = new LanguageServerSettingManager(mockLsConnection, mockProxyService,
@@ -74,6 +78,8 @@ void testBasicProxy() {
7478
var params = new DidChangeConfigurationParams();
7579
var settings = new CopilotLanguageServerSettings();
7680
settings.getHttp().setProxy("HTTPS://localhost:8080");
81+
settings.getGithubSettings().getCopilotSettings().getAgent()
82+
.setEnableSkills(PreferencesUtils.isSkillsEnabled());
7783
params.setSettings(settings);
7884

7985
// act
@@ -108,6 +114,7 @@ void testUpdateConfigShouldBeCalledWhenWorkspaceInstructionsEnabledWithContent()
108114
DidChangeConfigurationParams params = new DidChangeConfigurationParams();
109115
CopilotSettings copilotSettings = new CopilotSettings();
110116
copilotSettings.setWorkspaceCopilotInstructions("Test instructions");
117+
copilotSettings.getAgent().setEnableSkills(PreferencesUtils.isSkillsEnabled());
111118
CopilotLanguageServerSettings settings = new CopilotLanguageServerSettings();
112119
settings.getGithubSettings().setCopilotSettings(copilotSettings);
113120
params.setSettings(settings);
@@ -138,6 +145,8 @@ void testUpdateConfigShouldBeCalledWithoutInstructionWhenWorkspaceInstructionsDi
138145
// Expected params should have empty workspace instructions since it's disabled
139146
DidChangeConfigurationParams expectedParams = new DidChangeConfigurationParams();
140147
CopilotLanguageServerSettings expectedSettings = new CopilotLanguageServerSettings();
148+
expectedSettings.getGithubSettings().getCopilotSettings().getAgent()
149+
.setEnableSkills(PreferencesUtils.isSkillsEnabled());
141150
expectedParams.setSettings(expectedSettings);
142151

143152
// act

0 commit comments

Comments
 (0)