diff --git a/.gradle/9.3.1/checksums/checksums.lock b/.gradle/9.3.1/checksums/checksums.lock new file mode 100644 index 0000000..77bfcd7 Binary files /dev/null and b/.gradle/9.3.1/checksums/checksums.lock differ diff --git a/.gradle/9.3.1/checksums/md5-checksums.bin b/.gradle/9.3.1/checksums/md5-checksums.bin new file mode 100644 index 0000000..d4ebd5b Binary files /dev/null and b/.gradle/9.3.1/checksums/md5-checksums.bin differ diff --git a/.gradle/9.3.1/checksums/sha1-checksums.bin b/.gradle/9.3.1/checksums/sha1-checksums.bin new file mode 100644 index 0000000..17f80d7 Binary files /dev/null and b/.gradle/9.3.1/checksums/sha1-checksums.bin differ diff --git a/.gradle/9.3.1/executionHistory/executionHistory.bin b/.gradle/9.3.1/executionHistory/executionHistory.bin new file mode 100644 index 0000000..7e170e6 Binary files /dev/null and b/.gradle/9.3.1/executionHistory/executionHistory.bin differ diff --git a/.gradle/9.3.1/executionHistory/executionHistory.lock b/.gradle/9.3.1/executionHistory/executionHistory.lock new file mode 100644 index 0000000..d256b80 Binary files /dev/null and b/.gradle/9.3.1/executionHistory/executionHistory.lock differ diff --git a/.gradle/9.3.1/fileChanges/last-build.bin b/.gradle/9.3.1/fileChanges/last-build.bin new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/.gradle/9.3.1/fileChanges/last-build.bin differ diff --git a/.gradle/9.3.1/fileHashes/fileHashes.bin b/.gradle/9.3.1/fileHashes/fileHashes.bin new file mode 100644 index 0000000..9996800 Binary files /dev/null and b/.gradle/9.3.1/fileHashes/fileHashes.bin differ diff --git a/.gradle/9.3.1/fileHashes/fileHashes.lock b/.gradle/9.3.1/fileHashes/fileHashes.lock new file mode 100644 index 0000000..e9d56d0 Binary files /dev/null and b/.gradle/9.3.1/fileHashes/fileHashes.lock differ diff --git a/.gradle/9.3.1/fileHashes/resourceHashesCache.bin b/.gradle/9.3.1/fileHashes/resourceHashesCache.bin new file mode 100644 index 0000000..9d480a6 Binary files /dev/null and b/.gradle/9.3.1/fileHashes/resourceHashesCache.bin differ diff --git a/.gradle/9.3.1/gc.properties b/.gradle/9.3.1/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock new file mode 100644 index 0000000..673973d Binary files /dev/null and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/.gradle/buildOutputCleanup/cache.properties b/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 0000000..dc04367 --- /dev/null +++ b/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Thu Mar 12 21:16:55 KST 2026 +gradle.version=9.3.1 diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin new file mode 100644 index 0000000..2f9474b Binary files /dev/null and b/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/.gradle/file-system.probe b/.gradle/file-system.probe new file mode 100644 index 0000000..a61ba7d Binary files /dev/null and b/.gradle/file-system.probe differ diff --git a/.gradle/vcs-1/gc.properties b/.gradle/vcs-1/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..9879198 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,10 @@ +# 디폴트 무시된 파일 +/shelf/ +/workspace.xml +# 쿼리 파일을 포함한 무시된 디폴트 폴더 +/queries/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# 에디터 기반 HTTP 클라이언트 요청 +/httpRequests/ diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..fa666d8 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +spring-boot \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..2a04707 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..774a8ac --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..7c47dd4 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..0641d73 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/spring-boot.main.iml b/.idea/modules/spring-boot.main.iml new file mode 100644 index 0000000..afc1871 --- /dev/null +++ b/.idea/modules/spring-boot.main.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/HELP.md b/HELP.md new file mode 100644 index 0000000..5dd1902 --- /dev/null +++ b/HELP.md @@ -0,0 +1,27 @@ +# Read Me First +The following was discovered as part of building this project: + +* The original package name 'com.ceos23.spring-boot' is invalid and this project uses 'com.ceos23.spring_boot' instead. + +# Getting Started + +### Reference Documentation +For further reference, please consider the following sections: + +* [Official Gradle documentation](https://docs.gradle.org) +* [Spring Boot Gradle Plugin Reference Guide](https://docs.spring.io/spring-boot/4.0.3/gradle-plugin) +* [Create an OCI image](https://docs.spring.io/spring-boot/4.0.3/gradle-plugin/packaging-oci-image.html) +* [Spring Web](https://docs.spring.io/spring-boot/4.0.3/reference/web/servlet.html) + +### Guides +The following guides illustrate how to use some features concretely: + +* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/) +* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/) +* [Building REST services with Spring](https://spring.io/guides/tutorials/rest/) + +### Additional Links +These additional references should also help you: + +* [Gradle Build Scans – insights for your project's build](https://scans.gradle.com#gradle) + diff --git a/README.md b/README.md index c03120e..5b1d951 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,244 @@ -# spring-tutorial-22rd +# spring-tutorial-23rd CEOS 백엔드 23기 스프링 튜토리얼 + +--- + +### 1. spring-tutorial-23rd를 완료해요! +참고: [인텔리제이 설치](https://melodyblue.tistory.com/34) + +### 2. spring이 지원하는 기술들(IoC/DI, AOP, PSA 등)을 자유롭게 조사해요 + +Spring의 삼각형 + - IoC/DI & AOP & PSA + +IoC + - 객체의 호출을 스프링이 대신 해주는 것 + - 직접 생성 x + +DI +- 빈을 스프링 컨테이너에 넣어주는 것 + +``` +class A { + + private B b; // 선언만 + + A(B b){ // DI + this.b = b; + } + + void run() { + b.hello(); + } +} +``` +AOP +- 모듈별로 중복해서 나타나는 횡단 관심사를 분리 +- 공통 코드를 각 클래스에 쓰지 않고 한 곳에서만 작성해서 자동으로 실행되도록 + +PSA +- 오라클, MySQL, MS-SQL 등과 같은 다양한 DBMS의 종류에 상관없이 + Connection, Statement, ResultSet을 이용해 공통된 방식으로 코드를 작성할 수 있음 + + +### 3. Spring Bean이 무엇이고, Bean의 라이프사이클과 Bean Scope에 대해 조사해요 +Spring Bean: 스프링에서 관리하는 객체 +대표적인 빈: Controller, Service, Repository + +빈 생명 주기 +- 생성 -> 초기화 -> (프로그램에서 사용) -> 소멸 +``` +@Component +class TestBean { + + public TestBean() { + System.out.println("생성"); + } + + @PostConstruct + public void init(){ + System.out.println("초기화"); + } + + @PreDestroy + public void destroy(){ + System.out.println("소멸"); + } + +} +``` + +빈 스코프 +- 빈이 존재할 수 있는 범위 + +| Scope | Description | +|-------------|------------------------------------------------------------------------------------------------| +| singleton | (Default) 각 스프링 컨테이너에 대한 단일 객체 인스턴스에 대한 단일 bean definition의 범위를 지정합니다 | +| prototype | 빈의 생성과 의존관계 주입까지만 관여하고 더는 관리하지 않는 매우 짧은 범위의 스코프입니다. | +| request | 웹 요청이 들어오고 나갈 때까지 유지되는 스코프입니다. | +| session | 웹 세션이 생성되고 종료될 때까지 유지되는 스코프입니다. | +| application | 웹의 서블릿 컨텍스와 같은 범위로 유지되는 스코프입니다. | +| websocket | 단일 bean definition 범위를 WebSocket의 라이프사이클까지 확장합니다. Spring ApplicationContext의 Context에서만 유효합니다. | + + +#### 3.1 어노테이션이란 무엇이며, Java에서 어떻게 구현될까요? +어노테이션이란 +- 코드에 추가적인 정보를 제공하는 메타데이터 +- 어노테이션은 프로그램의 컴파일, 배포, 실행 과정에서 다양한 기능을 수행하도록 영향을 줄 수 있음 + +어노테이션 구현 +``` +public @interface MyAnnotation { // 어노테이션 만들기 +} +``` +``` +@MyAnnotation // 어노테이션 사용 -> 스프링이 실행 할 때 Test에 어노테이션이 있구나 +class Test { +} +``` + +#### 3.2 스프링에서 어노테이션을 통해 Bean을 등록할 때, 어떤 일련의 과정이 일어나는지 탐구해보세요. +#### 3.3 `@ComponentScan` 과 같은 어노테이션을 사용하여 스프링이 컴포넌트를 어떻게 탐색하고 찾는지의 과정을 깊게 파헤쳐보세요. + +1) 프로그램 시작 (SpringApplication.run) +2) ComponentScan 실행 (패키지 탐색) +3) 어노테이션 검사 (@Component, @Service 등 발견) +4) BeanDefinition 생성 (Bean 정보 저장) +5) 객체 생성 (Bean 인스턴스 생성) +6) 의존성 주입 (@Autowired) +7) 초기화 (@PostConstruct 실행) +8) 컨테이너에서 관리 (ApplicationContext가 Bean 관리) + +
+코드 예시 + +``` +// 1️⃣ 프로그램 시작 +// Spring Boot 애플리케이션 실행 +@SpringBootApplication // 내부에 @ComponentScan 포함 +public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + // Spring 컨테이너(ApplicationContext) 생성 + } +} + + +// 2️⃣ ComponentScan 실행 +// Spring이 현재 패키지와 하위 패키지를 탐색하여 +// Bean으로 등록할 클래스를 찾기 시작 + + +@Service +// 3️⃣ 어노테이션 검사 +// Spring이 클래스들을 검사하다가 +// @Service 발견 → Bean 후보로 판단 +class UserService { + + public void login(){ + System.out.println("login"); + } +} + + +// 4️⃣ BeanDefinition 생성 +// Spring 내부에서 UserService에 대한 BeanDefinition 생성 +// (객체 설계 정보 저장) +// 예: 클래스 이름, scope(singleton), 생성 방법 등 + + +@Service +class OrderService { + + // 6️⃣ 의존성 주입 (Dependency Injection) + // Spring이 UserService Bean을 찾아서 + // 이 변수에 자동으로 넣어줌 + @Autowired + UserService userService; + + public void order(){ + userService.login(); + } + + + // 7️⃣ 초기화 + // Bean 생성 후 실행되는 메서드 + @PostConstruct + public void init(){ + System.out.println("OrderService 초기화"); + } + +} + + +// 5️⃣ 객체 생성 +// Spring이 BeanDefinition을 기반으로 실제 객체 생성 +// new UserService() +// new OrderService() + + +// 8️⃣ 컨테이너에서 관리 +// 생성된 Bean들은 Spring Container(ApplicationContext)에 저장 +// 이후 다른 클래스에서 @Autowired로 주입해서 사용 +``` + +
+ +#### 3.4 (선택) 하나의 interface를 구현한 service가 여러개 있을때 어떻게 주입 해야할까요? +``` +@Autowired +@Qualifier("kakaoPayService") // Qualifier로 해결 +PaymentService paymentService; +``` +``` +@Primary // Primary로 해결 +@Service +class KakaoPayService implements PaymentService {} +``` + + +### 4. 🔥Spring MVC를 심층 분석해요🔥 +#### 4.1 MVC 패턴과 Spring MVC는 어떻게 다를까요? +Spring MVC +- MVC 패턴을 웹 환경에서 쉽게 사용할 수 있게 만든 프레임워크 +- 기본 MVC는 구조만 정의하고 요청 처리 방법을 직접 구현해야 했음 +#### 4.2 Servlet은 무엇이고 웹 요청이 어떻게 처리될까요? +Servlet +- Java로 웹 요청을 처리하는 서버 프로그램 +``` +@WebServlet("/hello") +public class HelloServlet extends HttpServlet { + + protected void doGet(HttpServletRequest req, + HttpServletResponse res) throws IOException { + + res.getWriter().println("hello"); + } +} +``` +#### 4.3 톰캣이 무엇이고 WAS는 무엇일까요? +톰캣 +- Java 웹 애플리케이션을 실행하는 서버 +- HTTP 요청 받기 -> Servlet 실행 -> 응답 반환 +WAS +- 웹 애플리케이션 실행 서버 +#### 4.4 Dispatcher Servlet은 무엇이고 어떻게 동작하는지 직접 흐름을 분석해요. +DispatcherServlet +- Spring MVC의 중앙 컨트롤러 +구조 +``` +브라우저 + ↓ +Tomcat + ↓ +DispatcherServlet + ↓ +Controller + ↓ +Service + ↓ +View +``` + + diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..e71da92 --- /dev/null +++ b/build.gradle @@ -0,0 +1,36 @@ +plugins { + id 'java' + id 'org.springframework.boot' version '3.3.2' + id 'io.spring.dependency-management' version '1.1.5' +} + +group = 'com.ceos23' +version = '0.0.1-SNAPSHOT' + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(21) + } +} + +repositories { + mavenCentral() +} + +dependencies { + implementation 'org.springframework.boot:spring-boot-starter-web' + testImplementation 'org.springframework.boot:spring-boot-starter-webmvc-test' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' + + compileOnly 'org.projectlombok:lombok' + annotationProcessor 'org.projectlombok:lombok' + + implementation 'org.springframework.boot:spring-boot-starter-data-jpa' + runtimeOnly 'com.mysql:mysql-connector-j' + + testImplementation 'org.springframework.boot:spring-boot-starter-test' +} + +tasks.named('test') { + useJUnitPlatform() +} \ No newline at end of file diff --git a/build/classes/java/main/com/ceos23/spring_boot/Application.class b/build/classes/java/main/com/ceos23/spring_boot/Application.class new file mode 100644 index 0000000..1634249 Binary files /dev/null and b/build/classes/java/main/com/ceos23/spring_boot/Application.class differ diff --git a/build/classes/java/main/com/ceos23/spring_boot/HelloController.class b/build/classes/java/main/com/ceos23/spring_boot/HelloController.class new file mode 100644 index 0000000..da36dc0 Binary files /dev/null and b/build/classes/java/main/com/ceos23/spring_boot/HelloController.class differ diff --git a/build/classes/java/main/com/ceos23/spring_boot/Test.class b/build/classes/java/main/com/ceos23/spring_boot/Test.class new file mode 100644 index 0000000..aa7af79 Binary files /dev/null and b/build/classes/java/main/com/ceos23/spring_boot/Test.class differ diff --git a/build/classes/java/main/com/ceos23/spring_boot/TestController.class b/build/classes/java/main/com/ceos23/spring_boot/TestController.class new file mode 100644 index 0000000..3cc59b6 Binary files /dev/null and b/build/classes/java/main/com/ceos23/spring_boot/TestController.class differ diff --git a/build/classes/java/main/com/ceos23/spring_boot/TestRepository.class b/build/classes/java/main/com/ceos23/spring_boot/TestRepository.class new file mode 100644 index 0000000..23fa91c Binary files /dev/null and b/build/classes/java/main/com/ceos23/spring_boot/TestRepository.class differ diff --git a/build/classes/java/main/com/ceos23/spring_boot/TestService.class b/build/classes/java/main/com/ceos23/spring_boot/TestService.class new file mode 100644 index 0000000..f02ab5d Binary files /dev/null and b/build/classes/java/main/com/ceos23/spring_boot/TestService.class differ diff --git a/build/classes/java/test/com/ceos23/spring_boot/ApplicationTests.class b/build/classes/java/test/com/ceos23/spring_boot/ApplicationTests.class new file mode 100644 index 0000000..adb5157 Binary files /dev/null and b/build/classes/java/test/com/ceos23/spring_boot/ApplicationTests.class differ diff --git a/build/classes/java/test/com/ceos23/spring_boot/HelloControllerTest.class b/build/classes/java/test/com/ceos23/spring_boot/HelloControllerTest.class new file mode 100644 index 0000000..7851f1a Binary files /dev/null and b/build/classes/java/test/com/ceos23/spring_boot/HelloControllerTest.class differ diff --git a/build/reports/problems/problems-report.html b/build/reports/problems/problems-report.html new file mode 100644 index 0000000..d6126fe --- /dev/null +++ b/build/reports/problems/problems-report.html @@ -0,0 +1,659 @@ + + + + + + + + + + + + + Gradle Configuration Cache + + + +
+ +
+ Loading... +
+ + + + + + diff --git a/build/reports/tests/test/com.ceos23.spring_boot.ApplicationTests/contextLoads().html b/build/reports/tests/test/com.ceos23.spring_boot.ApplicationTests/contextLoads().html new file mode 100644 index 0000000..cb953c2 --- /dev/null +++ b/build/reports/tests/test/com.ceos23.spring_boot.ApplicationTests/contextLoads().html @@ -0,0 +1,110 @@ + + + + + +Test results - contextLoads() + + + + + +
+ +
+ +
+

