diff --git a/src/main/java/hs/fulda/de/ci/exam/project/FlightInstance.java b/src/main/java/hs/fulda/de/ci/exam/project/FlightInstance.java index 2d30288..05e0f5e 100644 --- a/src/main/java/hs/fulda/de/ci/exam/project/FlightInstance.java +++ b/src/main/java/hs/fulda/de/ci/exam/project/FlightInstance.java @@ -14,14 +14,17 @@ public class FlightInstance { } public Time getDepartureTime() { - return departureTime; + return this.departureTime; } public String getGate() { - return gate; + return this.gate; } public FlightStatus getStatus() { - return status; + return this.status; + } + public void updateStatus(FlightStatus status){ + this.status = status; } } diff --git a/src/test/java/hs/fulda/de/ci/exam/project/FlightInstanceTest.java b/src/test/java/hs/fulda/de/ci/exam/project/FlightInstanceTest.java index 1a3b81b..9dd9578 100644 --- a/src/test/java/hs/fulda/de/ci/exam/project/FlightInstanceTest.java +++ b/src/test/java/hs/fulda/de/ci/exam/project/FlightInstanceTest.java @@ -4,9 +4,9 @@ import org.junit.jupiter.api.Test; import java.sql.Time; +import static hs.fulda.de.ci.exam.project.FlightStatus.Arrived; import static hs.fulda.de.ci.exam.project.FlightStatus.InAir; import static org.assertj.core.api.Assertions.*; -import static org.junit.jupiter.api.Assertions.*; class FlightInstanceTest { Time today = Time.valueOf("13:45:40"); @@ -27,5 +27,10 @@ class FlightInstanceTest { assertThat(fInstance1.getStatus()).describedAs("get status of flight isntance").isEqualTo(InAir); } + @Test + void updateStatus(){ + fInstance1.updateStatus(Arrived); + assertThat(fInstance1.getStatus()).describedAs("get status of flight isntance").isEqualTo(Arrived); + } } \ No newline at end of file diff --git a/target/classes/hs/fulda/de/ci/exam/project/FlightInstance.class b/target/classes/hs/fulda/de/ci/exam/project/FlightInstance.class index 9e46705..e507625 100644 Binary files a/target/classes/hs/fulda/de/ci/exam/project/FlightInstance.class and b/target/classes/hs/fulda/de/ci/exam/project/FlightInstance.class differ