Skip to content

Commit

Permalink
Minimally fix-up in-progress competition webapp scaffold
Browse files Browse the repository at this point in the history
  • Loading branch information
carltonwhitehead committed Nov 24, 2023
1 parent 98c8903 commit 65018e4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,9 @@
<coner-trailer-cli.argument-factory>native-image</coner-trailer-cli.argument-factory>
<coner-trailer-cli.native-image>${project.build.directory}/${native-image.filename}</coner-trailer-cli.native-image>
</systemPropertyVariables>
<environmentVariables>
<CONER_TRAILER_CLI_NATIVE>true</CONER_TRAILER_CLI_NATIVE>
</environmentVariables>
</configuration>
</execution>
</executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,19 @@ import kotlinx.coroutines.test.runTest
import org.awaitility.kotlin.await
import org.awaitility.kotlin.untilNotNull
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable
import org.junit.jupiter.api.parallel.Execution
import org.junit.jupiter.api.parallel.ExecutionMode
import tech.coner.trailer.assertk.ktor.bodyAsText
import tech.coner.trailer.assertk.ktor.hasContentTypeIgnoringParams
import tech.coner.trailer.assertk.ktor.status
import tech.coner.trailer.cli.command.BaseExecutableIT
import tech.coner.trailer.cli.util.findWebappPort

@EnabledIfEnvironmentVariable(named = "FEATURE_WEBAPP_ENABLE", matches = "true")
@EnabledIfEnvironmentVariable(named = "FEATURE_WEBAPP_ENABLE", matches = "true", disabledReason = "https://github.com/coner-tech/coner-trailer/issues/85")
@DisabledIfEnvironmentVariable(named = "CONER_TRAILER_CLI_NATIVE", matches = "true", disabledReason = "https://github.com/coner-tech/coner-trailer/issues/85")
@Execution(ExecutionMode.SAME_THREAD)
class WebappCompetitionCommandExecutableIT : BaseExecutableIT() {

@Test
Expand Down Expand Up @@ -63,7 +68,7 @@ class WebappCompetitionCommandExecutableIT : BaseExecutableIT() {

newTestCommandAsync { webappCompetition(port = 0) }
.runWebappTest { client ->
assertThat(client.get("/assets/bootstrap/bootstrap.bundle.min.js")).all {
assertThat(client.get("/webjars/bootstrap/bootstrap.bundle.min.js")).all {
status().isEqualTo(HttpStatusCode.OK)
hasContentTypeIgnoringParams(ContentType.Application.JavaScript)
bodyAsText().isNotEmpty()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class StaticAssetTest {

@Test
fun `It should serve webjar bootstrap js`() = testCompetitionWebapp { client ->
val url = "/assets/bootstrap/bootstrap.bundle.min.js"
val url = "/webjars/bootstrap/bootstrap.bundle.min.js"

val actual = client.get(url)

Expand Down

0 comments on commit 65018e4

Please sign in to comment.