Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -497,7 +497,7 @@
jobTransitionHandler(new, plan)
LOG.info { "Waiting for Modernization Job [$jobId] to complete. State changed for job: $old -> $new" }
}
return when {

Check notice on line 500 in plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/CodeModernizerSession.kt

View workflow job for this annotation

GitHub Actions / qodana

'when' that can be simplified by introducing an argument

'when' with subject should be used
result.state == TransformationStatus.STOPPED -> CodeModernizerJobCompletedResult.Stopped

result.state == TransformationStatus.PAUSED -> CodeModernizerJobCompletedResult.JobPaused(jobId, state.currentHilArtifactId.orEmpty())
Expand Down Expand Up @@ -530,7 +530,9 @@
}
}

result.succeeded -> CodeModernizerJobCompletedResult.JobCompletedSuccessfully(jobId)
result.state == TransformationStatus.COMPLETED -> {
CodeModernizerJobCompletedResult.JobCompletedSuccessfully(jobId)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These in theory should be doing the same thing, but again, for consistency it makes more sense to check the final job status directly rather than this internal succeeded field.


// Should not happen
else -> CodeModernizerJobCompletedResult.JobFailed(jobId, result.jobDetails?.reason().orEmpty())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class CodeModernizerJobHistoryPanelTest {
tablePanelMock.updateTableData(testData)
verify(tablePanelMock, times(1)).setDefaultUI()
verify(tablePanelMock, times(1)).updateTableData(testData)
assertThat(tablePanelMock.headerLabel.text).isEqualTo("Job status")
assertThat(tablePanelMock.headerLabel.text).isEqualTo("Transformation status")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use codemodernizer.toolwindow.job_status.header here instead of hardcoding the string?

assertThat(tablePanelMock.jbTable.columnCount).isEqualTo(5)
assertThat(tablePanelMock.jbTable.isEmpty).isFalse()
assertThat(tablePanelMock.tableData).isEqualTo(testData)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ codemodernizer.toolwindow.banner.job_starting=Job is starting.
codemodernizer.toolwindow.banner.no_ongoing_job=No job ongoing.
codemodernizer.toolwindow.banner.run_scan_complete=All steps of transformation successful
codemodernizer.toolwindow.banner.run_scan_info=Select 'Transform' in toolbar to upgrade this package.
codemodernizer.toolwindow.job_status.header=Job status
codemodernizer.toolwindow.job_status.header=Transformation status
codemodernizer.toolwindow.label=Transformation Hub - {0}
codemodernizer.toolwindow.label_no_job=Transformation Hub
codemodernizer.toolwindow.problems_mvn_window_not_found=Unable to display Code Transform results as the Maven window cannot be fetched.
Expand Down
Loading