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 05e0f5e..7ea9b10 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 @@ -2,6 +2,8 @@ package hs.fulda.de.ci.exam.project; import java.sql.Time; +import static hs.fulda.de.ci.exam.project.FlightStatus.Cancelled; + public class FlightInstance { Time departureTime; String gate; @@ -24,7 +26,12 @@ public class FlightInstance { public FlightStatus getStatus() { return this.status; } - public void updateStatus(FlightStatus status){ + + public void updateStatus(FlightStatus status) { this.status = status; } + + public boolean cancel() { + return true; + } } 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 9dd9578..5dd0106 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,8 +4,7 @@ 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 hs.fulda.de.ci.exam.project.FlightStatus.*; import static org.assertj.core.api.Assertions.*; class FlightInstanceTest { @@ -13,24 +12,30 @@ class FlightInstanceTest { FlightInstance fInstance1 = new FlightInstance(today, "G15", InAir); @Test - void getDepartureTime(){ + void getDepartureTime() { assertThat(fInstance1.getDepartureTime()).describedAs("get departure time of flight isntance").isEqualTo(Time.valueOf("13:45:40")); } @Test - void getGate(){ + void getGate() { assertThat(fInstance1.getGate()).describedAs("get gate number of flight isntance").isEqualTo("G15"); } @Test - void getStatus(){ + void getStatus() { assertThat(fInstance1.getStatus()).describedAs("get status of flight isntance").isEqualTo(InAir); } @Test - void updateStatus(){ + void updateStatus() { fInstance1.updateStatus(Arrived); assertThat(fInstance1.getStatus()).describedAs("get status of flight isntance").isEqualTo(Arrived); } + @Test + void cancel_FlightInstance() { + // TODO: 26.01.22 discuss + } + + } \ 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 e507625..acb5279 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