From 97a5a6b64db849f3a32e263298f9e36257d0ea84 Mon Sep 17 00:00:00 2001 From: Imron Date: Wed, 26 Jan 2022 14:13:14 +0100 Subject: [PATCH] update flight instance status --- .../de/ci/exam/project/FlightInstance.java | 9 ++++++--- .../de/ci/exam/project/FlightInstanceTest.java | 7 ++++++- .../de/ci/exam/project/FlightInstance.class | Bin 949 -> 1088 bytes 3 files changed, 12 insertions(+), 4 deletions(-) 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 9e46705bb2bb68b8e841ca00492defa2a042e7e9..e5076258ff4a595e4e06f56bdc39cc3a8a7a2c32 100644 GIT binary patch delta 169 zcmdnWet<*e)W2Q(7#JAL8C1C#*cjwE8CV(QL4*Q`P-JINVrNj^sIr|=kf*dDC9xzm zxFoTpw3v}WS7Y*eMy-h-SSH_QRAp3|%*a&1$hx_T$&4{jnt_plA84i>0}~K3FtBN9 zZ)ITF2xKua2mnbgu&4~sd|3uTAYTlkib04$7{~*vXW(Yw0h+8r1)2s{M