Gradle Test Run :test

+

contextLoads()

+
+ +
+

summary

+
+
+ + + + + +
+
+ + + + + + + +
+
+
1
+

tests

+
+
+
+
0
+

failures

+
+
+
+
0
+

skipped

+
+
+
+
0.334s
+

duration

+
+
+
+
+
+
100%
+

successful

+
+
+
+
+
+
+

error output

+ +
WARNING: A Java agent has been loaded dynamically (/Users/taehee/.gradle/caches/modules-2/files-2.1/net.bytebuddy/byte-buddy-agent/1.14.18/417558ea01fe9f0e8a94af28b9469d281c4e3984/byte-buddy-agent-1.14.18.jar)
+WARNING: If a serviceability tool is in use, please run with -XX:+EnableDynamicAgentLoading to hide this warning
+WARNING: If a serviceability tool is not in use, please run with -Djdk.instrument.traceUsage for more information
+WARNING: Dynamic loading of agents will be disallowed by default in a future release
+
+ +
+
+
+
+
+ +
+ + diff --git a/build/reports/tests/test/com.ceos23.spring_boot.ApplicationTests/index.html b/build/reports/tests/test/com.ceos23.spring_boot.ApplicationTests/index.html new file mode 100644 index 0000000..ba713ac --- /dev/null +++ b/build/reports/tests/test/com.ceos23.spring_boot.ApplicationTests/index.html @@ -0,0 +1,299 @@ + + + + + +Test results - com.ceos23.spring_boot.ApplicationTests + + + + + +
+ +
+ +
+

