when(repositoryRegistry.getRepository(REPO_ID)).thenReturn(repository);
when(repository.getRepositoryContentClass()).thenReturn(MAVEN_2_CONTENT_CLASS);
when(repository.getLocalStatus()).thenReturn(LocalStatus.IN_SERVICE);
when(repository.getRepositoryKind()).thenReturn(repositoryKind);
when(repositoryKind.isFacetAvailable(GroupRepository.class)).thenReturn(false);
when(repository.adaptToFacet(MavenRepository.class)).thenReturn(mavenRepository);
when(mavenRepository.getRepositoryPolicy()).thenReturn(RepositoryPolicy.SNAPSHOT);
thrown.expect(IllegalArgumentException.class);
new DefaultReleaseRemover(repositoryRegistry, targetRegistry, mock(Walker.class), MAVEN_2_CONTENT_CLASS)
.removeReleases(new ReleaseRemovalRequest(REPO_ID, 1, null));