use of org.apache.archiva.rest.api.model.BrowseResult in project archiva by apache.
the class RepositoriesServiceTest method deleteGroupId.
@Test
public void deleteGroupId() throws Exception {
initSourceTargetRepo();
try {
BrowseService browseService = getBrowseService(authorizationHeader, false);
BrowseResult browseResult = browseService.browseGroupId("org.apache.karaf.features", SOURCE_REPO_ID);
assertNotNull(browseResult);
log.info("browseResult: {}", browseResult);
assertThat(browseResult.getBrowseResultEntries()).isNotNull().isNotEmpty().contains(new BrowseResultEntry("org.apache.karaf.features.org.apache.karaf.features.command", true), new BrowseResultEntry("org.apache.karaf.features.org.apache.karaf.features.core", true));
Path directory = Paths.get("target/test-origin-repo/org/apache/karaf/features/org.apache.karaf.features.command");
assertTrue("directory not exists", Files.exists(directory));
RepositoriesService repositoriesService = getRepositoriesService(authorizationHeader);
repositoriesService.deleteGroupId("org.apache.karaf", SOURCE_REPO_ID);
assertFalse("directory not exists", Files.exists(directory));
browseResult = browseService.browseGroupId("org.apache.karaf.features", SOURCE_REPO_ID);
assertNotNull(browseResult);
assertThat(browseResult.getBrowseResultEntries()).isNotNull().isEmpty();
browseResult = browseService.browseGroupId("org.apache.karaf", SOURCE_REPO_ID);
assertNotNull(browseResult);
assertThat(browseResult.getBrowseResultEntries()).isNotNull().isEmpty();
log.info("browseResult empty: {}", browseResult);
} finally {
cleanRepos();
}
}
Aggregations