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 @@ -500,7 +500,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 503 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 @@ -533,7 +533,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 @@ -9,6 +9,7 @@ import org.mockito.kotlin.spy
import org.mockito.kotlin.times
import org.mockito.kotlin.verify
import software.aws.toolkits.jetbrains.services.codemodernizer.model.JobHistoryItem
import software.aws.toolkits.resources.message
import java.time.Duration
import java.time.Instant

Expand All @@ -23,7 +24,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(message("codemodernizer.toolwindow.job_status.header"))
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 @@ -803,7 +803,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