@ExtendWith(RepositoryManagementTestExecutionListener.class)
@Test
public void testRemoveRepositoryFromAssociatedGroups(@RawRepository(repositoryId = REPOSITORY_RELEASES_1) 
                                                     Repository releases1,
                                                     @Group(repositories = REPOSITORY_RELEASES_1)
                                                     @RawRepository(repositoryId = REPOSITORY_GROUP_1) 
                                                     Repository releasesGroup1,
                                                     @Group(repositories = REPOSITORY_RELEASES_1)
                                                     @RawRepository(repositoryId = REPOSITORY_GROUP_2) 
                                                     Repository releasesGroup2) throws IOException
{

    final String storageId = releases1.getStorage().getId();
    final String releases1Id = releases1.getId();
    assertThat(configurationManagementService.getConfiguration()
                                             .getGroupRepositoriesContaining(storageId, releases1Id))
            .as("Failed to add repository to group!")
            .hasSize(2);
    configurationManagementService.removeRepositoryFromAssociatedGroups(storageId,
                                                                        releases1Id);
    assertThat(configurationManagementService.getConfiguration()
                                             .getGroupRepositoriesContaining(storageId, releases1Id))
            .as("Failed to remove repository from all associated groups!")
            .isEmpty();
}