test: add WelcomeTest for welcome endpoint validation
All checks were successful
Quality Check / Tests (pull_request) Successful in 1m0s
Quality Check / Checkstyle Main (pull_request) Successful in 46s
gitea-sonarqube-bot OK
Build PR / Build and analyze (pull_request) Successful in 1m56s

This commit is contained in:
Jan Gleytenhoover 2024-10-02 12:55:50 +02:00
parent 1e38efaa63
commit 66f3b0da4c
Signed by: jank
GPG Key ID: B267751B8AE29EFE

@ -0,0 +1,24 @@
package de.szut.lf8_starter.integration.welcome;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.web.servlet.MockMvc;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@SpringBootTest
@AutoConfigureMockMvc
class WelcomeTest {
@Autowired
private MockMvc mockMvc;
@Test
void welcomeTest() throws Exception {
mockMvc.perform(get("/welcome"))
.andExpect(status().isOk())
.andExpect(content().string("welcome to lf8_starter"));
}
}