Gradle Test Run :test

+

ApplicationTests

+
+ +
+

summary

+
+
+ + + + + +
+
+ + + + + + + +
+
+
1
+

tests

+
+
+
+
0
+

failures

+
+
+
+
0
+

skipped

+
+
+
+
0.832s
+

duration

+
+
+
+
+
+
100%
+

successful

+
+
+
+ + + + + + + + + + + + + + + + + + + + + +
ChildTestsFailuresSkippedDurationSuccess rate
+contextLoads() +1000.334s100%
+
+
+
+

standard output

+ +
22:26:12.686 [Test worker] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils -- Could not detect default configuration classes for test class [com.ceos23.spring_boot.ApplicationTests]: ApplicationTests does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
+22:26:12.718 [Test worker] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper -- Found @SpringBootConfiguration com.ceos23.spring_boot.Application for test class com.ceos23.spring_boot.ApplicationTests
+
+  .   ____          _            __ _ _
+ /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
+( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
+ \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
+  '  |____| .__|_| |_|_| |_\__, | / / / /
+ =========|_|==============|___/=/_/_/_/
+
+ :: Spring Boot ::                (v3.3.2)
+
+2026-03-12T22:26:12.826+09:00  INFO 98874 --- [spring-boot] [    Test worker] c.ceos23.spring_boot.ApplicationTests    : Starting ApplicationTests using Java 21.0.10 with PID 98874 (started by taehee in /Users/taehee/Documents/ceos_spring/spring-tutorial-23rd)
+2026-03-12T22:26:12.827+09:00  INFO 98874 --- [spring-boot] [    Test worker] c.ceos23.spring_boot.ApplicationTests    : No active profile set, falling back to 1 default profile: "default"
+2026-03-12T22:26:13.133+09:00  INFO 98874 --- [spring-boot] [    Test worker] c.ceos23.spring_boot.ApplicationTests    : Started ApplicationTests in 0.372 seconds (process running for 0.703)
+Let's inspect the beans provided by Spring Boot:
+application
+applicationAvailability
+applicationTaskExecutor
+basicErrorController
+beanNameHandlerMapping
+beanNameViewResolver
+characterEncodingFilter
+commandLineRunner
+conventionErrorViewResolver
+defaultServletHandlerMapping
+defaultViewResolver
+dispatcherServlet
+dispatcherServletRegistration
+error
+errorAttributes
+errorPageCustomizer
+errorPageRegistrarBeanPostProcessor
+fileWatcher
+flashMapManager
+forceAutoProxyCreatorToUseClassProxying
+formContentFilter
+handlerExceptionResolver
+handlerFunctionAdapter
+helloController
+httpMessageConvertersRestClientCustomizer
+httpRequestHandlerAdapter
+jacksonObjectMapper
+jacksonObjectMapperBuilder
+jsonComponentModule
+jsonMixinModule
+jsonMixinModuleEntries
+lifecycleProcessor
+localeCharsetMappingsCustomizer
+localeResolver
+mappingJackson2HttpMessageConverter
+messageConverters
+multipartConfigElement
+multipartResolver
+mvcContentNegotiationManager
+mvcConversionService
+mvcHandlerMappingIntrospector
+mvcPathMatcher
+mvcPatternParser
+mvcResourceUrlProvider
+mvcUriComponentsContributor
+mvcUrlPathHelper
+mvcValidator
+mvcViewResolver
+org.springframework.aop.config.internalAutoProxyCreator
+org.springframework.boot.autoconfigure.AutoConfigurationPackages
+org.springframework.boot.autoconfigure.aop.AopAutoConfiguration
+org.springframework.boot.autoconfigure.aop.AopAutoConfiguration$ClassProxyingConfiguration
+org.springframework.boot.autoconfigure.availability.ApplicationAvailabilityAutoConfiguration
+org.springframework.boot.autoconfigure.context.ConfigurationPropertiesAutoConfiguration
+org.springframework.boot.autoconfigure.context.LifecycleAutoConfiguration
+org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration
+org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration
+org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration$StringHttpMessageConverterConfiguration
+org.springframework.boot.autoconfigure.http.JacksonHttpMessageConvertersConfiguration
+org.springframework.boot.autoconfigure.http.JacksonHttpMessageConvertersConfiguration$MappingJackson2HttpMessageConverterConfiguration
+org.springframework.boot.autoconfigure.info.ProjectInfoAutoConfiguration
+org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory
+org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
+org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$Jackson2ObjectMapperBuilderCustomizerConfiguration
+org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$JacksonMixinConfiguration
+org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$JacksonObjectMapperBuilderConfiguration
+org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$JacksonObjectMapperConfiguration
+org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$ParameterNamesModuleConfiguration
+org.springframework.boot.autoconfigure.sql.init.SqlInitializationAutoConfiguration
+org.springframework.boot.autoconfigure.ssl.SslAutoConfiguration
+org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration
+org.springframework.boot.autoconfigure.task.TaskExecutorConfigurations$SimpleAsyncTaskExecutorBuilderConfiguration
+org.springframework.boot.autoconfigure.task.TaskExecutorConfigurations$TaskExecutorBuilderConfiguration
+org.springframework.boot.autoconfigure.task.TaskExecutorConfigurations$TaskExecutorConfiguration
+org.springframework.boot.autoconfigure.task.TaskExecutorConfigurations$ThreadPoolTaskExecutorBuilderConfiguration
+org.springframework.boot.autoconfigure.task.TaskSchedulingAutoConfiguration
+org.springframework.boot.autoconfigure.task.TaskSchedulingConfigurations$SimpleAsyncTaskSchedulerBuilderConfiguration
+org.springframework.boot.autoconfigure.task.TaskSchedulingConfigurations$TaskSchedulerBuilderConfiguration
+org.springframework.boot.autoconfigure.task.TaskSchedulingConfigurations$ThreadPoolTaskSchedulerBuilderConfiguration
+org.springframework.boot.autoconfigure.web.client.RestClientAutoConfiguration
+org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration
+org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration
+org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration$DispatcherServletConfiguration
+org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration$DispatcherServletRegistrationConfiguration
+org.springframework.boot.autoconfigure.web.servlet.HttpEncodingAutoConfiguration
+org.springframework.boot.autoconfigure.web.servlet.MultipartAutoConfiguration
+org.springframework.boot.autoconfigure.web.servlet.ServletWebServerFactoryAutoConfiguration
+org.springframework.boot.autoconfigure.web.servlet.ServletWebServerFactoryConfiguration$EmbeddedTomcat
+org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration
+org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration$EnableWebMvcConfiguration
+org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter
+org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration
+org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration$DefaultErrorViewResolverConfiguration
+org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration
+org.springframework.boot.autoconfigure.websocket.servlet.WebSocketServletAutoConfiguration
+org.springframework.boot.autoconfigure.websocket.servlet.WebSocketServletAutoConfiguration$TomcatWebSocketConfiguration
+org.springframework.boot.context.internalConfigurationPropertiesBinder
+org.springframework.boot.context.properties.BoundConfigurationProperties
+org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor
+org.springframework.boot.context.properties.EnableConfigurationPropertiesRegistrar.methodValidationExcludeFilter
+org.springframework.boot.sql.init.dependency.DatabaseInitializationDependencyConfigurer$DependsOnDatabaseInitializationPostProcessor
+org.springframework.boot.test.mock.mockito.MockitoPostProcessor
+org.springframework.boot.test.mock.mockito.MockitoPostProcessor$SpyPostProcessor
+org.springframework.context.annotation.internalAutowiredAnnotationProcessor
+org.springframework.context.annotation.internalCommonAnnotationProcessor
+org.springframework.context.annotation.internalConfigurationAnnotationProcessor
+org.springframework.context.event.internalEventListenerFactory
+org.springframework.context.event.internalEventListenerProcessor
+parameterNamesModule
+preserveErrorControllerTargetClassPostProcessor
+propertySourcesPlaceholderConfigurer
+requestContextFilter
+requestMappingHandlerAdapter
+requestMappingHandlerMapping
+resourceHandlerMapping
+restClientBuilder
+restClientBuilderConfigurer
+restClientSsl
+restTemplateBuilder
+restTemplateBuilderConfigurer
+routerFunctionMapping
+server-org.springframework.boot.autoconfigure.web.ServerProperties
+servletWebServerFactoryCustomizer
+simpleAsyncTaskExecutorBuilder
+simpleAsyncTaskSchedulerBuilder
+simpleControllerHandlerAdapter
+spring.info-org.springframework.boot.autoconfigure.info.ProjectInfoProperties
+spring.jackson-org.springframework.boot.autoconfigure.jackson.JacksonProperties
+spring.lifecycle-org.springframework.boot.autoconfigure.context.LifecycleProperties
+spring.mvc-org.springframework.boot.autoconfigure.web.servlet.WebMvcProperties
+spring.servlet.multipart-org.springframework.boot.autoconfigure.web.servlet.MultipartProperties
+spring.sql.init-org.springframework.boot.autoconfigure.sql.init.SqlInitializationProperties
+spring.ssl-org.springframework.boot.autoconfigure.ssl.SslProperties
+spring.task.execution-org.springframework.boot.autoconfigure.task.TaskExecutionProperties
+spring.task.scheduling-org.springframework.boot.autoconfigure.task.TaskSchedulingProperties
+spring.web-org.springframework.boot.autoconfigure.web.WebProperties
+sslBundleRegistry
+sslPropertiesSslBundleRegistrar
+standardJacksonObjectMapperBuilderCustomizer
+stringHttpMessageConverter
+taskExecutorBuilder
+taskSchedulerBuilder
+themeResolver
+threadPoolTaskExecutorBuilder
+threadPoolTaskSchedulerBuilder
+tomcatServletWebServerFactory
+tomcatServletWebServerFactoryCustomizer
+viewControllerHandlerMapping
+viewNameTranslator
+viewResolver
+webServerFactoryCustomizerBeanPostProcessor
+websocketServletWebServerCustomizer
+welcomePageHandlerMapping
+welcomePageNotAcceptableHandlerMapping
+
+ +
+
+
+
+
+ +
+ + diff --git a/build/reports/tests/test/com.ceos23.spring_boot.HelloControllerTest/index.html b/build/reports/tests/test/com.ceos23.spring_boot.HelloControllerTest/index.html new file mode 100644 index 0000000..70b81f4 --- /dev/null +++ b/build/reports/tests/test/com.ceos23.spring_boot.HelloControllerTest/index.html @@ -0,0 +1,305 @@ + + + + + +Test results - com.ceos23.spring_boot.HelloControllerTest + + + + + +
+ +
+ +
+

Gradle Test Run :test

+

HelloControllerTest

+
+ +
+

summary

+
+
+ + + + + +
+
+ + + + + + + +
+
+
1
+

tests

+
+
+
+
0
+

failures

+
+
+
+
0
+

skipped

+
+
+
+
0.106s
+

duration

+
+
+
+
+
+
100%
+

successful

+
+
+
+ + + + + + + + + + + + + + + + + + + + + +
ChildNameTestsFailuresSkippedDurationSuccess rate
HelloController의 hello() 메서드 테스트getHello()1000.019s100%
+
+
+
+

standard output

+ +
2026-03-12T22:26:13.476+09:00  INFO 98874 --- [spring-boot] [    Test worker] t.c.s.AnnotationConfigContextLoaderUtils : Could not detect default configuration classes for test class [com.ceos23.spring_boot.HelloControllerTest]: HelloControllerTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
+2026-03-12T22:26:13.478+09:00  INFO 98874 --- [spring-boot] [    Test worker] .b.t.c.SpringBootTestContextBootstrapper : Found @SpringBootConfiguration com.ceos23.spring_boot.Application for test class com.ceos23.spring_boot.HelloControllerTest
+
+  .   ____          _            __ _ _
+ /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
+( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
+ \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
+  '  |____| .__|_| |_|_| |_\__, | / / / /
+ =========|_|==============|___/=/_/_/_/
+
+ :: Spring Boot ::                (v3.3.2)
+
+2026-03-12T22:26:13.487+09:00  INFO 98874 --- [spring-boot] [    Test worker] c.c.spring_boot.HelloControllerTest      : Starting HelloControllerTest using Java 21.0.10 with PID 98874 (started by taehee in /Users/taehee/Documents/ceos_spring/spring-tutorial-23rd)
+2026-03-12T22:26:13.487+09:00  INFO 98874 --- [spring-boot] [    Test worker] c.c.spring_boot.HelloControllerTest      : No active profile set, falling back to 1 default profile: "default"
+2026-03-12T22:26:13.555+09:00  INFO 98874 --- [spring-boot] [    Test worker] o.s.b.t.m.w.SpringBootMockServletContext : Initializing Spring TestDispatcherServlet ''
+2026-03-12T22:26:13.555+09:00  INFO 98874 --- [spring-boot] [    Test worker] o.s.t.web.servlet.TestDispatcherServlet  : Initializing Servlet ''
+2026-03-12T22:26:13.556+09:00  INFO 98874 --- [spring-boot] [    Test worker] o.s.t.web.servlet.TestDispatcherServlet  : Completed initialization in 0 ms
+2026-03-12T22:26:13.558+09:00  INFO 98874 --- [spring-boot] [    Test worker] c.c.spring_boot.HelloControllerTest      : Started HelloControllerTest in 0.078 seconds (process running for 1.128)
+Let's inspect the beans provided by Spring Boot:
+application
+applicationAvailability
+applicationTaskExecutor
+basicErrorController
+beanNameHandlerMapping
+beanNameViewResolver
+characterEncodingFilter
+commandLineRunner
+conventionErrorViewResolver
+defaultServletHandlerMapping
+defaultViewResolver
+dispatcherServlet
+dispatcherServletRegistration
+error
+errorAttributes
+errorPageCustomizer
+errorPageRegistrarBeanPostProcessor
+fileWatcher
+flashMapManager
+forceAutoProxyCreatorToUseClassProxying
+formContentFilter
+handlerExceptionResolver
+handlerFunctionAdapter
+helloController
+httpMessageConvertersRestClientCustomizer
+httpRequestHandlerAdapter
+jacksonObjectMapper
+jacksonObjectMapperBuilder
+jsonComponentModule
+jsonMixinModule
+jsonMixinModuleEntries
+lifecycleProcessor
+localeCharsetMappingsCustomizer
+localeResolver
+mappingJackson2HttpMessageConverter
+messageConverters
+mockMvc
+mockMvcBuilder
+multipartConfigElement
+multipartResolver
+mvcContentNegotiationManager
+mvcConversionService
+mvcHandlerMappingIntrospector
+mvcPathMatcher
+mvcPatternParser
+mvcResourceUrlProvider
+mvcUriComponentsContributor
+mvcUrlPathHelper
+mvcValidator
+mvcViewResolver
+org.springframework.aop.config.internalAutoProxyCreator
+org.springframework.boot.autoconfigure.AutoConfigurationPackages
+org.springframework.boot.autoconfigure.aop.AopAutoConfiguration
+org.springframework.boot.autoconfigure.aop.AopAutoConfiguration$ClassProxyingConfiguration
+org.springframework.boot.autoconfigure.availability.ApplicationAvailabilityAutoConfiguration
+org.springframework.boot.autoconfigure.context.ConfigurationPropertiesAutoConfiguration
+org.springframework.boot.autoconfigure.context.LifecycleAutoConfiguration
+org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration
+org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration
+org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration$StringHttpMessageConverterConfiguration
+org.springframework.boot.autoconfigure.http.JacksonHttpMessageConvertersConfiguration
+org.springframework.boot.autoconfigure.http.JacksonHttpMessageConvertersConfiguration$MappingJackson2HttpMessageConverterConfiguration
+org.springframework.boot.autoconfigure.info.ProjectInfoAutoConfiguration
+org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory
+org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
+org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$Jackson2ObjectMapperBuilderCustomizerConfiguration
+org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$JacksonMixinConfiguration
+org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$JacksonObjectMapperBuilderConfiguration
+org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$JacksonObjectMapperConfiguration
+org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$ParameterNamesModuleConfiguration
+org.springframework.boot.autoconfigure.sql.init.SqlInitializationAutoConfiguration
+org.springframework.boot.autoconfigure.ssl.SslAutoConfiguration
+org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration
+org.springframework.boot.autoconfigure.task.TaskExecutorConfigurations$SimpleAsyncTaskExecutorBuilderConfiguration
+org.springframework.boot.autoconfigure.task.TaskExecutorConfigurations$TaskExecutorBuilderConfiguration
+org.springframework.boot.autoconfigure.task.TaskExecutorConfigurations$TaskExecutorConfiguration
+org.springframework.boot.autoconfigure.task.TaskExecutorConfigurations$ThreadPoolTaskExecutorBuilderConfiguration
+org.springframework.boot.autoconfigure.task.TaskSchedulingAutoConfiguration
+org.springframework.boot.autoconfigure.task.TaskSchedulingConfigurations$SimpleAsyncTaskSchedulerBuilderConfiguration
+org.springframework.boot.autoconfigure.task.TaskSchedulingConfigurations$TaskSchedulerBuilderConfiguration
+org.springframework.boot.autoconfigure.task.TaskSchedulingConfigurations$ThreadPoolTaskSchedulerBuilderConfiguration
+org.springframework.boot.autoconfigure.web.client.RestClientAutoConfiguration
+org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration
+org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration
+org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration$DispatcherServletConfiguration
+org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration$DispatcherServletRegistrationConfiguration
+org.springframework.boot.autoconfigure.web.servlet.HttpEncodingAutoConfiguration
+org.springframework.boot.autoconfigure.web.servlet.MultipartAutoConfiguration
+org.springframework.boot.autoconfigure.web.servlet.ServletWebServerFactoryAutoConfiguration
+org.springframework.boot.autoconfigure.web.servlet.ServletWebServerFactoryConfiguration$EmbeddedTomcat
+org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration
+org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration$EnableWebMvcConfiguration
+org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter
+org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration
+org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration$DefaultErrorViewResolverConfiguration
+org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration
+org.springframework.boot.autoconfigure.websocket.servlet.WebSocketServletAutoConfiguration
+org.springframework.boot.autoconfigure.websocket.servlet.WebSocketServletAutoConfiguration$TomcatWebSocketConfiguration
+org.springframework.boot.context.internalConfigurationPropertiesBinder
+org.springframework.boot.context.properties.BoundConfigurationProperties
+org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor
+org.springframework.boot.context.properties.EnableConfigurationPropertiesRegistrar.methodValidationExcludeFilter
+org.springframework.boot.sql.init.dependency.DatabaseInitializationDependencyConfigurer$DependsOnDatabaseInitializationPostProcessor
+org.springframework.boot.test.autoconfigure.web.servlet.MockMvcAutoConfiguration
+org.springframework.boot.test.context.ImportsContextCustomizer$ImportsCleanupPostProcessor
+org.springframework.boot.test.mock.mockito.MockitoPostProcessor
+org.springframework.boot.test.mock.mockito.MockitoPostProcessor$SpyPostProcessor
+org.springframework.context.annotation.internalAutowiredAnnotationProcessor
+org.springframework.context.annotation.internalCommonAnnotationProcessor
+org.springframework.context.annotation.internalConfigurationAnnotationProcessor
+org.springframework.context.event.internalEventListenerFactory
+org.springframework.context.event.internalEventListenerProcessor
+parameterNamesModule
+preserveErrorControllerTargetClassPostProcessor
+propertySourcesPlaceholderConfigurer
+requestContextFilter
+requestMappingHandlerAdapter
+requestMappingHandlerMapping
+resourceHandlerMapping
+restClientBuilder
+restClientBuilderConfigurer
+restClientSsl
+restTemplateBuilder
+restTemplateBuilderConfigurer
+routerFunctionMapping
+server-org.springframework.boot.autoconfigure.web.ServerProperties
+servletWebServerFactoryCustomizer
+simpleAsyncTaskExecutorBuilder
+simpleAsyncTaskSchedulerBuilder
+simpleControllerHandlerAdapter
+spring.info-org.springframework.boot.autoconfigure.info.ProjectInfoProperties
+spring.jackson-org.springframework.boot.autoconfigure.jackson.JacksonProperties
+spring.lifecycle-org.springframework.boot.autoconfigure.context.LifecycleProperties
+spring.mvc-org.springframework.boot.autoconfigure.web.servlet.WebMvcProperties
+spring.servlet.multipart-org.springframework.boot.autoconfigure.web.servlet.MultipartProperties
+spring.sql.init-org.springframework.boot.autoconfigure.sql.init.SqlInitializationProperties
+spring.ssl-org.springframework.boot.autoconfigure.ssl.SslProperties
+spring.task.execution-org.springframework.boot.autoconfigure.task.TaskExecutionProperties
+spring.task.scheduling-org.springframework.boot.autoconfigure.task.TaskSchedulingProperties
+spring.web-org.springframework.boot.autoconfigure.web.WebProperties
+springBootMockMvcBuilderCustomizer
+sslBundleRegistry
+sslPropertiesSslBundleRegistrar
+standardJacksonObjectMapperBuilderCustomizer
+stringHttpMessageConverter
+taskExecutorBuilder
+taskSchedulerBuilder
+themeResolver
+threadPoolTaskExecutorBuilder
+threadPoolTaskSchedulerBuilder
+tomcatServletWebServerFactory
+tomcatServletWebServerFactoryCustomizer
+viewControllerHandlerMapping
+viewNameTranslator
+viewResolver
+webServerFactoryCustomizerBeanPostProcessor
+websocketServletWebServerCustomizer
+welcomePageHandlerMapping
+welcomePageNotAcceptableHandlerMapping
+
+ +
+
+
+
+
+ +
+ + diff --git a/build/reports/tests/test/css/base-style.css b/build/reports/tests/test/css/base-style.css new file mode 100644 index 0000000..d05f23d --- /dev/null +++ b/build/reports/tests/test/css/base-style.css @@ -0,0 +1,175 @@ + +body { + margin: 0; + padding: 0; + font-family: sans-serif; + font-size: 12pt; +} + +body, a, a:visited { + color: #303030; +} + +#content { + padding: 30px 50px; +} + +#content h1 { + font-size: 160%; + margin-bottom: 10px; +} + +#footer { + margin-top: 100px; + font-size: 80%; + white-space: nowrap; +} + +#footer, #footer a { + color: #a0a0a0; +} + +#line-wrapping-toggle { + vertical-align: middle; +} + +#label-for-line-wrapping-toggle { + vertical-align: middle; +} + +ul { + margin-left: 0; +} + +h1, h2, h3 { + white-space: nowrap; +} + +h2 { + font-size: 120%; +} + +.tab-container .tab-container { + margin-left: 8px; +} + +ul.tabLinks { + padding: 0; + margin-bottom: 0; + overflow: auto; + min-width: 800px; + width: auto; + border-bottom: solid 1px #aaa; +} + +ul.tabLinks li { + float: left; + height: 100%; + list-style: none; + padding: 5px 10px; + border-radius: 7px 7px 0 0; + border: solid 1px transparent; + border-bottom: none; + margin-right: 6px; + background-color: #f0f0f0; + cursor: pointer; +} + +ul.tabLinks li.deselected > a { + color: #6d6d6d; +} + +ul.tabLinks li:hover { + background-color: #fafafa; +} + +ul.tabLinks li.selected { + background-color: #c5f0f5; + border-color: #aaa; +} + +ul.tabLinks a { + font-size: 120%; + display: block; + outline: none; + text-decoration: none; + margin: 0; + padding: 0; +} + +ul.tabLinks li h2 { + margin: 0; + padding: 0; +} + +div.tab { +} + +div.selected { + display: block; +} + +div.deselected { + display: none; +} + +div.tab table { + min-width: 350px; + width: auto; + border-collapse: collapse; +} + +div.tab th, div.tab table { + border-bottom: solid 1px #d0d0d0; +} + +div.tab th { + text-align: left; + white-space: nowrap; + padding-left: 6em; +} + +div.tab th:first-child { + padding-left: 0; +} + +div.tab td { + white-space: nowrap; + padding-left: 6em; + padding-top: 5px; + padding-bottom: 5px; +} + +div.tab td:first-child { + padding-left: 0; +} + +div.tab td.numeric, div.tab th.numeric { + text-align: right; +} + +span.code { + display: inline-block; + margin-top: 0; + margin-bottom: 1em; +} + +span.code pre { + font-size: 11pt; + padding: 10px; + margin: 0; + background-color: #f7f7f7; + border: solid 1px #d0d0d0; + min-width: 700px; + width: auto; +} + +span.wrapped pre { + word-wrap: break-word; + white-space: pre-wrap; + word-break: break-all; +} + +label.hidden { + display: none; +} diff --git a/build/reports/tests/test/css/style.css b/build/reports/tests/test/css/style.css new file mode 100644 index 0000000..0ac18dc --- /dev/null +++ b/build/reports/tests/test/css/style.css @@ -0,0 +1,154 @@ +.summary { + margin-top: 30px; + margin-bottom: 40px; +} + +.summary table { + border-collapse: collapse; +} + +.summary td { + vertical-align: top; +} + +div.tab table.test-results td { + padding-left: 1em; +} + +div.tab table.test-results th { + padding-top: 0.5em; + padding-left: 1em; +} + +.breadcrumbs, .breadcrumbs a { + color: #606060; +} + +.infoBox { + width: 110px; + padding-top: 15px; + padding-bottom: 15px; + text-align: center; +} + +.infoBox p { + margin: 0; +} + +.counter, .percent { + font-size: 120%; + font-weight: bold; + margin-bottom: 8px; +} + +.duration { + width: 125px; +} + +.successRate, .summaryGroup { + border: solid 2px #d0d0d0; + -moz-border-radius: 10px; + border-radius: 10px; +} + +.successRate { + width: 140px; + margin-left: 35px; +} + +.successRate .percent { + font-size: 180%; +} + +.success, .success a { + color: #008000; +} + +div.success, .successRate.success { + background-color: #bbd9bb; + border-color: #008000; +} + +.failures, .failures a { + color: #b60808; +} + +.skipped, .skipped a { + color: #c09853; +} + +div.failures, .successRate.failures { + background-color: #ecdada; + border-color: #b60808; +} + +ul.linkList { + padding-left: 0; +} + +ul.linkList li { + list-style: none; + margin-bottom: 5px; +} + +div.metadata td:first-child { + padding-left: 5px; +} + +div.metadata td { + padding-left: 5px; +} + +.metadata tr.odd { + background-color: #f7f7f7; + border: solid 1px #d0d0d0; +} + +.metadata tr.even { + border: solid 1px #d0d0d0; +} + +.metadata th, .metadata td { + padding: 5px; + text-align: left; +} + +.metadata a { + color: blue; +} + +.metadata .unrenderable { + color: darkred; +} + +.code { + position: relative; +} + +.clipboard-copy-btn { + position: absolute; + top: 8px; + right: 8px; + padding: 4px 8px; + font-size: 0.9em; + cursor: pointer; +} + +.successGroup::before { + content: "\23FA"; + margin-right: 8px; + color: #008000; + display: inline-block; +} +.failureGroup::before { + content: "\2297"; + margin-right: 8px; + color: #b60808; + display: inline-block; +} +.skippedGroup::before { + content: "\2296"; + margin-right: 8px; + color: #c09853; + display: inline-block; +} diff --git a/build/reports/tests/test/index.html b/build/reports/tests/test/index.html new file mode 100644 index 0000000..3a7a448 --- /dev/null +++ b/build/reports/tests/test/index.html @@ -0,0 +1,127 @@ + + + + + +Test results - All Results + + + + + +
+

All Results

+
+ +
+

Gradle Test Run :test

+

Gradle Test Run :test

+
+ +
+

summary

+
+
+ + + + + +
+
+ + + + + + + +
+
+
2
+

tests

+
+
+
+
0
+

failures

+
+
+
+
0
+

skipped

+
+
+
+
1.178s
+

duration

+
+
+
+
+
+
100%
+

successful

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ChildNameTestsFailuresSkippedDurationSuccess rate
+ApplicationTests +com.ceos23.spring_boot.ApplicationTests1000.832s100%
+HelloControllerTest +com.ceos23.spring_boot.HelloControllerTest1000.106s100%
+
+
+
+
+
+ +
+ + diff --git a/build/reports/tests/test/js/report.js b/build/reports/tests/test/js/report.js new file mode 100644 index 0000000..3c37c39 --- /dev/null +++ b/build/reports/tests/test/js/report.js @@ -0,0 +1,228 @@ +(function (window, document) { + "use strict"; + + function changeElementClass(element, classValue) { + if (element.getAttribute("className")) { + element.setAttribute("className", classValue); + } else { + element.setAttribute("class", classValue); + } + } + + function getClassAttribute(element) { + if (element.getAttribute("className")) { + return element.getAttribute("className"); + } else { + return element.getAttribute("class"); + } + } + + function addClass(element, classValue) { + changeElementClass(element, getClassAttribute(element) + " " + classValue); + } + + function removeClass(element, classValue) { + changeElementClass(element, getClassAttribute(element).replace(classValue, "")); + } + + function getCheckBox() { + return document.getElementById("line-wrapping-toggle"); + } + + function getLabelForCheckBox() { + return document.getElementById("label-for-line-wrapping-toggle"); + } + + function findCodeBlocks() { + const codeBlocks = []; + const tabContainers = getTabContainers(); + for (let i = 0; i < tabContainers.length; i++) { + const spans = tabContainers[i].getElementsByTagName("span"); + for (let i = 0; i < spans.length; ++i) { + if (spans[i].className.indexOf("code") >= 0) { + codeBlocks.push(spans[i]); + } + } + } + return codeBlocks; + } + + function forAllCodeBlocks(operation) { + const codeBlocks = findCodeBlocks(); + + for (let i = 0; i < codeBlocks.length; ++i) { + operation(codeBlocks[i], "wrapped"); + } + } + + function toggleLineWrapping() { + const checkBox = getCheckBox(); + + if (checkBox.checked) { + forAllCodeBlocks(addClass); + } else { + forAllCodeBlocks(removeClass); + } + } + + function initClipboardCopyButton() { + document.querySelectorAll(".clipboard-copy-btn").forEach((button) => { + const copyElementId = button.getAttribute("data-copy-element-id"); + const elementWithCodeToSelect = document.getElementById(copyElementId); + + button.addEventListener("click", () => { + const text = elementWithCodeToSelect.innerText.trim(); + navigator.clipboard + .writeText(text) + .then(() => { + button.textContent = "Copied!"; + setTimeout(() => { + button.textContent = "Copy"; + }, 1500); + }) + .catch((err) => { + alert("Failed to copy to the clipboard: '" + err.message + "'. Check JavaScript console for more details.") + console.warn("Failed to copy to the clipboard", err); + }); + }); + }); + } + + function initControls() { + if (findCodeBlocks().length > 0) { + const checkBox = getCheckBox(); + const label = getLabelForCheckBox(); + + checkBox.onclick = toggleLineWrapping; + checkBox.checked = false; + + removeClass(label, "hidden"); + } + + initClipboardCopyButton() + } + + class TabManager { + baseId; + tabs; + titles; + headers; + + constructor(baseId, tabs, titles, headers) { + this.baseId = baseId; + this.tabs = tabs; + this.titles = titles; + this.headers = headers; + this.init(); + } + + init() { + for (let i = 0; i < this.headers.length; i++) { + const header = this.headers[i]; + header.onclick = () => { + this.select(i); + return false; + }; + } + } + + select(i) { + this.deselectAll(); + + changeElementClass(this.tabs[i], "tab selected"); + changeElementClass(this.headers[i], "selected"); + } + + deselectAll() { + for (let i = 0; i < this.tabs.length; i++) { + changeElementClass(this.tabs[i], "tab deselected"); + changeElementClass(this.headers[i], "deselected"); + } + } + } + + function getTabContainers() { + const tabContainers = Array.from(document.getElementsByClassName("tab-container")); + + // Used by existing TabbedPageRenderer users, which have not adjusted to use TabsRenderer yet. + const legacyContainer = document.getElementById("tabs"); + if (legacyContainer) { + tabContainers.push(legacyContainer); + } + + return tabContainers; + } + + function initTabs() { + let tabGroups = 0; + + function createTab(num, container) { + const tabElems = findTabs(container); + const tabManager = new TabManager("tabs" + num, tabElems, findTitles(tabElems), findHeaders(container)); + tabManager.select(0); + } + + const tabContainers = getTabContainers(); + + for (let i = 0; i < tabContainers.length; i++) { + createTab(tabGroups, tabContainers[i]); + tabGroups++; + } + + return true; + } + + function findTabs(container) { + return findChildElements(container, "DIV", "tab"); + } + + function findHeaders(container) { + const owner = findChildElements(container, "UL", "tabLinks"); + return findChildElements(owner[0], "LI", null); + } + + function findTitles(tabs) { + const titles = []; + + for (let i = 0; i < tabs.length; i++) { + const tab = tabs[i]; + const header = findChildElements(tab, "H2", null)[0]; + + header.parentNode.removeChild(header); + + if (header.innerText) { + titles.push(header.innerText); + } else { + titles.push(header.textContent); + } + } + + return titles; + } + + function findChildElements(container, name, targetClass) { + const elements = []; + const children = container.childNodes; + + for (let i = 0; i < children.length; i++) { + const child = children.item(i); + + if (child.nodeType === 1 && child.nodeName === name) { + if (targetClass && child.className.indexOf(targetClass) < 0) { + continue; + } + + elements.push(child); + } + } + + return elements; + } + + // Entry point. + + window.onload = function() { + initTabs(); + initControls(); + }; +} (window, window.document)); diff --git a/build/resources/main/application.yaml b/build/resources/main/application.yaml new file mode 100644 index 0000000..77b9794 --- /dev/null +++ b/build/resources/main/application.yaml @@ -0,0 +1,18 @@ +spring: + datasource: + url: jdbc:mysql://localhost:3306/test_db?allowPublicKeyRetrieval=true&useSSL=false&characterEncoding=UTF-8 + username: root + password: 0812 + driver-class-name: com.mysql.cj.jdbc.Driver + + jpa: + hibernate: + ddl-auto: create + show-sql: true + properties: + hibernate: + format_sql: true + +logging: + level: + org.hibernate.SQL: debug \ No newline at end of file diff --git a/build/test-results/test/TEST-com.ceos23.spring_boot.ApplicationTests.xml b/build/test-results/test/TEST-com.ceos23.spring_boot.ApplicationTests.xml new file mode 100644 index 0000000..b6ebf01 --- /dev/null +++ b/build/test-results/test/TEST-com.ceos23.spring_boot.ApplicationTests.xml @@ -0,0 +1,181 @@ + + + + + + + diff --git a/build/test-results/test/TEST-com.ceos23.spring_boot.HelloControllerTest.xml b/build/test-results/test/TEST-com.ceos23.spring_boot.HelloControllerTest.xml new file mode 100644 index 0000000..c1b7bdb --- /dev/null +++ b/build/test-results/test/TEST-com.ceos23.spring_boot.HelloControllerTest.xml @@ -0,0 +1,185 @@ + + + + + + + diff --git a/build/test-results/test/binary/output-events.bin b/build/test-results/test/binary/output-events.bin new file mode 100644 index 0000000..ca950c4 Binary files /dev/null and b/build/test-results/test/binary/output-events.bin differ diff --git a/build/test-results/test/binary/results-generic.bin b/build/test-results/test/binary/results-generic.bin new file mode 100644 index 0000000..66d2587 Binary files /dev/null and b/build/test-results/test/binary/results-generic.bin differ diff --git a/build/tmp/compileJava/previous-compilation-data.bin b/build/tmp/compileJava/previous-compilation-data.bin new file mode 100644 index 0000000..c53d97f Binary files /dev/null and b/build/tmp/compileJava/previous-compilation-data.bin differ diff --git a/build/tmp/compileTestJava/previous-compilation-data.bin b/build/tmp/compileTestJava/previous-compilation-data.bin new file mode 100644 index 0000000..0cb0e86 Binary files /dev/null and b/build/tmp/compileTestJava/previous-compilation-data.bin differ diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..61285a6 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..37f78a6 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100755 index 0000000..adff685 --- /dev/null +++ b/gradlew @@ -0,0 +1,248 @@ +#!/bin/sh + +# +# Copyright © 2015 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..c4bdd3a --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,93 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..19b5204 --- /dev/null +++ b/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'spring-boot' diff --git a/src/gitignore.txt b/src/gitignore.txt new file mode 100644 index 0000000..d70d5a9 --- /dev/null +++ b/src/gitignore.txt @@ -0,0 +1,43 @@ +*# +*.iml +*.ipr +*.iws +*.jar +*.sw? +*~ +.#* +.*.md.html +.DS_Store +.attach_pid* +.classpath +.factorypath +.gradle +.metadata +.project +.recommenders +.settings +.springBeans +.vscode +/code +MANIFEST.MF +_site/ +activemq-data +bin +build +!/**/src/**/bin +!/**/src/**/build +build.log +dependency-reduced-pom.xml +dump.rdb +interpolated*.xml +lib/ +manifest.yml +out +overridedb.* +target +.flattened-pom.xml +secrets.yml +.gradletasknamecache +.sts4-cache + +.idea \ No newline at end of file diff --git a/src/main/java/com/ceos23/spring_boot/Application.java b/src/main/java/com/ceos23/spring_boot/Application.java new file mode 100644 index 0000000..2bfaecc --- /dev/null +++ b/src/main/java/com/ceos23/spring_boot/Application.java @@ -0,0 +1,31 @@ +package com.ceos23.spring_boot; + +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Bean; + +import java.util.Arrays; + +@SpringBootApplication +public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } + + @Bean + public CommandLineRunner commandLineRunner(ApplicationContext ctx) { + return args -> { + + System.out.println("Let's inspect the beans provided by Spring Boot:"); + + String[] beanNames = ctx.getBeanDefinitionNames(); + Arrays.sort(beanNames); + for (String beanName : beanNames) { + System.out.println(beanName); + } + }; + } +} \ No newline at end of file diff --git a/src/main/java/com/ceos23/spring_boot/HelloController.java b/src/main/java/com/ceos23/spring_boot/HelloController.java new file mode 100644 index 0000000..2473eea --- /dev/null +++ b/src/main/java/com/ceos23/spring_boot/HelloController.java @@ -0,0 +1,13 @@ +package com.ceos23.spring_boot; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/") + public String hello() { + return "Hello, Spring Boot!"; + } +} \ No newline at end of file diff --git a/src/main/java/com/ceos23/spring_boot/Test.java b/src/main/java/com/ceos23/spring_boot/Test.java new file mode 100644 index 0000000..1b8060a --- /dev/null +++ b/src/main/java/com/ceos23/spring_boot/Test.java @@ -0,0 +1,14 @@ +package com.ceos23.spring_boot; + +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import lombok.Data; + +@Data +@Entity +public class Test { + + @Id + private Long id; + private String name; +} \ No newline at end of file diff --git a/src/main/java/com/ceos23/spring_boot/TestController.java b/src/main/java/com/ceos23/spring_boot/TestController.java new file mode 100644 index 0000000..83ba74d --- /dev/null +++ b/src/main/java/com/ceos23/spring_boot/TestController.java @@ -0,0 +1,23 @@ +package com.ceos23.spring_boot; + +import com.ceos23.spring_boot.Test; +import com.ceos23.spring_boot.TestService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@RestController +@RequiredArgsConstructor +@RequestMapping(value = "/tests") +public class TestController { + + private final TestService testService; + + @GetMapping + public List findAllTests() { + return testService.findAllTests(); + } +} \ No newline at end of file diff --git a/src/main/java/com/ceos23/spring_boot/TestRepository.java b/src/main/java/com/ceos23/spring_boot/TestRepository.java new file mode 100644 index 0000000..8dcd82c --- /dev/null +++ b/src/main/java/com/ceos23/spring_boot/TestRepository.java @@ -0,0 +1,6 @@ +package com.ceos23.spring_boot; + +import com.ceos23.spring_boot.Test; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface TestRepository extends JpaRepository {} \ No newline at end of file diff --git a/src/main/java/com/ceos23/spring_boot/TestService.java b/src/main/java/com/ceos23/spring_boot/TestService.java new file mode 100644 index 0000000..1fca2d3 --- /dev/null +++ b/src/main/java/com/ceos23/spring_boot/TestService.java @@ -0,0 +1,22 @@ +package com.ceos23.spring_boot; + +import com.ceos23.spring_boot.Test; +import com.ceos23.spring_boot.TestRepository; +import org.springframework.transaction.annotation.Transactional; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +@RequiredArgsConstructor +public class TestService { + + private final TestRepository testRepository; + + /* Read All*/ + @Transactional(readOnly = true) + public List findAllTests() { + return testRepository.findAll(); + } +} \ No newline at end of file diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml new file mode 100644 index 0000000..77b9794 --- /dev/null +++ b/src/main/resources/application.yaml @@ -0,0 +1,18 @@ +spring: + datasource: + url: jdbc:mysql://localhost:3306/test_db?allowPublicKeyRetrieval=true&useSSL=false&characterEncoding=UTF-8 + username: root + password: 0812 + driver-class-name: com.mysql.cj.jdbc.Driver + + jpa: + hibernate: + ddl-auto: create + show-sql: true + properties: + hibernate: + format_sql: true + +logging: + level: + org.hibernate.SQL: debug \ No newline at end of file diff --git a/src/test/java/com/ceos23/spring_boot/ApplicationTests.java b/src/test/java/com/ceos23/spring_boot/ApplicationTests.java new file mode 100644 index 0000000..2e64589 --- /dev/null +++ b/src/test/java/com/ceos23/spring_boot/ApplicationTests.java @@ -0,0 +1,13 @@ +package com.ceos23.spring_boot; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class ApplicationTests { + + @Test + void contextLoads() { + } + +} diff --git a/src/test/java/com/ceos23/spring_boot/HelloControllerTest.java b/src/test/java/com/ceos23/spring_boot/HelloControllerTest.java new file mode 100644 index 0000000..1418c6e --- /dev/null +++ b/src/test/java/com/ceos23/spring_boot/HelloControllerTest.java @@ -0,0 +1,30 @@ +package com.ceos23.spring_boot; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +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.status; + +@SpringBootTest +@AutoConfigureMockMvc +public class HelloControllerTest { + + @Autowired + private MockMvc mvc; + + @DisplayName("HelloController의 hello() 메서드 테스트") + @Test + public void getHello() throws Exception { + mvc.perform(get("/")) + .andExpect(status().isOk()) + .andExpect(result -> { + String response = result.getResponse().getContentAsString(); + assert response.equals("Hello, Spring Boot!"); + }); + } +} \ No newline at end of file