Skip to content

Commit

Permalink
test(sql): demonstrate behavior of retrievePipelinesForApplication
Browse files Browse the repository at this point in the history
which also verifies the behavior of selectExections when cursor is null
  • Loading branch information
dbyron-sf committed Apr 15, 2024
1 parent 93fdf9f commit 42081af
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,21 @@ class SqlExecutionRepositoryTest : JUnit5Minutests {
assertThat(actualPipelineExecution).isEqualTo(pipelineExecution)
}
}

context("retrievePipelinesForApplication") {
val pipelineExecution1 = PipelineExecutionImpl(ExecutionType.PIPELINE, "application-1")
val pipelineExecution2 = PipelineExecutionImpl(ExecutionType.PIPELINE, "application-2")

test("correctly use where clause") {
// Store pipelines in two different applications
sqlExecutionRepository.store(pipelineExecution1)
sqlExecutionRepository.store(pipelineExecution2)

val observable = sqlExecutionRepository.retrievePipelinesForApplication("application-2")
val executions = observable.toList().toBlocking().single()
assertThat(executions.map(PipelineExecution::getApplication).single()).isEqualTo("application-2")
}
}
}

private inner class Fixture {
Expand Down

0 comments on commit 42081af

Please sign in to comment.