test: Increase test coverage #33

Closed
jank wants to merge 2 commits from tests/increase-coverage into main
Showing only changes of commit 66f3b0da4c - Show all commits

@ -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"));
}
}