From b9110c595f389b63933683d23723839d6824db92 Mon Sep 17 00:00:00 2001 From: sejoung kim Date: Tue, 22 Jun 2021 20:20:32 +0900 Subject: [PATCH] asdsad --- .editorconfig | 24 ++ .gitignore | 101 +++++++ README.md | 10 +- adapters/jpa-persistence/build.gradle | 25 ++ ...duct.repository.ProductRepositoryTest.html | 252 ++++++++++++++++++ .../reports/tests/test/css/base-style.css | 179 +++++++++++++ .../build/reports/tests/test/css/style.css | 84 ++++++ .../build/reports/tests/test/index.html | 145 ++++++++++ .../build/reports/tests/test/js/report.js | 194 ++++++++++++++ .../io.github.sejoung.product.repository.html | 115 ++++++++ ...oduct.repository.ProductRepositoryTest.xml | 143 ++++++++++ .../build/test-results/test/binary/output.bin | Bin 0 -> 8094 bytes .../test-results/test/binary/output.bin.idx | Bin 0 -> 36 bytes .../test-results/test/binary/results.bin | Bin 0 -> 12220 bytes .../compileJava/source-classes-mapping.txt | 10 + .../source-classes-mapping.txt | 2 + .../product/constants/ProductType.java | 15 ++ .../product/entities/PeriodProductEntity.java | 19 ++ .../product/entities/ProductEntity.java | 48 ++++ .../product/entities/RoundProductEntity.java | 29 ++ .../product/repository/ProductRepository.java | 8 + .../sejoung/product/TestApplication.java | 8 + .../repository/ProductRepositoryTest.java | 19 ++ build.gradle | 27 ++ domain/build.gradle | 18 ++ ...ng.product.entities.PeriodProductTest.html | 98 +++++++ ...ung.product.entities.RoundProductTest.html | 98 +++++++ ...port.in.SaveRoundProductInUseCaseTest.html | 98 +++++++ ...s.service.SaveRoundProductServiceTest.html | 109 ++++++++ .../reports/tests/test/css/base-style.css | 179 +++++++++++++ domain/build/reports/tests/test/css/style.css | 84 ++++++ domain/build/reports/tests/test/index.html | 183 +++++++++++++ domain/build/reports/tests/test/js/report.js | 194 ++++++++++++++ .../io.github.sejoung.product.entities.html | 113 ++++++++ ...thub.sejoung.product.usecases.port.in.html | 103 +++++++ ...thub.sejoung.product.usecases.service.html | 103 +++++++ ...ung.product.entities.PeriodProductTest.xml | 7 + ...oung.product.entities.RoundProductTest.xml | 7 + ....port.in.SaveRoundProductInUseCaseTest.xml | 7 + ...es.service.SaveRoundProductServiceTest.xml | 9 + .../build/test-results/test/binary/output.bin | Bin 0 -> 140 bytes .../test-results/test/binary/output.bin.idx | Bin 0 -> 36 bytes .../test-results/test/binary/results.bin | Bin 0 -> 668 bytes .../compileJava/source-classes-mapping.txt | 25 ++ .../source-classes-mapping.txt | 10 + domain/build/tmp/jar/MANIFEST.MF | 2 + .../sejoung/product/entities/Category.java | 25 ++ .../product/entities/PeriodProduct.java | 25 ++ .../sejoung/product/entities/Product.java | 67 +++++ .../product/entities/RoundProduct.java | 28 ++ .../product/exception/ProductException.java | 13 + .../exception/ProductExceptionCode.java | 16 ++ .../mapper/SaveRoundProductCommandMapper.java | 22 ++ .../port/in/SaveRoundProductInUseCase.java | 50 ++++ .../port/out/SaveRoundProductOutUseCase.java | 7 + .../service/SaveRoundProductService.java | 21 ++ .../product/validating/SelfValidating.java | 26 ++ .../product/entities/PeriodProductTest.java | 24 ++ .../product/entities/RoundProductTest.java | 20 ++ .../in/SaveRoundProductInUseCaseTest.java | 26 ++ .../out/SaveRoundProductOutUseCaseStub.java | 13 + .../service/SaveRoundProductServiceTest.java | 31 +++ gradle/wrapper/gradle-wrapper.properties | 5 + gradlew | 185 +++++++++++++ gradlew.bat | 89 +++++++ settings.gradle | 5 + 66 files changed, 3601 insertions(+), 1 deletion(-) create mode 100644 .editorconfig create mode 100644 .gitignore create mode 100644 adapters/jpa-persistence/build.gradle create mode 100644 adapters/jpa-persistence/build/reports/tests/test/classes/io.github.sejoung.product.repository.ProductRepositoryTest.html create mode 100644 adapters/jpa-persistence/build/reports/tests/test/css/base-style.css create mode 100644 adapters/jpa-persistence/build/reports/tests/test/css/style.css create mode 100644 adapters/jpa-persistence/build/reports/tests/test/index.html create mode 100644 adapters/jpa-persistence/build/reports/tests/test/js/report.js create mode 100644 adapters/jpa-persistence/build/reports/tests/test/packages/io.github.sejoung.product.repository.html create mode 100644 adapters/jpa-persistence/build/test-results/test/TEST-io.github.sejoung.product.repository.ProductRepositoryTest.xml create mode 100644 adapters/jpa-persistence/build/test-results/test/binary/output.bin create mode 100644 adapters/jpa-persistence/build/test-results/test/binary/output.bin.idx create mode 100644 adapters/jpa-persistence/build/test-results/test/binary/results.bin create mode 100644 adapters/jpa-persistence/build/tmp/compileJava/source-classes-mapping.txt create mode 100644 adapters/jpa-persistence/build/tmp/compileTestJava/source-classes-mapping.txt create mode 100644 adapters/jpa-persistence/src/main/java/io/github/sejoung/product/constants/ProductType.java create mode 100644 adapters/jpa-persistence/src/main/java/io/github/sejoung/product/entities/PeriodProductEntity.java create mode 100644 adapters/jpa-persistence/src/main/java/io/github/sejoung/product/entities/ProductEntity.java create mode 100644 adapters/jpa-persistence/src/main/java/io/github/sejoung/product/entities/RoundProductEntity.java create mode 100644 adapters/jpa-persistence/src/main/java/io/github/sejoung/product/repository/ProductRepository.java create mode 100644 adapters/jpa-persistence/src/test/java/io/github/sejoung/product/TestApplication.java create mode 100644 adapters/jpa-persistence/src/test/java/io/github/sejoung/product/repository/ProductRepositoryTest.java create mode 100644 build.gradle create mode 100644 domain/build.gradle create mode 100644 domain/build/reports/tests/test/classes/io.github.sejoung.product.entities.PeriodProductTest.html create mode 100644 domain/build/reports/tests/test/classes/io.github.sejoung.product.entities.RoundProductTest.html create mode 100644 domain/build/reports/tests/test/classes/io.github.sejoung.product.usecases.port.in.SaveRoundProductInUseCaseTest.html create mode 100644 domain/build/reports/tests/test/classes/io.github.sejoung.product.usecases.service.SaveRoundProductServiceTest.html create mode 100644 domain/build/reports/tests/test/css/base-style.css create mode 100644 domain/build/reports/tests/test/css/style.css create mode 100644 domain/build/reports/tests/test/index.html create mode 100644 domain/build/reports/tests/test/js/report.js create mode 100644 domain/build/reports/tests/test/packages/io.github.sejoung.product.entities.html create mode 100644 domain/build/reports/tests/test/packages/io.github.sejoung.product.usecases.port.in.html create mode 100644 domain/build/reports/tests/test/packages/io.github.sejoung.product.usecases.service.html create mode 100644 domain/build/test-results/test/TEST-io.github.sejoung.product.entities.PeriodProductTest.xml create mode 100644 domain/build/test-results/test/TEST-io.github.sejoung.product.entities.RoundProductTest.xml create mode 100644 domain/build/test-results/test/TEST-io.github.sejoung.product.usecases.port.in.SaveRoundProductInUseCaseTest.xml create mode 100644 domain/build/test-results/test/TEST-io.github.sejoung.product.usecases.service.SaveRoundProductServiceTest.xml create mode 100644 domain/build/test-results/test/binary/output.bin create mode 100644 domain/build/test-results/test/binary/output.bin.idx create mode 100644 domain/build/test-results/test/binary/results.bin create mode 100644 domain/build/tmp/compileJava/source-classes-mapping.txt create mode 100644 domain/build/tmp/compileTestJava/source-classes-mapping.txt create mode 100644 domain/build/tmp/jar/MANIFEST.MF create mode 100644 domain/src/main/java/io/github/sejoung/product/entities/Category.java create mode 100644 domain/src/main/java/io/github/sejoung/product/entities/PeriodProduct.java create mode 100644 domain/src/main/java/io/github/sejoung/product/entities/Product.java create mode 100644 domain/src/main/java/io/github/sejoung/product/entities/RoundProduct.java create mode 100644 domain/src/main/java/io/github/sejoung/product/exception/ProductException.java create mode 100644 domain/src/main/java/io/github/sejoung/product/exception/ProductExceptionCode.java create mode 100644 domain/src/main/java/io/github/sejoung/product/mapper/SaveRoundProductCommandMapper.java create mode 100644 domain/src/main/java/io/github/sejoung/product/usecases/port/in/SaveRoundProductInUseCase.java create mode 100644 domain/src/main/java/io/github/sejoung/product/usecases/port/out/SaveRoundProductOutUseCase.java create mode 100644 domain/src/main/java/io/github/sejoung/product/usecases/service/SaveRoundProductService.java create mode 100644 domain/src/main/java/io/github/sejoung/product/validating/SelfValidating.java create mode 100644 domain/src/test/java/io/github/sejoung/product/entities/PeriodProductTest.java create mode 100644 domain/src/test/java/io/github/sejoung/product/entities/RoundProductTest.java create mode 100644 domain/src/test/java/io/github/sejoung/product/usecases/port/in/SaveRoundProductInUseCaseTest.java create mode 100644 domain/src/test/java/io/github/sejoung/product/usecases/port/out/SaveRoundProductOutUseCaseStub.java create mode 100644 domain/src/test/java/io/github/sejoung/product/usecases/service/SaveRoundProductServiceTest.java create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100755 gradlew create mode 100644 gradlew.bat create mode 100644 settings.gradle diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..b1c8adc --- /dev/null +++ b/.editorconfig @@ -0,0 +1,24 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +tab_width = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = false + +[*.md] +max_line_length = 0 +trim_trailing_whitespace = false + +[*.java] +indent_style = space + +indent_size = 4 +tab_width = 4 +trim_trailing_whitespace = true + +[line-length-120] +max_line_length = 120 \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b74e15b --- /dev/null +++ b/.gitignore @@ -0,0 +1,101 @@ +# Compiled class file +*.class + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +/target/ +.project +.classpath +.settings/ +.project +/bin/ +.svn + +/.gradle/ + +# Created by https://www.gitignore.io/api/intellij+all + +### Intellij+all ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff: +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/dictionaries + +# Sensitive or high-churn files: +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.xml +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml + +# Gradle: +.idea/**/gradle.xml +.idea/**/libraries + +# CMake +cmake-build-debug/ + +# Mongo Explorer plugin: +.idea/**/mongoSettings.xml + +## File-based project format: +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +/build/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Ruby plugin and RubyMine +/.rakeTasks + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +### Intellij+all Patch ### +# Ignores the whole idea folder +# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360 + +.idea/ + +*.iml + +# End of https://www.gitignore.io/api/intellij+all + +.DS_Store + +/build \ No newline at end of file diff --git a/README.md b/README.md index 4906061..e1bee1d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,10 @@ # spring-boot-hexagonal-architecture -spring boot hexagonal architecture + + + +# 참고 +----- +* [지속 가능한 소프트웨어 설계 패턴: 포트와 어댑터 아키텍처 적용하기](https://engineering.linecorp.com/ko/blog/port-and-adapter-architecture/) +* [spring-hexagonal](https://reflectoring.io/spring-hexagonal/) +* [spring-hexagonal-example](https://github.com/gshaw-pivotal/spring-hexagonal-example) + diff --git a/adapters/jpa-persistence/build.gradle b/adapters/jpa-persistence/build.gradle new file mode 100644 index 0000000..f36e9e6 --- /dev/null +++ b/adapters/jpa-persistence/build.gradle @@ -0,0 +1,25 @@ +plugins { + id 'java' + id 'org.springframework.boot' version '2.3.9.RELEASE' + id 'io.spring.dependency-management' version '1.0.11.RELEASE' +} + +repositories { + mavenCentral() +} + +dependencies { + implementation project(':domain') + implementation 'org.springframework.boot:spring-boot-starter-validation' + implementation 'org.springframework.boot:spring-boot-starter-data-jpa' + + testImplementation('org.springframework.boot:spring-boot-starter-test') { + exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' + } + + testImplementation 'com.h2database:h2' +} + +test { + useJUnitPlatform() +} \ No newline at end of file diff --git a/adapters/jpa-persistence/build/reports/tests/test/classes/io.github.sejoung.product.repository.ProductRepositoryTest.html b/adapters/jpa-persistence/build/reports/tests/test/classes/io.github.sejoung.product.repository.ProductRepositoryTest.html new file mode 100644 index 0000000..5a2eb5c --- /dev/null +++ b/adapters/jpa-persistence/build/reports/tests/test/classes/io.github.sejoung.product.repository.ProductRepositoryTest.html @@ -0,0 +1,252 @@ + + + + + +Test results - ProductRepositoryTest + + + + + +
+

