@@ -17,8 +17,10 @@ import software.amazon.awssdk.services.codewhispererruntime.model.StartTransform
1717import software.amazon.awssdk.services.codewhispererruntime.model.TransformationJob
1818import software.amazon.awssdk.services.codewhispererruntime.model.TransformationLanguage
1919import software.amazon.awssdk.services.codewhispererruntime.model.TransformationPlan
20+ import software.amazon.awssdk.services.codewhispererruntime.model.TransformationProgressUpdate
2021import software.amazon.awssdk.services.codewhispererruntime.model.TransformationProgressUpdateStatus
2122import software.amazon.awssdk.services.codewhispererruntime.model.TransformationStatus
23+ import software.amazon.awssdk.services.codewhispererruntime.model.TransformationStep
2224import software.amazon.awssdk.services.codewhispererruntime.model.TransformationUserActionStatus
2325import software.amazon.awssdk.services.codewhispererruntime.model.UploadContext
2426import software.amazon.awssdk.services.codewhispererstreaming.model.TransformationDownloadArtifactType
@@ -608,7 +610,72 @@ class CodeModernizerSession(
608610 }
609611
610612 fun tryOpenTransformationPlanEditor () {
611- val transformationPlan = getTransformationPlan()
613+ // var transformationPlan = getTransformationPlan()
614+ // TODO: remove this mocked API response
615+ val transformationPlan = TransformationPlan .builder()
616+ .transformationSteps(
617+ listOf (
618+ TransformationStep .builder()
619+ .id(" 0" )
620+ .name(" Supplement Info" )
621+ .status(" COMPLETED" )
622+ .progressUpdates(
623+ listOf (
624+ TransformationProgressUpdate .builder()
625+ .name(" 0" )
626+ .status(" COMPLETED" )
627+ .description(" {\" type\" :\" STATISTICS\" ,\" name\" :\" Plan Statistics\" ,\" description\" :null,\" columnNames\" :[\" name\" ,\" value\" ],\" rows\" :[{\" name\" :\" linesOfCode\" ,\" value\" :\" 2532\" },{\" name\" :\" plannedDependencyChanges\" ,\" value\" :\" 4\" },{\" name\" :\" plannedDeprecatedApiChanges\" ,\" value\" :\" 0\" },{\" name\" :\" plannedFileChanges\" ,\" value\" :\" 7\" }]}" )
628+ .build(),
629+ TransformationProgressUpdate .builder()
630+ .name(" 1" )
631+ .status(" COMPLETED" )
632+ .description(" {\" type\" :\" DEPENDENCIES\" ,\" name\" :\" Dependency Changes\" ,\" description\" :null,\" columnNames\" :[\" dependencyName\" ,\" action\" ,\" currentVersion\" ,\" targetVersion\" ],\" rows\" :[{\" dependencyName\" :\" junit:junit\" ,\" action\" :\" REMOVE\" ,\" currentVersion\" :\" 4.12\" ,\" targetVersion\" :\" -\" },{\" dependencyName\" :\" org.apache.logging.log4j:log4j-slf4j-impl\" ,\" action\" :\" ADD\" ,\" currentVersion\" :\" -\" ,\" targetVersion\" :\" 2.x\" },{\" dependencyName\" :\" org.apache.maven.plugins:maven-surefire-plugin\" ,\" action\" :\" UPDATE\" ,\" currentVersion\" :\" 2.18.1\" ,\" targetVersion\" :\" 3.1.x\" },{\" dependencyName\" :\" org.slf4j:slf4j-log4j12\" ,\" action\" :\" REMOVE\" ,\" currentVersion\" :\" 1.8.0-beta0\" ,\" targetVersion\" :\" -\" }]}" )
633+ .build(),
634+ TransformationProgressUpdate .builder()
635+ .name(" 1" )
636+ .status(" COMPLETED" )
637+ .description(" {\" type\" :\" DEPENDENCIES\" ,\" name\" :\" Dependency Changes\" ,\" description\" :null,\" columnNames\" :[\" dependencyName\" ,\" action\" ,\" currentVersion\" ,\" targetVersion\" ],\" rows\" :[{\" dependencyName\" :\" junit:junit\" ,\" action\" :\" REMOVE\" ,\" currentVersion\" :\" 4.12\" ,\" targetVersion\" :\" -\" },{\" dependencyName\" :\" org.apache.logging.log4j:log4j-slf4j-impl\" ,\" action\" :\" ADD\" ,\" currentVersion\" :\" -\" ,\" targetVersion\" :\" 2.x\" },{\" dependencyName\" :\" org.apache.maven.plugins:maven-surefire-plugin\" ,\" action\" :\" UPDATE\" ,\" currentVersion\" :\" 2.18.1\" ,\" targetVersion\" :\" 3.1.x\" },{\" dependencyName\" :\" org.slf4j:slf4j-log4j12\" ,\" action\" :\" REMOVE\" ,\" currentVersion\" :\" 1.8.0-beta0\" ,\" targetVersion\" :\" -\" }]}" )
638+ .build(),
639+ TransformationProgressUpdate .builder()
640+ .name(" 1" )
641+ .status(" COMPLETED" )
642+ .description(" {\" type\" :\" DEPENDENCIES\" ,\" name\" :\" Dependency Changes\" ,\" description\" :null,\" columnNames\" :[\" dependencyName\" ,\" action\" ,\" currentVersion\" ,\" targetVersion\" ],\" rows\" :[{\" dependencyName\" :\" com.squareup.okio:okio\" ,\" action\" :\" UPDATE\" ,\" currentVersion\" :\" 4.12\" ,\" targetVersion\" :\" -\" },{\" dependencyName\" :\" org.apache.logging.log4j:log4j-slf4j-impl\" ,\" action\" :\" ADD\" ,\" currentVersion\" :\" -\" ,\" targetVersion\" :\" 2.x\" },{\" dependencyName\" :\" org.apache.maven.plugins:maven-surefire-plugin\" ,\" action\" :\" UPDATE\" ,\" currentVersion\" :\" 2.18.1\" ,\" targetVersion\" :\" 3.1.x\" },{\" dependencyName\" :\" org.slf4j:slf4j-log4j12\" ,\" action\" :\" REMOVE\" ,\" currentVersion\" :\" 1.8.0-beta0\" ,\" targetVersion\" :\" -\" }]}" )
643+ .build(),
644+ TransformationProgressUpdate .builder()
645+ .name(" 1" )
646+ .status(" COMPLETED" )
647+ .description(" {\" type\" :\" DEPENDENCIES\" ,\" name\" :\" Dependency Changes\" ,\" description\" :null,\" columnNames\" :[\" dependencyName\" ,\" action\" ,\" currentVersion\" ,\" targetVersion\" ],\" rows\" :[{\" dependencyName\" :\" com.squareup.okio:okio\" ,\" action\" :\" UPDATE\" ,\" currentVersion\" :\" 4.12\" ,\" targetVersion\" :\" -\" },{\" dependencyName\" :\" org.apache.logging.log4j:log4j-slf4j-impl\" ,\" action\" :\" ADD\" ,\" currentVersion\" :\" -\" ,\" targetVersion\" :\" 2.x\" },{\" dependencyName\" :\" org.apache.maven.plugins:maven-surefire-plugin\" ,\" action\" :\" UPDATE\" ,\" currentVersion\" :\" 2.18.1\" ,\" targetVersion\" :\" 3.1.x\" },{\" dependencyName\" :\" org.slf4j:slf4j-log4j12\" ,\" action\" :\" REMOVE\" ,\" currentVersion\" :\" 1.8.0-beta0\" ,\" targetVersion\" :\" -\" }]}" )
648+ .build(),
649+ TransformationProgressUpdate .builder()
650+ .name(" 1" )
651+ .status(" COMPLETED" )
652+ .description(" {\" type\" :\" DEPENDENCIES\" ,\" name\" :\" Dependency Changes\" ,\" description\" :null,\" columnNames\" :[\" dependencyName\" ,\" action\" ,\" currentVersion\" ,\" targetVersion\" ],\" rows\" :[{\" dependencyName\" :\" com.squareup.okio:okio\" ,\" action\" :\" UPDATE\" ,\" currentVersion\" :\" 4.12\" ,\" targetVersion\" :\" -\" },{\" dependencyName\" :\" org.apache.logging.log4j:log4j-slf4j-impl\" ,\" action\" :\" ADD\" ,\" currentVersion\" :\" -\" ,\" targetVersion\" :\" 2.x\" },{\" dependencyName\" :\" org.apache.maven.plugins:maven-surefire-plugin\" ,\" action\" :\" UPDATE\" ,\" currentVersion\" :\" 2.18.1\" ,\" targetVersion\" :\" 3.1.x\" },{\" dependencyName\" :\" org.slf4j:slf4j-log4j12\" ,\" action\" :\" REMOVE\" ,\" currentVersion\" :\" 1.8.0-beta0\" ,\" targetVersion\" :\" -\" }]}" )
653+ .build(),
654+ TransformationProgressUpdate .builder()
655+ .name(" -1" )
656+ .status(" COMPLETED" )
657+ .description(" {\" type\" :\" FILES\" ,\" name\" :\" File Changes\" ,\" description\" :null,\" columnNames\" :[\" relativePath\" ,\" action\" ],\" rows\" :[{\" relativePath\" :\" src/main/test/com/nxllxn/plantuml/java/TopLevelInterfaceTest.java\" ,\" action\" :\" UPDATE\" },{\" relativePath\" :\" src/main/test/com/nxllxn/plantuml/java/TopLevelEnumerationTest.java\" ,\" action\" :\" UPDATE\" },{\" relativePath\" :\" src/main/test/com/nxllxn/plantuml/java/TopLevelClassTest.java\" ,\" action\" :\" UPDATE\" },{\" relativePath\" :\" src/main/test/com/nxllxn/plantuml/java/TopLevelAnnotationTest.java\" ,\" action\" :\" UPDATE\" },{\" relativePath\" :\" src/main/test/com/nxllxn/plantuml/java/ParameterTest.java\" ,\" action\" :\" UPDATE\" },{\" relativePath\" :\" src/main/test/com/nxllxn/plantuml/java/MethodTest.java\" ,\" action\" :\" UPDATE\" },{\" relativePath\" :\" src/main/test/com/nxllxn/plantuml/java/FieldTest.java\" ,\" action\" :\" UPDATE\" }]}" )
658+ .build()
659+ )
660+ )
661+ .build(),
662+ TransformationStep .builder()
663+ .id(" 1" )
664+ .name(" Step 1 - Update JDK version, dependencies and related code (David)" )
665+ .description(" Amazon Q will attempt to update the JDK version and change the following dependencies and related code." )
666+ .status(" CREATED" )
667+ .progressUpdates(emptyList())
668+ .build(),
669+ TransformationStep .builder()
670+ .id(" 2" )
671+ .name(" Step 2 - Finalize code changes" )
672+ .description(" Amazon Q will attempt to replace the following instances of deprecated code." )
673+ .status(" CREATED" )
674+ .progressUpdates(emptyList())
675+ .build()
676+ )
677+ )
678+ .build()
612679 if (transformationPlan != null ) {
613680 runInEdt {
614681 CodeModernizerPlanEditorProvider .openEditor(
0 commit comments