From dc018471b2ce64d7800a53d52d9e4024cf852bbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20S=C3=A4ume?= Date: Mon, 7 Oct 2024 15:55:05 +0200 Subject: [PATCH 1/3] PMT-16: Change Java Datetime Library to be follow Spring Context. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Dominik Säume --- gen/config-pmt.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gen/config-pmt.json b/gen/config-pmt.json index c2d6f24..80ab789 100644 --- a/gen/config-pmt.json +++ b/gen/config-pmt.json @@ -4,7 +4,7 @@ "invokerPackage": "de.hmmh.pmt", "java8": false, "java11": true, - "dateLibrary": "java11", + "dateLibrary": "java8-localdatetime", "library": "spring-boot3", "defaultInterfaces": false, "serializableModel": true From 13d5283b67c10af6386c374b94a31d3b54ddb95f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20S=C3=A4ume?= Date: Wed, 9 Oct 2024 09:58:09 +0200 Subject: [PATCH 2/3] PMT-16: Add ObjectMapper and MockAPI to base IntegrationTest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Dominik Säume --- src/test/java/de/hmmh/pmt/IntegrationTest.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/test/java/de/hmmh/pmt/IntegrationTest.java b/src/test/java/de/hmmh/pmt/IntegrationTest.java index 1bc1a0c..bdcf3fa 100644 --- a/src/test/java/de/hmmh/pmt/IntegrationTest.java +++ b/src/test/java/de/hmmh/pmt/IntegrationTest.java @@ -1,12 +1,17 @@ package de.hmmh.pmt; +import com.fasterxml.jackson.databind.ObjectMapper; import de.hmmh.pmt.db.Project; import de.hmmh.pmt.db.ProjectRepository; +import de.hmmh.pmt.employee.ApiClientFactory; +import de.hmmh.pmt.employee.api.EmployeeControllerApi; +import de.hmmh.pmt.employee.api.QualificationControllerApi; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.web.servlet.MockMvc; @@ -23,8 +28,15 @@ public abstract class IntegrationTest { @Autowired protected MockMvc mvc; @Autowired + protected ObjectMapper objectMapper; + @Autowired protected ProjectRepository projectRepository; + @MockBean + protected EmployeeControllerApi mockEmployeeApi; + @MockBean + protected QualificationControllerApi mockQualificationApi; + @BeforeEach void setUp() { projectRepository.deleteAll(); From 137095814f2c8cdb1d67ae369634a7a844e990aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20S=C3=A4ume?= Date: Wed, 9 Oct 2024 10:05:55 +0200 Subject: [PATCH 3/3] PMT-16: Disable Parallel Unittests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Dominik Säume --- build.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/build.gradle.kts b/build.gradle.kts index 7b6b717..f290ba7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -110,6 +110,7 @@ tasks { } withType { useJUnitPlatform() + maxParallelForks = 1 } named("compileJava").configure { dependsOn(swaggerSources.getByName("pmt").code)