Add gradle9 module: Spring Boot 4 build migrated from Gradle 8 to Gradle 9
Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Gth99spB1CzQmBFofXmU4Z
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package com.ankurm.g9;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@SpringBootApplication
|
||||
@RestController
|
||||
public class G9Application {
|
||||
public static void main(String[] args) { SpringApplication.run(G9Application.class, args); }
|
||||
|
||||
@GetMapping("/hello")
|
||||
String hello() { return "hello"; }
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.ankurm.g9;
|
||||
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.webmvc.test.autoconfigure.AutoConfigureMockMvc;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
|
||||
@SpringBootTest
|
||||
@AutoConfigureMockMvc
|
||||
class G9ApplicationTest {
|
||||
@Autowired MockMvc mvc;
|
||||
|
||||
@Test
|
||||
void hello() throws Exception {
|
||||
mvc.perform(get("/hello")).andExpect(content().string("hello"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user