|
@ -110,4 +110,12 @@ public class AdminTest { |
|
|
assertEquals(admin.searchFlights("1"), flight1.toString()); |
|
|
assertEquals(admin.searchFlights("1"), flight1.toString()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
public void test_searchFlightThrowsExceptionWhenBlank(){ |
|
|
|
|
|
when(flightRepository.findFlightByFlightNumber(any(String.class))).thenReturn(""); |
|
|
|
|
|
assertThrows(RuntimeException.class, () -> { |
|
|
|
|
|
admin.searchFlights("1"); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |