Skip to content

Commit 98c9eab

Browse files
committed
fixing failed test and lint
1 parent 6fb6f3f commit 98c9eab

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

plugins/amazonq/codetransform/jetbrains-community/tst/software/aws/toolkits/jetbrains/services/codemodernizer/CodeWhispererCodeModernizerTest.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33

44
package software.aws.toolkits.jetbrains.services.codemodernizer
55

6+
import com.intellij.openapi.vcs.changes.patch.ApplyPatchDifferentiatedDialog
67
import com.intellij.testFramework.LightVirtualFile
78
import junit.framework.TestCase.assertEquals
89
import junit.framework.TestCase.assertFalse
910
import kotlinx.coroutines.runBlocking
1011
import org.junit.Before
1112
import org.junit.Test
13+
import org.mockito.Mockito.doAnswer
14+
import org.mockito.Mockito.mock
1215
import org.mockito.kotlin.any
1316
import org.mockito.kotlin.doNothing
1417
import org.mockito.kotlin.doReturn
@@ -128,6 +131,12 @@ class CodeWhispererCodeModernizerTest : CodeWhispererCodeModernizerTestBase() {
128131
val path = testCodeModernizerArtifact.zipPath
129132
val result = DownloadArtifactResult.Success(testCodeModernizerArtifact, path)
130133
doReturn(result).whenever(handler).downloadArtifact(any(), eq(TransformationDownloadArtifactType.CLIENT_INSTRUCTIONS), eq(false))
134+
val mockDialog = mock<ApplyPatchDifferentiatedDialog>()
135+
whenever(mockDialog.showAndGet()).thenReturn(true)
136+
doAnswer {
137+
mockDialog.showAndGet()
138+
mockDialog
139+
}.whenever(handler).displayDiffUsingPatch(any(), any(), any(), any(), any())
131140
handler.displayDiff(jobId, CodeTransformVCSViewerSrcComponents.Chat)
132141
verify(handler, never()).notifyUnableToApplyPatch(any())
133142
verify(handler, times(1)).displayDiffUsingPatch(

plugins/core/resources/resources/software/aws/toolkits/resources/MessagesBundle.properties

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -582,8 +582,8 @@ codemodernizer.chat.message.button.view_build=View build progress
582582
codemodernizer.chat.message.button.view_diff=View diff
583583
codemodernizer.chat.message.button.view_failure_build_log=View Failure Build Log
584584
codemodernizer.chat.message.button.view_summary=View summary
585-
codemodernizer.chat.message.choose_objective=Enter "language upgrade" or "SQL conversion"
586585
codemodernizer.chat.message.changes_applied=I applied the changes to your project.
586+
codemodernizer.chat.message.choose_objective=Enter "language upgrade" or "SQL conversion"
587587
codemodernizer.chat.message.download_failed_client_instructions_expired=Your transformation is not available anymore. Your code and transformation summary are deleted 24 hours after the transformation completes. Please try starting the transformation again.
588588
codemodernizer.chat.message.download_failed_invalid_artifact=Sorry, I was unable to find your {0}. Artifacts are deleted after 24 hours. Please try starting the transformation again.
589589
codemodernizer.chat.message.download_failed_other=Sorry, I ran into an issue while trying to download your {0}. Please try again. {1}
@@ -612,14 +612,7 @@ codemodernizer.chat.message.hil.user_rejected=I'll continue upgrading your modul
612612
codemodernizer.chat.message.local_build_begin=I'm building your module. This can take up to 10 minutes, depending on the size of your module.
613613
codemodernizer.chat.message.local_build_failed=Sorry, I couldn't run the Maven clean install command to build your module.
614614
codemodernizer.chat.message.local_build_success=I was able to build your module and will start uploading your code.
615-
codemodernizer.chat.message.one_or_multiple_diffs=\
616-
I can now divide the transformation results into diff patches (if applicable to the app) if you would like to review and accept each diff with fewer changes:\n\n\
617-
- Minimal Compatible Library Upgrade to Java 17: Dependencies to the minimum compatible versions in Java 17, including Springboot, JUnit, and PowerMockito.\n\n\
618-
- Popular Enterprise Specifications Application Frameworks: Popular enterprise and application frameworks like Jakarta EE, Hibernate, and Micronaut 3.\n\n\
619-
- HTTP Client Utilities Web Frameworks: HTTP client libraries, Apache Commons utilities, and Struts frameworks.\n\n\
620-
- Testing Tools Frameworks: Testing tools like ArchUnit, Mockito, and TestContainers and build tools like Jenkins and Maven Wrapper.\n\n\
621-
- Miscellaneous Processing Documentation: Diverse set spanning ORMs, XML processing, and API documentation like Swagger to SpringDoc/OpenAPI.\n\n\
622-
- Deprecated API replacement and dependency upgrades: Replaces deprecated APIs and makes additional dependency version upgrades.
615+
codemodernizer.chat.message.one_or_multiple_diffs=I can now divide the transformation results into diff patches (if applicable to the app) if you would like to review and accept each diff with fewer changes:\n\n\ - Minimal Compatible Library Upgrade to Java 17: Dependencies to the minimum compatible versions in Java 17, including Springboot, JUnit, and PowerMockito.\n\n\ - Popular Enterprise Specifications Application Frameworks: Popular enterprise and application frameworks like Jakarta EE, Hibernate, and Micronaut 3.\n\n\ - HTTP Client Utilities Web Frameworks: HTTP client libraries, Apache Commons utilities, and Struts frameworks.\n\n\ - Testing Tools Frameworks: Testing tools like ArchUnit, Mockito, and TestContainers and build tools like Jenkins and Maven Wrapper.\n\n\ - Miscellaneous Processing Documentation: Diverse set spanning ORMs, XML processing, and API documentation like Swagger to SpringDoc/OpenAPI.\n\n\ - Deprecated API replacement and dependency upgrades: Replaces deprecated APIs and makes additional dependency version upgrades.
623616
codemodernizer.chat.message.one_or_multiple_diffs_form.multiple_diffs=Multiple diffs
624617
codemodernizer.chat.message.one_or_multiple_diffs_form.one_diff=One diff
625618
codemodernizer.chat.message.one_or_multiple_diffs_form.response=Okay, I will create {0} when providing the proposed changes.

0 commit comments

Comments
 (0)