Skip to content

Commit

Permalink
Rework theNextAction members
Browse files Browse the repository at this point in the history
  • Loading branch information
thetaurean committed Oct 8, 2024
1 parent 2906942 commit ecc6d50
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions prime-router/src/test/kotlin/common/ReportNodeBuilder.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ReportGraphBuilder {
private lateinit var theTopic: Topic
private lateinit var theFormat: MimeFormat
private lateinit var theSender: Sender
private lateinit var theNextAction: TaskAction
private var theNextAction: TaskAction? = null

fun topic(topic: Topic) {
this.theTopic = topic
Expand Down Expand Up @@ -85,13 +85,7 @@ class ReportGraphBuilder {
.setItemCount(theSubmission.theItemCount)
.setExternalName("test-external-name")
.setBodyUrl(theSubmission.theReportBlobUrl)
.setNextAction(
if (::theNextAction.isInitialized) {
theNextAction
} else {
theSubmission.reportGraphNodes.firstOrNull()?.theAction
}
)
.setNextAction(theNextAction ?: theSubmission.reportGraphNodes.firstOrNull()?.theAction)
.setCreatedAt(OffsetDateTime.now())
dbAccess.insertReportFile(
reportFile, txn, action
Expand Down Expand Up @@ -142,13 +136,7 @@ class ReportGraphBuilder {
.setExternalName("test-external-name")
.setBodyUrl(node.theReportBlobUrl)
.setTransportResult(node.theTransportResult)
.setNextAction(
if (node.theNextAction != null) {
node.theNextAction
} else {
node.reportGraphNodes.firstOrNull()?.theAction
}
)
.setNextAction(node.theNextAction ?: node.reportGraphNodes.firstOrNull()?.theAction)
.setCreatedAt(graph.node.createdAt.plusMinutes(1))

if (node.receiver != null) {
Expand Down

0 comments on commit ecc6d50

Please sign in to comment.