Compare commits

...

4 commits

Author SHA1 Message Date
5c06b052af Merge pull request 'bugfix/testing' (!8) from bugfix/testing into trunk
Some checks failed
Quality Check / Validate OAS (push) Successful in 29s
Quality Check / Linting (push) Has been cancelled
Quality Check / Static Analysis (push) Has been cancelled
Quality Check / Testing (push) Has been cancelled
Reviewed-on: #8
Reviewed-by: SZUT-Rajbir <rajbir2@schule.bremen.de>
Reviewed-by: SZUT-Ole <ole.kueck@hmmh.de>
2024-10-09 08:26:02 +00:00
137095814f
PMT-16: Disable Parallel Unittests
All checks were successful
Quality Check / Validate OAS (push) Successful in 3m53s
Quality Check / Linting (push) Successful in 4m26s
Quality Check / Static Analysis (push) Successful in 4m32s
Quality Check / Testing (push) Successful in 4m31s
Quality Check / Validate OAS (pull_request) Successful in 30s
Quality Check / Linting (pull_request) Successful in 1m7s
Quality Check / Testing (pull_request) Successful in 1m8s
Quality Check / Static Analysis (pull_request) Successful in 1m11s
Signed-off-by: Dominik Säume <Dominik.Saeume@hmmh.de>
2024-10-09 10:13:59 +02:00
13d5283b67
PMT-16: Add ObjectMapper and MockAPI to base IntegrationTest
Signed-off-by: Dominik Säume <Dominik.Saeume@hmmh.de>
2024-10-09 10:13:56 +02:00
dc018471b2
PMT-16: Change Java Datetime Library to be follow Spring Context.
Signed-off-by: Dominik Säume <Dominik.Saeume@hmmh.de>
2024-10-09 10:13:33 +02:00
3 changed files with 14 additions and 1 deletions

View file

@ -110,6 +110,7 @@ tasks {
}
withType<Test> {
useJUnitPlatform()
maxParallelForks = 1
}
named("compileJava").configure {
dependsOn(swaggerSources.getByName("pmt").code)

View file

@ -4,7 +4,7 @@
"invokerPackage": "de.hmmh.pmt",
"java8": false,
"java11": true,
"dateLibrary": "java11",
"dateLibrary": "java8-localdatetime",
"library": "spring-boot3",
"defaultInterfaces": false,
"serializableModel": true

View file

@ -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();