Skip to content

Commit 1c9acf7

Browse files
committed
fix test
1 parent 85e9077 commit 1c9acf7

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import com.microsoft.copilot.eclipse.core.lsp.CopilotLanguageServerConnection;
2929
import com.microsoft.copilot.eclipse.core.lsp.protocol.CopilotLanguageServerSettings;
3030
import com.microsoft.copilot.eclipse.core.lsp.protocol.CopilotLanguageServerSettings.CopilotSettings;
31+
import com.microsoft.copilot.eclipse.core.utils.PlatformUtils;
3132
import com.microsoft.copilot.eclipse.ui.CopilotUi;
3233

3334
@ExtendWith(MockitoExtension.class)
@@ -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 settings = new CopilotLanguageServerSettings();
52+
settings.getGithubSettings().getCopilotSettings().getAgent()
53+
.setTranscriptDirectory(PlatformUtils.getTranscriptDirectory());
54+
params.setSettings(settings);
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+
.setTranscriptDirectory(PlatformUtils.getTranscriptDirectory());
7783
params.setSettings(settings);
7884

7985
// act
@@ -109,6 +115,8 @@ void testUpdateConfigShouldBeCalledWhenWorkspaceInstructionsEnabledWithContent()
109115
copilotSettings.setWorkspaceCopilotInstructions("Test instructions");
110116
CopilotLanguageServerSettings settings = new CopilotLanguageServerSettings();
111117
settings.getGithubSettings().setCopilotSettings(copilotSettings);
118+
settings.getGithubSettings().getCopilotSettings().getAgent()
119+
.setTranscriptDirectory(PlatformUtils.getTranscriptDirectory());
112120
params.setSettings(settings);
113121

114122
// act
@@ -137,6 +145,8 @@ void testUpdateConfigShouldBeCalledWithoutInstructionWhenWorkspaceInstructionsDi
137145
// Expected params should have empty workspace instructions since it's disabled
138146
DidChangeConfigurationParams expectedParams = new DidChangeConfigurationParams();
139147
CopilotLanguageServerSettings expectedSettings = new CopilotLanguageServerSettings();
148+
expectedSettings.getGithubSettings().getCopilotSettings().getAgent()
149+
.setTranscriptDirectory(PlatformUtils.getTranscriptDirectory());
140150
expectedParams.setSettings(expectedSettings);
141151

142152
// act

0 commit comments

Comments
 (0)