ProductRepositoryTest

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

tests

+
+
+
+
1
+

failures

+
+
+
+
0
+

ignored

+
+
+
+
0s
+

duration

+
+
+
+
+
+
0%
+

successful

+
+
+
+
+ +
+

Failed tests

+
+ +

initializationError

+ +
java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test
+	at org.springframework.util.Assert.state(Assert.java:76)
+	at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.getOrFindConfigurationClasses(SpringBootTestContextBootstrapper.java:235)
+	at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.processMergedContextConfiguration(SpringBootTestContextBootstrapper.java:151)
+	at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:395)
+	at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildDefaultMergedContextConfiguration(AbstractTestContextBootstrapper.java:312)
+	at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:265)
+	at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildTestContext(AbstractTestContextBootstrapper.java:108)
+	at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.buildTestContext(SpringBootTestContextBootstrapper.java:101)
+	at org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:137)
+	at org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:122)
+	at org.junit.jupiter.engine.execution.ExtensionValuesStore.lambda$getOrComputeIfAbsent$0(ExtensionValuesStore.java:81)
+	at org.junit.jupiter.engine.execution.ExtensionValuesStore$MemoizingSupplier.get(ExtensionValuesStore.java:182)
+	at org.junit.jupiter.engine.execution.ExtensionValuesStore.getOrComputeIfAbsent(ExtensionValuesStore.java:84)
+	at org.junit.jupiter.engine.execution.ExtensionValuesStore.getOrComputeIfAbsent(ExtensionValuesStore.java:88)
+	at org.junit.jupiter.engine.execution.NamespaceAwareStore.getOrComputeIfAbsent(NamespaceAwareStore.java:61)
+	at org.springframework.test.context.junit.jupiter.SpringExtension.getTestContextManager(SpringExtension.java:213)
+	at org.springframework.test.context.junit.jupiter.SpringExtension.beforeAll(SpringExtension.java:77)
+	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeBeforeAllCallbacks$7(ClassBasedTestDescriptor.java:359)
+	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
+	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeBeforeAllCallbacks(ClassBasedTestDescriptor.java:359)
+	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:189)
+	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:78)
+	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:132)
+	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
+	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
+	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
+	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
+	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
+	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
+	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
+	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
+	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
+	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
+	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
+	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
+	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
+	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
+	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
+	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
+	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
+	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
+	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
+	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
+	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:108)
+	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
+	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
+	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
+	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
+	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:96)
+	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:75)
+	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:99)
+	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:79)
+	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:75)
+	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
+	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
+	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
+	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
+	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
+	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
+	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
+	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
+	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
+	at com.sun.proxy.$Proxy2.stop(Unknown Source)
+	at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:133)
+	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
+	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
+	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
+	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
+	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
+	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
+	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)
+	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)
+	at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:414)
+	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
+	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
+	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
+	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
+	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
+	at java.base/java.lang.Thread.run(Thread.java:834)
+	Suppressed: java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test
+		at org.springframework.util.Assert.state(Assert.java:76)
+		at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.getOrFindConfigurationClasses(SpringBootTestContextBootstrapper.java:235)
+		at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.processMergedContextConfiguration(SpringBootTestContextBootstrapper.java:151)
+		at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:395)
+		at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildDefaultMergedContextConfiguration(AbstractTestContextBootstrapper.java:312)
+		at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:265)
+		at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildTestContext(AbstractTestContextBootstrapper.java:108)
+		at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.buildTestContext(SpringBootTestContextBootstrapper.java:101)
+		at org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:137)
+		at org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:122)
+		at org.junit.jupiter.engine.execution.ExtensionValuesStore.lambda$getOrComputeIfAbsent$0(ExtensionValuesStore.java:81)
+		at org.junit.jupiter.engine.execution.ExtensionValuesStore$MemoizingSupplier.get(ExtensionValuesStore.java:182)
+		at org.junit.jupiter.engine.execution.ExtensionValuesStore.remove(ExtensionValuesStore.java:98)
+		at org.junit.jupiter.engine.execution.NamespaceAwareStore.remove(NamespaceAwareStore.java:73)
+		at org.springframework.test.context.junit.jupiter.SpringExtension.afterAll(SpringExtension.java:89)
+		at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeAfterAllCallbacks$13(ClassBasedTestDescriptor.java:425)
+		at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
+		at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeAfterAllCallbacks$14(ClassBasedTestDescriptor.java:425)
+		at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
+		at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeAfterAllCallbacks(ClassBasedTestDescriptor.java:425)
+		at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.after(ClassBasedTestDescriptor.java:213)
+		at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.after(ClassBasedTestDescriptor.java:78)
+		at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:145)
+		at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
+		at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:145)
+		... 54 more
+
+
+
+
+
+

Tests

+ + + + + + + + + + + + + +
TestDurationResult
initializationError0sfailed
+
+
+

Standard output

