From 9c6bd64a7e73ce3503a358cd6416c1f605380f11 Mon Sep 17 00:00:00 2001 From: Paul-Christian Volkmer Date: Mon, 6 May 2024 13:32:51 +0200 Subject: [PATCH] test: ensure correct view is rendered --- .../dev/dnpm/etl/processor/web/ConfigControllerTest.kt | 8 +++++++- .../dev/dnpm/etl/processor/web/LoginControllerTest.kt | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/integrationTest/kotlin/dev/dnpm/etl/processor/web/ConfigControllerTest.kt b/src/integrationTest/kotlin/dev/dnpm/etl/processor/web/ConfigControllerTest.kt index 1d97d88..e244b3d 100644 --- a/src/integrationTest/kotlin/dev/dnpm/etl/processor/web/ConfigControllerTest.kt +++ b/src/integrationTest/kotlin/dev/dnpm/etl/processor/web/ConfigControllerTest.kt @@ -105,12 +105,13 @@ class ConfigControllerTest { } @Test - fun testShouldShowConfigPageIfLoggedIn() { + fun testShouldRequestConfigPageIfLoggedIn() { mockMvc.get("/configs") { with(user("admin").roles("ADMIN")) accept(MediaType.TEXT_HTML) }.andExpect { status { isOk() } + view { name("configs") } } } @@ -136,6 +137,7 @@ class ConfigControllerTest { content = "name=Testtoken" }.andExpect { status { is2xxSuccessful() } + view { name("configs/tokens") } } val captor = argumentCaptor() @@ -155,6 +157,7 @@ class ConfigControllerTest { content = "name=Testtoken" }.andExpect { status { is2xxSuccessful() } + view { name("configs/tokens") } } val captor = argumentCaptor() @@ -170,6 +173,7 @@ class ConfigControllerTest { accept(MediaType.TEXT_HTML) }.andExpect { status { is2xxSuccessful() } + view { name("configs/tokens") } } val captor = argumentCaptor() @@ -185,6 +189,7 @@ class ConfigControllerTest { accept(MediaType.TEXT_HTML) }.andExpect { status { is2xxSuccessful() } + view { name("configs/userroles") } } val captor = argumentCaptor() @@ -202,6 +207,7 @@ class ConfigControllerTest { content = "role=ADMIN" }.andExpect { status { is2xxSuccessful() } + view { name("configs/userroles") } } val idCaptor = argumentCaptor() diff --git a/src/integrationTest/kotlin/dev/dnpm/etl/processor/web/LoginControllerTest.kt b/src/integrationTest/kotlin/dev/dnpm/etl/processor/web/LoginControllerTest.kt index 254eb18..83cf1b8 100644 --- a/src/integrationTest/kotlin/dev/dnpm/etl/processor/web/LoginControllerTest.kt +++ b/src/integrationTest/kotlin/dev/dnpm/etl/processor/web/LoginControllerTest.kt @@ -74,6 +74,7 @@ class LoginControllerTest { fun testShouldRequestLoginPage() { mockMvc.get("/login").andExpect { status { isOk() } + view { name("login") } } }