Compare commits

..

No commits in common. "forge/role-developer-reverify-001-attempt-2-run-2442ff580a26" and "main" have entirely different histories.

6 changed files with 0 additions and 130 deletions

View file

@ -1,3 +0,0 @@
# role-developer-reverify-001-attempt-2-run-2442ff580a26
Forge 이슈 작업 브랜치 `forge/role-developer-reverify-001-attempt-2-run-2442ff580a26`.

48
pom.xml
View file

@ -1,48 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.5</version>
<relativePath/>
</parent>
<groupId>com.example</groupId>
<artifactId>spring-minimal</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
<name>spring-minimal</name>
<description>Spring Boot Minimal Application</description>
<properties>
<java.version>17</java.version>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View file

@ -1,12 +0,0 @@
package com.example;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class SpringMinimalApplication {
public static void main(String[] args) {
SpringApplication.run(SpringMinimalApplication.class, args);
}
}

View file

@ -1,16 +0,0 @@
package com.example.controller;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
@RestController
public class HealthController {
@GetMapping("/health")
public ResponseEntity<Map<String, String>> health() {
return ResponseEntity.ok(Map.of("status", "UP"));
}
}

View file

@ -1,13 +0,0 @@
package com.example;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class SpringMinimalApplicationTests {
@Test
void contextLoads() {
// Verifies that the Spring context loads successfully
}
}

View file

@ -1,38 +0,0 @@
package com.example.controller;
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 org.springframework.test.web.servlet.MvcResult;
import static org.hamcrest.Matchers.*;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
@SpringBootTest
@AutoConfigureMockMvc
class HealthControllerTest {
@Autowired
private MockMvc mockMvc;
@Test
void healthEndpointReturnsUp() throws Exception {
mockMvc.perform(get("/health"))
.andExpect(status().isOk())
.andExpect(jsonPath("$.status", is("UP")));
}
@Test
void healthEndpointReturnsJson() throws Exception {
MvcResult result = mockMvc.perform(get("/health"))
.andExpect(status().isOk())
.andReturn();
String content = result.getResponse().getContentAsString();
org.assertj.core.api.Assertions.assertThat(content)
.contains("{\"status\":\"UP\"}");
}
}