summaryrefslogtreecommitdiff
path: root/src/main/kotlin/dev/dnpm/etl
diff options
context:
space:
mode:
authorPaul-Christian Volkmer2024-05-06 11:42:11 +0200
committerPaul-Christian Volkmer2024-05-06 11:42:11 +0200
commit94d7b4c4f052948dc0735c0ee683e4d4ce92f8dc (patch)
treeb9959a5ea78f43a5a18069350f765f2998db06c5 /src/main/kotlin/dev/dnpm/etl
parent107429fda7a4814d5fee5f374240df2352ebaad1 (diff)
test: add tests for token requests
Diffstat (limited to 'src/main/kotlin/dev/dnpm/etl')
-rw-r--r--src/main/kotlin/dev/dnpm/etl/processor/web/ConfigController.kt7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/kotlin/dev/dnpm/etl/processor/web/ConfigController.kt b/src/main/kotlin/dev/dnpm/etl/processor/web/ConfigController.kt
index 36589c8..4e101eb 100644
--- a/src/main/kotlin/dev/dnpm/etl/processor/web/ConfigController.kt
+++ b/src/main/kotlin/dev/dnpm/etl/processor/web/ConfigController.kt
@@ -127,10 +127,11 @@ class ConfigController(
} else {
model.addAttribute("tokensEnabled", true)
val result = tokenService.addToken(name)
- if (result.isSuccess) {
- model.addAttribute("newTokenValue", result.getOrDefault(""))
+ result.onSuccess {
+ model.addAttribute("newTokenValue", it)
model.addAttribute("success", true)
- } else {
+ }
+ result.onFailure {
model.addAttribute("success", false)
}
model.addAttribute("tokens", tokenService.findAll())