Browse Source

update flight instance status

feature-flight-instance
Imron 3 years ago
parent
commit
97a5a6b64d
  1. 9
      src/main/java/hs/fulda/de/ci/exam/project/FlightInstance.java
  2. 7
      src/test/java/hs/fulda/de/ci/exam/project/FlightInstanceTest.java
  3. BIN
      target/classes/hs/fulda/de/ci/exam/project/FlightInstance.class

9
src/main/java/hs/fulda/de/ci/exam/project/FlightInstance.java

@ -14,14 +14,17 @@ public class FlightInstance {
} }
public Time getDepartureTime() { public Time getDepartureTime() {
return departureTime;
return this.departureTime;
} }
public String getGate() { public String getGate() {
return gate;
return this.gate;
} }
public FlightStatus getStatus() { public FlightStatus getStatus() {
return status;
return this.status;
}
public void updateStatus(FlightStatus status){
this.status = status;
} }
} }

7
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 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.InAir;
import static org.assertj.core.api.Assertions.*; import static org.assertj.core.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.*;
class FlightInstanceTest { class FlightInstanceTest {
Time today = Time.valueOf("13:45:40"); Time today = Time.valueOf("13:45:40");
@ -27,5 +27,10 @@ class FlightInstanceTest {
assertThat(fInstance1.getStatus()).describedAs("get status of flight isntance").isEqualTo(InAir); 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);
}
} }

BIN
target/classes/hs/fulda/de/ci/exam/project/FlightInstance.class

Loading…
Cancel
Save