diff --git a/src/main/java/hs/fulda/de/ci/exam/project/Airport.java b/src/main/java/hs/fulda/de/ci/exam/project/Airport.java index 75af1e7..673fcaa 100644 --- a/src/main/java/hs/fulda/de/ci/exam/project/Airport.java +++ b/src/main/java/hs/fulda/de/ci/exam/project/Airport.java @@ -1,8 +1,11 @@ package hs.fulda.de.ci.exam.project; +import java.util.LinkedList; + public class Airport { public Address address; + public LinkedList flights; protected String code; protected String name; @@ -17,4 +20,8 @@ public class Airport { public Address getAddress() { return this.address; } + + public LinkedList getFlights() { + return this.flights; + } } diff --git a/src/main/java/hs/fulda/de/ci/exam/project/ExampleClass.java b/src/main/java/hs/fulda/de/ci/exam/project/ExampleClass.java index 6969c70..10e23b9 100644 --- a/src/main/java/hs/fulda/de/ci/exam/project/ExampleClass.java +++ b/src/main/java/hs/fulda/de/ci/exam/project/ExampleClass.java @@ -4,5 +4,10 @@ import java.util.LinkedList; public class ExampleClass { public static void main(String[] args) { + LinkedList list = new LinkedList<>(); + list.add("heello"); + list.add("world"); + list.remove("heello"); + System.out.println(list); } } diff --git a/src/main/java/hs/fulda/de/ci/exam/project/Flight.java b/src/main/java/hs/fulda/de/ci/exam/project/Flight.java new file mode 100644 index 0000000..fc75e78 --- /dev/null +++ b/src/main/java/hs/fulda/de/ci/exam/project/Flight.java @@ -0,0 +1,4 @@ +package hs.fulda.de.ci.exam.project; + +public class Flight { +} diff --git a/src/test/java/hs/fulda/de/ci/exam/project/AirportClassTest.java b/src/test/java/hs/fulda/de/ci/exam/project/AirportClassTest.java index 38bc27e..f4b2f05 100644 --- a/src/test/java/hs/fulda/de/ci/exam/project/AirportClassTest.java +++ b/src/test/java/hs/fulda/de/ci/exam/project/AirportClassTest.java @@ -5,6 +5,8 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; +import java.util.LinkedList; + import static org.assertj.core.api.Assertions.*; @ExtendWith(MockitoExtension.class) @@ -33,6 +35,16 @@ public class AirportClassTest { assertThat(airport.getAddress()).describedAs("get address of airport").isEqualTo(address); } + @Test + void test_getFlights(){ + Airport airport = new Airport(); + LinkedList flights = new LinkedList<>(); + Flight flight1 = new Flight(); + flights.add(flight1); + airport.flights = flights; + assertThat(airport.getFlights()).describedAs("get all flights of the airport").isEqualTo(flights); + } + diff --git a/target/classes/hs/fulda/de/ci/exam/project/ExampleClass.class b/target/classes/hs/fulda/de/ci/exam/project/ExampleClass.class index 6818a52..ecca178 100644 Binary files a/target/classes/hs/fulda/de/ci/exam/project/ExampleClass.class and b/target/classes/hs/fulda/de/ci/exam/project/ExampleClass.class differ