From 0490da4a4792add8728ef902378fca17be97510c Mon Sep 17 00:00:00 2001 From: kangeunchan Date: Tue, 3 Mar 2026 11:49:03 +0900 Subject: [PATCH 1/9] refactor(admission): isolate bootstrap runtime module and config #31 --- .../admission-adapter-in/BUILD.bazel | 11 ++++------ .../admission/admission-adapter-in/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ .../admission-adapter-out/BUILD.bazel | 11 ++++------ .../admission/admission-adapter-out/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ .../admission-application/BUILD.bazel | 11 ++++------ .../admission/admission-application/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ .../admission/admission-bootstrap/BUILD.bazel | 14 +++++++++---- .../hs/kr/entrydsm/ExampleApplication.kt | 8 +++---- .../src/main/resources/application.yaml | 21 +++++++++++++++++++ .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 10 ++++----- .../admission/admission-domain/BUILD.bazel | 11 ++++------ systems/admission/admission-domain/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ 20 files changed, 96 insertions(+), 149 deletions(-) create mode 100644 systems/admission/admission-bootstrap/src/main/resources/application.yaml diff --git a/systems/admission/admission-adapter-in/BUILD.bazel b/systems/admission/admission-adapter-in/BUILD.bazel index 4945eef..6acb022 100644 --- a/systems/admission/admission-adapter-in/BUILD.bazel +++ b/systems/admission/admission-adapter-in/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.admission.adapterin.AdmissionAdapterInModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/admission/admission-adapter-in/deps.bzl b/systems/admission/admission-adapter-in/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/admission/admission-adapter-in/deps.bzl +++ b/systems/admission/admission-adapter-in/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/admission/admission-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/admission/admission-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..e3b938c 100644 --- a/systems/admission/admission-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/admission/admission-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.admission.adapterin -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class AdmissionAdapterInModule diff --git a/systems/admission/admission-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/admission/admission-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..617f838 100644 --- a/systems/admission/admission-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/admission/admission-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.admission.adapterin -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class AdmissionAdapterInModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/admission/admission-adapter-out/BUILD.bazel b/systems/admission/admission-adapter-out/BUILD.bazel index 4945eef..0a9c033 100644 --- a/systems/admission/admission-adapter-out/BUILD.bazel +++ b/systems/admission/admission-adapter-out/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.admission.adapterout.AdmissionAdapterOutModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/admission/admission-adapter-out/deps.bzl b/systems/admission/admission-adapter-out/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/admission/admission-adapter-out/deps.bzl +++ b/systems/admission/admission-adapter-out/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/admission/admission-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/admission/admission-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..140bf3d 100644 --- a/systems/admission/admission-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/admission/admission-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.admission.adapterout -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class AdmissionAdapterOutModule diff --git a/systems/admission/admission-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/admission/admission-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..c24e2b9 100644 --- a/systems/admission/admission-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/admission/admission-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.admission.adapterout -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class AdmissionAdapterOutModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/admission/admission-application/BUILD.bazel b/systems/admission/admission-application/BUILD.bazel index 4945eef..62ea23e 100644 --- a/systems/admission/admission-application/BUILD.bazel +++ b/systems/admission/admission-application/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.admission.application.AdmissionApplicationModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/admission/admission-application/deps.bzl b/systems/admission/admission-application/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/admission/admission-application/deps.bzl +++ b/systems/admission/admission-application/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/admission/admission-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/admission/admission-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..a25a144 100644 --- a/systems/admission/admission-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/admission/admission-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.admission.application -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class AdmissionApplicationModule diff --git a/systems/admission/admission-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/admission/admission-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..d51a3d8 100644 --- a/systems/admission/admission-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/admission/admission-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.admission.application -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class AdmissionApplicationModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/admission/admission-bootstrap/BUILD.bazel b/systems/admission/admission-bootstrap/BUILD.bazel index 4945eef..831ef18 100644 --- a/systems/admission/admission-bootstrap/BUILD.bazel +++ b/systems/admission/admission-bootstrap/BUILD.bazel @@ -1,14 +1,20 @@ load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) kt_jvm_binary( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", + resources = glob(["src/main/resources/**"]), + main_class = "hs.kr.entrydsm.admission.AdmissionBootstrapApplicationKt", plugins = ["//:spring_allopen"], - deps = MODULE_DEPS, + deps = MODULE_DEPS + [ + "//systems/admission/admission-adapter-in:main", + "//systems/admission/admission-adapter-out:main", + "//systems/admission/admission-application:main", + "//systems/admission/admission-domain:main", + ], javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", ) @@ -16,7 +22,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", + test_class = "hs.kr.entrydsm.admission.AdmissionBootstrapApplicationTest", plugins = ["//:spring_allopen"], deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", diff --git a/systems/admission/admission-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/admission/admission-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..a256a5d 100644 --- a/systems/admission/admission-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/admission/admission-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.admission import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.runApplication @SpringBootApplication -class ExampleApplication +class AdmissionBootstrapApplication fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file + runApplication(*args) +} diff --git a/systems/admission/admission-bootstrap/src/main/resources/application.yaml b/systems/admission/admission-bootstrap/src/main/resources/application.yaml new file mode 100644 index 0000000..2b0a2dd --- /dev/null +++ b/systems/admission/admission-bootstrap/src/main/resources/application.yaml @@ -0,0 +1,21 @@ +spring: + application: + name: admission + profiles: + default: local + main: + lazy-initialization: true +server: + shutdown: graceful +management: + endpoints: + web: + exposure: + include: health,info + endpoint: + health: + probes: + enabled: true +logging: + level: + root: INFO diff --git a/systems/admission/admission-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/admission/admission-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..c2f099f 100644 --- a/systems/admission/admission-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/admission/admission-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.admission -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class AdmissionBootstrapApplicationTest { @Test fun contextLoads() { - assertEquals(4, 2 + 2) + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/admission/admission-domain/BUILD.bazel b/systems/admission/admission-domain/BUILD.bazel index 4945eef..dcedd0d 100644 --- a/systems/admission/admission-domain/BUILD.bazel +++ b/systems/admission/admission-domain/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.admission.domain.AdmissionDomainModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/admission/admission-domain/deps.bzl b/systems/admission/admission-domain/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/admission/admission-domain/deps.bzl +++ b/systems/admission/admission-domain/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/admission/admission-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/admission/admission-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..a219dec 100644 --- a/systems/admission/admission-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/admission/admission-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.admission.domain -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class AdmissionDomainModule diff --git a/systems/admission/admission-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/admission/admission-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..de6b61c 100644 --- a/systems/admission/admission-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/admission/admission-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.admission.domain -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class AdmissionDomainModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} From fd7432e40c89466bb1a382aa886ebf810496eea2 Mon Sep 17 00:00:00 2001 From: kangeunchan Date: Tue, 3 Mar 2026 11:49:03 +0900 Subject: [PATCH 2/9] refactor(application): isolate bootstrap runtime module and config #31 --- .../application-adapter-in/BUILD.bazel | 11 ++++------ .../application-adapter-in/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ .../application-adapter-out/BUILD.bazel | 11 ++++------ .../application-adapter-out/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ .../application-application/BUILD.bazel | 11 ++++------ .../application-application/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ .../application-bootstrap/BUILD.bazel | 14 +++++++++---- .../hs/kr/entrydsm/ExampleApplication.kt | 8 +++---- .../src/main/resources/application.yaml | 21 +++++++++++++++++++ .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 10 ++++----- .../application-domain/BUILD.bazel | 11 ++++------ .../application/application-domain/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ 20 files changed, 96 insertions(+), 149 deletions(-) create mode 100644 systems/application/application-bootstrap/src/main/resources/application.yaml diff --git a/systems/application/application-adapter-in/BUILD.bazel b/systems/application/application-adapter-in/BUILD.bazel index 4945eef..c400c1c 100644 --- a/systems/application/application-adapter-in/BUILD.bazel +++ b/systems/application/application-adapter-in/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.application.adapterin.ApplicationAdapterInModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/application/application-adapter-in/deps.bzl b/systems/application/application-adapter-in/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/application/application-adapter-in/deps.bzl +++ b/systems/application/application-adapter-in/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/application/application-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/application/application-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..64d7783 100644 --- a/systems/application/application-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/application/application-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.application.adapterin -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class ApplicationAdapterInModule diff --git a/systems/application/application-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/application/application-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..6882fcc 100644 --- a/systems/application/application-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/application/application-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.application.adapterin -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class ApplicationAdapterInModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/application/application-adapter-out/BUILD.bazel b/systems/application/application-adapter-out/BUILD.bazel index 4945eef..97da6bd 100644 --- a/systems/application/application-adapter-out/BUILD.bazel +++ b/systems/application/application-adapter-out/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.application.adapterout.ApplicationAdapterOutModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/application/application-adapter-out/deps.bzl b/systems/application/application-adapter-out/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/application/application-adapter-out/deps.bzl +++ b/systems/application/application-adapter-out/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/application/application-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/application/application-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..eb98b37 100644 --- a/systems/application/application-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/application/application-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.application.adapterout -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class ApplicationAdapterOutModule diff --git a/systems/application/application-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/application/application-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..4de698d 100644 --- a/systems/application/application-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/application/application-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.application.adapterout -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class ApplicationAdapterOutModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/application/application-application/BUILD.bazel b/systems/application/application-application/BUILD.bazel index 4945eef..f39136b 100644 --- a/systems/application/application-application/BUILD.bazel +++ b/systems/application/application-application/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.application.application.ApplicationApplicationModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/application/application-application/deps.bzl b/systems/application/application-application/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/application/application-application/deps.bzl +++ b/systems/application/application-application/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/application/application-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/application/application-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..7e091ae 100644 --- a/systems/application/application-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/application/application-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.application.application -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class ApplicationApplicationModule diff --git a/systems/application/application-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/application/application-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..f2a878b 100644 --- a/systems/application/application-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/application/application-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.application.application -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class ApplicationApplicationModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/application/application-bootstrap/BUILD.bazel b/systems/application/application-bootstrap/BUILD.bazel index 4945eef..d601fa0 100644 --- a/systems/application/application-bootstrap/BUILD.bazel +++ b/systems/application/application-bootstrap/BUILD.bazel @@ -1,14 +1,20 @@ load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) kt_jvm_binary( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", + resources = glob(["src/main/resources/**"]), + main_class = "hs.kr.entrydsm.application.ApplicationBootstrapApplicationKt", plugins = ["//:spring_allopen"], - deps = MODULE_DEPS, + deps = MODULE_DEPS + [ + "//systems/application/application-adapter-in:main", + "//systems/application/application-adapter-out:main", + "//systems/application/application-application:main", + "//systems/application/application-domain:main", + ], javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", ) @@ -16,7 +22,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", + test_class = "hs.kr.entrydsm.application.ApplicationBootstrapApplicationTest", plugins = ["//:spring_allopen"], deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", diff --git a/systems/application/application-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/application/application-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..1598bd9 100644 --- a/systems/application/application-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/application/application-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.application import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.runApplication @SpringBootApplication -class ExampleApplication +class ApplicationBootstrapApplication fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file + runApplication(*args) +} diff --git a/systems/application/application-bootstrap/src/main/resources/application.yaml b/systems/application/application-bootstrap/src/main/resources/application.yaml new file mode 100644 index 0000000..03aced9 --- /dev/null +++ b/systems/application/application-bootstrap/src/main/resources/application.yaml @@ -0,0 +1,21 @@ +spring: + application: + name: application + profiles: + default: local + main: + lazy-initialization: true +server: + shutdown: graceful +management: + endpoints: + web: + exposure: + include: health,info + endpoint: + health: + probes: + enabled: true +logging: + level: + root: INFO diff --git a/systems/application/application-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/application/application-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..565b6ad 100644 --- a/systems/application/application-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/application/application-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.application -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class ApplicationBootstrapApplicationTest { @Test fun contextLoads() { - assertEquals(4, 2 + 2) + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/application/application-domain/BUILD.bazel b/systems/application/application-domain/BUILD.bazel index 4945eef..34a4c8b 100644 --- a/systems/application/application-domain/BUILD.bazel +++ b/systems/application/application-domain/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.application.domain.ApplicationDomainModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/application/application-domain/deps.bzl b/systems/application/application-domain/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/application/application-domain/deps.bzl +++ b/systems/application/application-domain/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/application/application-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/application/application-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..1881a32 100644 --- a/systems/application/application-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/application/application-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.application.domain -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class ApplicationDomainModule diff --git a/systems/application/application-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/application/application-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..188ddf8 100644 --- a/systems/application/application-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/application/application-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.application.domain -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class ApplicationDomainModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} From 19d6a687f5c656d220c62eeb5b2facaa17f822b4 Mon Sep 17 00:00:00 2001 From: kangeunchan Date: Tue, 3 Mar 2026 11:49:03 +0900 Subject: [PATCH 3/9] refactor(configuration): isolate bootstrap runtime module and config #31 --- .../configuration-adapter-in/BUILD.bazel | 11 ++++------ .../configuration-adapter-in/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ .../configuration-adapter-out/BUILD.bazel | 11 ++++------ .../configuration-adapter-out/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ .../configuration-application/BUILD.bazel | 11 ++++------ .../configuration-application/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ .../configuration-bootstrap/BUILD.bazel | 14 +++++++++---- .../hs/kr/entrydsm/ExampleApplication.kt | 8 +++---- .../src/main/resources/application.yaml | 21 +++++++++++++++++++ .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 10 ++++----- .../configuration-domain/BUILD.bazel | 11 ++++------ .../configuration-domain/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ 20 files changed, 96 insertions(+), 149 deletions(-) create mode 100644 systems/configuration/configuration-bootstrap/src/main/resources/application.yaml diff --git a/systems/configuration/configuration-adapter-in/BUILD.bazel b/systems/configuration/configuration-adapter-in/BUILD.bazel index 4945eef..54ee3d5 100644 --- a/systems/configuration/configuration-adapter-in/BUILD.bazel +++ b/systems/configuration/configuration-adapter-in/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.configuration.adapterin.ConfigurationAdapterInModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/configuration/configuration-adapter-in/deps.bzl b/systems/configuration/configuration-adapter-in/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/configuration/configuration-adapter-in/deps.bzl +++ b/systems/configuration/configuration-adapter-in/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/configuration/configuration-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/configuration/configuration-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..9b8993b 100644 --- a/systems/configuration/configuration-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/configuration/configuration-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.configuration.adapterin -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class ConfigurationAdapterInModule diff --git a/systems/configuration/configuration-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/configuration/configuration-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..4ab5b84 100644 --- a/systems/configuration/configuration-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/configuration/configuration-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.configuration.adapterin -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class ConfigurationAdapterInModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/configuration/configuration-adapter-out/BUILD.bazel b/systems/configuration/configuration-adapter-out/BUILD.bazel index 4945eef..4e05b59 100644 --- a/systems/configuration/configuration-adapter-out/BUILD.bazel +++ b/systems/configuration/configuration-adapter-out/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.configuration.adapterout.ConfigurationAdapterOutModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/configuration/configuration-adapter-out/deps.bzl b/systems/configuration/configuration-adapter-out/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/configuration/configuration-adapter-out/deps.bzl +++ b/systems/configuration/configuration-adapter-out/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/configuration/configuration-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/configuration/configuration-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..20a0b60 100644 --- a/systems/configuration/configuration-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/configuration/configuration-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.configuration.adapterout -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class ConfigurationAdapterOutModule diff --git a/systems/configuration/configuration-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/configuration/configuration-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..11d69c7 100644 --- a/systems/configuration/configuration-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/configuration/configuration-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.configuration.adapterout -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class ConfigurationAdapterOutModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/configuration/configuration-application/BUILD.bazel b/systems/configuration/configuration-application/BUILD.bazel index 4945eef..51019b0 100644 --- a/systems/configuration/configuration-application/BUILD.bazel +++ b/systems/configuration/configuration-application/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.configuration.application.ConfigurationApplicationModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/configuration/configuration-application/deps.bzl b/systems/configuration/configuration-application/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/configuration/configuration-application/deps.bzl +++ b/systems/configuration/configuration-application/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/configuration/configuration-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/configuration/configuration-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..d9958de 100644 --- a/systems/configuration/configuration-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/configuration/configuration-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.configuration.application -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class ConfigurationApplicationModule diff --git a/systems/configuration/configuration-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/configuration/configuration-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..3253b7e 100644 --- a/systems/configuration/configuration-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/configuration/configuration-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.configuration.application -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class ConfigurationApplicationModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/configuration/configuration-bootstrap/BUILD.bazel b/systems/configuration/configuration-bootstrap/BUILD.bazel index 4945eef..88f795b 100644 --- a/systems/configuration/configuration-bootstrap/BUILD.bazel +++ b/systems/configuration/configuration-bootstrap/BUILD.bazel @@ -1,14 +1,20 @@ load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) kt_jvm_binary( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", + resources = glob(["src/main/resources/**"]), + main_class = "hs.kr.entrydsm.configuration.ConfigurationBootstrapApplicationKt", plugins = ["//:spring_allopen"], - deps = MODULE_DEPS, + deps = MODULE_DEPS + [ + "//systems/configuration/configuration-adapter-in:main", + "//systems/configuration/configuration-adapter-out:main", + "//systems/configuration/configuration-application:main", + "//systems/configuration/configuration-domain:main", + ], javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", ) @@ -16,7 +22,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", + test_class = "hs.kr.entrydsm.configuration.ConfigurationBootstrapApplicationTest", plugins = ["//:spring_allopen"], deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", diff --git a/systems/configuration/configuration-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/configuration/configuration-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..3383132 100644 --- a/systems/configuration/configuration-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/configuration/configuration-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.configuration import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.runApplication @SpringBootApplication -class ExampleApplication +class ConfigurationBootstrapApplication fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file + runApplication(*args) +} diff --git a/systems/configuration/configuration-bootstrap/src/main/resources/application.yaml b/systems/configuration/configuration-bootstrap/src/main/resources/application.yaml new file mode 100644 index 0000000..5c1fdd3 --- /dev/null +++ b/systems/configuration/configuration-bootstrap/src/main/resources/application.yaml @@ -0,0 +1,21 @@ +spring: + application: + name: configuration + profiles: + default: local + main: + lazy-initialization: true +server: + shutdown: graceful +management: + endpoints: + web: + exposure: + include: health,info + endpoint: + health: + probes: + enabled: true +logging: + level: + root: INFO diff --git a/systems/configuration/configuration-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/configuration/configuration-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..82b4d5e 100644 --- a/systems/configuration/configuration-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/configuration/configuration-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.configuration -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class ConfigurationBootstrapApplicationTest { @Test fun contextLoads() { - assertEquals(4, 2 + 2) + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/configuration/configuration-domain/BUILD.bazel b/systems/configuration/configuration-domain/BUILD.bazel index 4945eef..e4a445e 100644 --- a/systems/configuration/configuration-domain/BUILD.bazel +++ b/systems/configuration/configuration-domain/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.configuration.domain.ConfigurationDomainModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/configuration/configuration-domain/deps.bzl b/systems/configuration/configuration-domain/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/configuration/configuration-domain/deps.bzl +++ b/systems/configuration/configuration-domain/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/configuration/configuration-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/configuration/configuration-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..94113b1 100644 --- a/systems/configuration/configuration-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/configuration/configuration-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.configuration.domain -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class ConfigurationDomainModule diff --git a/systems/configuration/configuration-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/configuration/configuration-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..6dbe24e 100644 --- a/systems/configuration/configuration-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/configuration/configuration-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.configuration.domain -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class ConfigurationDomainModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} From 7f45cdd630050421f6ec307c4095075d3e1407d3 Mon Sep 17 00:00:00 2001 From: kangeunchan Date: Tue, 3 Mar 2026 11:49:03 +0900 Subject: [PATCH 4/9] refactor(document): isolate bootstrap runtime module and config #31 --- .../document/document-adapter-in/BUILD.bazel | 11 ++++------ systems/document/document-adapter-in/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ .../document/document-adapter-out/BUILD.bazel | 11 ++++------ .../document/document-adapter-out/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ .../document/document-application/BUILD.bazel | 11 ++++------ .../document/document-application/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ .../document/document-bootstrap/BUILD.bazel | 14 +++++++++---- .../hs/kr/entrydsm/ExampleApplication.kt | 8 +++---- .../src/main/resources/application.yaml | 21 +++++++++++++++++++ .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 10 ++++----- systems/document/document-domain/BUILD.bazel | 11 ++++------ systems/document/document-domain/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ 20 files changed, 96 insertions(+), 149 deletions(-) create mode 100644 systems/document/document-bootstrap/src/main/resources/application.yaml diff --git a/systems/document/document-adapter-in/BUILD.bazel b/systems/document/document-adapter-in/BUILD.bazel index 4945eef..faa3cc2 100644 --- a/systems/document/document-adapter-in/BUILD.bazel +++ b/systems/document/document-adapter-in/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.document.adapterin.DocumentAdapterInModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/document/document-adapter-in/deps.bzl b/systems/document/document-adapter-in/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/document/document-adapter-in/deps.bzl +++ b/systems/document/document-adapter-in/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/document/document-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/document/document-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..0d23a35 100644 --- a/systems/document/document-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/document/document-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.document.adapterin -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class DocumentAdapterInModule diff --git a/systems/document/document-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/document/document-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..c82b469 100644 --- a/systems/document/document-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/document/document-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.document.adapterin -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class DocumentAdapterInModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/document/document-adapter-out/BUILD.bazel b/systems/document/document-adapter-out/BUILD.bazel index 4945eef..c7875e9 100644 --- a/systems/document/document-adapter-out/BUILD.bazel +++ b/systems/document/document-adapter-out/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.document.adapterout.DocumentAdapterOutModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/document/document-adapter-out/deps.bzl b/systems/document/document-adapter-out/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/document/document-adapter-out/deps.bzl +++ b/systems/document/document-adapter-out/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/document/document-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/document/document-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..b6b51db 100644 --- a/systems/document/document-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/document/document-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.document.adapterout -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class DocumentAdapterOutModule diff --git a/systems/document/document-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/document/document-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..0d4003b 100644 --- a/systems/document/document-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/document/document-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.document.adapterout -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class DocumentAdapterOutModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/document/document-application/BUILD.bazel b/systems/document/document-application/BUILD.bazel index 4945eef..8e00eab 100644 --- a/systems/document/document-application/BUILD.bazel +++ b/systems/document/document-application/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.document.application.DocumentApplicationModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/document/document-application/deps.bzl b/systems/document/document-application/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/document/document-application/deps.bzl +++ b/systems/document/document-application/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/document/document-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/document/document-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..ed6d2d6 100644 --- a/systems/document/document-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/document/document-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.document.application -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class DocumentApplicationModule diff --git a/systems/document/document-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/document/document-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..da4e597 100644 --- a/systems/document/document-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/document/document-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.document.application -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class DocumentApplicationModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/document/document-bootstrap/BUILD.bazel b/systems/document/document-bootstrap/BUILD.bazel index 4945eef..6cb97c8 100644 --- a/systems/document/document-bootstrap/BUILD.bazel +++ b/systems/document/document-bootstrap/BUILD.bazel @@ -1,14 +1,20 @@ load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) kt_jvm_binary( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", + resources = glob(["src/main/resources/**"]), + main_class = "hs.kr.entrydsm.document.DocumentBootstrapApplicationKt", plugins = ["//:spring_allopen"], - deps = MODULE_DEPS, + deps = MODULE_DEPS + [ + "//systems/document/document-adapter-in:main", + "//systems/document/document-adapter-out:main", + "//systems/document/document-application:main", + "//systems/document/document-domain:main", + ], javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", ) @@ -16,7 +22,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", + test_class = "hs.kr.entrydsm.document.DocumentBootstrapApplicationTest", plugins = ["//:spring_allopen"], deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", diff --git a/systems/document/document-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/document/document-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..6923358 100644 --- a/systems/document/document-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/document/document-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.document import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.runApplication @SpringBootApplication -class ExampleApplication +class DocumentBootstrapApplication fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file + runApplication(*args) +} diff --git a/systems/document/document-bootstrap/src/main/resources/application.yaml b/systems/document/document-bootstrap/src/main/resources/application.yaml new file mode 100644 index 0000000..a3f8398 --- /dev/null +++ b/systems/document/document-bootstrap/src/main/resources/application.yaml @@ -0,0 +1,21 @@ +spring: + application: + name: document + profiles: + default: local + main: + lazy-initialization: true +server: + shutdown: graceful +management: + endpoints: + web: + exposure: + include: health,info + endpoint: + health: + probes: + enabled: true +logging: + level: + root: INFO diff --git a/systems/document/document-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/document/document-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..0523e57 100644 --- a/systems/document/document-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/document/document-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.document -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class DocumentBootstrapApplicationTest { @Test fun contextLoads() { - assertEquals(4, 2 + 2) + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/document/document-domain/BUILD.bazel b/systems/document/document-domain/BUILD.bazel index 4945eef..89d04e0 100644 --- a/systems/document/document-domain/BUILD.bazel +++ b/systems/document/document-domain/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.document.domain.DocumentDomainModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/document/document-domain/deps.bzl b/systems/document/document-domain/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/document/document-domain/deps.bzl +++ b/systems/document/document-domain/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/document/document-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/document/document-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..c44fb41 100644 --- a/systems/document/document-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/document/document-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.document.domain -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class DocumentDomainModule diff --git a/systems/document/document-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/document/document-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..88fbb49 100644 --- a/systems/document/document-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/document/document-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.document.domain -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class DocumentDomainModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} From 5d5390c594c64604dc805bd4ae6393e2b918e699 Mon Sep 17 00:00:00 2001 From: kangeunchan Date: Tue, 3 Mar 2026 11:49:03 +0900 Subject: [PATCH 5/9] refactor(gateway): isolate bootstrap runtime module and config #31 --- .../gateway/gateway-adapter-in/BUILD.bazel | 11 ++++------ systems/gateway/gateway-adapter-in/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ .../gateway/gateway-adapter-out/BUILD.bazel | 11 ++++------ systems/gateway/gateway-adapter-out/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ .../gateway/gateway-application/BUILD.bazel | 11 ++++------ systems/gateway/gateway-application/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ systems/gateway/gateway-bootstrap/BUILD.bazel | 14 +++++++++---- .../hs/kr/entrydsm/ExampleApplication.kt | 8 +++---- .../src/main/resources/application.yaml | 21 +++++++++++++++++++ .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 10 ++++----- systems/gateway/gateway-domain/BUILD.bazel | 11 ++++------ systems/gateway/gateway-domain/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ 20 files changed, 96 insertions(+), 149 deletions(-) create mode 100644 systems/gateway/gateway-bootstrap/src/main/resources/application.yaml diff --git a/systems/gateway/gateway-adapter-in/BUILD.bazel b/systems/gateway/gateway-adapter-in/BUILD.bazel index 4945eef..ca4ee82 100644 --- a/systems/gateway/gateway-adapter-in/BUILD.bazel +++ b/systems/gateway/gateway-adapter-in/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.gateway.adapterin.GatewayAdapterInModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/gateway/gateway-adapter-in/deps.bzl b/systems/gateway/gateway-adapter-in/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/gateway/gateway-adapter-in/deps.bzl +++ b/systems/gateway/gateway-adapter-in/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/gateway/gateway-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/gateway/gateway-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..9f30226 100644 --- a/systems/gateway/gateway-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/gateway/gateway-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.gateway.adapterin -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class GatewayAdapterInModule diff --git a/systems/gateway/gateway-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/gateway/gateway-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..2ea6bc0 100644 --- a/systems/gateway/gateway-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/gateway/gateway-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.gateway.adapterin -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class GatewayAdapterInModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/gateway/gateway-adapter-out/BUILD.bazel b/systems/gateway/gateway-adapter-out/BUILD.bazel index 4945eef..acd2b0c 100644 --- a/systems/gateway/gateway-adapter-out/BUILD.bazel +++ b/systems/gateway/gateway-adapter-out/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.gateway.adapterout.GatewayAdapterOutModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/gateway/gateway-adapter-out/deps.bzl b/systems/gateway/gateway-adapter-out/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/gateway/gateway-adapter-out/deps.bzl +++ b/systems/gateway/gateway-adapter-out/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/gateway/gateway-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/gateway/gateway-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..afb7245 100644 --- a/systems/gateway/gateway-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/gateway/gateway-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.gateway.adapterout -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class GatewayAdapterOutModule diff --git a/systems/gateway/gateway-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/gateway/gateway-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..9952037 100644 --- a/systems/gateway/gateway-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/gateway/gateway-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.gateway.adapterout -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class GatewayAdapterOutModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/gateway/gateway-application/BUILD.bazel b/systems/gateway/gateway-application/BUILD.bazel index 4945eef..d3f2aed 100644 --- a/systems/gateway/gateway-application/BUILD.bazel +++ b/systems/gateway/gateway-application/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.gateway.application.GatewayApplicationModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/gateway/gateway-application/deps.bzl b/systems/gateway/gateway-application/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/gateway/gateway-application/deps.bzl +++ b/systems/gateway/gateway-application/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/gateway/gateway-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/gateway/gateway-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..7462662 100644 --- a/systems/gateway/gateway-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/gateway/gateway-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.gateway.application -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class GatewayApplicationModule diff --git a/systems/gateway/gateway-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/gateway/gateway-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..4d51c54 100644 --- a/systems/gateway/gateway-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/gateway/gateway-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.gateway.application -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class GatewayApplicationModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/gateway/gateway-bootstrap/BUILD.bazel b/systems/gateway/gateway-bootstrap/BUILD.bazel index 4945eef..ef5e6c1 100644 --- a/systems/gateway/gateway-bootstrap/BUILD.bazel +++ b/systems/gateway/gateway-bootstrap/BUILD.bazel @@ -1,14 +1,20 @@ load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) kt_jvm_binary( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", + resources = glob(["src/main/resources/**"]), + main_class = "hs.kr.entrydsm.gateway.GatewayBootstrapApplicationKt", plugins = ["//:spring_allopen"], - deps = MODULE_DEPS, + deps = MODULE_DEPS + [ + "//systems/gateway/gateway-adapter-in:main", + "//systems/gateway/gateway-adapter-out:main", + "//systems/gateway/gateway-application:main", + "//systems/gateway/gateway-domain:main", + ], javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", ) @@ -16,7 +22,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", + test_class = "hs.kr.entrydsm.gateway.GatewayBootstrapApplicationTest", plugins = ["//:spring_allopen"], deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", diff --git a/systems/gateway/gateway-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/gateway/gateway-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..a77c119 100644 --- a/systems/gateway/gateway-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/gateway/gateway-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.gateway import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.runApplication @SpringBootApplication -class ExampleApplication +class GatewayBootstrapApplication fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file + runApplication(*args) +} diff --git a/systems/gateway/gateway-bootstrap/src/main/resources/application.yaml b/systems/gateway/gateway-bootstrap/src/main/resources/application.yaml new file mode 100644 index 0000000..160acbc --- /dev/null +++ b/systems/gateway/gateway-bootstrap/src/main/resources/application.yaml @@ -0,0 +1,21 @@ +spring: + application: + name: gateway + profiles: + default: local + main: + lazy-initialization: true +server: + shutdown: graceful +management: + endpoints: + web: + exposure: + include: health,info + endpoint: + health: + probes: + enabled: true +logging: + level: + root: INFO diff --git a/systems/gateway/gateway-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/gateway/gateway-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..5817660 100644 --- a/systems/gateway/gateway-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/gateway/gateway-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.gateway -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class GatewayBootstrapApplicationTest { @Test fun contextLoads() { - assertEquals(4, 2 + 2) + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/gateway/gateway-domain/BUILD.bazel b/systems/gateway/gateway-domain/BUILD.bazel index 4945eef..e28fb3d 100644 --- a/systems/gateway/gateway-domain/BUILD.bazel +++ b/systems/gateway/gateway-domain/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.gateway.domain.GatewayDomainModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/gateway/gateway-domain/deps.bzl b/systems/gateway/gateway-domain/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/gateway/gateway-domain/deps.bzl +++ b/systems/gateway/gateway-domain/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/gateway/gateway-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/gateway/gateway-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..8fe9819 100644 --- a/systems/gateway/gateway-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/gateway/gateway-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.gateway.domain -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class GatewayDomainModule diff --git a/systems/gateway/gateway-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/gateway/gateway-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..c162ee5 100644 --- a/systems/gateway/gateway-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/gateway/gateway-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.gateway.domain -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class GatewayDomainModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} From a43ac9acfbf37c8fa7cb813ef821d24dc6cb9b41 Mon Sep 17 00:00:00 2001 From: kangeunchan Date: Tue, 3 Mar 2026 11:49:03 +0900 Subject: [PATCH 6/9] refactor(identity): isolate bootstrap runtime module and config #31 --- .../identity/identity-adapter-in/BUILD.bazel | 11 ++++------ systems/identity/identity-adapter-in/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ .../identity/identity-adapter-out/BUILD.bazel | 11 ++++------ .../identity/identity-adapter-out/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ .../identity/identity-application/BUILD.bazel | 11 ++++------ .../identity/identity-application/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ .../identity/identity-bootstrap/BUILD.bazel | 14 +++++++++---- .../hs/kr/entrydsm/ExampleApplication.kt | 8 +++---- .../src/main/resources/application.yaml | 21 +++++++++++++++++++ .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 10 ++++----- systems/identity/identity-domain/BUILD.bazel | 11 ++++------ systems/identity/identity-domain/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ 20 files changed, 96 insertions(+), 149 deletions(-) create mode 100644 systems/identity/identity-bootstrap/src/main/resources/application.yaml diff --git a/systems/identity/identity-adapter-in/BUILD.bazel b/systems/identity/identity-adapter-in/BUILD.bazel index 4945eef..c32ea4f 100644 --- a/systems/identity/identity-adapter-in/BUILD.bazel +++ b/systems/identity/identity-adapter-in/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.identity.adapterin.IdentityAdapterInModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/identity/identity-adapter-in/deps.bzl b/systems/identity/identity-adapter-in/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/identity/identity-adapter-in/deps.bzl +++ b/systems/identity/identity-adapter-in/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..965026c 100644 --- a/systems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.identity.adapterin -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class IdentityAdapterInModule diff --git a/systems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..908f057 100644 --- a/systems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.identity.adapterin -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class IdentityAdapterInModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/identity/identity-adapter-out/BUILD.bazel b/systems/identity/identity-adapter-out/BUILD.bazel index 4945eef..4128d2b 100644 --- a/systems/identity/identity-adapter-out/BUILD.bazel +++ b/systems/identity/identity-adapter-out/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.identity.adapterout.IdentityAdapterOutModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/identity/identity-adapter-out/deps.bzl b/systems/identity/identity-adapter-out/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/identity/identity-adapter-out/deps.bzl +++ b/systems/identity/identity-adapter-out/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..f4e490b 100644 --- a/systems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.identity.adapterout -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class IdentityAdapterOutModule diff --git a/systems/identity/identity-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/identity/identity-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..0ebc7a6 100644 --- a/systems/identity/identity-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/identity/identity-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.identity.adapterout -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class IdentityAdapterOutModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/identity/identity-application/BUILD.bazel b/systems/identity/identity-application/BUILD.bazel index 4945eef..ef9e100 100644 --- a/systems/identity/identity-application/BUILD.bazel +++ b/systems/identity/identity-application/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.identity.application.IdentityApplicationModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/identity/identity-application/deps.bzl b/systems/identity/identity-application/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/identity/identity-application/deps.bzl +++ b/systems/identity/identity-application/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..e5be5ef 100644 --- a/systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.identity.application -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class IdentityApplicationModule diff --git a/systems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..5457255 100644 --- a/systems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.identity.application -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class IdentityApplicationModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/identity/identity-bootstrap/BUILD.bazel b/systems/identity/identity-bootstrap/BUILD.bazel index 4945eef..8d10379 100644 --- a/systems/identity/identity-bootstrap/BUILD.bazel +++ b/systems/identity/identity-bootstrap/BUILD.bazel @@ -1,14 +1,20 @@ load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) kt_jvm_binary( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", + resources = glob(["src/main/resources/**"]), + main_class = "hs.kr.entrydsm.identity.IdentityBootstrapApplicationKt", plugins = ["//:spring_allopen"], - deps = MODULE_DEPS, + deps = MODULE_DEPS + [ + "//systems/identity/identity-adapter-in:main", + "//systems/identity/identity-adapter-out:main", + "//systems/identity/identity-application:main", + "//systems/identity/identity-domain:main", + ], javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", ) @@ -16,7 +22,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", + test_class = "hs.kr.entrydsm.identity.IdentityBootstrapApplicationTest", plugins = ["//:spring_allopen"], deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", diff --git a/systems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..05e8290 100644 --- a/systems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.identity import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.runApplication @SpringBootApplication -class ExampleApplication +class IdentityBootstrapApplication fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file + runApplication(*args) +} diff --git a/systems/identity/identity-bootstrap/src/main/resources/application.yaml b/systems/identity/identity-bootstrap/src/main/resources/application.yaml new file mode 100644 index 0000000..d036910 --- /dev/null +++ b/systems/identity/identity-bootstrap/src/main/resources/application.yaml @@ -0,0 +1,21 @@ +spring: + application: + name: identity + profiles: + default: local + main: + lazy-initialization: true +server: + shutdown: graceful +management: + endpoints: + web: + exposure: + include: health,info + endpoint: + health: + probes: + enabled: true +logging: + level: + root: INFO diff --git a/systems/identity/identity-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/identity/identity-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..168191c 100644 --- a/systems/identity/identity-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/identity/identity-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.identity -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class IdentityBootstrapApplicationTest { @Test fun contextLoads() { - assertEquals(4, 2 + 2) + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/identity/identity-domain/BUILD.bazel b/systems/identity/identity-domain/BUILD.bazel index 4945eef..37353e8 100644 --- a/systems/identity/identity-domain/BUILD.bazel +++ b/systems/identity/identity-domain/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.identity.domain.IdentityDomainModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/identity/identity-domain/deps.bzl b/systems/identity/identity-domain/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/identity/identity-domain/deps.bzl +++ b/systems/identity/identity-domain/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/identity/identity-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/identity/identity-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..6e39608 100644 --- a/systems/identity/identity-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/identity/identity-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.identity.domain -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class IdentityDomainModule diff --git a/systems/identity/identity-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/identity/identity-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..4c977f2 100644 --- a/systems/identity/identity-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/identity/identity-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.identity.domain -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class IdentityDomainModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} From e5fbab1308c24eef041d726b202f038ac842728b Mon Sep 17 00:00:00 2001 From: kangeunchan Date: Tue, 3 Mar 2026 11:49:03 +0900 Subject: [PATCH 7/9] refactor(notification): isolate bootstrap runtime module and config #31 --- .../notification-adapter-in/BUILD.bazel | 11 ++++------ .../notification-adapter-in/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ .../notification-adapter-out/BUILD.bazel | 11 ++++------ .../notification-adapter-out/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ .../notification-application/BUILD.bazel | 11 ++++------ .../notification-application/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ .../notification-bootstrap/BUILD.bazel | 14 +++++++++---- .../hs/kr/entrydsm/ExampleApplication.kt | 8 +++---- .../src/main/resources/application.yaml | 21 +++++++++++++++++++ .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 10 ++++----- .../notification-domain/BUILD.bazel | 11 ++++------ .../notification/notification-domain/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ 20 files changed, 96 insertions(+), 149 deletions(-) create mode 100644 systems/notification/notification-bootstrap/src/main/resources/application.yaml diff --git a/systems/notification/notification-adapter-in/BUILD.bazel b/systems/notification/notification-adapter-in/BUILD.bazel index 4945eef..9e8a44b 100644 --- a/systems/notification/notification-adapter-in/BUILD.bazel +++ b/systems/notification/notification-adapter-in/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.notification.adapterin.NotificationAdapterInModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/notification/notification-adapter-in/deps.bzl b/systems/notification/notification-adapter-in/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/notification/notification-adapter-in/deps.bzl +++ b/systems/notification/notification-adapter-in/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/notification/notification-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/notification/notification-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..e8502a6 100644 --- a/systems/notification/notification-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/notification/notification-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.notification.adapterin -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class NotificationAdapterInModule diff --git a/systems/notification/notification-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/notification/notification-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..5d76ee0 100644 --- a/systems/notification/notification-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/notification/notification-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.notification.adapterin -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class NotificationAdapterInModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/notification/notification-adapter-out/BUILD.bazel b/systems/notification/notification-adapter-out/BUILD.bazel index 4945eef..4a21278 100644 --- a/systems/notification/notification-adapter-out/BUILD.bazel +++ b/systems/notification/notification-adapter-out/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.notification.adapterout.NotificationAdapterOutModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/notification/notification-adapter-out/deps.bzl b/systems/notification/notification-adapter-out/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/notification/notification-adapter-out/deps.bzl +++ b/systems/notification/notification-adapter-out/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/notification/notification-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/notification/notification-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..77f75c8 100644 --- a/systems/notification/notification-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/notification/notification-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.notification.adapterout -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class NotificationAdapterOutModule diff --git a/systems/notification/notification-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/notification/notification-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..0519eb6 100644 --- a/systems/notification/notification-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/notification/notification-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.notification.adapterout -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class NotificationAdapterOutModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/notification/notification-application/BUILD.bazel b/systems/notification/notification-application/BUILD.bazel index 4945eef..7ff455b 100644 --- a/systems/notification/notification-application/BUILD.bazel +++ b/systems/notification/notification-application/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.notification.application.NotificationApplicationModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/notification/notification-application/deps.bzl b/systems/notification/notification-application/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/notification/notification-application/deps.bzl +++ b/systems/notification/notification-application/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..b9e555c 100644 --- a/systems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.notification.application -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class NotificationApplicationModule diff --git a/systems/notification/notification-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/notification/notification-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..d89e765 100644 --- a/systems/notification/notification-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/notification/notification-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.notification.application -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class NotificationApplicationModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/notification/notification-bootstrap/BUILD.bazel b/systems/notification/notification-bootstrap/BUILD.bazel index 4945eef..fdf8338 100644 --- a/systems/notification/notification-bootstrap/BUILD.bazel +++ b/systems/notification/notification-bootstrap/BUILD.bazel @@ -1,14 +1,20 @@ load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) kt_jvm_binary( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", + resources = glob(["src/main/resources/**"]), + main_class = "hs.kr.entrydsm.notification.NotificationBootstrapApplicationKt", plugins = ["//:spring_allopen"], - deps = MODULE_DEPS, + deps = MODULE_DEPS + [ + "//systems/notification/notification-adapter-in:main", + "//systems/notification/notification-adapter-out:main", + "//systems/notification/notification-application:main", + "//systems/notification/notification-domain:main", + ], javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", ) @@ -16,7 +22,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", + test_class = "hs.kr.entrydsm.notification.NotificationBootstrapApplicationTest", plugins = ["//:spring_allopen"], deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", diff --git a/systems/notification/notification-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/notification/notification-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..bceeb79 100644 --- a/systems/notification/notification-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/notification/notification-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.notification import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.runApplication @SpringBootApplication -class ExampleApplication +class NotificationBootstrapApplication fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file + runApplication(*args) +} diff --git a/systems/notification/notification-bootstrap/src/main/resources/application.yaml b/systems/notification/notification-bootstrap/src/main/resources/application.yaml new file mode 100644 index 0000000..7d637fc --- /dev/null +++ b/systems/notification/notification-bootstrap/src/main/resources/application.yaml @@ -0,0 +1,21 @@ +spring: + application: + name: notification + profiles: + default: local + main: + lazy-initialization: true +server: + shutdown: graceful +management: + endpoints: + web: + exposure: + include: health,info + endpoint: + health: + probes: + enabled: true +logging: + level: + root: INFO diff --git a/systems/notification/notification-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/notification/notification-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..55a7255 100644 --- a/systems/notification/notification-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/notification/notification-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.notification -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class NotificationBootstrapApplicationTest { @Test fun contextLoads() { - assertEquals(4, 2 + 2) + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/notification/notification-domain/BUILD.bazel b/systems/notification/notification-domain/BUILD.bazel index 4945eef..c0d7382 100644 --- a/systems/notification/notification-domain/BUILD.bazel +++ b/systems/notification/notification-domain/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.notification.domain.NotificationDomainModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/notification/notification-domain/deps.bzl b/systems/notification/notification-domain/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/notification/notification-domain/deps.bzl +++ b/systems/notification/notification-domain/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/notification/notification-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/notification/notification-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..bdfde7e 100644 --- a/systems/notification/notification-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/notification/notification-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.notification.domain -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class NotificationDomainModule diff --git a/systems/notification/notification-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/notification/notification-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..21541c0 100644 --- a/systems/notification/notification-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/notification/notification-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.notification.domain -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class NotificationDomainModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} From d1fbc14ee23f0e436b9148b3fc8d592ff1d72a29 Mon Sep 17 00:00:00 2001 From: kangeunchan Date: Tue, 3 Mar 2026 11:49:03 +0900 Subject: [PATCH 8/9] refactor(schedule): isolate bootstrap runtime module and config #31 --- .../schedule/schedule-adapter-in/BUILD.bazel | 11 ++++------ systems/schedule/schedule-adapter-in/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ .../schedule/schedule-adapter-out/BUILD.bazel | 11 ++++------ .../schedule/schedule-adapter-out/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ .../schedule/schedule-application/BUILD.bazel | 11 ++++------ .../schedule/schedule-application/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ .../schedule/schedule-bootstrap/BUILD.bazel | 14 +++++++++---- .../hs/kr/entrydsm/ExampleApplication.kt | 8 +++---- .../src/main/resources/application.yaml | 21 +++++++++++++++++++ .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 10 ++++----- systems/schedule/schedule-domain/BUILD.bazel | 11 ++++------ systems/schedule/schedule-domain/deps.bzl | 13 ++---------- .../hs/kr/entrydsm/ExampleApplication.kt | 12 ++--------- .../test/kotlin/hs/kr/entrydsm/TestMain.kt | 12 +++++------ 20 files changed, 96 insertions(+), 149 deletions(-) create mode 100644 systems/schedule/schedule-bootstrap/src/main/resources/application.yaml diff --git a/systems/schedule/schedule-adapter-in/BUILD.bazel b/systems/schedule/schedule-adapter-in/BUILD.bazel index 4945eef..833fac6 100644 --- a/systems/schedule/schedule-adapter-in/BUILD.bazel +++ b/systems/schedule/schedule-adapter-in/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.schedule.adapterin.ScheduleAdapterInModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/schedule/schedule-adapter-in/deps.bzl b/systems/schedule/schedule-adapter-in/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/schedule/schedule-adapter-in/deps.bzl +++ b/systems/schedule/schedule-adapter-in/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/schedule/schedule-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/schedule/schedule-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..0bce16b 100644 --- a/systems/schedule/schedule-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/schedule/schedule-adapter-in/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.schedule.adapterin -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class ScheduleAdapterInModule diff --git a/systems/schedule/schedule-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/schedule/schedule-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..62e64f4 100644 --- a/systems/schedule/schedule-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/schedule/schedule-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.schedule.adapterin -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class ScheduleAdapterInModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/schedule/schedule-adapter-out/BUILD.bazel b/systems/schedule/schedule-adapter-out/BUILD.bazel index 4945eef..2a23ffc 100644 --- a/systems/schedule/schedule-adapter-out/BUILD.bazel +++ b/systems/schedule/schedule-adapter-out/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.schedule.adapterout.ScheduleAdapterOutModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/schedule/schedule-adapter-out/deps.bzl b/systems/schedule/schedule-adapter-out/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/schedule/schedule-adapter-out/deps.bzl +++ b/systems/schedule/schedule-adapter-out/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/schedule/schedule-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/schedule/schedule-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..773268a 100644 --- a/systems/schedule/schedule-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/schedule/schedule-adapter-out/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.schedule.adapterout -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class ScheduleAdapterOutModule diff --git a/systems/schedule/schedule-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/schedule/schedule-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..c87682e 100644 --- a/systems/schedule/schedule-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/schedule/schedule-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.schedule.adapterout -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class ScheduleAdapterOutModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/schedule/schedule-application/BUILD.bazel b/systems/schedule/schedule-application/BUILD.bazel index 4945eef..a740773 100644 --- a/systems/schedule/schedule-application/BUILD.bazel +++ b/systems/schedule/schedule-application/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.schedule.application.ScheduleApplicationModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/schedule/schedule-application/deps.bzl b/systems/schedule/schedule-application/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/schedule/schedule-application/deps.bzl +++ b/systems/schedule/schedule-application/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/schedule/schedule-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/schedule/schedule-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..a99b737 100644 --- a/systems/schedule/schedule-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/schedule/schedule-application/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.schedule.application -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class ScheduleApplicationModule diff --git a/systems/schedule/schedule-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/schedule/schedule-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..9e44986 100644 --- a/systems/schedule/schedule-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/schedule/schedule-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.schedule.application -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class ScheduleApplicationModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/schedule/schedule-bootstrap/BUILD.bazel b/systems/schedule/schedule-bootstrap/BUILD.bazel index 4945eef..7275a13 100644 --- a/systems/schedule/schedule-bootstrap/BUILD.bazel +++ b/systems/schedule/schedule-bootstrap/BUILD.bazel @@ -1,14 +1,20 @@ load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) kt_jvm_binary( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", + resources = glob(["src/main/resources/**"]), + main_class = "hs.kr.entrydsm.schedule.ScheduleBootstrapApplicationKt", plugins = ["//:spring_allopen"], - deps = MODULE_DEPS, + deps = MODULE_DEPS + [ + "//systems/schedule/schedule-adapter-in:main", + "//systems/schedule/schedule-adapter-out:main", + "//systems/schedule/schedule-application:main", + "//systems/schedule/schedule-domain:main", + ], javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", ) @@ -16,7 +22,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", + test_class = "hs.kr.entrydsm.schedule.ScheduleBootstrapApplicationTest", plugins = ["//:spring_allopen"], deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", diff --git a/systems/schedule/schedule-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/schedule/schedule-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..7a63561 100644 --- a/systems/schedule/schedule-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/schedule/schedule-bootstrap/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.schedule import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.runApplication @SpringBootApplication -class ExampleApplication +class ScheduleBootstrapApplication fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file + runApplication(*args) +} diff --git a/systems/schedule/schedule-bootstrap/src/main/resources/application.yaml b/systems/schedule/schedule-bootstrap/src/main/resources/application.yaml new file mode 100644 index 0000000..cf40163 --- /dev/null +++ b/systems/schedule/schedule-bootstrap/src/main/resources/application.yaml @@ -0,0 +1,21 @@ +spring: + application: + name: schedule + profiles: + default: local + main: + lazy-initialization: true +server: + shutdown: graceful +management: + endpoints: + web: + exposure: + include: health,info + endpoint: + health: + probes: + enabled: true +logging: + level: + root: INFO diff --git a/systems/schedule/schedule-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/schedule/schedule-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..b61911d 100644 --- a/systems/schedule/schedule-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/schedule/schedule-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.schedule -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class ScheduleBootstrapApplicationTest { @Test fun contextLoads() { - assertEquals(4, 2 + 2) + assertTrue(true) } -} \ No newline at end of file +} diff --git a/systems/schedule/schedule-domain/BUILD.bazel b/systems/schedule/schedule-domain/BUILD.bazel index 4945eef..63f89f5 100644 --- a/systems/schedule/schedule-domain/BUILD.bazel +++ b/systems/schedule/schedule-domain/BUILD.bazel @@ -1,13 +1,11 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test") -load("//systems/admission/module-a:deps.bzl", "MODULE_DEPS", "TEST_DEPS") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") +load(":deps.bzl", "MODULE_DEPS", "TEST_DEPS") package(default_visibility = ["//visibility:public"]) -kt_jvm_binary( +kt_jvm_library( name = "main", srcs = glob(["src/main/kotlin/**/*.kt"]), - main_class = "hs.kr.entrydsm.example.ExampleApplicationKt", - plugins = ["//:spring_allopen"], deps = MODULE_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", @@ -16,8 +14,7 @@ kt_jvm_binary( kt_jvm_test( name = "test", srcs = glob(["src/test/kotlin/**/*.kt"]), - test_class = "hs.kr.entrydsm.example.ExampleApplicationTest", - plugins = ["//:spring_allopen"], + test_class = "hs.kr.entrydsm.schedule.domain.ScheduleDomainModuleTest", deps = MODULE_DEPS + TEST_DEPS, javac_opts = "//:javac_options", kotlinc_opts = "//:kotlinc_options", diff --git a/systems/schedule/schedule-domain/deps.bzl b/systems/schedule/schedule-domain/deps.bzl index bfdb5ae..5cf0364 100644 --- a/systems/schedule/schedule-domain/deps.bzl +++ b/systems/schedule/schedule-domain/deps.bzl @@ -1,16 +1,7 @@ -SPRING_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_boot_spring_boot_starter_actuator", -] - -KOTLIN_DEPS = [ - "@maven//:org_jetbrains_kotlin_kotlin_reflect", - "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin", -] +KOTLIN_DEPS = [] TEST_DEPS = [ - "@maven//:org_springframework_boot_spring_boot_starter_test", "@maven//:junit_junit", ] -MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS +MODULE_DEPS = KOTLIN_DEPS diff --git a/systems/schedule/schedule-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt b/systems/schedule/schedule-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt index 10d9573..7ef1d26 100644 --- a/systems/schedule/schedule-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt +++ b/systems/schedule/schedule-domain/src/main/kotlin/hs/kr/entrydsm/ExampleApplication.kt @@ -1,11 +1,3 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.schedule.domain -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.runApplication - -@SpringBootApplication -class ExampleApplication - -fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file +class ScheduleDomainModule diff --git a/systems/schedule/schedule-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt b/systems/schedule/schedule-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt index 561ecc3..edce399 100644 --- a/systems/schedule/schedule-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt +++ b/systems/schedule/schedule-domain/src/test/kotlin/hs/kr/entrydsm/TestMain.kt @@ -1,11 +1,11 @@ -package hs.kr.entrydsm.example +package hs.kr.entrydsm.schedule.domain -import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -class ExampleApplicationTest { +class ScheduleDomainModuleTest { @Test - fun contextLoads() { - assertEquals(4, 2 + 2) + fun moduleLoads() { + assertTrue(true) } -} \ No newline at end of file +} From 48e5fd9534768b88ac33cec9e9e60c629161ec82 Mon Sep 17 00:00:00 2001 From: kangeunchan Date: Tue, 3 Mar 2026 11:49:03 +0900 Subject: [PATCH 9/9] refactor(infra): point service aliases to bootstrap targets #31 --- BUILD.bazel | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index 84b8582..1f80e56 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -14,14 +14,14 @@ gazelle( command = "update-repos", ) -alias(name = "admission", actual = "//systems/admission/module-a:main") -alias(name = "application", actual = "//systems/application/module-a:main") -alias(name = "configuration", actual = "//systems/configuration/module-a:main") -alias(name = "document", actual = "//systems/document/module-a:main") -alias(name = "gateway", actual = "//systems/gateway/module-a:main") -alias(name = "identity", actual = "//systems/identity/module-a:main") -alias(name = "notification", actual = "//systems/notification/module-a:main") -alias(name = "schedule", actual = "//systems/schedule/module-a:main") +alias(name = "admission", actual = "//systems/admission/admission-bootstrap:main") +alias(name = "application", actual = "//systems/application/application-bootstrap:main") +alias(name = "configuration", actual = "//systems/configuration/configuration-bootstrap:main") +alias(name = "document", actual = "//systems/document/document-bootstrap:main") +alias(name = "gateway", actual = "//systems/gateway/gateway-bootstrap:main") +alias(name = "identity", actual = "//systems/identity/identity-bootstrap:main") +alias(name = "notification", actual = "//systems/notification/notification-bootstrap:main") +alias(name = "schedule", actual = "//systems/schedule/schedule-bootstrap:main") alias(name = "analytics", actual = "//systems/analytics/cmd/server:server") alias(name = "evaluation", actual = "//systems/evaluation/cmd/server:server")