Extract deletion preconditions to its own class
Instead of spreading the assertions done before deleting a change in
several classes, extract them in a dedicated class, DeletePreconditions.
This eases the unit testing of the now simplified classes and better
reflects the fact that some of these assertions do not belong anymore to
the class where they were hosted. One example: the check for submodules
was in the DatabaseDeleteHandler class because this information used to
be in the database, but this is no longer the case.
Additional test coverage for this class will be provided in an upcoming
change adding IT tests.
Change-Id: Ie1f513f5981035aba217200f608c6ca6e6357cb1
9 files changed