diff --git a/src/main/java/hs/fulda/de/ci/exam/project/Address.java b/src/main/java/hs/fulda/de/ci/exam/project/Address.java new file mode 100644 index 0000000..86898aa --- /dev/null +++ b/src/main/java/hs/fulda/de/ci/exam/project/Address.java @@ -0,0 +1,6 @@ +package hs.fulda.de.ci.exam.project; + +public class Address { + public Address(String streetAddress, String city, String state, String zipCode, String country) { + } +} 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 03173a0..75af1e7 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 @@ -2,6 +2,7 @@ package hs.fulda.de.ci.exam.project; public class Airport { + public Address address; protected String code; protected String name; @@ -12,4 +13,8 @@ public class Airport { public String getCode() { return this.code; } + + public Address getAddress() { + return this.address; + } } 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 101063d..38bc27e 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 @@ -1,10 +1,16 @@ package hs.fulda.de.ci.exam.project; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThat; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import static org.assertj.core.api.Assertions.*; +@ExtendWith(MockitoExtension.class) public class AirportClassTest { + + @Test void test_getName(){ Airport airport = new Airport(); @@ -19,4 +25,16 @@ public class AirportClassTest { assertThat(airport.getCode()).describedAs("get airport code").isEqualTo("PC994"); } + @Test + void test_getAddress(){ + Airport airport = new Airport(); + Address address = new Address("Mittelstr", "Fulda", "Hessen", "36037", "Germany"); + airport.address = address; + assertThat(airport.getAddress()).describedAs("get address of airport").isEqualTo(address); + } + + + + + } 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 ecca178..6818a52 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