@ -37,5 +37,6 @@ public class FrontDeskOfficer extends Person{
public void validateItinerary(Itinerary itinerary){
itinerary.validateStartAirport();
itinerary.validateFinalAirport();
itinerary.validateCreationDate();
}
@ -82,5 +82,9 @@ public class Itinerary {
if(this.final_airport.getName().isBlank())
throw new RuntimeException(("Destination Airport Cannot be null or empty"));
public void validateCreationDate() {
if(this.creationDate.equals(null))
throw new RuntimeException(("Creation Date should not be null or empty"));
@ -36,7 +36,7 @@ public class FrontDeskOfficerTest {
@DisplayName("Should Not Create Itinerary when Destination Airport is null")
public void shouldThrowRuntimeExceptionWhenFinalAirportIsNull(){
assertThrows(RuntimeException.class, () -> {
frontDeskOfficer.createItinerary(airport_fr, null, new Date());
frontDeskOfficer.createItinerary(airport_fr, airport_be, null);
});