|
@ -126,4 +126,13 @@ public class AdminTest { |
|
|
} |
|
|
} |
|
|
assertNotNull(admin.addAircraft("Boeing", "787", 2003)); |
|
|
assertNotNull(admin.addAircraft("Boeing", "787", 2003)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
public void testAddAircraft_throwsException() throws IOException { |
|
|
|
|
|
|
|
|
|
|
|
when(aircraftRepository.save(any(Aircraft.class))).thenThrow(IOException.class); |
|
|
|
|
|
assertThrows(IOException.class, () -> { |
|
|
|
|
|
admin.addAircraft("Boeing", "787", 2003); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
} |
|
|
} |