Browse Source

search flight should not be null

feature-pr-Admin
Sona Markosyan 3 years ago
parent
commit
f41c71f31f
  1. 8
      src/test/java/hs/fulda/de/ci/exam/project/AdminTest.java

8
src/test/java/hs/fulda/de/ci/exam/project/AdminTest.java

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