Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
anders88 committed Nov 26, 2023
1 parent b853c2f commit 45970c3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
8 changes: 3 additions & 5 deletions src/main/kotlin/no/java/partner/Application.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,8 @@ fun Application.module() {
version = VersionConfig.version,
port = environment.config.property("ktor.deployment.port").getString().toInt(),
)
//if (environment.config.property("jwt.security_on").getString() != "false") {
configureSecurity(
httpClient,
)
//}
configureSecurity(
httpClient,
)
configureServices(dataSource)
}
2 changes: 1 addition & 1 deletion src/main/kotlin/no/java/partner/plugins/ListRouting.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import no.java.partner.plugins.openapi.ListRoutingDoc
import no.java.partner.service.ListService

fun Application.configureListRouting(service: ListService) {
val optionalSec = (environment.config.property("jwt.security_on").getString() != "false")
val optionalSec = (environment.config.property("jwt.security_on").getString() != "true")
routing {
authenticate("auth-jwt", optional = optionalSec) {
route("/list") {
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/no/java/partner/plugins/PartnerRouting.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import no.java.partner.service.PartnerService


fun Application.configurePartnerRouting(service: PartnerService) {
val optionalSec = (environment.config.property("jwt.security_on").getString() != "false")
val optionalSec = (environment.config.property("jwt.security_on").getString() != "true")
routing {
authenticate("auth-jwt", optional = optionalSec) {
route("/partner") {
Expand Down
1 change: 1 addition & 0 deletions src/test/kotlin/no/java/partner/TestApplicationBuilder.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ val appConfig = HoconApplicationConfig(
ConfigFactory.parseMap(
mapOf(
"jwt" to mapOf(
"security_on" to "true",
"secret" to "secret",
"issuer" to "issuer",
"audience" to "audience",
Expand Down

0 comments on commit 45970c3

Please sign in to comment.