Set up development infrastructure for TDD: JPA + Liquibase for database migrations, Testcontainers for integration tests against real PostgreSQL, profile-based configuration (prod/local), and README deployment documentation with docker-compose example. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
34 lines
1.0 KiB
Java
34 lines
1.0 KiB
Java
package de.fete;
|
|
|
|
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
|
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
|
|
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
|
|
|
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.context.annotation.Import;
|
|
import org.springframework.test.web.servlet.MockMvc;
|
|
|
|
@SpringBootTest
|
|
@AutoConfigureMockMvc
|
|
@Import(TestcontainersConfig.class)
|
|
class FeteApplicationTest {
|
|
|
|
@Autowired
|
|
private MockMvc mockMvc;
|
|
|
|
@Test
|
|
void contextLoads() {
|
|
// Spring context starts successfully
|
|
}
|
|
|
|
@Test
|
|
void healthEndpointReturns200() throws Exception {
|
|
mockMvc.perform(get("/actuator/health"))
|
|
.andExpect(status().isOk())
|
|
.andExpect(jsonPath("$.status").value("UP"));
|
|
}
|
|
}
|