@Test
public void should_delete_existing_deploy_key_before_adding_new_one() throws IOException {
when(githubRepository.isPrivate()).thenReturn(true);
when(setupConfig.getDeployKey()).thenReturn("deploy_key");
GHDeployKey deployKey = mock(GHDeployKey.class);
when(deployKey.getKey()).thenReturn("deploy_key");
when(githubRepository.getDeployKeys()).thenReturn(Arrays.asList(deployKey));
githubRepositoryService.addDeployKey();
verify(deployKey).delete();