Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ class DefaultCodeWhispererModelConfigurator : CodeWhispererModelConfigurator, Pe
QRegionProfileSelectedListener.TOPIC,
object : QRegionProfileSelectedListener {
override fun onProfileSelected(project: Project, profile: QRegionProfile?) {
pluginAwareExecuteOnPooledThread {
CodeWhispererModelConfigurator.getInstance().listCustomizations(project, passive = true)
}
switchCustomization(project, null)
}
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ class CodeWhispererModelConfiguratorTest {
}

@Test
fun `profile switch should keep using existing customization if new list still contains that arn`() {
fun `should switch to default customization on profile changed`() {
val ssoConn = spy(LegacyManagedBearerSsoConnection(region = "us-east-1", startUrl = "url 1", scopes = Q_SCOPES))
ToolkitConnectionManager.getInstance(projectRule.project).switchConnection(ssoConn)
val oldCustomization = CodeWhispererCustomization("oldArn", "oldName", "oldDescription")
Expand All @@ -632,7 +632,7 @@ class CodeWhispererModelConfiguratorTest {
.syncPublisher(QRegionProfileSelectedListener.TOPIC)
.onProfileSelected(projectRule.project, null)

assertThat(sut.activeCustomization(projectRule.project)).isEqualTo(oldCustomization)
assertThat(sut.activeCustomization(projectRule.project)).isEqualTo(null)
}

@Test
Expand Down
Loading