File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed
src/test/kotlin/io/github/typesafegithub/workflows/jitbindingserver Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ dependencies {
26
26
27
27
implementation(projects.mavenBindingBuilder)
28
28
implementation(projects.sharedInternal)
29
+
30
+ testImplementation(" io.ktor:ktor-server-test-host" )
29
31
}
30
32
31
33
application {
Original file line number Diff line number Diff line change
1
+ package io.github.typesafegithub.workflows.jitbindingserver
2
+
3
+ import io.kotest.core.spec.style.FunSpec
4
+ import io.kotest.matchers.shouldBe
5
+ import io.ktor.client.request.get
6
+ import io.ktor.http.HttpStatusCode
7
+ import io.ktor.server.routing.routing
8
+ import io.ktor.server.testing.testApplication
9
+
10
+ class ArtifactRoutesTest :
11
+ FunSpec ({
12
+ context(" artifacts for a given version" ) {
13
+ test(" when binding generation fails" ) {
14
+ testApplication {
15
+ // Given
16
+ application {
17
+ routing {
18
+ artifactRoutes(
19
+ buildBindingsCache(
20
+ buildVersionArtifacts = { error(" An internal error occurred!" ) },
21
+ ),
22
+ )
23
+ }
24
+ }
25
+
26
+ // When
27
+ val response = client.get(" some-owner/some-action/v4/some-action-v4.pom" )
28
+
29
+ // Then
30
+ // This is incorrect, and will be fixed in
31
+ // https://github.com/typesafegithub/github-workflows-kt/pull/1924/
32
+ response.status shouldBe HttpStatusCode .NotFound
33
+ }
34
+ }
35
+ }
36
+ })
You can’t perform that action at this time.
0 commit comments