Skip to content

Commit 7cf0dc5

Browse files
committed
Fix BaseRepositoryTests - handle package types that don't support local repos
Fixed P2PackageTypeRepositoryTests failure by checking if the package type supports local repositories before creating virtualRepoIncludedRepo. For package types that don't support local repos (like P2), we now fall back to using GenericRepositorySettingsImpl. This ensures virtualRepoIncludedRepo can always be created as a local repository. This fixes: "Package type 'p2' is not supported in local repositories"
1 parent e5a50fe commit 7cf0dc5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

services/src/test/groovy/org/jfrog/artifactory/client/BaseRepositoryTests.groovy

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,11 @@ abstract class BaseRepositoryTests extends ArtifactoryTestsBase {
156156

157157
if (prepareVirtualRepo) {
158158
RepositorySettings settings = getRepositorySettings(RepositoryTypeImpl.VIRTUAL)
159-
RepositorySettings includedRepoSettings = settings ?: new GenericRepositorySettingsImpl()
159+
RepositorySettings includedRepoSettings = getRepositorySettings(RepositoryTypeImpl.LOCAL)
160+
161+
if (includedRepoSettings == null) {
162+
includedRepoSettings = new GenericRepositorySettingsImpl()
163+
}
160164

161165
virtualRepoIncludedRepo = artifactory.repositories().builders().localRepositoryBuilder()
162166
.key("$REPO_NAME_PREFIX-virtual-included-$id")

0 commit comments

Comments
 (0)