+ +
20:15:42.913 [Test worker] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate]
+20:15:42.926 [Test worker] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating BootstrapContext using constructor [public org.springframework.test.context.support.DefaultBootstrapContext(java.lang.Class,org.springframework.test.context.CacheAwareContextLoaderDelegate)]
+20:15:42.951 [Test worker] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating TestContextBootstrapper for test class [io.github.sejoung.product.repository.ProductRepositoryTest] from class [org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTestContextBootstrapper]
+20:15:42.968 [Test worker] INFO org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [io.github.sejoung.product.repository.ProductRepositoryTest], using SpringBootContextLoader
+20:15:42.972 [Test worker] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [io.github.sejoung.product.repository.ProductRepositoryTest]: class path resource [io/github/sejoung/product/repository/ProductRepositoryTest-context.xml] does not exist
+20:15:42.973 [Test worker] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [io.github.sejoung.product.repository.ProductRepositoryTest]: class path resource [io/github/sejoung/product/repository/ProductRepositoryTestContext.groovy] does not exist
+20:15:42.973 [Test worker] INFO org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [io.github.sejoung.product.repository.ProductRepositoryTest]: no resource found for suffixes {-context.xml, Context.groovy}.
+20:15:42.974 [Test worker] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [io.github.sejoung.product.repository.ProductRepositoryTest]: ProductRepositoryTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
+20:15:43.023 [Test worker] DEBUG org.springframework.test.context.support.ActiveProfilesUtils - Could not find an 'annotation declaring class' for annotation type [org.springframework.test.context.ActiveProfiles] and class [io.github.sejoung.product.repository.ProductRepositoryTest]
+20:15:43.057 [Test worker] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate]
+20:15:43.058 [Test worker] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating BootstrapContext using constructor [public org.springframework.test.context.support.DefaultBootstrapContext(java.lang.Class,org.springframework.test.context.CacheAwareContextLoaderDelegate)]
+20:15:43.058 [Test worker] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating TestContextBootstrapper for test class [io.github.sejoung.product.repository.ProductRepositoryTest] from class [org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTestContextBootstrapper]
+20:15:43.059 [Test worker] INFO org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [io.github.sejoung.product.repository.ProductRepositoryTest], using SpringBootContextLoader
+20:15:43.059 [Test worker] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [io.github.sejoung.product.repository.ProductRepositoryTest]: class path resource [io/github/sejoung/product/repository/ProductRepositoryTest-context.xml] does not exist
+20:15:43.060 [Test worker] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [io.github.sejoung.product.repository.ProductRepositoryTest]: class path resource [io/github/sejoung/product/repository/ProductRepositoryTestContext.groovy] does not exist
+20:15:43.060 [Test worker] INFO org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [io.github.sejoung.product.repository.ProductRepositoryTest]: no resource found for suffixes {-context.xml, Context.groovy}.
+20:15:43.060 [Test worker] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [io.github.sejoung.product.repository.ProductRepositoryTest]: ProductRepositoryTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
+20:15:43.063 [Test worker] DEBUG org.springframework.test.context.support.ActiveProfilesUtils - Could not find an 'annotation declaring class' for annotation type [org.springframework.test.context.ActiveProfiles] and class [io.github.sejoung.product.repository.ProductRepositoryTest]
+20:15:43.069 [Test worker] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate]
+20:15:43.069 [Test worker] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating BootstrapContext using constructor [public org.springframework.test.context.support.DefaultBootstrapContext(java.lang.Class,org.springframework.test.context.CacheAwareContextLoaderDelegate)]
+20:15:43.069 [Test worker] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating TestContextBootstrapper for test class [io.github.sejoung.product.repository.ProductRepositoryTest] from class [org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTestContextBootstrapper]
+20:15:43.070 [Test worker] INFO org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [io.github.sejoung.product.repository.ProductRepositoryTest], using SpringBootContextLoader
+20:15:43.070 [Test worker] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [io.github.sejoung.product.repository.ProductRepositoryTest]: class path resource [io/github/sejoung/product/repository/ProductRepositoryTest-context.xml] does not exist
+20:15:43.070 [Test worker] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [io.github.sejoung.product.repository.ProductRepositoryTest]: class path resource [io/github/sejoung/product/repository/ProductRepositoryTestContext.groovy] does not exist
+20:15:43.071 [Test worker] INFO org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [io.github.sejoung.product.repository.ProductRepositoryTest]: no resource found for suffixes {-context.xml, Context.groovy}.
+20:15:43.071 [Test worker] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [io.github.sejoung.product.repository.ProductRepositoryTest]: ProductRepositoryTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
+20:15:43.075 [Test worker] DEBUG org.springframework.test.context.support.ActiveProfilesUtils - Could not find an 'annotation declaring class' for annotation type [org.springframework.test.context.ActiveProfiles] and class [io.github.sejoung.product.repository.ProductRepositoryTest]
+
+
+
+
+ +
+ + diff --git a/adapters/jpa-persistence/build/reports/tests/test/css/base-style.css b/adapters/jpa-persistence/build/reports/tests/test/css/base-style.css new file mode 100644 index 0000000..4afa73e --- /dev/null +++ b/adapters/jpa-persistence/build/reports/tests/test/css/base-style.css @@ -0,0 +1,179 @@ + +body { + margin: 0; + padding: 0; + font-family: sans-serif; + font-size: 12pt; +} + +body, a, a:visited { + color: #303030; +} + +#content { + padding-left: 50px; + padding-right: 50px; + padding-top: 30px; + padding-bottom: 30px; +} + +#content h1 { + font-size: 160%; + margin-bottom: 10px; +} + +#footer { + margin-top: 100px; + font-size: 80%; + white-space: nowrap; +} + +#footer, #footer a { + color: #a0a0a0; +} + +#line-wrapping-toggle { + vertical-align: middle; +} + +#label-for-line-wrapping-toggle { + vertical-align: middle; +} + +ul { + margin-left: 0; +} + +h1, h2, h3 { + white-space: nowrap; +} + +h2 { + font-size: 120%; +} + +ul.tabLinks { + padding-left: 0; + padding-top: 10px; + padding-bottom: 10px; + overflow: auto; + min-width: 800px; + width: auto !important; + width: 800px; +} + +ul.tabLinks li { + float: left; + height: 100%; + list-style: none; + padding-left: 10px; + padding-right: 10px; + padding-top: 5px; + padding-bottom: 5px; + margin-bottom: 0; + -moz-border-radius: 7px; + border-radius: 7px; + margin-right: 25px; + border: solid 1px #d4d4d4; + background-color: #f0f0f0; +} + +ul.tabLinks li:hover { + background-color: #fafafa; +} + +ul.tabLinks li.selected { + background-color: #c5f0f5; + border-color: #c5f0f5; +} + +ul.tabLinks a { + font-size: 120%; + display: block; + outline: none; + text-decoration: none; + margin: 0; + padding: 0; +} + +ul.tabLinks li h2 { + margin: 0; + padding: 0; +} + +div.tab { +} + +div.selected { + display: block; +} + +div.deselected { + display: none; +} + +div.tab table { + min-width: 350px; + width: auto !important; + width: 350px; + border-collapse: collapse; +} + +div.tab th, div.tab table { + border-bottom: solid #d0d0d0 1px; +} + +div.tab th { + text-align: left; + white-space: nowrap; + padding-left: 6em; +} + +div.tab th:first-child { + padding-left: 0; +} + +div.tab td { + white-space: nowrap; + padding-left: 6em; + padding-top: 5px; + padding-bottom: 5px; +} + +div.tab td:first-child { + padding-left: 0; +} + +div.tab td.numeric, div.tab th.numeric { + text-align: right; +} + +span.code { + display: inline-block; + margin-top: 0em; + margin-bottom: 1em; +} + +span.code pre { + font-size: 11pt; + padding-top: 10px; + padding-bottom: 10px; + padding-left: 10px; + padding-right: 10px; + margin: 0; + background-color: #f7f7f7; + border: solid 1px #d0d0d0; + min-width: 700px; + width: auto !important; + width: 700px; +} + +span.wrapped pre { + word-wrap: break-word; + white-space: pre-wrap; + word-break: break-all; +} + +label.hidden { + display: none; +} \ No newline at end of file diff --git a/adapters/jpa-persistence/build/reports/tests/test/css/style.css b/adapters/jpa-persistence/build/reports/tests/test/css/style.css new file mode 100644 index 0000000..3dc4913 --- /dev/null +++ b/adapters/jpa-persistence/build/reports/tests/test/css/style.css @@ -0,0 +1,84 @@ + +#summary { + margin-top: 30px; + margin-bottom: 40px; +} + +#summary table { + border-collapse: collapse; +} + +#summary td { + vertical-align: top; +} + +.breadcrumbs, .breadcrumbs a { + color: #606060; +} + +.infoBox { + width: 110px; + padding-top: 15px; + padding-bottom: 15px; + text-align: center; +} + +.infoBox p { + margin: 0; +} + +.counter, .percent { + font-size: 120%; + font-weight: bold; + margin-bottom: 8px; +} + +#duration { + width: 125px; +} + +#successRate, .summaryGroup { + border: solid 2px #d0d0d0; + -moz-border-radius: 10px; + border-radius: 10px; +} + +#successRate { + width: 140px; + margin-left: 35px; +} + +#successRate .percent { + font-size: 180%; +} + +.success, .success a { + color: #008000; +} + +div.success, #successRate.success { + background-color: #bbd9bb; + border-color: #008000; +} + +.failures, .failures a { + color: #b60808; +} + +.skipped, .skipped a { + color: #c09853; +} + +div.failures, #successRate.failures { + background-color: #ecdada; + border-color: #b60808; +} + +ul.linkList { + padding-left: 0; +} + +ul.linkList li { + list-style: none; + margin-bottom: 5px; +} diff --git a/adapters/jpa-persistence/build/reports/tests/test/index.html b/adapters/jpa-persistence/build/reports/tests/test/index.html new file mode 100644 index 0000000..c6744c4 --- /dev/null +++ b/adapters/jpa-persistence/build/reports/tests/test/index.html @@ -0,0 +1,145 @@ + + + + + +Test results - Test Summary + + + + + +
+

Test Summary

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

tests

+
+
+
+
1
+

failures

+
+
+
+
0
+

ignored

+
+
+
+
0s
+

duration

+
+
+
+
+
+
0%
+

successful

+
+
+
+
+ +
+

Failed tests

+ +
+
+

Packages

+ + + + + + + + + + + + + + + + + + + + + +
PackageTestsFailuresIgnoredDurationSuccess rate
+io.github.sejoung.product.repository +1100s0%
+
+
+

Classes

+ + + + + + + + + + + + + + + + + + + + + +
ClassTestsFailuresIgnoredDurationSuccess rate
+io.github.sejoung.product.repository.ProductRepositoryTest +1100s0%
+
+
+ +
+ + diff --git a/adapters/jpa-persistence/build/reports/tests/test/js/report.js b/adapters/jpa-persistence/build/reports/tests/test/js/report.js new file mode 100644 index 0000000..83bab4a --- /dev/null +++ b/adapters/jpa-persistence/build/reports/tests/test/js/report.js @@ -0,0 +1,194 @@ +(function (window, document) { + "use strict"; + + var tabs = {}; + + function changeElementClass(element, classValue) { + if (element.getAttribute("className")) { + element.setAttribute("className", classValue); + } else { + element.setAttribute("class", classValue); + } + } + + function getClassAttribute(element) { + if (element.getAttribute("className")) { + return element.getAttribute("className"); + } else { + return element.getAttribute("class"); + } + } + + function addClass(element, classValue) { + changeElementClass(element, getClassAttribute(element) + " " + classValue); + } + + function removeClass(element, classValue) { + changeElementClass(element, getClassAttribute(element).replace(classValue, "")); + } + + function initTabs() { + var container = document.getElementById("tabs"); + + tabs.tabs = findTabs(container); + tabs.titles = findTitles(tabs.tabs); + tabs.headers = findHeaders(container); + tabs.select = select; + tabs.deselectAll = deselectAll; + tabs.select(0); + + return true; + } + + function getCheckBox() { + return document.getElementById("line-wrapping-toggle"); + } + + function getLabelForCheckBox() { + return document.getElementById("label-for-line-wrapping-toggle"); + } + + function findCodeBlocks() { + var spans = document.getElementById("tabs").getElementsByTagName("span"); + var codeBlocks = []; + for (var i = 0; i < spans.length; ++i) { + if (spans[i].className.indexOf("code") >= 0) { + codeBlocks.push(spans[i]); + } + } + return codeBlocks; + } + + function forAllCodeBlocks(operation) { + var codeBlocks = findCodeBlocks(); + + for (var i = 0; i < codeBlocks.length; ++i) { + operation(codeBlocks[i], "wrapped"); + } + } + + function toggleLineWrapping() { + var checkBox = getCheckBox(); + + if (checkBox.checked) { + forAllCodeBlocks(addClass); + } else { + forAllCodeBlocks(removeClass); + } + } + + function initControls() { + if (findCodeBlocks().length > 0) { + var checkBox = getCheckBox(); + var label = getLabelForCheckBox(); + + checkBox.onclick = toggleLineWrapping; + checkBox.checked = false; + + removeClass(label, "hidden"); + } + } + + function switchTab() { + var id = this.id.substr(1); + + for (var i = 0; i < tabs.tabs.length; i++) { + if (tabs.tabs[i].id === id) { + tabs.select(i); + break; + } + } + + return false; + } + + function select(i) { + this.deselectAll(); + + changeElementClass(this.tabs[i], "tab selected"); + changeElementClass(this.headers[i], "selected"); + + while (this.headers[i].firstChild) { + this.headers[i].removeChild(this.headers[i].firstChild); + } + + var h2 = document.createElement("H2"); + + h2.appendChild(document.createTextNode(this.titles[i])); + this.headers[i].appendChild(h2); + } + + function deselectAll() { + for (var i = 0; i < this.tabs.length; i++) { + changeElementClass(this.tabs[i], "tab deselected"); + changeElementClass(this.headers[i], "deselected"); + + while (this.headers[i].firstChild) { + this.headers[i].removeChild(this.headers[i].firstChild); + } + + var a = document.createElement("A"); + + a.setAttribute("id", "ltab" + i); + a.setAttribute("href", "#tab" + i); + a.onclick = switchTab; + a.appendChild(document.createTextNode(this.titles[i])); + + this.headers[i].appendChild(a); + } + } + + function findTabs(container) { + return findChildElements(container, "DIV", "tab"); + } + + function findHeaders(container) { + var owner = findChildElements(container, "UL", "tabLinks"); + return findChildElements(owner[0], "LI", null); + } + + function findTitles(tabs) { + var titles = []; + + for (var i = 0; i < tabs.length; i++) { + var tab = tabs[i]; + var header = findChildElements(tab, "H2", null)[0]; + + header.parentNode.removeChild(header); + + if (header.innerText) { + titles.push(header.innerText); + } else { + titles.push(header.textContent); + } + } + + return titles; + } + + function findChildElements(container, name, targetClass) { + var elements = []; + var children = container.childNodes; + + for (var i = 0; i < children.length; i++) { + var child = children.item(i); + + if (child.nodeType === 1 && child.nodeName === name) { + if (targetClass && child.className.indexOf(targetClass) < 0) { + continue; + } + + elements.push(child); + } + } + + return elements; + } + + // Entry point. + + window.onload = function() { + initTabs(); + initControls(); + }; +} (window, window.document)); \ No newline at end of file diff --git a/adapters/jpa-persistence/build/reports/tests/test/packages/io.github.sejoung.product.repository.html b/adapters/jpa-persistence/build/reports/tests/test/packages/io.github.sejoung.product.repository.html new file mode 100644 index 0000000..c058ad6 --- /dev/null +++ b/adapters/jpa-persistence/build/reports/tests/test/packages/io.github.sejoung.product.repository.html @@ -0,0 +1,115 @@ + + + + + +Test results - Package io.github.sejoung.product.repository + + + + + +
+

Package io.github.sejoung.product.repository

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

tests

+
+
+
+
1
+

failures

+
+
+
+
0
+

ignored

+
+
+
+
0s
+

duration

+
+
+
+
+
+
0%
+

successful

+
+
+
+
+ +
+

Failed tests

+ +
+
+

Classes

+ + + + + + + + + + + + + + + + + + + +
ClassTestsFailuresIgnoredDurationSuccess rate
+ProductRepositoryTest +1100s0%
+
+
+ +
+ + diff --git a/adapters/jpa-persistence/build/test-results/test/TEST-io.github.sejoung.product.repository.ProductRepositoryTest.xml b/adapters/jpa-persistence/build/test-results/test/TEST-io.github.sejoung.product.repository.ProductRepositoryTest.xml new file mode 100644 index 0000000..8002504 --- /dev/null +++ b/adapters/jpa-persistence/build/test-results/test/TEST-io.github.sejoung.product.repository.ProductRepositoryTest.xml @@ -0,0 +1,143 @@ + + + + + java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test + at org.springframework.util.Assert.state(Assert.java:76) + at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.getOrFindConfigurationClasses(SpringBootTestContextBootstrapper.java:235) + at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.processMergedContextConfiguration(SpringBootTestContextBootstrapper.java:151) + at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:395) + at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildDefaultMergedContextConfiguration(AbstractTestContextBootstrapper.java:312) + at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:265) + at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildTestContext(AbstractTestContextBootstrapper.java:108) + at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.buildTestContext(SpringBootTestContextBootstrapper.java:101) + at org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:137) + at org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:122) + at org.junit.jupiter.engine.execution.ExtensionValuesStore.lambda$getOrComputeIfAbsent$0(ExtensionValuesStore.java:81) + at org.junit.jupiter.engine.execution.ExtensionValuesStore$MemoizingSupplier.get(ExtensionValuesStore.java:182) + at org.junit.jupiter.engine.execution.ExtensionValuesStore.getOrComputeIfAbsent(ExtensionValuesStore.java:84) + at org.junit.jupiter.engine.execution.ExtensionValuesStore.getOrComputeIfAbsent(ExtensionValuesStore.java:88) + at org.junit.jupiter.engine.execution.NamespaceAwareStore.getOrComputeIfAbsent(NamespaceAwareStore.java:61) + at org.springframework.test.context.junit.jupiter.SpringExtension.getTestContextManager(SpringExtension.java:213) + at org.springframework.test.context.junit.jupiter.SpringExtension.beforeAll(SpringExtension.java:77) + at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeBeforeAllCallbacks$7(ClassBasedTestDescriptor.java:359) + at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) + at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeBeforeAllCallbacks(ClassBasedTestDescriptor.java:359) + at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:189) + at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:78) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:132) + at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125) + at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123) + at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80) + at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) + at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139) + at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125) + at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123) + at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80) + at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32) + at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) + at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:108) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52) + at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:96) + at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:75) + at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:99) + at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:79) + at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:75) + at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:566) + at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36) + at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) + at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33) + at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94) + at com.sun.proxy.$Proxy2.stop(Unknown Source) + at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:133) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:566) + at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36) + at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) + at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182) + at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164) + at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:414) + at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64) + at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48) + at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) + at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) + at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56) + at java.base/java.lang.Thread.run(Thread.java:834) + Suppressed: java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test + at org.springframework.util.Assert.state(Assert.java:76) + at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.getOrFindConfigurationClasses(SpringBootTestContextBootstrapper.java:235) + at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.processMergedContextConfiguration(SpringBootTestContextBootstrapper.java:151) + at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:395) + at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildDefaultMergedContextConfiguration(AbstractTestContextBootstrapper.java:312) + at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:265) + at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildTestContext(AbstractTestContextBootstrapper.java:108) + at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.buildTestContext(SpringBootTestContextBootstrapper.java:101) + at org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:137) + at org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:122) + at org.junit.jupiter.engine.execution.ExtensionValuesStore.lambda$getOrComputeIfAbsent$0(ExtensionValuesStore.java:81) + at org.junit.jupiter.engine.execution.ExtensionValuesStore$MemoizingSupplier.get(ExtensionValuesStore.java:182) + at org.junit.jupiter.engine.execution.ExtensionValuesStore.remove(ExtensionValuesStore.java:98) + at org.junit.jupiter.engine.execution.NamespaceAwareStore.remove(NamespaceAwareStore.java:73) + at org.springframework.test.context.junit.jupiter.SpringExtension.afterAll(SpringExtension.java:89) + at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeAfterAllCallbacks$13(ClassBasedTestDescriptor.java:425) + at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) + at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeAfterAllCallbacks$14(ClassBasedTestDescriptor.java:425) + at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) + at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeAfterAllCallbacks(ClassBasedTestDescriptor.java:425) + at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.after(ClassBasedTestDescriptor.java:213) + at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.after(ClassBasedTestDescriptor.java:78) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:145) + at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:145) + ... 54 more + + + + + diff --git a/adapters/jpa-persistence/build/test-results/test/binary/output.bin b/adapters/jpa-persistence/build/test-results/test/binary/output.bin new file mode 100644 index 0000000000000000000000000000000000000000..1190277b9d123968fe4e151ceed1b72a4a28391a GIT binary patch literal 8094 zcmeI1Pjk{h7{-f7KgHgvGjwTb0n5o2{8PuNj@lE$VM#WyHDoip8w%t2L3BKL@tZh) z3U7W9-_3tgVqyWO6;40`*?oU`-e;dImCDY~N`1e5&}bjk@$tbS>b;{`SXb+t^QV~ZnqTolULyQqU zxgvsgf*-u(#H6B2Z8{{1B1`ZwGHfCx>J^S<=!@YlwTNe{f-Cp$S1LPS?%{ zuih_I(g1`SNSAnu!~L8pjec)5Y0 zqs}QX0a}kkgz)0e9XgCV$N`4YndgiOB8<@t$a;>sO1{-l*l&F^(04JMP0-M~+rFpp zwCWi=CG8|?fs=tY6=Qx7V9{kJRIHFm6*csW?*&Lu$vt6EWOF0HvO;OKLwUMHjgpai zjMoCO)f;a#0y`mgeUHs9>c%ys#6K<})dbDkvh(3_*ZV%%}oj zXAkUd0zoDCU@?c-@D}7j&A=64nj|P4j$DCJ`(~W@v(NcU#Q6~K*OzT*L$L{kYAj|` zd7UiG(S#|X-EdlZjR=bKbBPWPyFS^}c{OusiTrgkH*_CH2_Yab!yB*MT8MEH1wf5f zMu;VsjyPFFOm1Zo)dgmw!)gkQ>knJ+4kyv|LCT4DtF)SbnnX3J<4nKg8u#WU(M5Pl zc3aW1zgbBXKsNU?I@^K_o=8)kQYMKmLYdpL8<#{^Kxdmo%O%m~Hi^#fA!Us$FS%9#;~s$ z_ORdB;YBiKOSUZAOMvw$u}Gf#g*@kcb9D5lN72ON(|Cj;azo=_fuwfr|a~~M-uVha=$)%cJ!qc{Oun-|J4gT?qT2ig1JY7bH*sk`*!p!J@fkwzQf4J zK*fdclL_{R9CLF1;E+(j`0M$G4X>?F0Ur6p;?x>@fooywr(wvvU~)n!Kc&Igo5W1g z^Q|?fu@w;Fip_CEte;?=lZWg!i!u|0VBB_m97QDh0U`9tx(DeAP|V`6_Rk+jPo2b< zFE9tLCMc4E88bX1_mthDn0r1N0B4M&NXXsRKLkgwd)-%sCr2P$B-lre5+Pa$T}Vs| zR_Gw&42L0MXhQf0_6Bs6(aNb3t-blYB&yl!?3XGqeuqTSC1DdHC|j|IvXnJCjbh3& zqKe`$q#*LaNXW+FMFJbep6{+9Y}0uuu-5S!fmJ8#jEr&Y^PQ<{G@qi-n%#p4%}}&m zN_mZXzgRp~d{CN{Nk&PxYt+jcw*mYT2Y3RG|GmfyKiWAf(n1@pUNMv0j4?S7HoH9Hap{f8ZpD;J;t6ACqVZiI6~QnvGmsldLTFhlGZ==***U;T^%FNhfmJ;PksYwVHR}EHYlf^EH zvDs)X#JK~?5gCKg4tzf!P0w(&EbZDEToO6V3&HY{%*!V@BCcTKY_Xs{!VB)`EjdXL zo?_o0Vdplg_3Xl3|wMsnK1Vup|vLFfd#Z;hZTw0G!%ESkXMalI7N^?wm)KN-Vfnih;IUDLU27%Fr`JO58CS&#!>$ka$m9m-BP!_6|oWRO)G1l8UXAJdB|(mTD|jr@~jXC`~jen1~APvc(9}Q(1y7qmxNELJCFjU>|z%B`pQ|i)doxLSh*!v0I4D7pj32ghuuK;84;Z+ z4vvrmNL`ohwR;UjV#p(`miz|Q zUO+v|k$u9qIDl}-5-sE%)Zs`o=+GI8;y^^UhdHXr15M>NpMu+f-UrqY+Jz2T)V(%G zFVUa_B7{GFR{u)BH-1ar8?9Bds^BPJeGmO_e2+nEfs1#(PW56G;1aSM^lIM5qZ26N z68FRC1|l{%UI2d}oTQ%eSvPaju(Ii-E=`&3iDe&s6oR^IqSJbUYDs`#aR4zo5u9SQ z-B<(Hp#c;-8T5{z*(BOdlwDEZbLO>E5xxh33)N7{+&9?sV@4tbLlkl!f!2t*U*THE zf`Ll4;oJm*$hfrzlEljfU1mjdq2CH3#4OjS49KdWbVaG302g3YxDrKqs5WI5Rm5sE zt3t2oNGND80^d!bi#PPLrLEBZ2HNj1?;>TQ<)i>#$AO$Hk#bU>jJ--q9i2Isq$H)Rl@2gRvIF9ZgCsj(gfY??y%RT zza)mdAq|ZnZ%M+JZT|%R4$~BP3^!!i2$OS@DMLDyixN+QCD$a%H25>q6a$TLF-*~D zZRq{CWd}J+Mp~#Ns`QcB1t2|DTMYZGv`{1};n&YK=*H#_Wo!QWB(q)a6CVtW4 zsUSmXnHx~4nWCNfEQ3l;g=8_6vcXJqJlk3@$3nV!P5QQ|ZC1bu7xPMEL={k#WG{Cx RM6n0+=2oX|&7kM>@?Wk1*jE4m literal 0 HcmV?d00001 diff --git a/adapters/jpa-persistence/build/tmp/compileJava/source-classes-mapping.txt b/adapters/jpa-persistence/build/tmp/compileJava/source-classes-mapping.txt new file mode 100644 index 0000000..37f446f --- /dev/null +++ b/adapters/jpa-persistence/build/tmp/compileJava/source-classes-mapping.txt @@ -0,0 +1,10 @@ +io/github/sejoung/product/repository/ProductRepository.java + io.github.sejoung.product.repository.ProductRepository +io/github/sejoung/product/entities/ProductEntity.java + io.github.sejoung.product.entities.ProductEntity +io/github/sejoung/product/entities/RoundProductEntity.java + io.github.sejoung.product.entities.RoundProductEntity +io/github/sejoung/product/entities/PeriodProductEntity.java + io.github.sejoung.product.entities.PeriodProductEntity +io/github/sejoung/product/constants/ProductType.java + io.github.sejoung.product.constants.ProductType diff --git a/adapters/jpa-persistence/build/tmp/compileTestJava/source-classes-mapping.txt b/adapters/jpa-persistence/build/tmp/compileTestJava/source-classes-mapping.txt new file mode 100644 index 0000000..b3f510f --- /dev/null +++ b/adapters/jpa-persistence/build/tmp/compileTestJava/source-classes-mapping.txt @@ -0,0 +1,2 @@ +io/github/sejoung/product/repository/ProductRepositoryTest.java + io.github.sejoung.product.repository.ProductRepositoryTest diff --git a/adapters/jpa-persistence/src/main/java/io/github/sejoung/product/constants/ProductType.java b/adapters/jpa-persistence/src/main/java/io/github/sejoung/product/constants/ProductType.java new file mode 100644 index 0000000..c0b79a6 --- /dev/null +++ b/adapters/jpa-persistence/src/main/java/io/github/sejoung/product/constants/ProductType.java @@ -0,0 +1,15 @@ +package io.github.sejoung.product.constants; + +import io.github.sejoung.product.entities.PeriodProductEntity; +import io.github.sejoung.product.entities.RoundProductEntity; +import lombok.Getter; + +@Getter +public enum ProductType { + ROUND(RoundProductEntity.DISCRIMINATOR_VALUE), PERIOD(PeriodProductEntity.DISCRIMINATOR_VALUE); + private final String value; + + ProductType(String value) { + this.value = value; + } +} diff --git a/adapters/jpa-persistence/src/main/java/io/github/sejoung/product/entities/PeriodProductEntity.java b/adapters/jpa-persistence/src/main/java/io/github/sejoung/product/entities/PeriodProductEntity.java new file mode 100644 index 0000000..2766343 --- /dev/null +++ b/adapters/jpa-persistence/src/main/java/io/github/sejoung/product/entities/PeriodProductEntity.java @@ -0,0 +1,19 @@ +package io.github.sejoung.product.entities; + +import javax.persistence.DiscriminatorValue; +import javax.persistence.Entity; + +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.ToString; + +@ToString(callSuper = true) +@DiscriminatorValue(PeriodProductEntity.DISCRIMINATOR_VALUE) +@Entity +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class PeriodProductEntity extends ProductEntity{ + public static final String DISCRIMINATOR_VALUE = "PERIOD"; + +} diff --git a/adapters/jpa-persistence/src/main/java/io/github/sejoung/product/entities/ProductEntity.java b/adapters/jpa-persistence/src/main/java/io/github/sejoung/product/entities/ProductEntity.java new file mode 100644 index 0000000..7d56d7f --- /dev/null +++ b/adapters/jpa-persistence/src/main/java/io/github/sejoung/product/entities/ProductEntity.java @@ -0,0 +1,48 @@ +package io.github.sejoung.product.entities; + +import javax.persistence.Column; +import javax.persistence.DiscriminatorColumn; +import javax.persistence.DiscriminatorType; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; + +import org.springframework.data.domain.AbstractAggregateRoot; + +import io.github.sejoung.product.constants.ProductType; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.ToString; + +@Inheritance(strategy = InheritanceType.JOINED) +@DiscriminatorColumn(name = "product_type", discriminatorType = DiscriminatorType.STRING) +@Entity +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@ToString +public class ProductEntity extends AbstractAggregateRoot { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long productId; + + @Column(name = "product_name", nullable = false) + private String productName; + + @Enumerated(EnumType.STRING) + @Column(name = "product_type", nullable = false) + private ProductType productType; + + private Long categoryId; + + public ProductEntity(String productName, ProductType productType, Long categoryId) { + this.productName = productName; + this.productType = productType; + this.categoryId = categoryId; + } +} diff --git a/adapters/jpa-persistence/src/main/java/io/github/sejoung/product/entities/RoundProductEntity.java b/adapters/jpa-persistence/src/main/java/io/github/sejoung/product/entities/RoundProductEntity.java new file mode 100644 index 0000000..1fa2b38 --- /dev/null +++ b/adapters/jpa-persistence/src/main/java/io/github/sejoung/product/entities/RoundProductEntity.java @@ -0,0 +1,29 @@ +package io.github.sejoung.product.entities; + +import javax.persistence.Column; +import javax.persistence.DiscriminatorValue; +import javax.persistence.Entity; + +import io.github.sejoung.product.constants.ProductType; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.ToString; + +@ToString(callSuper = true) +@DiscriminatorValue(RoundProductEntity.DISCRIMINATOR_VALUE) +@Entity +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class RoundProductEntity extends ProductEntity { + public static final String DISCRIMINATOR_VALUE = "ROUND"; + + @Column(name = "cnt", nullable = false) + private Integer count; + + public RoundProductEntity(String productName, ProductType productType, + Long categoryId, Integer count) { + super(productName, productType, categoryId); + this.count = count; + } +} diff --git a/adapters/jpa-persistence/src/main/java/io/github/sejoung/product/repository/ProductRepository.java b/adapters/jpa-persistence/src/main/java/io/github/sejoung/product/repository/ProductRepository.java new file mode 100644 index 0000000..d1785a2 --- /dev/null +++ b/adapters/jpa-persistence/src/main/java/io/github/sejoung/product/repository/ProductRepository.java @@ -0,0 +1,8 @@ +package io.github.sejoung.product.repository; + +import org.springframework.data.jpa.repository.JpaRepository; + +import io.github.sejoung.product.entities.ProductEntity; + +public interface ProductRepository extends JpaRepository { +} diff --git a/adapters/jpa-persistence/src/test/java/io/github/sejoung/product/TestApplication.java b/adapters/jpa-persistence/src/test/java/io/github/sejoung/product/TestApplication.java new file mode 100644 index 0000000..735be76 --- /dev/null +++ b/adapters/jpa-persistence/src/test/java/io/github/sejoung/product/TestApplication.java @@ -0,0 +1,8 @@ +package io.github.sejoung.product; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootApplication +public class TestApplication { +} diff --git a/adapters/jpa-persistence/src/test/java/io/github/sejoung/product/repository/ProductRepositoryTest.java b/adapters/jpa-persistence/src/test/java/io/github/sejoung/product/repository/ProductRepositoryTest.java new file mode 100644 index 0000000..89452f8 --- /dev/null +++ b/adapters/jpa-persistence/src/test/java/io/github/sejoung/product/repository/ProductRepositoryTest.java @@ -0,0 +1,19 @@ +package io.github.sejoung.product.repository; + +import static org.assertj.core.api.Assertions.*; + +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; + +@DataJpaTest +class ProductRepositoryTest { + + @Autowired + private ProductRepository repository; + + @Test + void test() { + assertThat(repository).isNotNull(); + } +} \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..05155e7 --- /dev/null +++ b/build.gradle @@ -0,0 +1,27 @@ +subprojects { + apply plugin: 'java' + + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + + ext { + lombokVersion = "1.18.20" + } + + repositories { + mavenCentral() + } + + test { + useJUnitPlatform() + } + + dependencies { + + compileOnly "org.projectlombok:lombok:${lombokVersion}" + annotationProcessor "org.projectlombok:lombok:${lombokVersion}" + testCompileOnly "org.projectlombok:lombok:${lombokVersion}" + testAnnotationProcessor "org.projectlombok:lombok:${lombokVersion}" + + } +} diff --git a/domain/build.gradle b/domain/build.gradle new file mode 100644 index 0000000..1c92873 --- /dev/null +++ b/domain/build.gradle @@ -0,0 +1,18 @@ +plugins { + id 'java' +} + +jar { + enabled = true +} + +dependencies { + implementation 'org.hibernate:hibernate-validator:7.0.1.Final' + implementation 'org.glassfish:jakarta.el:4.0.1' + implementation "org.mapstruct:mapstruct:1.4.2.Final" + annotationProcessor "org.mapstruct:mapstruct-processor:1.4.2.Final" + + testAnnotationProcessor "org.mapstruct:mapstruct-processor:1.4.2.Final" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0' +} diff --git a/domain/build/reports/tests/test/classes/io.github.sejoung.product.entities.PeriodProductTest.html b/domain/build/reports/tests/test/classes/io.github.sejoung.product.entities.PeriodProductTest.html new file mode 100644 index 0000000..a572ca3 --- /dev/null +++ b/domain/build/reports/tests/test/classes/io.github.sejoung.product.entities.PeriodProductTest.html @@ -0,0 +1,98 @@ + + + + + +Test results - PeriodProductTest + + + + + +
+

PeriodProductTest

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

tests

+
+
+
+
0
+

failures

+
+
+
+
0
+

ignored

+
+
+
+
0.013s
+

duration

+
+
+
+
+
+
100%
+

successful

+
+
+
+
+ +
+

Tests

+ + + + + + + + + + + + + + + +
TestMethod nameDurationResult
startDate는 값이 있어야 됩니다.startDateValidate()0.013spassed
+
+
+ +
+ + diff --git a/domain/build/reports/tests/test/classes/io.github.sejoung.product.entities.RoundProductTest.html b/domain/build/reports/tests/test/classes/io.github.sejoung.product.entities.RoundProductTest.html new file mode 100644 index 0000000..c8efae8 --- /dev/null +++ b/domain/build/reports/tests/test/classes/io.github.sejoung.product.entities.RoundProductTest.html @@ -0,0 +1,98 @@ + + + + + +Test results - RoundProductTest + + + + + +
+

RoundProductTest

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

tests

+
+
+
+
0
+

failures

+
+
+
+
0
+

ignored

+
+
+
+
0.009s
+

duration

+
+
+
+
+
+
100%
+

successful

+
+
+
+
+ +
+

Tests

+ + + + + + + + + + + + + + + +
TestMethod nameDurationResult
count 최소 값은 1 이상입니다.countValidate()0.009spassed
+
+
+ +
+ + diff --git a/domain/build/reports/tests/test/classes/io.github.sejoung.product.usecases.port.in.SaveRoundProductInUseCaseTest.html b/domain/build/reports/tests/test/classes/io.github.sejoung.product.usecases.port.in.SaveRoundProductInUseCaseTest.html new file mode 100644 index 0000000..aa80c13 --- /dev/null +++ b/domain/build/reports/tests/test/classes/io.github.sejoung.product.usecases.port.in.SaveRoundProductInUseCaseTest.html @@ -0,0 +1,98 @@ + + + + + +Test results - SaveRoundProductInUseCaseTest + + + + + +
+

SaveRoundProductInUseCaseTest

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

tests

+
+
+
+
0
+

failures

+
+
+
+
0
+

ignored

+
+
+
+
0.020s
+

duration

+
+
+
+
+
+
100%
+

successful

+
+
+
+
+ +
+

Tests

+ + + + + + + + + + + + + + + +
TestMethod nameDurationResult
Commend 회차권 count는 99 이하여야 합니다validationSaveRoundProductCommand()0.020spassed
+
+
+ +
+ + diff --git a/domain/build/reports/tests/test/classes/io.github.sejoung.product.usecases.service.SaveRoundProductServiceTest.html b/domain/build/reports/tests/test/classes/io.github.sejoung.product.usecases.service.SaveRoundProductServiceTest.html new file mode 100644 index 0000000..60ab365 --- /dev/null +++ b/domain/build/reports/tests/test/classes/io.github.sejoung.product.usecases.service.SaveRoundProductServiceTest.html @@ -0,0 +1,109 @@ + + + + + +Test results - SaveRoundProductServiceTest + + + + + +
+

SaveRoundProductServiceTest

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

tests

+
+
+
+
0
+

failures

+
+
+
+
0
+

ignored

+
+
+
+
0.286s
+

duration

+
+
+
+
+
+
100%
+

successful

+
+
+
+
+ +
+

Tests

+ + + + + + + + + + + + + + + +
TestMethod nameDurationResult
회차권 저장saveTest()0.286spassed
+
+
+

Standard error

+ +
6월 22, 2021 7:55:32 오후 org.hibernate.validator.internal.util.Version <clinit>
+INFO: HV000001: Hibernate Validator 7.0.1.Final
+
+
+
+
+ +
+ + diff --git a/domain/build/reports/tests/test/css/base-style.css b/domain/build/reports/tests/test/css/base-style.css new file mode 100644 index 0000000..4afa73e --- /dev/null +++ b/domain/build/reports/tests/test/css/base-style.css @@ -0,0 +1,179 @@ + +body { + margin: 0; + padding: 0; + font-family: sans-serif; + font-size: 12pt; +} + +body, a, a:visited { + color: #303030; +} + +#content { + padding-left: 50px; + padding-right: 50px; + padding-top: 30px; + padding-bottom: 30px; +} + +#content h1 { + font-size: 160%; + margin-bottom: 10px; +} + +#footer { + margin-top: 100px; + font-size: 80%; + white-space: nowrap; +} + +#footer, #footer a { + color: #a0a0a0; +} + +#line-wrapping-toggle { + vertical-align: middle; +} + +#label-for-line-wrapping-toggle { + vertical-align: middle; +} + +ul { + margin-left: 0; +} + +h1, h2, h3 { + white-space: nowrap; +} + +h2 { + font-size: 120%; +} + +ul.tabLinks { + padding-left: 0; + padding-top: 10px; + padding-bottom: 10px; + overflow: auto; + min-width: 800px; + width: auto !important; + width: 800px; +} + +ul.tabLinks li { + float: left; + height: 100%; + list-style: none; + padding-left: 10px; + padding-right: 10px; + padding-top: 5px; + padding-bottom: 5px; + margin-bottom: 0; + -moz-border-radius: 7px; + border-radius: 7px; + margin-right: 25px; + border: solid 1px #d4d4d4; + background-color: #f0f0f0; +} + +ul.tabLinks li:hover { + background-color: #fafafa; +} + +ul.tabLinks li.selected { + background-color: #c5f0f5; + border-color: #c5f0f5; +} + +ul.tabLinks a { + font-size: 120%; + display: block; + outline: none; + text-decoration: none; + margin: 0; + padding: 0; +} + +ul.tabLinks li h2 { + margin: 0; + padding: 0; +} + +div.tab { +} + +div.selected { + display: block; +} + +div.deselected { + display: none; +} + +div.tab table { + min-width: 350px; + width: auto !important; + width: 350px; + border-collapse: collapse; +} + +div.tab th, div.tab table { + border-bottom: solid #d0d0d0 1px; +} + +div.tab th { + text-align: left; + white-space: nowrap; + padding-left: 6em; +} + +div.tab th:first-child { + padding-left: 0; +} + +div.tab td { + white-space: nowrap; + padding-left: 6em; + padding-top: 5px; + padding-bottom: 5px; +} + +div.tab td:first-child { + padding-left: 0; +} + +div.tab td.numeric, div.tab th.numeric { + text-align: right; +} + +span.code { + display: inline-block; + margin-top: 0em; + margin-bottom: 1em; +} + +span.code pre { + font-size: 11pt; + padding-top: 10px; + padding-bottom: 10px; + padding-left: 10px; + padding-right: 10px; + margin: 0; + background-color: #f7f7f7; + border: solid 1px #d0d0d0; + min-width: 700px; + width: auto !important; + width: 700px; +} + +span.wrapped pre { + word-wrap: break-word; + white-space: pre-wrap; + word-break: break-all; +} + +label.hidden { + display: none; +} \ No newline at end of file diff --git a/domain/build/reports/tests/test/css/style.css b/domain/build/reports/tests/test/css/style.css new file mode 100644 index 0000000..3dc4913 --- /dev/null +++ b/domain/build/reports/tests/test/css/style.css @@ -0,0 +1,84 @@ + +#summary { + margin-top: 30px; + margin-bottom: 40px; +} + +#summary table { + border-collapse: collapse; +} + +#summary td { + vertical-align: top; +} + +.breadcrumbs, .breadcrumbs a { + color: #606060; +} + +.infoBox { + width: 110px; + padding-top: 15px; + padding-bottom: 15px; + text-align: center; +} + +.infoBox p { + margin: 0; +} + +.counter, .percent { + font-size: 120%; + font-weight: bold; + margin-bottom: 8px; +} + +#duration { + width: 125px; +} + +#successRate, .summaryGroup { + border: solid 2px #d0d0d0; + -moz-border-radius: 10px; + border-radius: 10px; +} + +#successRate { + width: 140px; + margin-left: 35px; +} + +#successRate .percent { + font-size: 180%; +} + +.success, .success a { + color: #008000; +} + +div.success, #successRate.success { + background-color: #bbd9bb; + border-color: #008000; +} + +.failures, .failures a { + color: #b60808; +} + +.skipped, .skipped a { + color: #c09853; +} + +div.failures, #successRate.failures { + background-color: #ecdada; + border-color: #b60808; +} + +ul.linkList { + padding-left: 0; +} + +ul.linkList li { + list-style: none; + margin-bottom: 5px; +} diff --git a/domain/build/reports/tests/test/index.html b/domain/build/reports/tests/test/index.html new file mode 100644 index 0000000..00e3a56 --- /dev/null +++ b/domain/build/reports/tests/test/index.html @@ -0,0 +1,183 @@ + + + + + +Test results - Test Summary + + + + + +
+

Test Summary

+
+ + + + + +
+
+ + + + + + + +
+
+
4
+

tests

+
+
+
+
0
+

failures

+
+
+
+
0
+

ignored

+
+
+
+
0.328s
+

duration

+
+
+
+
+
+
100%
+

successful

+
+
+
+
+ +
+

Packages

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PackageTestsFailuresIgnoredDurationSuccess rate
+io.github.sejoung.product.entities +2000.022s100%
+io.github.sejoung.product.usecases.port.in +1000.020s100%
+io.github.sejoung.product.usecases.service +1000.286s100%
+
+
+

Classes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ClassTestsFailuresIgnoredDurationSuccess rate
+io.github.sejoung.product.entities.PeriodProductTest +1000.013s100%
+io.github.sejoung.product.entities.RoundProductTest +1000.009s100%
+io.github.sejoung.product.usecases.port.in.SaveRoundProductInUseCaseTest +1000.020s100%
+io.github.sejoung.product.usecases.service.SaveRoundProductServiceTest +1000.286s100%
+
+
+ +
+ + diff --git a/domain/build/reports/tests/test/js/report.js b/domain/build/reports/tests/test/js/report.js new file mode 100644 index 0000000..83bab4a --- /dev/null +++ b/domain/build/reports/tests/test/js/report.js @@ -0,0 +1,194 @@ +(function (window, document) { + "use strict"; + + var tabs = {}; + + function changeElementClass(element, classValue) { + if (element.getAttribute("className")) { + element.setAttribute("className", classValue); + } else { + element.setAttribute("class", classValue); + } + } + + function getClassAttribute(element) { + if (element.getAttribute("className")) { + return element.getAttribute("className"); + } else { + return element.getAttribute("class"); + } + } + + function addClass(element, classValue) { + changeElementClass(element, getClassAttribute(element) + " " + classValue); + } + + function removeClass(element, classValue) { + changeElementClass(element, getClassAttribute(element).replace(classValue, "")); + } + + function initTabs() { + var container = document.getElementById("tabs"); + + tabs.tabs = findTabs(container); + tabs.titles = findTitles(tabs.tabs); + tabs.headers = findHeaders(container); + tabs.select = select; + tabs.deselectAll = deselectAll; + tabs.select(0); + + return true; + } + + function getCheckBox() { + return document.getElementById("line-wrapping-toggle"); + } + + function getLabelForCheckBox() { + return document.getElementById("label-for-line-wrapping-toggle"); + } + + function findCodeBlocks() { + var spans = document.getElementById("tabs").getElementsByTagName("span"); + var codeBlocks = []; + for (var i = 0; i < spans.length; ++i) { + if (spans[i].className.indexOf("code") >= 0) { + codeBlocks.push(spans[i]); + } + } + return codeBlocks; + } + + function forAllCodeBlocks(operation) { + var codeBlocks = findCodeBlocks(); + + for (var i = 0; i < codeBlocks.length; ++i) { + operation(codeBlocks[i], "wrapped"); + } + } + + function toggleLineWrapping() { + var checkBox = getCheckBox(); + + if (checkBox.checked) { + forAllCodeBlocks(addClass); + } else { + forAllCodeBlocks(removeClass); + } + } + + function initControls() { + if (findCodeBlocks().length > 0) { + var checkBox = getCheckBox(); + var label = getLabelForCheckBox(); + + checkBox.onclick = toggleLineWrapping; + checkBox.checked = false; + + removeClass(label, "hidden"); + } + } + + function switchTab() { + var id = this.id.substr(1); + + for (var i = 0; i < tabs.tabs.length; i++) { + if (tabs.tabs[i].id === id) { + tabs.select(i); + break; + } + } + + return false; + } + + function select(i) { + this.deselectAll(); + + changeElementClass(this.tabs[i], "tab selected"); + changeElementClass(this.headers[i], "selected"); + + while (this.headers[i].firstChild) { + this.headers[i].removeChild(this.headers[i].firstChild); + } + + var h2 = document.createElement("H2"); + + h2.appendChild(document.createTextNode(this.titles[i])); + this.headers[i].appendChild(h2); + } + + function deselectAll() { + for (var i = 0; i < this.tabs.length; i++) { + changeElementClass(this.tabs[i], "tab deselected"); + changeElementClass(this.headers[i], "deselected"); + + while (this.headers[i].firstChild) { + this.headers[i].removeChild(this.headers[i].firstChild); + } + + var a = document.createElement("A"); + + a.setAttribute("id", "ltab" + i); + a.setAttribute("href", "#tab" + i); + a.onclick = switchTab; + a.appendChild(document.createTextNode(this.titles[i])); + + this.headers[i].appendChild(a); + } + } + + function findTabs(container) { + return findChildElements(container, "DIV", "tab"); + } + + function findHeaders(container) { + var owner = findChildElements(container, "UL", "tabLinks"); + return findChildElements(owner[0], "LI", null); + } + + function findTitles(tabs) { + var titles = []; + + for (var i = 0; i < tabs.length; i++) { + var tab = tabs[i]; + var header = findChildElements(tab, "H2", null)[0]; + + header.parentNode.removeChild(header); + + if (header.innerText) { + titles.push(header.innerText); + } else { + titles.push(header.textContent); + } + } + + return titles; + } + + function findChildElements(container, name, targetClass) { + var elements = []; + var children = container.childNodes; + + for (var i = 0; i < children.length; i++) { + var child = children.item(i); + + if (child.nodeType === 1 && child.nodeName === name) { + if (targetClass && child.className.indexOf(targetClass) < 0) { + continue; + } + + elements.push(child); + } + } + + return elements; + } + + // Entry point. + + window.onload = function() { + initTabs(); + initControls(); + }; +} (window, window.document)); \ No newline at end of file diff --git a/domain/build/reports/tests/test/packages/io.github.sejoung.product.entities.html b/domain/build/reports/tests/test/packages/io.github.sejoung.product.entities.html new file mode 100644 index 0000000..8b0f516 --- /dev/null +++ b/domain/build/reports/tests/test/packages/io.github.sejoung.product.entities.html @@ -0,0 +1,113 @@ + + + + + +Test results - Package io.github.sejoung.product.entities + + + + + +
+

Package io.github.sejoung.product.entities

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

tests

+
+
+
+
0
+

failures

+
+
+
+
0
+

ignored

+
+
+
+
0.022s
+

duration

+
+
+
+
+
+
100%
+

successful

+
+
+
+
+ +
+

Classes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
ClassTestsFailuresIgnoredDurationSuccess rate
+PeriodProductTest +1000.013s100%
+RoundProductTest +1000.009s100%
+
+
+ +
+ + diff --git a/domain/build/reports/tests/test/packages/io.github.sejoung.product.usecases.port.in.html b/domain/build/reports/tests/test/packages/io.github.sejoung.product.usecases.port.in.html new file mode 100644 index 0000000..aaa78f3 --- /dev/null +++ b/domain/build/reports/tests/test/packages/io.github.sejoung.product.usecases.port.in.html @@ -0,0 +1,103 @@ + + + + + +Test results - Package io.github.sejoung.product.usecases.port.in + + + + + +
+

Package io.github.sejoung.product.usecases.port.in

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

tests

+
+
+
+
0
+

failures

+
+
+
+
0
+

ignored

+
+
+
+
0.020s
+

duration

+
+
+
+
+
+
100%
+

successful

+
+
+
+
+ +
+

Classes

+ + + + + + + + + + + + + + + + + + + +
ClassTestsFailuresIgnoredDurationSuccess rate
+SaveRoundProductInUseCaseTest +1000.020s100%
+
+
+ +
+ + diff --git a/domain/build/reports/tests/test/packages/io.github.sejoung.product.usecases.service.html b/domain/build/reports/tests/test/packages/io.github.sejoung.product.usecases.service.html new file mode 100644 index 0000000..1d5d74a --- /dev/null +++ b/domain/build/reports/tests/test/packages/io.github.sejoung.product.usecases.service.html @@ -0,0 +1,103 @@ + + + + + +Test results - Package io.github.sejoung.product.usecases.service + + + + + +
+

Package io.github.sejoung.product.usecases.service

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

tests

+
+
+
+
0
+

failures

+
+
+
+
0
+

ignored

+
+
+
+
0.286s
+

duration

+
+
+
+
+
+
100%
+

successful

+
+
+
+
+ +
+

Classes

+ + + + + + + + + + + + + + + + + + + +
ClassTestsFailuresIgnoredDurationSuccess rate
+SaveRoundProductServiceTest +1000.286s100%
+
+
+ +
+ + diff --git a/domain/build/test-results/test/TEST-io.github.sejoung.product.entities.PeriodProductTest.xml b/domain/build/test-results/test/TEST-io.github.sejoung.product.entities.PeriodProductTest.xml new file mode 100644 index 0000000..9c09ee1 --- /dev/null +++ b/domain/build/test-results/test/TEST-io.github.sejoung.product.entities.PeriodProductTest.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/domain/build/test-results/test/TEST-io.github.sejoung.product.entities.RoundProductTest.xml b/domain/build/test-results/test/TEST-io.github.sejoung.product.entities.RoundProductTest.xml new file mode 100644 index 0000000..ffa2105 --- /dev/null +++ b/domain/build/test-results/test/TEST-io.github.sejoung.product.entities.RoundProductTest.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/domain/build/test-results/test/TEST-io.github.sejoung.product.usecases.port.in.SaveRoundProductInUseCaseTest.xml b/domain/build/test-results/test/TEST-io.github.sejoung.product.usecases.port.in.SaveRoundProductInUseCaseTest.xml new file mode 100644 index 0000000..a9735bc --- /dev/null +++ b/domain/build/test-results/test/TEST-io.github.sejoung.product.usecases.port.in.SaveRoundProductInUseCaseTest.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/domain/build/test-results/test/TEST-io.github.sejoung.product.usecases.service.SaveRoundProductServiceTest.xml b/domain/build/test-results/test/TEST-io.github.sejoung.product.usecases.service.SaveRoundProductServiceTest.xml new file mode 100644 index 0000000..abeb87a --- /dev/null +++ b/domain/build/test-results/test/TEST-io.github.sejoung.product.usecases.service.SaveRoundProductServiceTest.xml @@ -0,0 +1,9 @@ + + + + + + +INFO: HV000001: Hibernate Validator 7.0.1.Final +]]> + diff --git a/domain/build/test-results/test/binary/output.bin b/domain/build/test-results/test/binary/output.bin new file mode 100644 index 0000000000000000000000000000000000000000..bfd74cb101df966545894d9721c8b3badf064298 GIT binary patch literal 140 zcmZQzVhk~RGkc1Hk&%vqk%5t+g1MEcsg<#j!kZaO-p+1O$S+FQ%g9VhEy_zQN!2S$ z%*jkiEXgm@%gieQiRI{(mSpDWg{2l1XXfWA*d*s<=4F=HaWOD48hHA-`CBP?gc*Q< ZA&><#Mj;GljDoqIfu5nBTPDyXE&$AuEqVX| literal 0 HcmV?d00001 diff --git a/domain/build/test-results/test/binary/output.bin.idx b/domain/build/test-results/test/binary/output.bin.idx new file mode 100644 index 0000000000000000000000000000000000000000..50c72ea5ac123c1bffb33ce9b79d80468e3f40d9 GIT binary patch literal 36 RcmZQ%Vr2Y}1{hF51OSJy5KaI9 literal 0 HcmV?d00001 diff --git a/domain/build/test-results/test/binary/results.bin b/domain/build/test-results/test/binary/results.bin new file mode 100644 index 0000000000000000000000000000000000000000..c724ae1200c4adf7532c3893807560893c437334 GIT binary patch literal 668 zcmZQ(VL8c|nXi|gS&~tjq*t7pm0y~du2)c$pHiA!qE}j+nw(giTC7))UsR%(nWq<= zSe6Yqc{6p7!rQ4U zUw3!B?q0$m0=48f1IHHJzDmt2$t=kP`U=@6AP-DL7l0U-&CSR@0c?91#NnwLnp44i zg*RL0ylLxEc(q~Do4E}Nh9GynX>NQouNC4TJqAvw5h4t1TZwQ{Kx$EDJ}huSPMU-v z0`=lwM%F3CC5c5PE{P?n2zO0~i-AH4?5-^eZ{~HpnYINKRIevMgG!Hq7wR%D2Bzc0 zB!S}8qO#27RE#7L3=s!8b`E-UBFRB)%RJ7=*j)@vL?GoFn(c_#eY2q9&Ag=y^O&Ii Hd&&R+SJo3s literal 0 HcmV?d00001 diff --git a/domain/build/tmp/compileJava/source-classes-mapping.txt b/domain/build/tmp/compileJava/source-classes-mapping.txt new file mode 100644 index 0000000..12c5226 --- /dev/null +++ b/domain/build/tmp/compileJava/source-classes-mapping.txt @@ -0,0 +1,25 @@ +io/github/sejoung/product/usecases/port/out/SaveRoundProductOutUseCase.java + io.github.sejoung.product.usecases.port.out.SaveRoundProductOutUseCase +io/github/sejoung/product/usecases/port/in/SaveRoundProductInUseCase.java + io.github.sejoung.product.usecases.port.in.SaveRoundProductInUseCase + io.github.sejoung.product.usecases.port.in.SaveRoundProductInUseCase$SaveRoundProductCommand +io/github/sejoung/product/exception/ProductExceptionCode.java + io.github.sejoung.product.exception.ProductExceptionCode +io/github/sejoung/product/mapper/SaveRoundProductCommandMapper.java + io.github.sejoung.product.mapper.SaveRoundProductCommandMapper +io/github/sejoung/product/entities/PeriodProduct.java + io.github.sejoung.product.entities.PeriodProduct +io/github/sejoung/product/entities/Category.java + io.github.sejoung.product.entities.Category + io.github.sejoung.product.entities.Category$ProductType +io/github/sejoung/product/exception/ProductException.java + io.github.sejoung.product.exception.ProductException +io/github/sejoung/product/usecases/service/SaveRoundProductService.java + io.github.sejoung.product.usecases.service.SaveRoundProductService +io/github/sejoung/product/validating/SelfValidating.java + io.github.sejoung.product.validating.SelfValidating +io/github/sejoung/product/entities/RoundProduct.java + io.github.sejoung.product.entities.RoundProduct +io/github/sejoung/product/entities/Product.java + io.github.sejoung.product.entities.Product + io.github.sejoung.product.entities.Product$ProductStatus diff --git a/domain/build/tmp/compileTestJava/source-classes-mapping.txt b/domain/build/tmp/compileTestJava/source-classes-mapping.txt new file mode 100644 index 0000000..de542aa --- /dev/null +++ b/domain/build/tmp/compileTestJava/source-classes-mapping.txt @@ -0,0 +1,10 @@ +io/github/sejoung/product/entities/PeriodProductTest.java + io.github.sejoung.product.entities.PeriodProductTest +io/github/sejoung/product/usecases/port/out/SaveRoundProductOutUseCaseStub.java + io.github.sejoung.product.usecases.port.out.SaveRoundProductOutUseCaseStub +io/github/sejoung/product/entities/RoundProductTest.java + io.github.sejoung.product.entities.RoundProductTest +io/github/sejoung/product/usecases/port/in/SaveRoundProductInUseCaseTest.java + io.github.sejoung.product.usecases.port.in.SaveRoundProductInUseCaseTest +io/github/sejoung/product/usecases/service/SaveRoundProductServiceTest.java + io.github.sejoung.product.usecases.service.SaveRoundProductServiceTest diff --git a/domain/build/tmp/jar/MANIFEST.MF b/domain/build/tmp/jar/MANIFEST.MF new file mode 100644 index 0000000..58630c0 --- /dev/null +++ b/domain/build/tmp/jar/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/domain/src/main/java/io/github/sejoung/product/entities/Category.java b/domain/src/main/java/io/github/sejoung/product/entities/Category.java new file mode 100644 index 0000000..52ab78d --- /dev/null +++ b/domain/src/main/java/io/github/sejoung/product/entities/Category.java @@ -0,0 +1,25 @@ +package io.github.sejoung.product.entities; + +import jakarta.validation.constraints.NotNull; + +import lombok.Getter; +import lombok.ToString; + +@Getter +@ToString +public class Category { + public enum ProductType { + ROUND, PERIOD + } + + @NotNull + private final Long categoryId; + + @NotNull + private final ProductType productType; + + public Category(Long categoryId, ProductType productType) { + this.categoryId = categoryId; + this.productType = productType; + } +} diff --git a/domain/src/main/java/io/github/sejoung/product/entities/PeriodProduct.java b/domain/src/main/java/io/github/sejoung/product/entities/PeriodProduct.java new file mode 100644 index 0000000..fd7a67b --- /dev/null +++ b/domain/src/main/java/io/github/sejoung/product/entities/PeriodProduct.java @@ -0,0 +1,25 @@ +package io.github.sejoung.product.entities; + +import java.time.LocalDate; + +import jakarta.validation.constraints.NotNull; + +import lombok.Getter; +import lombok.ToString; + +@Getter +@ToString(callSuper = true) +public class PeriodProduct extends Product { + @NotNull + private final LocalDate startDate; + @NotNull + private final LocalDate endDate; + + public PeriodProduct(Long productId, Long categoryId, Category.ProductType productType, + ProductStatus status, String productName, LocalDate startDate, LocalDate endDate) { + super(productId, new Category(categoryId, productType), status, productName); + this.startDate = startDate; + this.endDate = endDate; + validateSelf(); + } +} diff --git a/domain/src/main/java/io/github/sejoung/product/entities/Product.java b/domain/src/main/java/io/github/sejoung/product/entities/Product.java new file mode 100644 index 0000000..c467fb2 --- /dev/null +++ b/domain/src/main/java/io/github/sejoung/product/entities/Product.java @@ -0,0 +1,67 @@ +package io.github.sejoung.product.entities; + +import java.time.LocalDateTime; +import java.util.Set; + +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ConstraintViolationException; +import jakarta.validation.Validation; +import jakarta.validation.Validator; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +@Getter +@ToString +public abstract class Product { + public enum ProductStatus { + CREATE, DELETE, TEMPORARY, PERMANENTLY_DELETE + } + + private final Validator validator; + + private final Long productId; + + @NotNull + private final Category category; + @Setter + private ProductStatus status; + @NotEmpty + private String productName; + + private final LocalDateTime createTime; + + Product(Long productId, Category category, ProductStatus status, String productName) { + this.productId = productId; + this.category = category; + this.status = status; + this.productName = productName; + this.createTime = LocalDateTime.now(); + this.validator = Validation.buildDefaultValidatorFactory().getValidator(); + } + + protected void validateSelf() { + Set> violations = validator.validate((T)this); + if (!violations.isEmpty()) { + throw new ConstraintViolationException(violations); + } + } + + public void created() { + this.status = ProductStatus.CREATE; + } + + public void deleted() { + this.status = ProductStatus.DELETE; + } + + public void temporaryed() { + this.status = ProductStatus.TEMPORARY; + } + + public void permanentlyDelete() { + this.status = ProductStatus.PERMANENTLY_DELETE; + } +} diff --git a/domain/src/main/java/io/github/sejoung/product/entities/RoundProduct.java b/domain/src/main/java/io/github/sejoung/product/entities/RoundProduct.java new file mode 100644 index 0000000..59a3343 --- /dev/null +++ b/domain/src/main/java/io/github/sejoung/product/entities/RoundProduct.java @@ -0,0 +1,28 @@ +package io.github.sejoung.product.entities; + +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; + +import lombok.Getter; +import lombok.ToString; + +@Getter +@ToString(callSuper = true) +public class RoundProduct extends Product { + + @Min(1) + @Max(99) + private Integer count; + + public RoundProduct(Long productId, Long categoryId, Category.ProductType productType, ProductStatus status, + String productName, Integer count) { + super(productId, new Category(categoryId, productType), status, productName); + this.count = count; + validateSelf(); + } + + public void update(ProductStatus status, Integer count) { + setStatus(status); + this.count = count; + } +} diff --git a/domain/src/main/java/io/github/sejoung/product/exception/ProductException.java b/domain/src/main/java/io/github/sejoung/product/exception/ProductException.java new file mode 100644 index 0000000..03fd09f --- /dev/null +++ b/domain/src/main/java/io/github/sejoung/product/exception/ProductException.java @@ -0,0 +1,13 @@ +package io.github.sejoung.product.exception; + +import lombok.Getter; + +@Getter +public class ProductException extends RuntimeException { + private final ProductExceptionCode exceptionCode; + + public ProductException(ProductExceptionCode exceptionCode) { + super(exceptionCode.getMessage()); + this.exceptionCode = exceptionCode; + } +} diff --git a/domain/src/main/java/io/github/sejoung/product/exception/ProductExceptionCode.java b/domain/src/main/java/io/github/sejoung/product/exception/ProductExceptionCode.java new file mode 100644 index 0000000..d60751c --- /dev/null +++ b/domain/src/main/java/io/github/sejoung/product/exception/ProductExceptionCode.java @@ -0,0 +1,16 @@ +package io.github.sejoung.product.exception; + +import lombok.Getter; + +@Getter +public enum ProductExceptionCode { + P0100("상품이 존재하지 않습니다."); + + private final String code; + private final String message; + + ProductExceptionCode(String message) { + this.code = this.name(); + this.message = message; + } +} diff --git a/domain/src/main/java/io/github/sejoung/product/mapper/SaveRoundProductCommandMapper.java b/domain/src/main/java/io/github/sejoung/product/mapper/SaveRoundProductCommandMapper.java new file mode 100644 index 0000000..afcdb58 --- /dev/null +++ b/domain/src/main/java/io/github/sejoung/product/mapper/SaveRoundProductCommandMapper.java @@ -0,0 +1,22 @@ +package io.github.sejoung.product.mapper; + +import io.github.sejoung.product.entities.RoundProduct; +import io.github.sejoung.product.usecases.port.in.SaveRoundProductInUseCase; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public abstract class SaveRoundProductCommandMapper { + + public static SaveRoundProductInUseCase.SaveRoundProductCommand toDto(RoundProduct roundProduct) { + + return new SaveRoundProductInUseCase.SaveRoundProductCommand(roundProduct.getProductId(), + roundProduct.getCategory().getCategoryId(), roundProduct.getCategory().getProductType(), + roundProduct.getStatus(), roundProduct.getProductName(), roundProduct.getCount()); + } + + public static RoundProduct toEntity(SaveRoundProductInUseCase.SaveRoundProductCommand command) { + return new RoundProduct(command.getProductId(), command.getCategoryId(), command.getProductType(), + command.getStatus(), command.getProductName(), command.getCount()); + } +} diff --git a/domain/src/main/java/io/github/sejoung/product/usecases/port/in/SaveRoundProductInUseCase.java b/domain/src/main/java/io/github/sejoung/product/usecases/port/in/SaveRoundProductInUseCase.java new file mode 100644 index 0000000..3575b09 --- /dev/null +++ b/domain/src/main/java/io/github/sejoung/product/usecases/port/in/SaveRoundProductInUseCase.java @@ -0,0 +1,50 @@ +package io.github.sejoung.product.usecases.port.in; + +import io.github.sejoung.product.entities.Category; +import io.github.sejoung.product.entities.Product; +import io.github.sejoung.product.validating.SelfValidating; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +public interface SaveRoundProductInUseCase { + + SaveRoundProductCommand save(SaveRoundProductCommand command); + + @Getter + @EqualsAndHashCode(callSuper = false) + final class SaveRoundProductCommand extends SelfValidating { + + private final Long productId; + + @NotNull + private final Long categoryId; + + @NotNull + private final Category.ProductType productType; + + @NotNull + private final Product.ProductStatus status; + + @NotEmpty + private final String productName; + + @Min(1) + @Max(99) + private final Integer count; + + public SaveRoundProductCommand(Long productId, Long categoryId, Category.ProductType productType, + Product.ProductStatus status, String productName, Integer count) { + this.productId = productId; + this.categoryId = categoryId; + this.productType = productType; + this.status = status; + this.productName = productName; + this.count = count; + this.validateSelf(); + } + } +} diff --git a/domain/src/main/java/io/github/sejoung/product/usecases/port/out/SaveRoundProductOutUseCase.java b/domain/src/main/java/io/github/sejoung/product/usecases/port/out/SaveRoundProductOutUseCase.java new file mode 100644 index 0000000..153d576 --- /dev/null +++ b/domain/src/main/java/io/github/sejoung/product/usecases/port/out/SaveRoundProductOutUseCase.java @@ -0,0 +1,7 @@ +package io.github.sejoung.product.usecases.port.out; + +import io.github.sejoung.product.entities.RoundProduct; + +public interface SaveRoundProductOutUseCase { + RoundProduct saveRoundProduct(RoundProduct product); +} diff --git a/domain/src/main/java/io/github/sejoung/product/usecases/service/SaveRoundProductService.java b/domain/src/main/java/io/github/sejoung/product/usecases/service/SaveRoundProductService.java new file mode 100644 index 0000000..8b285b0 --- /dev/null +++ b/domain/src/main/java/io/github/sejoung/product/usecases/service/SaveRoundProductService.java @@ -0,0 +1,21 @@ +package io.github.sejoung.product.usecases.service; + +import io.github.sejoung.product.mapper.SaveRoundProductCommandMapper; +import io.github.sejoung.product.usecases.port.in.SaveRoundProductInUseCase; +import io.github.sejoung.product.usecases.port.out.SaveRoundProductOutUseCase; + +public class SaveRoundProductService implements SaveRoundProductInUseCase { + + private final SaveRoundProductOutUseCase saveRoundProductOutUseCase; + + public SaveRoundProductService(SaveRoundProductOutUseCase saveRoundProductOutUseCase) { + this.saveRoundProductOutUseCase = saveRoundProductOutUseCase; + } + + @Override + public SaveRoundProductCommand save(SaveRoundProductCommand command) { + + var roundProduct = saveRoundProductOutUseCase.saveRoundProduct(SaveRoundProductCommandMapper.toEntity(command)); + return SaveRoundProductCommandMapper.toDto(roundProduct); + } +} diff --git a/domain/src/main/java/io/github/sejoung/product/validating/SelfValidating.java b/domain/src/main/java/io/github/sejoung/product/validating/SelfValidating.java new file mode 100644 index 0000000..607ba8e --- /dev/null +++ b/domain/src/main/java/io/github/sejoung/product/validating/SelfValidating.java @@ -0,0 +1,26 @@ +package io.github.sejoung.product.validating; + +import jakarta.validation.ConstraintViolationException; +import jakarta.validation.Validation; +import jakarta.validation.Validator; + +public abstract class SelfValidating { + + private Validator validator; + + protected SelfValidating() { + var factory = Validation.buildDefaultValidatorFactory(); + validator = factory.getValidator(); + } + + /** + * Evaluates all Bean Validations on the attributes of this + * instance. + */ + protected void validateSelf() { + var violations = validator.validate((T)this); + if (!violations.isEmpty()) { + throw new ConstraintViolationException(violations); + } + } +} diff --git a/domain/src/test/java/io/github/sejoung/product/entities/PeriodProductTest.java b/domain/src/test/java/io/github/sejoung/product/entities/PeriodProductTest.java new file mode 100644 index 0000000..d22846c --- /dev/null +++ b/domain/src/test/java/io/github/sejoung/product/entities/PeriodProductTest.java @@ -0,0 +1,24 @@ +package io.github.sejoung.product.entities; + +import static org.junit.jupiter.api.Assertions.*; + +import java.time.LocalDate; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +import jakarta.validation.ConstraintViolationException; + +class PeriodProductTest { + + @DisplayName("startDate는 값이 있어야 됩니다.") + @Test + void startDateValidate() { + Throwable exception = assertThrows(ConstraintViolationException.class, () -> { + new PeriodProduct(null, 1L, Category.ProductType.PERIOD, Product.ProductStatus.TEMPORARY, "기간권", null, + LocalDate.now().plusDays(1)); + }); + assertEquals("startDate: 널이어서는 안됩니다", exception.getMessage()); + + } +} \ No newline at end of file diff --git a/domain/src/test/java/io/github/sejoung/product/entities/RoundProductTest.java b/domain/src/test/java/io/github/sejoung/product/entities/RoundProductTest.java new file mode 100644 index 0000000..2378099 --- /dev/null +++ b/domain/src/test/java/io/github/sejoung/product/entities/RoundProductTest.java @@ -0,0 +1,20 @@ +package io.github.sejoung.product.entities; + +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +import jakarta.validation.ConstraintViolationException; + +class RoundProductTest { + + @DisplayName("count 최소 값은 1 이상입니다.") + @Test + void countValidate() { + Throwable exception = assertThrows(ConstraintViolationException.class, () -> { + new RoundProduct(null, 1L, Category.ProductType.ROUND, Product.ProductStatus.CREATE, "회차권", 0); + }); + assertEquals("count: 1 이상이어야 합니다", exception.getMessage()); + } +} \ No newline at end of file diff --git a/domain/src/test/java/io/github/sejoung/product/usecases/port/in/SaveRoundProductInUseCaseTest.java b/domain/src/test/java/io/github/sejoung/product/usecases/port/in/SaveRoundProductInUseCaseTest.java new file mode 100644 index 0000000..f91631e --- /dev/null +++ b/domain/src/test/java/io/github/sejoung/product/usecases/port/in/SaveRoundProductInUseCaseTest.java @@ -0,0 +1,26 @@ +package io.github.sejoung.product.usecases.port.in; + +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +import io.github.sejoung.product.entities.Category; +import io.github.sejoung.product.entities.Product; +import jakarta.validation.ConstraintViolationException; + +class SaveRoundProductInUseCaseTest { + + @DisplayName("Commend 회차권 count는 99 이하여야 합니다") + @Test + void validationSaveRoundProductCommand() { + + Throwable exception = assertThrows(ConstraintViolationException.class, () -> { + var command = new SaveRoundProductInUseCase.SaveRoundProductCommand(null, 1L, Category.ProductType.ROUND, + Product.ProductStatus.CREATE, "2회권", 999); + }); + + assertEquals("count: 99 이하여야 합니다", exception.getMessage()); + + } +} \ No newline at end of file diff --git a/domain/src/test/java/io/github/sejoung/product/usecases/port/out/SaveRoundProductOutUseCaseStub.java b/domain/src/test/java/io/github/sejoung/product/usecases/port/out/SaveRoundProductOutUseCaseStub.java new file mode 100644 index 0000000..dd366e6 --- /dev/null +++ b/domain/src/test/java/io/github/sejoung/product/usecases/port/out/SaveRoundProductOutUseCaseStub.java @@ -0,0 +1,13 @@ +package io.github.sejoung.product.usecases.port.out; + +import io.github.sejoung.product.entities.RoundProduct; + +public class SaveRoundProductOutUseCaseStub implements SaveRoundProductOutUseCase { + + @Override + public RoundProduct saveRoundProduct( + RoundProduct product) { + return new RoundProduct(99L, product.getCategory().getCategoryId(), product.getCategory().getProductType(), + product.getStatus(), product.getProductName(), product.getCount()); + } +} \ No newline at end of file diff --git a/domain/src/test/java/io/github/sejoung/product/usecases/service/SaveRoundProductServiceTest.java b/domain/src/test/java/io/github/sejoung/product/usecases/service/SaveRoundProductServiceTest.java new file mode 100644 index 0000000..e2abd95 --- /dev/null +++ b/domain/src/test/java/io/github/sejoung/product/usecases/service/SaveRoundProductServiceTest.java @@ -0,0 +1,31 @@ +package io.github.sejoung.product.usecases.service; + +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +import io.github.sejoung.product.entities.Category; +import io.github.sejoung.product.entities.Product; +import io.github.sejoung.product.usecases.port.in.SaveRoundProductInUseCase; +import io.github.sejoung.product.usecases.port.out.SaveRoundProductOutUseCaseStub; + +class SaveRoundProductServiceTest { + + private SaveRoundProductService service; + + @BeforeEach + void setUp() { + this.service = new SaveRoundProductService(new SaveRoundProductOutUseCaseStub()); + } + + @DisplayName("회차권 저장") + @Test + void saveTest() { + var command = new SaveRoundProductInUseCase.SaveRoundProductCommand(null, 1L, Category.ProductType.ROUND, + Product.ProductStatus.CREATE, "2회권", 2); + var actual = service.save(command); + assertEquals(99, actual.getProductId()); + } +} \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..da9702f --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100755 index 0000000..4f906e0 --- /dev/null +++ b/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..ac1b06f --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..de58017 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,5 @@ +rootProject.name = 'hexagonal-architecture' + +include 'domain' +include 'adapters:jpa-persistence' +