wip: input data fixed

This commit is contained in:
Jan 2026-02-06 14:37:54 +01:00
parent b389480cc8
commit adf3666430
5 changed files with 191 additions and 88 deletions

74
.gitea/workflows/test.yml Normal file
View file

@ -0,0 +1,74 @@
name: Tests
on:
push:
branches: [main, dev]
pull_request:
branches: [main]
env:
ALLURE_SERVER: "http://10.80.0.6:5050"
ALLURE_PROJECT: "lcc"
jobs:
test:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java 23
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '23'
cache: 'maven'
- name: Run Tests
run: mvn verify -B --no-transfer-progress
env:
TESTCONTAINERS_RYUK_DISABLED: "true"
- name: Prepare Allure Results
if: always()
run: |
cat > target/allure-results/executor.json << EOF
{
"name": "Gitea Actions",
"type": "gitea",
"buildName": "#${{ gitea.run_number }}",
"buildOrder": ${{ gitea.run_number }},
"buildUrl": "${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}"
}
EOF
- name: Upload to Allure
if: always()
run: |
# Projekt anlegen falls nicht vorhanden
curl -s -o /dev/null \
-u admin:${{ secrets.ALLURE_PASSWORD }} \
-X POST "${ALLURE_SERVER}/allure-docker-service/projects" \
-H "Content-Type: application/json" \
-d '{"id": "'${ALLURE_PROJECT}'"}' || true
# Results aufräumen
curl -s \
-u admin:${{ secrets.ALLURE_PASSWORD }} \
"${ALLURE_SERVER}/allure-docker-service/clean-results?project_id=${ALLURE_PROJECT}"
# Results hochladen
for f in target/allure-results/*; do
[ -f "$f" ] && curl -s \
-u admin:${{ secrets.ALLURE_PASSWORD }} \
-X POST "${ALLURE_SERVER}/allure-docker-service/send-results?project_id=${ALLURE_PROJECT}" \
-F "results[]=@$f"
done
# Report generieren
curl -s \
-u admin:${{ secrets.ALLURE_PASSWORD }} \
"${ALLURE_SERVER}/allure-docker-service/generate-report?project_id=${ALLURE_PROJECT}"

27
pom.xml
View file

@ -33,6 +33,13 @@
<flyway.version>11.18.0</flyway.version> <flyway.version>11.18.0</flyway.version>
</properties> </properties>
<dependencies> <dependencies>
<!-- Allure -->
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-junit5</artifactId>
<version>2.29.0</version>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId> <artifactId>spring-boot-starter-jdbc</artifactId>
@ -244,6 +251,13 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.9.21</version>
<scope>test</scope>
</dependency>
</dependencies> </dependencies>
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
@ -259,6 +273,7 @@
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId> <artifactId>versions-maven-plugin</artifactId>
@ -284,15 +299,25 @@
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>3.5.4</version> <version>3.5.4</version>
<configuration> <configuration>
<argLine> <argLine>
-javaagent:${settings.localRepository}/org/mockito/mockito-core/${mockito.version}/mockito-core-${mockito.version}.jar -javaagent:${settings.localRepository}/org/mockito/mockito-core/${mockito.version}/mockito-core-${mockito.version}.jar
-javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/1.9.22/aspectjweaver-1.9.22.jar
</argLine> </argLine>
<systemPropertyVariables>
<allure.results.directory>${project.build.directory}/allure-results</allure.results.directory>
</systemPropertyVariables>
</configuration> </configuration>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.9.21</version>
</dependency>
</dependencies>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>

View file

@ -68,7 +68,7 @@ public record TestCaseExpected(
return this; return this;
} }
public Builder d2d(double d2d) { public Builder d2d(Double d2d) {
this.d2d = d2d; this.d2d = d2d;
return this; return this;
} }

View file

@ -53,18 +53,18 @@ public final class TestCases {
.build(), .build(),
TestCaseExpected.builder() TestCaseExpected.builder()
.mekA(8.0) .mekA(8.0)
.logisticCost(33.75985361256046) .logisticCost(33.76)
.mekB(41.75985361256046) .mekB(41.76)
.fcaFee(0.0) .fcaFee(0.0)
.transportation(4.29165) .transportation(4.29)
.d2d(0.0) .d2d(0.0)
.airFreight(0.0) .airFreight(0.0)
.custom(0.0) .custom(0.0)
.repackaging(0.0) .repackaging(0.0)
.handling(4.392) .handling(4.392)
.disposal(0.0) .disposal(0.0)
.space(24.952728074399992) .space(24.95)
.capital(0.12347553816046966) .capital(0.12)
.safetyStock(10) .safetyStock(10)
.destinations(List.of( .destinations(List.of(
DestinationExpected.builder() DestinationExpected.builder()
@ -128,18 +128,18 @@ public final class TestCases {
.build(), .build(),
TestCaseExpected.builder() TestCaseExpected.builder()
.mekA(230.0) .mekA(230.0)
.logisticCost(1.413250548826279) .logisticCost(1.41)
.mekB(231.41325054882628) .mekB(231.41)
.fcaFee(0.46) .fcaFee(0.46)
.transportation(0.022133802105263157) .transportation(0.02)
.d2d(0.0) .d2d(0.0)
.airFreight(0.0) .airFreight(0.0)
.custom(0.0) .custom(0.0)
.repackaging(0.001613157894736842) .repackaging(0.00)
.handling(0.001530701754385965) .handling(0.00)
.disposal(0.003907894736842105) .disposal(0.00)
.space(0.009627000252631579) .space(0.01)
.capital(0.9144379920824194) .capital(0.91)
.safetyStock(10) .safetyStock(10)
.destinations(List.of( .destinations(List.of(
DestinationExpected.builder() DestinationExpected.builder()
@ -214,18 +214,18 @@ public final class TestCases {
.build(), .build(),
TestCaseExpected.builder() TestCaseExpected.builder()
.mekA(11.0) .mekA(11.0)
.logisticCost(0.33018468622916425) .logisticCost(0.33)
.mekB(11.330184686229165) .mekB(11.33)
.fcaFee(0.022) .fcaFee(0.022)
.transportation(0.05941010149411764) .transportation(0.06)
.d2d(0.0) .d2d(0.0)
.airFreight(0.0) .airFreight(0.0)
.custom(0.2058839717254) .custom(0.21)
.repackaging(0.003) .repackaging(0.00)
.handling(0.004015905882352942) .handling(0.00)
.disposal(0.001411764705882353) .disposal(0.00)
.space(0.007002467458823528) .space(0.00)
.capital(0.02746047496258778) .capital(0.03)
.safetyStock(10) .safetyStock(10)
.destinations(List.of( .destinations(List.of(
DestinationExpected.builder() DestinationExpected.builder()
@ -290,18 +290,18 @@ public final class TestCases {
.build(), .build(),
TestCaseExpected.builder() TestCaseExpected.builder()
.mekA(11.0) .mekA(11.0)
.logisticCost(0.33666333119914466) .logisticCost(0.34)
.mekB(11.336663331199144) .mekB(11.34)
.fcaFee(0.022) .fcaFee(0.02)
.transportation(0.0644631867) .transportation(0.06)
.d2d(0.0) .d2d(0.0)
.airFreight(0.0) .airFreight(0.0)
.custom(0.2094698741739) .custom(0.21)
.repackaging(0.0) .repackaging(0.0)
.handling(0.0054199999999999995) .handling(0.01)
.disposal(0.0) .disposal(0.0)
.space(0.0057600941999999995) .space(0.01)
.capital(0.029550176125244645) .capital(0.03)
.safetyStock(10) .safetyStock(10)
.destinations(List.of( .destinations(List.of(
DestinationExpected.builder() DestinationExpected.builder()
@ -354,18 +354,18 @@ public final class TestCases {
.build(), .build(),
TestCaseExpected.builder() TestCaseExpected.builder()
.mekA(56.87) .mekA(56.87)
.logisticCost(2.5379307573423042) .logisticCost(2.54)
.mekB(59.4079307573423) .mekB(59.41)
.fcaFee(0.0) .fcaFee(0.0)
.transportation(0.0) .transportation(0.0)
.d2d(0.026309523809523814) .d2d(0.026)
.airFreight(0.0) .airFreight(0.0)
.custom(1.7083476190476192) .custom(1.71)
.repackaging(0.0) .repackaging(0.0)
.handling(0.0008798333333333333) .handling(0.00)
.disposal(0.0006) .disposal(0.00)
.space(0.0010396970030999997) .space(0.00)
.capital(0.8007540841487281) .capital(0.80)
.safetyStock(10) .safetyStock(10)
.destinations(List.of( .destinations(List.of(
DestinationExpected.builder() DestinationExpected.builder()
@ -433,18 +433,18 @@ public final class TestCases {
.build(), .build(),
TestCaseExpected.builder() TestCaseExpected.builder()
.mekA(8.0) .mekA(8.0)
.logisticCost(8.612428329367493) .logisticCost(8.61)
.mekB(16.612428329367493) .mekB(16.61)
.fcaFee(0.016) .fcaFee(0.02)
.transportation(0.0) .transportation(0.0)
.d2d(8.0) .d2d(8.0)
.airFreight(0.0) .airFreight(0.0)
.custom(0.0) .custom(0.0)
.repackaging(0.039999999999999994) .repackaging(0.04)
.handling(0.245) .handling(0.245)
.disposal(0.0028333333333333335) .disposal(0.00)
.space(0.16635152049599994) .space(0.17)
.capital(0.1422434755381605) .capital(0.14)
.safetyStock(10) .safetyStock(10)
.destinations(List.of( .destinations(List.of(
DestinationExpected.builder() DestinationExpected.builder()
@ -525,18 +525,18 @@ public final class TestCases {
.build(), .build(),
TestCaseExpected.builder() TestCaseExpected.builder()
.mekA(18.2) .mekA(18.2)
.logisticCost(0.3853939170089231) .logisticCost(0.36)
.mekB(18.585393917008922) .mekB(18.59)
.fcaFee(0.0) .fcaFee(0.0)
.transportation(0.0) .transportation(0.0)
.d2d(0.06923307692307692) .d2d(0.07)
.airFreight(0.0) .airFreight(0.0)
.custom(0.0) .custom(0.0)
.repackaging(0.0025984615384615386) .repackaging(0.00)
.handling(0.007116923076923077) .handling(0.01)
.disposal(0.002653846153846154) .disposal(0.00)
.space(0.028791609316615382) .space(0.03)
.capital(0.275) .capital(0.28)
.safetyStock(10) .safetyStock(10)
.destinations(List.of( .destinations(List.of(
DestinationExpected.builder() DestinationExpected.builder()
@ -603,18 +603,18 @@ public final class TestCases {
.build(), .build(),
TestCaseExpected.builder() TestCaseExpected.builder()
.mekA(56.87) .mekA(56.87)
.logisticCost(5.227211225310775) .logisticCost(5.23)
.mekB(62.09721122531077) .mekB(62.10)
.fcaFee(0.11374) .fcaFee(0.11)
.transportation(0.0) .transportation(0.0)
.d2d(0.39) .d2d(0.39)
.airFreight(0.0115344) .airFreight(0.01)
.custom(1.7247122) .custom(1.72)
.repackaging(0.00034144) .repackaging(0.00)
.handling(0.00047695999999999996) .handling(0.00)
.disposal(0.0006) .disposal(0.00)
.space(0.007485818422319998) .space(0.01)
.capital(2.9783204068884546) .capital(2.98)
.safetyStock(100) .safetyStock(100)
.destinations(List.of( .destinations(List.of(
DestinationExpected.builder() DestinationExpected.builder()
@ -667,18 +667,18 @@ public final class TestCases {
.build(), .build(),
TestCaseExpected.builder() TestCaseExpected.builder()
.mekA(18.2) .mekA(18.2)
.logisticCost(2.9027159030831053) .logisticCost(2.90)
.mekB(21.102715903083105) .mekB(21.10)
.fcaFee(0.0) .fcaFee(0.0)
.transportation(0.0) .transportation(0.0)
.d2d(0.9) .d2d(0.9)
.airFreight(0.0) .airFreight(0.0)
.custom(0.58) .custom(0.58)
.repackaging(0.05173333333333333) .repackaging(0.05)
.handling(0.049493333333333334) .handling(0.05)
.disposal(0.04) .disposal(0.04)
.space(0.3302454007999999) .space(0.33)
.capital(0.9512438356164384) .capital(0.95)
.safetyStock(55) .safetyStock(55)
.destinations(List.of( .destinations(List.of(
DestinationExpected.builder() DestinationExpected.builder()
@ -729,18 +729,18 @@ public final class TestCases {
.build(), .build(),
TestCaseExpected.builder() TestCaseExpected.builder()
.mekA(8.0) .mekA(8.0)
.logisticCost(866.0954912837934) .logisticCost(866.10)
.mekB(874.0954912837934) .mekB(874.10)
.fcaFee(0.0) .fcaFee(0.0)
.transportation(836.22) .transportation(836.22)
.d2d(0.0) .d2d(0.0)
.airFreight(0.0) .airFreight(0.0)
.custom(0.0) .custom(0.0)
.repackaging(0.388) .repackaging(0.39)
.handling(4.392) .handling(4.39)
.disposal(0.0) .disposal(0.0)
.space(24.952728074399992) .space(24.95)
.capital(0.14276320939334639) .capital(0.14)
.safetyStock(10) .safetyStock(10)
.destinations(List.of( .destinations(List.of(
DestinationExpected.builder() DestinationExpected.builder()
@ -794,18 +794,18 @@ public final class TestCases {
.build(), .build(),
TestCaseExpected.builder() TestCaseExpected.builder()
.mekA(8.0) .mekA(8.0)
.logisticCost(108.85563974511213) .logisticCost(108.86)
.mekB(116.85563974511213) .mekB(116.86)
.fcaFee(0.016) .fcaFee(0.02)
.transportation(104.5275) .transportation(104.53)
.d2d(0.0) .d2d(0.0)
.airFreight(0.0) .airFreight(0.0)
.custom(0.0) .custom(0.0)
.repackaging(0.3) .repackaging(0.3)
.handling(0.45) .handling(0.45)
.disposal(0.3) .disposal(0.3)
.space(3.119091009299999) .space(3.12)
.capital(0.1430487358121331) .capital(0.14)
.safetyStock(10) .safetyStock(10)
.destinations(List.of( .destinations(List.of(
DestinationExpected.builder() DestinationExpected.builder()
@ -856,13 +856,13 @@ public final class TestCases {
.build(), .build(),
TestCaseExpected.builder() TestCaseExpected.builder()
.mekA(8.0) .mekA(8.0)
.logisticCost(11.186192) .logisticCost(11.19)
.mekB(19.186192) .mekB(19.19)
.fcaFee(0.016) .fcaFee(0.02)
.transportation(7.3) .transportation(7.3)
.d2d(0.0) .d2d(0.0)
.airFreight(3.4603200000000007) .airFreight(3.46)
.custom(0.40987200000000007) .custom(0.41)
.repackaging(0.0) .repackaging(0.0)
.handling(0.0) .handling(0.0)
.disposal(0.0) .disposal(0.0)

View file

@ -12,6 +12,10 @@ INSERT INTO sys_user_group_mapping (group_id, user_id)
VALUES ((SELECT id FROM sys_group WHERE group_name = 'super'), VALUES ((SELECT id FROM sys_group WHERE group_name = 'super'),
(SELECT id FROM sys_user WHERE email = 'john.doe@company.com')); (SELECT id FROM sys_user WHERE email = 'john.doe@company.com'));
INSERT INTO sys_user_group_mapping (group_id, user_id)
VALUES ((SELECT id FROM sys_group WHERE group_name = 'right-management'),
(SELECT id FROM sys_user WHERE email = 'john.doe@company.com'));
INSERT INTO sys_user_group_mapping (group_id, user_id) INSERT INTO sys_user_group_mapping (group_id, user_id)
VALUES ((SELECT id FROM sys_group WHERE group_name = 'basic'), VALUES ((SELECT id FROM sys_group WHERE group_name = 'basic'),
(SELECT id FROM sys_user WHERE email = 'sarah.smith@company.com')); (SELECT id FROM sys_user WHERE email = 'sarah.smith@company.com'));