diff --git a/pom.xml b/pom.xml
index e361a07..65d348d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
4.0.0
de.olech2412.adapter
db-adapter-v6
- 2.2.0
+ 2.2.1
db-adapter-v6
This is an adapter for this rest-api: https://github.com/derhuerst/db-rest.
It can be used as a maven dependency and provides all models
diff --git a/release-changes.md b/release-changes.md
index 5ed12ed..f4e67b6 100644
--- a/release-changes.md
+++ b/release-changes.md
@@ -2,18 +2,27 @@
## Description
-This file contains the changes made in each release of the project since version 2.0.0
+This file contains the changes made in each release of the project since version 2.2.0
In the following table you can see the versions and the release dates of the project.
Click on the version to get to the release changes.
-| Version | Release Date |
-|---------------|--------------|
-| [2.0.0](#110) | unknown |
-
+| Version | Release Date | Release Type |
+|-----------------|--------------|--------------|
+| [2.2.1](#2.2.1) | 20.02.2024 | Minor |
+| [2.2.0](#2.2.0) | 20.02.2024 | Patch |
#TODO: Add the changes of the versions
-## 2.0.0
+## [2.2.1](#2.2.1) (20.02.2024) Patch Release
+
+### Bugfixes
+
+- Fixed a bug that the price class does not provide any getter or setter methods
+- Fixed a bug that the Location class (for journeys) does not provide any getter or setter methods
+
+## [2.2.0](#2.2.0) (20.02.2024) Minor Release
-### Description
+### Support for "journeys"
+- Added support for "journeys" in the project
+- Queries for journeys are now supported with the most features
\ No newline at end of file
diff --git a/src/main/java/de/olech2412/adapter/dbadapter/APIConfiguration.java b/src/main/java/de/olech2412/adapter/dbadapter/APIConfiguration.java
index f1e1391..1f9f2aa 100644
--- a/src/main/java/de/olech2412/adapter/dbadapter/APIConfiguration.java
+++ b/src/main/java/de/olech2412/adapter/dbadapter/APIConfiguration.java
@@ -25,7 +25,7 @@ public class APIConfiguration {
@Setter
private Proxy proxy;
-
+
public APIConfiguration() {
buildRequestList();
}
diff --git a/src/main/java/de/olech2412/adapter/dbadapter/DB_Adapter_v6.java b/src/main/java/de/olech2412/adapter/dbadapter/DB_Adapter_v6.java
index 1167869..062761a 100644
--- a/src/main/java/de/olech2412/adapter/dbadapter/DB_Adapter_v6.java
+++ b/src/main/java/de/olech2412/adapter/dbadapter/DB_Adapter_v6.java
@@ -178,6 +178,7 @@ private Request getRequest(RequestPath requestPath) {
/**
* Perform the request
+ *
* @param request the request
* @return the result of the request
* @throws IOException if the request fails
diff --git a/src/main/java/de/olech2412/adapter/dbadapter/model/journey/sub/Location.java b/src/main/java/de/olech2412/adapter/dbadapter/model/journey/sub/Location.java
index d1f2739..e17bdf3 100644
--- a/src/main/java/de/olech2412/adapter/dbadapter/model/journey/sub/Location.java
+++ b/src/main/java/de/olech2412/adapter/dbadapter/model/journey/sub/Location.java
@@ -1,8 +1,15 @@
package de.olech2412.adapter.dbadapter.model.journey.sub;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
/**
* Represents a location in the system.
*/
+@Getter
+@Setter
+@ToString
public class Location {
/**
* The type of the location.
diff --git a/src/main/java/de/olech2412/adapter/dbadapter/model/journey/sub/Price.java b/src/main/java/de/olech2412/adapter/dbadapter/model/journey/sub/Price.java
index f5a07cd..79a3cf8 100644
--- a/src/main/java/de/olech2412/adapter/dbadapter/model/journey/sub/Price.java
+++ b/src/main/java/de/olech2412/adapter/dbadapter/model/journey/sub/Price.java
@@ -1,8 +1,15 @@
package de.olech2412.adapter.dbadapter.model.journey.sub;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
/**
* Represents the price of a journey.
*/
+@Getter
+@Setter
+@ToString
public class Price {
/**
* The amount of the price.
diff --git a/src/main/java/de/olech2412/adapter/dbadapter/model/stop/sub/Mode.java b/src/main/java/de/olech2412/adapter/dbadapter/model/stop/sub/Mode.java
index 5a45bd7..9d97180 100644
--- a/src/main/java/de/olech2412/adapter/dbadapter/model/stop/sub/Mode.java
+++ b/src/main/java/de/olech2412/adapter/dbadapter/model/stop/sub/Mode.java
@@ -14,16 +14,6 @@
public enum Mode {
BUS, TAXI, WATERCRAFT, TRAIN;
- public String toValue() {
- switch (this) {
- case BUS: return "bus";
- case TAXI: return "taxi";
- case WATERCRAFT: return "watercraft";
- case TRAIN: return "train";
- }
- return null;
- }
-
public static Mode forValue(String value) throws IOException {
if (value.equals("bus")) return BUS;
if (value.equals("taxi")) return TAXI;
@@ -32,6 +22,20 @@ public static Mode forValue(String value) throws IOException {
throw new IOException("Cannot deserialize Mode");
}
+ public String toValue() {
+ switch (this) {
+ case BUS:
+ return "bus";
+ case TAXI:
+ return "taxi";
+ case WATERCRAFT:
+ return "watercraft";
+ case TRAIN:
+ return "train";
+ }
+ return null;
+ }
+
// custom ModeTypeAdapter for gson
public static class ModeTypeAdapter extends TypeAdapter {
diff --git a/src/test/java/de/olech2412/adapter/dbadapter/exception/ErrorTest.java b/src/test/java/de/olech2412/adapter/dbadapter/exception/ErrorTest.java
new file mode 100644
index 0000000..39724c7
--- /dev/null
+++ b/src/test/java/de/olech2412/adapter/dbadapter/exception/ErrorTest.java
@@ -0,0 +1,48 @@
+package de.olech2412.adapter.dbadapter.exception;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+class ErrorTest {
+
+ @Test
+ void creatingErrorShouldSetMessageAndCode() {
+ String message = "Error Message";
+ int code = 404;
+ Error error = new Error() {
+ @Override
+ public String getMessage() {
+ return message;
+ }
+
+ @Override
+ public int getCode() {
+ return code;
+ }
+ };
+
+ assertEquals(message, error.getMessage());
+ assertEquals(code, error.getCode());
+ }
+
+ @Test
+ void getErrorShouldReturnFormattedErrorMessage() {
+ String message = "Error Message";
+ int code = 404;
+ Error error = new Error() {
+ @Override
+ public String getMessage() {
+ return message;
+ }
+
+ @Override
+ public int getCode() {
+ return code;
+ }
+ };
+
+ String expected = "404: Error Message";
+ assertEquals(expected, error.getError());
+ }
+}
\ No newline at end of file
diff --git a/src/test/java/de/olech2412/adapter/dbadapter/model/journey/JourneyTest.java b/src/test/java/de/olech2412/adapter/dbadapter/model/journey/JourneyTest.java
new file mode 100644
index 0000000..a75aa55
--- /dev/null
+++ b/src/test/java/de/olech2412/adapter/dbadapter/model/journey/JourneyTest.java
@@ -0,0 +1,72 @@
+package de.olech2412.adapter.dbadapter.model.journey;
+
+import de.olech2412.adapter.dbadapter.model.journey.sub.Leg;
+import de.olech2412.adapter.dbadapter.model.journey.sub.Price;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import java.util.Collections;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
+public class JourneyTest {
+ private Journey journey;
+
+ @BeforeEach
+ void setUp() {
+ journey = new Journey();
+ }
+
+ @Test
+ void shouldSetAndGetType() {
+ String expectedType = "TestType";
+ journey.setType(expectedType);
+ assertEquals(expectedType, journey.getType());
+ }
+
+ @Test
+ void shouldSetAndGetTypeWhenTypeIsNull() {
+ journey.setType(null);
+ assertNull(journey.getType());
+ }
+
+ @Test
+ void shouldSetAndGetLegs() {
+ Leg expectedLeg = new Leg();
+ journey.setLegs(Collections.singletonList(expectedLeg));
+ assertEquals(Collections.singletonList(expectedLeg), journey.getLegs());
+ }
+
+ @Test
+ void shouldSetAndGetLegsWhenLegsIsNull() {
+ journey.setLegs(null);
+ assertNull(journey.getLegs());
+ }
+
+ @Test
+ void shouldSetAndGetRefreshToken() {
+ String expectedRefreshToken = "TestRefreshToken";
+ journey.setRefreshToken(expectedRefreshToken);
+ assertEquals(expectedRefreshToken, journey.getRefreshToken());
+ }
+
+ @Test
+ void shouldSetAndGetRefreshTokenWhenRefreshTokenIsNull() {
+ journey.setRefreshToken(null);
+ assertNull(journey.getRefreshToken());
+ }
+
+ @Test
+ void shouldSetAndGetPrice() {
+ Price expectedPrice = new Price();
+ journey.setPrice(expectedPrice);
+ assertEquals(expectedPrice, journey.getPrice());
+ }
+
+ @Test
+ void shouldSetAndGetPriceWhenPriceIsNull() {
+ journey.setPrice(null);
+ assertNull(journey.getPrice());
+ }
+}
\ No newline at end of file
diff --git a/src/test/java/de/olech2412/adapter/dbadapter/model/journey/sub/FeatureTest.java b/src/test/java/de/olech2412/adapter/dbadapter/model/journey/sub/FeatureTest.java
new file mode 100644
index 0000000..49dae54
--- /dev/null
+++ b/src/test/java/de/olech2412/adapter/dbadapter/model/journey/sub/FeatureTest.java
@@ -0,0 +1,55 @@
+package de.olech2412.adapter.dbadapter.model.journey.sub;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
+public class FeatureTest {
+ private Feature feature;
+
+ @BeforeEach
+ void setUp() {
+ feature = new Feature();
+ }
+
+ @Test
+ void shouldSetAndGetType() {
+ String expectedType = "TestType";
+ feature.setType(expectedType);
+ assertEquals(expectedType, feature.getType());
+ }
+
+ @Test
+ void shouldSetAndGetTypeWhenTypeIsNull() {
+ feature.setType(null);
+ assertNull(feature.getType());
+ }
+
+ @Test
+ void shouldSetAndGetProperties() {
+ Properties expectedProperties = new Properties();
+ feature.setProperties(expectedProperties);
+ assertEquals(expectedProperties, feature.getProperties());
+ }
+
+ @Test
+ void shouldSetAndGetPropertiesWhenPropertiesIsNull() {
+ feature.setProperties(null);
+ assertNull(feature.getProperties());
+ }
+
+ @Test
+ void shouldSetAndGetGeometry() {
+ Geometry expectedGeometry = new Geometry();
+ feature.setGeometry(expectedGeometry);
+ assertEquals(expectedGeometry, feature.getGeometry());
+ }
+
+ @Test
+ void shouldSetAndGetGeometryWhenGeometryIsNull() {
+ feature.setGeometry(null);
+ assertNull(feature.getGeometry());
+ }
+}
\ No newline at end of file
diff --git a/src/test/java/de/olech2412/adapter/dbadapter/model/journey/sub/GeometryTest.java b/src/test/java/de/olech2412/adapter/dbadapter/model/journey/sub/GeometryTest.java
new file mode 100644
index 0000000..a4474d5
--- /dev/null
+++ b/src/test/java/de/olech2412/adapter/dbadapter/model/journey/sub/GeometryTest.java
@@ -0,0 +1,51 @@
+package de.olech2412.adapter.dbadapter.model.journey.sub;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+public class GeometryTest {
+ private Geometry geometry;
+
+ @BeforeEach
+ void setUp() {
+ geometry = new Geometry();
+ }
+
+ @Test
+ void shouldSetAndGetType() {
+ String expectedType = "Point";
+ geometry.setType(expectedType);
+ assertEquals(expectedType, geometry.getType());
+ }
+
+ @Test
+ void shouldSetAndGetTypeWhenTypeIsNull() {
+ geometry.setType(null);
+ assertNull(geometry.getType());
+ }
+
+ @Test
+ void shouldSetAndGetCoordinates() {
+ List expectedCoordinates = Arrays.asList(1.0, 2.0);
+ geometry.setCoordinates(expectedCoordinates);
+ assertEquals(expectedCoordinates, geometry.getCoordinates());
+ }
+
+ @Test
+ void shouldSetAndGetCoordinatesWhenCoordinatesIsNull() {
+ geometry.setCoordinates(null);
+ assertNull(geometry.getCoordinates());
+ }
+
+ @Test
+ void shouldSetAndGetCoordinatesWhenCoordinatesIsEmpty() {
+ geometry.setCoordinates(new ArrayList<>());
+ assertTrue(geometry.getCoordinates().isEmpty());
+ }
+}
\ No newline at end of file
diff --git a/src/test/java/de/olech2412/adapter/dbadapter/model/journey/sub/LegTest.java b/src/test/java/de/olech2412/adapter/dbadapter/model/journey/sub/LegTest.java
new file mode 100644
index 0000000..2b4484d
--- /dev/null
+++ b/src/test/java/de/olech2412/adapter/dbadapter/model/journey/sub/LegTest.java
@@ -0,0 +1,181 @@
+package de.olech2412.adapter.dbadapter.model.journey.sub;
+
+import de.olech2412.adapter.dbadapter.model.stop.Stop;
+import de.olech2412.adapter.dbadapter.model.stop.sub.Line;
+import de.olech2412.adapter.dbadapter.model.trip.sub.Remark;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import java.util.Collections;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class LegTest {
+ private Leg leg;
+
+ @BeforeEach
+ void setUp() {
+ leg = new Leg();
+ }
+
+ @Test
+ void shouldSetAndGetOrigin() {
+ Stop expectedOrigin = new Stop();
+ leg.setOrigin(expectedOrigin);
+ assertEquals(expectedOrigin, leg.getOrigin());
+ }
+
+ @Test
+ void shouldSetAndGetDestination() {
+ Stop expectedDestination = new Stop();
+ leg.setDestination(expectedDestination);
+ assertEquals(expectedDestination, leg.getDestination());
+ }
+
+ @Test
+ void shouldSetAndGetDeparture() {
+ String expectedDeparture = "10:00";
+ leg.setDeparture(expectedDeparture);
+ assertEquals(expectedDeparture, leg.getDeparture());
+ }
+
+ @Test
+ void shouldSetAndGetPlannedDeparture() {
+ String expectedPlannedDeparture = "10:00";
+ leg.setPlannedDeparture(expectedPlannedDeparture);
+ assertEquals(expectedPlannedDeparture, leg.getPlannedDeparture());
+ }
+
+ @Test
+ void shouldSetAndGetDepartureDelay() {
+ int expectedDepartureDelay = 5;
+ leg.setDepartureDelay(expectedDepartureDelay);
+ assertEquals(expectedDepartureDelay, leg.getDepartureDelay());
+ }
+
+ @Test
+ void shouldSetAndGetArrival() {
+ String expectedArrival = "11:00";
+ leg.setArrival(expectedArrival);
+ assertEquals(expectedArrival, leg.getArrival());
+ }
+
+ @Test
+ void shouldSetAndGetPlannedArrival() {
+ String expectedPlannedArrival = "11:00";
+ leg.setPlannedArrival(expectedPlannedArrival);
+ assertEquals(expectedPlannedArrival, leg.getPlannedArrival());
+ }
+
+ @Test
+ void shouldSetAndGetArrivalDelay() {
+ int expectedArrivalDelay = 10;
+ leg.setArrivalDelay(expectedArrivalDelay);
+ assertEquals(expectedArrivalDelay, leg.getArrivalDelay());
+ }
+
+ @Test
+ void shouldSetAndGetReachable() {
+ leg.setReachable(true);
+ assertTrue(leg.isReachable());
+ }
+
+ @Test
+ void shouldSetAndGetTripId() {
+ String expectedTripId = "12345";
+ leg.setTripId(expectedTripId);
+ assertEquals(expectedTripId, leg.getTripId());
+ }
+
+ @Test
+ void shouldSetAndGetLine() {
+ Line expectedLine = new Line();
+ leg.setLine(expectedLine);
+ assertEquals(expectedLine, leg.getLine());
+ }
+
+ @Test
+ void shouldSetAndGetDirection() {
+ String expectedDirection = "North";
+ leg.setDirection(expectedDirection);
+ assertEquals(expectedDirection, leg.getDirection());
+ }
+
+ @Test
+ void shouldSetAndGetLocation() {
+ Location expectedLocation = new Location();
+ leg.setCurrentLocation(expectedLocation);
+ assertEquals(expectedLocation, leg.getCurrentLocation());
+ }
+
+ @Test
+ void shouldSetAndGetArrivalPlatform() {
+ String expectedArrivalPlatform = "1";
+ leg.setArrivalPlatform(expectedArrivalPlatform);
+ assertEquals(expectedArrivalPlatform, leg.getArrivalPlatform());
+ }
+
+ @Test
+ void shouldSetAndGetPlannedArrivalPlatform() {
+ String expectedPlannedArrivalPlatform = "1";
+ leg.setPlannedArrivalPlatform(expectedPlannedArrivalPlatform);
+ assertEquals(expectedPlannedArrivalPlatform, leg.getPlannedArrivalPlatform());
+ }
+
+ @Test
+ void shouldSetAndGetArrivalPrognosisType() {
+ String expectedArrivalPrognosisType = "On Time";
+ leg.setArrivalPrognosisType(expectedArrivalPrognosisType);
+ assertEquals(expectedArrivalPrognosisType, leg.getArrivalPrognosisType());
+ }
+
+ @Test
+ void shouldSetAndGetDeparturePlatform() {
+ String expectedDeparturePlatform = "1";
+ leg.setDeparturePlatform(expectedDeparturePlatform);
+ assertEquals(expectedDeparturePlatform, leg.getDeparturePlatform());
+ }
+
+ @Test
+ void shouldSetAndGetPlannedDeparturePlatform() {
+ String expectedPlannedDeparturePlatform = "1";
+ leg.setPlannedDeparturePlatform(expectedPlannedDeparturePlatform);
+ assertEquals(expectedPlannedDeparturePlatform, leg.getPlannedDeparturePlatform());
+ }
+
+ @Test
+ void shouldSetAndGetDeparturePrognosisType() {
+ String expectedDeparturePrognosisType = "On Time";
+ leg.setDeparturePrognosisType(expectedDeparturePrognosisType);
+ assertEquals(expectedDeparturePrognosisType, leg.getDeparturePrognosisType());
+ }
+
+ @Test
+ void shouldSetAndGetRemarks() {
+ Remark expectedRemark = new Remark();
+ leg.setRemarks(Collections.singletonList(expectedRemark));
+ assertEquals(Collections.singletonList(expectedRemark), leg.getRemarks());
+ }
+
+ @Test
+ void shouldSetAndGetLoadFactor() {
+ String expectedLoadFactor = "High";
+ leg.setLoadFactor(expectedLoadFactor);
+ assertEquals(expectedLoadFactor, leg.getLoadFactor());
+ }
+
+ @Test
+ void shouldSetAndGetStopovers() {
+ Stopover expectedStopover = new Stopover();
+ leg.setStopovers(Collections.singletonList(expectedStopover));
+ assertEquals(Collections.singletonList(expectedStopover), leg.getStopovers());
+ }
+
+ @Test
+ void shouldSetAndGetPolyline() {
+ Polyline expectedPolyline = new Polyline();
+ leg.setPolyline(expectedPolyline);
+ assertEquals(expectedPolyline, leg.getPolyline());
+ }
+}
\ No newline at end of file
diff --git a/src/test/java/de/olech2412/adapter/dbadapter/model/journey/sub/LocationTest.java b/src/test/java/de/olech2412/adapter/dbadapter/model/journey/sub/LocationTest.java
new file mode 100644
index 0000000..b48e4d4
--- /dev/null
+++ b/src/test/java/de/olech2412/adapter/dbadapter/model/journey/sub/LocationTest.java
@@ -0,0 +1,38 @@
+package de.olech2412.adapter.dbadapter.model.journey.sub;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class LocationTest {
+
+ @Test
+ void shouldSetAndGetLatitude() {
+ Location location = new Location();
+ double expectedLatitude = 50.8503;
+ location.setLatitude(expectedLatitude);
+ assertEquals(expectedLatitude, location.getLatitude());
+ }
+
+ @Test
+ void shouldSetAndGetLatitudeWhenLatitudeIsZero() {
+ Location location = new Location();
+ location.setLatitude(0);
+ assertEquals(0, location.getLatitude());
+ }
+
+ @Test
+ void shouldSetAndGetLongitude() {
+ Location location = new Location();
+ double expectedLongitude = 4.3517;
+ location.setLongitude(expectedLongitude);
+ assertEquals(expectedLongitude, location.getLongitude());
+ }
+
+ @Test
+ void shouldSetAndGetLongitudeWhenLongitudeIsZero() {
+ Location location = new Location();
+ location.setLongitude(0);
+ assertEquals(0, location.getLongitude());
+ }
+}
\ No newline at end of file
diff --git a/src/test/java/de/olech2412/adapter/dbadapter/model/journey/sub/PolylineTest.java b/src/test/java/de/olech2412/adapter/dbadapter/model/journey/sub/PolylineTest.java
new file mode 100644
index 0000000..0b29107
--- /dev/null
+++ b/src/test/java/de/olech2412/adapter/dbadapter/model/journey/sub/PolylineTest.java
@@ -0,0 +1,44 @@
+package de.olech2412.adapter.dbadapter.model.journey.sub;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import java.util.Collections;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
+public class PolylineTest {
+ private Polyline polyline;
+
+ @BeforeEach
+ void setUp() {
+ polyline = new Polyline();
+ }
+
+ @Test
+ void shouldSetAndGetType() {
+ String expectedType = "TestType";
+ polyline.setType(expectedType);
+ assertEquals(expectedType, polyline.getType());
+ }
+
+ @Test
+ void shouldSetAndGetTypeWhenTypeIsNull() {
+ polyline.setType(null);
+ assertNull(polyline.getType());
+ }
+
+ @Test
+ void shouldSetAndGetFeatures() {
+ Feature expectedFeature = new Feature();
+ polyline.setFeatures(Collections.singletonList(expectedFeature));
+ assertEquals(Collections.singletonList(expectedFeature), polyline.getFeatures());
+ }
+
+ @Test
+ void shouldSetAndGetFeaturesWhenFeaturesIsNull() {
+ polyline.setFeatures(null);
+ assertNull(polyline.getFeatures());
+ }
+}
\ No newline at end of file
diff --git a/src/test/java/de/olech2412/adapter/dbadapter/model/journey/sub/PriceTest.java b/src/test/java/de/olech2412/adapter/dbadapter/model/journey/sub/PriceTest.java
new file mode 100644
index 0000000..fd14f6b
--- /dev/null
+++ b/src/test/java/de/olech2412/adapter/dbadapter/model/journey/sub/PriceTest.java
@@ -0,0 +1,56 @@
+package de.olech2412.adapter.dbadapter.model.journey.sub;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
+public class PriceTest {
+ private Price price;
+
+ @BeforeEach
+ void setUp() {
+ price = new Price();
+ }
+
+ @Test
+ void shouldSetAndGetAmount() {
+ double expectedAmount = 10.0;
+ price.setAmount(expectedAmount);
+ assertEquals(expectedAmount, price.getAmount());
+ }
+
+ @Test
+ void shouldSetAndGetAmountWhenAmountIsZero() {
+ double expectedAmount = 0.0;
+ price.setAmount(expectedAmount);
+ assertEquals(expectedAmount, price.getAmount());
+ }
+
+ @Test
+ void shouldSetAndGetCurrency() {
+ String expectedCurrency = "USD";
+ price.setCurrency(expectedCurrency);
+ assertEquals(expectedCurrency, price.getCurrency());
+ }
+
+ @Test
+ void shouldSetAndGetCurrencyWhenCurrencyIsNull() {
+ price.setCurrency(null);
+ assertNull(price.getCurrency());
+ }
+
+ @Test
+ void shouldSetAndGetHint() {
+ String expectedHint = "This is a hint.";
+ price.setHint(expectedHint);
+ assertEquals(expectedHint, price.getHint());
+ }
+
+ @Test
+ void shouldSetAndGetHintWhenHintIsNull() {
+ price.setHint(null);
+ assertNull(price.getHint());
+ }
+}
\ No newline at end of file
diff --git a/src/test/java/de/olech2412/adapter/dbadapter/model/journey/sub/PropertiesTest.java b/src/test/java/de/olech2412/adapter/dbadapter/model/journey/sub/PropertiesTest.java
new file mode 100644
index 0000000..6182b30
--- /dev/null
+++ b/src/test/java/de/olech2412/adapter/dbadapter/model/journey/sub/PropertiesTest.java
@@ -0,0 +1,29 @@
+package de.olech2412.adapter.dbadapter.model.journey.sub;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
+public class PropertiesTest {
+ private Properties properties;
+
+ @BeforeEach
+ void setUp() {
+ properties = new Properties();
+ }
+
+ @Test
+ void shouldSetAndGetName() {
+ String expectedName = "TestName";
+ properties.setName(expectedName);
+ assertEquals(expectedName, properties.getName());
+ }
+
+ @Test
+ void shouldSetAndGetNameWhenNameIsNull() {
+ properties.setName(null);
+ assertNull(properties.getName());
+ }
+}
\ No newline at end of file
diff --git a/src/test/java/de/olech2412/adapter/dbadapter/model/journey/sub/StopoverTest.java b/src/test/java/de/olech2412/adapter/dbadapter/model/journey/sub/StopoverTest.java
new file mode 100644
index 0000000..783e82f
--- /dev/null
+++ b/src/test/java/de/olech2412/adapter/dbadapter/model/journey/sub/StopoverTest.java
@@ -0,0 +1,186 @@
+package de.olech2412.adapter.dbadapter.model.journey.sub;
+
+import de.olech2412.adapter.dbadapter.model.stop.Stop;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
+public class StopoverTest {
+ private Stopover stopover;
+
+ @BeforeEach
+ void setUp() {
+ stopover = new Stopover();
+ }
+
+ @Test
+ void shouldSetAndGetStop() {
+ Stop expectedStop = new Stop();
+ stopover.setStop(expectedStop);
+ assertEquals(expectedStop, stopover.getStop());
+ }
+
+ @Test
+ void shouldSetAndGetStopWhenStopIsNull() {
+ stopover.setStop(null);
+ assertNull(stopover.getStop());
+ }
+
+ @Test
+ void shouldSetAndGetArrival() {
+ String expectedArrival = "10:00";
+ stopover.setArrival(expectedArrival);
+ assertEquals(expectedArrival, stopover.getArrival());
+ }
+
+ @Test
+ void shouldSetAndGetArrivalWhenArrivalIsNull() {
+ stopover.setArrival(null);
+ assertNull(stopover.getArrival());
+ }
+
+ @Test
+ void shouldSetAndGetPlannedArrival() {
+ String expectedPlannedArrival = "10:00";
+ stopover.setPlannedArrival(expectedPlannedArrival);
+ assertEquals(expectedPlannedArrival, stopover.getPlannedArrival());
+ }
+
+ @Test
+ void shouldSetAndGetPlannedArrivalWhenPlannedArrivalIsNull() {
+ stopover.setPlannedArrival(null);
+ assertNull(stopover.getPlannedArrival());
+ }
+
+ @Test
+ void shouldSetAndGetArrivalDelay() {
+ Integer expectedArrivalDelay = 5;
+ stopover.setArrivalDelay(expectedArrivalDelay);
+ assertEquals(expectedArrivalDelay, stopover.getArrivalDelay());
+ }
+
+ @Test
+ void shouldSetAndGetArrivalDelayWhenArrivalDelayIsNull() {
+ stopover.setArrivalDelay(null);
+ assertNull(stopover.getArrivalDelay());
+ }
+
+ @Test
+ void shouldSetAndGetArrivalPlatform() {
+ String expectedArrivalPlatform = "Platform 1";
+ stopover.setArrivalPlatform(expectedArrivalPlatform);
+ assertEquals(expectedArrivalPlatform, stopover.getArrivalPlatform());
+ }
+
+ @Test
+ void shouldSetAndGetArrivalPlatformWhenArrivalPlatformIsNull() {
+ stopover.setArrivalPlatform(null);
+ assertNull(stopover.getArrivalPlatform());
+ }
+
+ @Test
+ void shouldSetAndGetArrivalPrognosisType() {
+ String expectedArrivalPrognosisType = "On Time";
+ stopover.setArrivalPrognosisType(expectedArrivalPrognosisType);
+ assertEquals(expectedArrivalPrognosisType, stopover.getArrivalPrognosisType());
+ }
+
+ @Test
+ void shouldSetAndGetArrivalPrognosisTypeWhenArrivalPrognosisTypeIsNull() {
+ stopover.setArrivalPrognosisType(null);
+ assertNull(stopover.getArrivalPrognosisType());
+ }
+
+ @Test
+ void shouldSetAndGetPlannedArrivalPlatform() {
+ String expectedPlannedArrivalPlatform = "Platform 1";
+ stopover.setPlannedArrivalPlatform(expectedPlannedArrivalPlatform);
+ assertEquals(expectedPlannedArrivalPlatform, stopover.getPlannedArrivalPlatform());
+ }
+
+ @Test
+ void shouldSetAndGetPlannedArrivalPlatformWhenPlannedArrivalPlatformIsNull() {
+ stopover.setPlannedArrivalPlatform(null);
+ assertNull(stopover.getPlannedArrivalPlatform());
+ }
+
+ @Test
+ void shouldSetAndGetDeparture() {
+ String expectedDeparture = "11:00";
+ stopover.setDeparture(expectedDeparture);
+ assertEquals(expectedDeparture, stopover.getDeparture());
+ }
+
+ @Test
+ void shouldSetAndGetDepartureWhenDepartureIsNull() {
+ stopover.setDeparture(null);
+ assertNull(stopover.getDeparture());
+ }
+
+ @Test
+ void shouldSetAndGetPlannedDeparture() {
+ String expectedPlannedDeparture = "11:00";
+ stopover.setPlannedDeparture(expectedPlannedDeparture);
+ assertEquals(expectedPlannedDeparture, stopover.getPlannedDeparture());
+ }
+
+ @Test
+ void shouldSetAndGetPlannedDepartureWhenPlannedDepartureIsNull() {
+ stopover.setPlannedDeparture(null);
+ assertNull(stopover.getPlannedDeparture());
+ }
+
+ @Test
+ void shouldSetAndGetDepartureDelay() {
+ Integer expectedDepartureDelay = 5;
+ stopover.setDepartureDelay(expectedDepartureDelay);
+ assertEquals(expectedDepartureDelay, stopover.getDepartureDelay());
+ }
+
+ @Test
+ void shouldSetAndGetDepartureDelayWhenDepartureDelayIsNull() {
+ stopover.setDepartureDelay(null);
+ assertNull(stopover.getDepartureDelay());
+ }
+
+ @Test
+ void shouldSetAndGetDeparturePlatform() {
+ String expectedDeparturePlatform = "Platform 2";
+ stopover.setDeparturePlatform(expectedDeparturePlatform);
+ assertEquals(expectedDeparturePlatform, stopover.getDeparturePlatform());
+ }
+
+ @Test
+ void shouldSetAndGetDeparturePlatformWhenDeparturePlatformIsNull() {
+ stopover.setDeparturePlatform(null);
+ assertNull(stopover.getDeparturePlatform());
+ }
+
+ @Test
+ void shouldSetAndGetDeparturePrognosisType() {
+ String expectedDeparturePrognosisType = "Delayed";
+ stopover.setDeparturePrognosisType(expectedDeparturePrognosisType);
+ assertEquals(expectedDeparturePrognosisType, stopover.getDeparturePrognosisType());
+ }
+
+ @Test
+ void shouldSetAndGetDeparturePrognosisTypeWhenDeparturePrognosisTypeIsNull() {
+ stopover.setDeparturePrognosisType(null);
+ assertNull(stopover.getDeparturePrognosisType());
+ }
+
+ @Test
+ void shouldSetAndGetPlannedDeparturePlatform() {
+ String expectedPlannedDeparturePlatform = "Platform 2";
+ stopover.setPlannedDeparturePlatform(expectedPlannedDeparturePlatform);
+ assertEquals(expectedPlannedDeparturePlatform, stopover.getPlannedDeparturePlatform());
+ }
+
+ @Test
+ void shouldSetAndGetPlannedDeparturePlatformWhenPlannedDeparturePlatformIsNull() {
+ stopover.setPlannedDeparturePlatform(null);
+ assertNull(stopover.getPlannedDeparturePlatform());
+ }
+}
\ No newline at end of file