diff --git a/assembly/assembly-wsmaster-war/pom.xml b/assembly/assembly-wsmaster-war/pom.xml index 75e59b3650..b18fa33434 100644 --- a/assembly/assembly-wsmaster-war/pom.xml +++ b/assembly/assembly-wsmaster-war/pom.xml @@ -139,6 +139,10 @@ org.eclipse.che.core che-core-api-factory-bitbucket-server + + org.eclipse.che.core + che-core-api-factory-git-ssh + org.eclipse.che.core che-core-api-factory-github diff --git a/assembly/assembly-wsmaster-war/src/main/java/org/eclipse/che/api/deploy/WsMasterModule.java b/assembly/assembly-wsmaster-war/src/main/java/org/eclipse/che/api/deploy/WsMasterModule.java index 274c1ff2f8..97867dfe71 100644 --- a/assembly/assembly-wsmaster-war/src/main/java/org/eclipse/che/api/deploy/WsMasterModule.java +++ b/assembly/assembly-wsmaster-war/src/main/java/org/eclipse/che/api/deploy/WsMasterModule.java @@ -44,6 +44,8 @@ import org.eclipse.che.api.factory.server.bitbucket.BitbucketFactoryParametersRe import org.eclipse.che.api.factory.server.bitbucket.BitbucketScmFileResolver; import org.eclipse.che.api.factory.server.bitbucket.BitbucketServerAuthorizingFactoryParametersResolver; import org.eclipse.che.api.factory.server.bitbucket.BitbucketServerScmFileResolver; +import org.eclipse.che.api.factory.server.git.ssh.GitSshFactoryParametersResolver; +import org.eclipse.che.api.factory.server.git.ssh.GitSshScmFileResolver; import org.eclipse.che.api.factory.server.github.GithubFactoryParametersResolver; import org.eclipse.che.api.factory.server.github.GithubScmFileResolver; import org.eclipse.che.api.factory.server.gitlab.GitlabFactoryParametersResolver; @@ -175,6 +177,7 @@ public class WsMasterModule extends AbstractModule { factoryParametersResolverMultibinder .addBinding() .to(AzureDevOpsFactoryParametersResolver.class); + factoryParametersResolverMultibinder.addBinding().to(GitSshFactoryParametersResolver.class); Multibinder scmFileResolverResolverMultibinder = Multibinder.newSetBinder(binder(), ScmFileResolver.class); @@ -183,6 +186,7 @@ public class WsMasterModule extends AbstractModule { scmFileResolverResolverMultibinder.addBinding().to(GitlabScmFileResolver.class); scmFileResolverResolverMultibinder.addBinding().to(BitbucketServerScmFileResolver.class); scmFileResolverResolverMultibinder.addBinding().to(AzureDevOpsScmFileResolver.class); + scmFileResolverResolverMultibinder.addBinding().to(GitSshScmFileResolver.class); install(new org.eclipse.che.api.factory.server.scm.KubernetesScmModule()); install(new org.eclipse.che.api.factory.server.bitbucket.BitbucketServerModule()); diff --git a/pom.xml b/pom.xml index 93d2b0e19a..84971303ca 100644 --- a/pom.xml +++ b/pom.xml @@ -759,6 +759,11 @@ che-core-api-factory-bitbucket-server ${che.version} + + org.eclipse.che.core + che-core-api-factory-git-ssh + ${che.version} + org.eclipse.che.core che-core-api-factory-github diff --git a/wsmaster/che-core-api-factory-git-ssh/pom.xml b/wsmaster/che-core-api-factory-git-ssh/pom.xml new file mode 100644 index 0000000000..76fec090cd --- /dev/null +++ b/wsmaster/che-core-api-factory-git-ssh/pom.xml @@ -0,0 +1,112 @@ + + + + 4.0.0 + + che-master-parent + org.eclipse.che.core + 7.74.0-SNAPSHOT + + che-core-api-factory-git-ssh + jar + Che Core :: API :: Factory Resolver Git Ssh + + true + + + + jakarta.inject + jakarta.inject-api + + + jakarta.validation + jakarta.validation-api + + + org.eclipse.che.core + che-core-api-core + + + org.eclipse.che.core + che-core-api-dto + + + org.eclipse.che.core + che-core-api-factory + + + org.eclipse.che.core + che-core-api-factory-shared + + + org.eclipse.che.core + che-core-api-workspace + + + org.eclipse.che.core + che-core-api-workspace-shared + + + ch.qos.logback + logback-classic + test + + + com.github.tomakehurst + wiremock-jre8-standalone + test + + + jakarta.servlet + jakarta.servlet-api + test + + + jakarta.ws.rs + jakarta.ws.rs-api + test + + + org.eclipse.che.core + che-core-commons-json + test + + + org.hamcrest + hamcrest-core + test + + + org.mockito + mockito-core + test + + + org.mockito + mockito-testng + test + + + org.slf4j + jcl-over-slf4j + test + + + org.testng + testng + test + + + diff --git a/wsmaster/che-core-api-factory-git-ssh/src/main/java/org/eclipse/che/api/factory/server/git/ssh/GitSshAuthorizingFileContentProvider.java b/wsmaster/che-core-api-factory-git-ssh/src/main/java/org/eclipse/che/api/factory/server/git/ssh/GitSshAuthorizingFileContentProvider.java new file mode 100644 index 0000000000..094a2a2575 --- /dev/null +++ b/wsmaster/che-core-api-factory-git-ssh/src/main/java/org/eclipse/che/api/factory/server/git/ssh/GitSshAuthorizingFileContentProvider.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2012-2023 Red Hat, Inc. + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Red Hat, Inc. - initial API and implementation + */ +package org.eclipse.che.api.factory.server.git.ssh; + +import org.eclipse.che.api.factory.server.scm.AuthorizingFileContentProvider; +import org.eclipse.che.api.factory.server.scm.PersonalAccessTokenManager; +import org.eclipse.che.api.workspace.server.devfile.URLFetcher; + +/** + * Git Ssh specific authorizing file content provider. + * + * @author Anatolii Bazko + */ +class GitSshAuthorizingFileContentProvider extends AuthorizingFileContentProvider { + + GitSshAuthorizingFileContentProvider( + GitSshUrl gitSshUrl, + URLFetcher urlFetcher, + PersonalAccessTokenManager personalAccessTokenManager) { + super(gitSshUrl, urlFetcher, personalAccessTokenManager); + } +} diff --git a/wsmaster/che-core-api-factory-git-ssh/src/main/java/org/eclipse/che/api/factory/server/git/ssh/GitSshFactoryParametersResolver.java b/wsmaster/che-core-api-factory-git-ssh/src/main/java/org/eclipse/che/api/factory/server/git/ssh/GitSshFactoryParametersResolver.java new file mode 100644 index 0000000000..0d5add093e --- /dev/null +++ b/wsmaster/che-core-api-factory-git-ssh/src/main/java/org/eclipse/che/api/factory/server/git/ssh/GitSshFactoryParametersResolver.java @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2012-2023 Red Hat, Inc. + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Red Hat, Inc. - initial API and implementation + */ +package org.eclipse.che.api.factory.server.git.ssh; + +import static org.eclipse.che.api.factory.shared.Constants.CURRENT_VERSION; +import static org.eclipse.che.api.factory.shared.Constants.URL_PARAMETER_NAME; +import static org.eclipse.che.dto.server.DtoFactory.newDto; + +import jakarta.validation.constraints.NotNull; +import java.util.Map; +import javax.inject.Inject; +import javax.inject.Singleton; +import org.eclipse.che.api.core.ApiException; +import org.eclipse.che.api.factory.server.RawDevfileUrlFactoryParameterResolver; +import org.eclipse.che.api.factory.server.scm.PersonalAccessTokenManager; +import org.eclipse.che.api.factory.server.urlfactory.RemoteFactoryUrl; +import org.eclipse.che.api.factory.server.urlfactory.URLFactoryBuilder; +import org.eclipse.che.api.factory.shared.dto.FactoryDevfileV2Dto; +import org.eclipse.che.api.factory.shared.dto.FactoryDto; +import org.eclipse.che.api.factory.shared.dto.FactoryMetaDto; +import org.eclipse.che.api.factory.shared.dto.FactoryVisitor; +import org.eclipse.che.api.factory.shared.dto.ScmInfoDto; +import org.eclipse.che.api.workspace.server.devfile.URLFetcher; +import org.eclipse.che.api.workspace.shared.dto.devfile.ProjectDto; +import org.eclipse.che.api.workspace.shared.dto.devfile.SourceDto; + +/** + * Provides Factory Parameters resolver for Git Ssh repositories. + * + * @author Anatolii Bazko + */ +@Singleton +public class GitSshFactoryParametersResolver extends RawDevfileUrlFactoryParameterResolver { + + private final GitSshURLParser gitSshURLParser; + + private final PersonalAccessTokenManager personalAccessTokenManager; + + @Inject + public GitSshFactoryParametersResolver( + GitSshURLParser gitSshURLParser, + URLFetcher urlFetcher, + URLFactoryBuilder urlFactoryBuilder, + PersonalAccessTokenManager personalAccessTokenManager) { + super(urlFactoryBuilder, urlFetcher); + this.gitSshURLParser = gitSshURLParser; + this.personalAccessTokenManager = personalAccessTokenManager; + } + + @Override + public boolean accept(@NotNull final Map factoryParameters) { + return factoryParameters.containsKey(URL_PARAMETER_NAME) + && gitSshURLParser.isValid(factoryParameters.get(URL_PARAMETER_NAME)); + } + + @Override + public FactoryMetaDto createFactory(@NotNull final Map factoryParameters) + throws ApiException { + // no need to check null value of url parameter as accept() method has performed the check + final GitSshUrl gitSshUrl = gitSshURLParser.parse(factoryParameters.get(URL_PARAMETER_NAME)); + + // create factory from the following location if location exists, else create default factory + return urlFactoryBuilder + .createFactoryFromDevfile( + gitSshUrl, + new GitSshAuthorizingFileContentProvider( + gitSshUrl, urlFetcher, personalAccessTokenManager), + extractOverrideParams(factoryParameters), + true) + .orElseGet(() -> newDto(FactoryDto.class).withV(CURRENT_VERSION).withSource("repo")) + .acceptVisitor(new GitSshFactoryVisitor(gitSshUrl)); + } + + /** + * Visitor that puts the default devfile or updates devfile projects into the Git Ssh Factory, if + * needed. + */ + private class GitSshFactoryVisitor implements FactoryVisitor { + + private final GitSshUrl gitSshUrl; + + private GitSshFactoryVisitor(GitSshUrl gitSshUrl) { + this.gitSshUrl = gitSshUrl; + } + + @Override + public FactoryDevfileV2Dto visit(FactoryDevfileV2Dto factoryDto) { + ScmInfoDto scmInfo = + newDto(ScmInfoDto.class) + .withScmProviderName(gitSshUrl.getProviderName()) + .withRepositoryUrl(gitSshUrl.getRepositoryLocation()); + return factoryDto.withScmInfo(scmInfo); + } + + @Override + public FactoryDto visit(FactoryDto factory) { + if (factory.getDevfile() == null) { + factory.setDevfile(urlFactoryBuilder.buildDefaultDevfile(gitSshUrl.getRepository())); + } + + updateProjects( + factory.getDevfile(), + () -> + newDto(ProjectDto.class) + .withSource( + newDto(SourceDto.class) + .withLocation(gitSshUrl.getRepositoryLocation()) + .withType("git")) + .withName(gitSshUrl.getRepository()), + project -> {}); + + return factory; + } + } + + @Override + public RemoteFactoryUrl parseFactoryUrl(String factoryUrl) { + return gitSshURLParser.parse(factoryUrl); + } +} diff --git a/wsmaster/che-core-api-factory-git-ssh/src/main/java/org/eclipse/che/api/factory/server/git/ssh/GitSshScmFileResolver.java b/wsmaster/che-core-api-factory-git-ssh/src/main/java/org/eclipse/che/api/factory/server/git/ssh/GitSshScmFileResolver.java new file mode 100644 index 0000000000..a28b208cb8 --- /dev/null +++ b/wsmaster/che-core-api-factory-git-ssh/src/main/java/org/eclipse/che/api/factory/server/git/ssh/GitSshScmFileResolver.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2012-2023 Red Hat, Inc. + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Red Hat, Inc. - initial API and implementation + */ +package org.eclipse.che.api.factory.server.git.ssh; + +import jakarta.validation.constraints.NotNull; +import javax.inject.Inject; +import org.eclipse.che.api.factory.server.ScmFileResolver; + +/** + * Git Ssh specific SCM file resolver. + * + * @author Anatolii Bazko + */ +public class GitSshScmFileResolver implements ScmFileResolver { + + private final GitSshURLParser gitSshURLParser; + + @Inject + public GitSshScmFileResolver(GitSshURLParser gitSshURLParser) { + this.gitSshURLParser = gitSshURLParser; + } + + @Override + public boolean accept(@NotNull String repository) { + return gitSshURLParser.isValid(repository); + } + + /** + * There is no way to get a file content from a git repository via ssh protocol. So this method + * always returns an empty string. It allows to start a workspace from an empty devfile. + */ + @Override + public String fileContent(@NotNull String repository, @NotNull String filePath) { + return ""; + } +} diff --git a/wsmaster/che-core-api-factory-git-ssh/src/main/java/org/eclipse/che/api/factory/server/git/ssh/GitSshURLParser.java b/wsmaster/che-core-api-factory-git-ssh/src/main/java/org/eclipse/che/api/factory/server/git/ssh/GitSshURLParser.java new file mode 100644 index 0000000000..9c25e825b7 --- /dev/null +++ b/wsmaster/che-core-api-factory-git-ssh/src/main/java/org/eclipse/che/api/factory/server/git/ssh/GitSshURLParser.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2012-2023 Red Hat, Inc. + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Red Hat, Inc. - initial API and implementation + */ +package org.eclipse.che.api.factory.server.git.ssh; + +import static java.lang.String.format; +import static java.util.regex.Pattern.compile; + +import jakarta.validation.constraints.NotNull; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.inject.Inject; +import javax.inject.Singleton; +import org.eclipse.che.api.factory.server.urlfactory.DevfileFilenamesProvider; + +/** + * Parser of String Git Ssh URLs and provide {@link GitSshUrl} objects. + * + * @author Anatolii Bazko + */ +@Singleton +public class GitSshURLParser { + + private final Pattern gitSshPattern; + + private final DevfileFilenamesProvider devfileFilenamesProvider; + + @Inject + public GitSshURLParser(DevfileFilenamesProvider devfileFilenamesProvider) { + this.devfileFilenamesProvider = devfileFilenamesProvider; + this.gitSshPattern = compile("^git@(?[^:]++):(.*)/(?[^/]++)$"); + } + + public boolean isValid(@NotNull String url) { + return gitSshPattern.matcher(url).matches(); + } + + public GitSshUrl parse(String url) { + Matcher matcher = gitSshPattern.matcher(url); + if (!matcher.matches()) { + throw new IllegalArgumentException( + format("The given url %s is not a valid. It should start with git@", url)); + } + + String hostName = matcher.group("hostName"); + String repoName = matcher.group("repoName"); + if (repoName.endsWith(".git")) { + repoName = repoName.substring(0, repoName.length() - 4); + } + + return new GitSshUrl() + .withDevfileFilenames(devfileFilenamesProvider.getConfiguredDevfileFilenames()) + .withHostName(hostName) + .withRepository(repoName) + .withRepositoryLocation(url) + .withUrl(url); + } +} diff --git a/wsmaster/che-core-api-factory-git-ssh/src/main/java/org/eclipse/che/api/factory/server/git/ssh/GitSshUrl.java b/wsmaster/che-core-api-factory-git-ssh/src/main/java/org/eclipse/che/api/factory/server/git/ssh/GitSshUrl.java new file mode 100644 index 0000000000..ae180c9e07 --- /dev/null +++ b/wsmaster/che-core-api-factory-git-ssh/src/main/java/org/eclipse/che/api/factory/server/git/ssh/GitSshUrl.java @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2012-2023 Red Hat, Inc. + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Red Hat, Inc. - initial API and implementation + */ +package org.eclipse.che.api.factory.server.git.ssh; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; +import org.eclipse.che.api.factory.server.urlfactory.DefaultFactoryUrl; + +/** + * Representation of Git Ssh URL, allowing to get details from it. + * + * @author Anatolii Bazko + */ +public class GitSshUrl extends DefaultFactoryUrl { + + private String repository; + private String hostName; + + private String repositoryLocation; + + private final List devfileFilenames = new ArrayList<>(); + + protected GitSshUrl() {} + + @Override + public String getProviderName() { + return "git-ssh"; + } + + @Override + public String getBranch() { + return null; + } + + public GitSshUrl withDevfileFilenames(List devfileFilenames) { + this.devfileFilenames.addAll(devfileFilenames); + return this; + } + + @Override + public void setDevfileFilename(String devfileName) { + this.devfileFilenames.clear(); + this.devfileFilenames.add(devfileName); + } + + @Override + public List devfileFileLocations() { + return devfileFilenames.stream().map(this::createDevfileLocation).collect(Collectors.toList()); + } + + @Override + public String rawFileLocation(String filename) { + return filename; + } + + private DevfileLocation createDevfileLocation(String devfileFilename) { + return new DevfileLocation() { + @Override + public Optional filename() { + return Optional.of(devfileFilename); + } + + @Override + public String location() { + return devfileFilename; + } + }; + } + + @Override + public String getHostName() { + return hostName; + } + + public GitSshUrl withHostName(String hostName) { + this.hostName = hostName; + return this; + } + + public String getRepositoryLocation() { + return repositoryLocation; + } + + public GitSshUrl withRepositoryLocation(String repositoryLocation) { + this.repositoryLocation = repositoryLocation; + return this; + } + + public String getRepository() { + return repository; + } + + public GitSshUrl withRepository(String repository) { + this.repository = repository; + return this; + } +} diff --git a/wsmaster/che-core-api-factory-git-ssh/src/test/java/org/eclipse/che/api/factory/server/git/ssh/GitSshURLParserTest.java b/wsmaster/che-core-api-factory-git-ssh/src/test/java/org/eclipse/che/api/factory/server/git/ssh/GitSshURLParserTest.java new file mode 100644 index 0000000000..715e5f544b --- /dev/null +++ b/wsmaster/che-core-api-factory-git-ssh/src/test/java/org/eclipse/che/api/factory/server/git/ssh/GitSshURLParserTest.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2012-2023 Red Hat, Inc. + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Red Hat, Inc. - initial API and implementation + */ +package org.eclipse.che.api.factory.server.git.ssh; + +import static org.mockito.Mockito.mock; +import static org.testng.Assert.assertEquals; + +import org.eclipse.che.api.factory.server.urlfactory.DevfileFilenamesProvider; +import org.mockito.testng.MockitoTestNGListener; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +/** @author Anatalii Bazko */ +@Listeners(MockitoTestNGListener.class) +public class GitSshURLParserTest { + + private GitSshURLParser gitSshURLParser; + + @BeforeMethod + protected void start() { + gitSshURLParser = new GitSshURLParser(mock(DevfileFilenamesProvider.class)); + } + + @Test(dataProvider = "parsing") + public void testParse(String url, String hostName, String repository) { + GitSshUrl gitSshUrl = gitSshURLParser.parse(url); + + assertEquals(gitSshUrl.getHostName(), hostName); + assertEquals(gitSshUrl.getRepository(), repository); + } + + @DataProvider(name = "parsing") + public Object[][] expectedParsing() { + return new Object[][] { + {"git@ssh.dev.azure.com:v3/MyOrg/MyProject/MyRepo", "ssh.dev.azure.com", "MyRepo"}, + {"git@github.com:MyOrg/MyRepo.git", "github.com", "MyRepo"}, + }; + } +} diff --git a/wsmaster/che-core-api-factory-git-ssh/src/test/resources/logback-test.xml b/wsmaster/che-core-api-factory-git-ssh/src/test/resources/logback-test.xml new file mode 100644 index 0000000000..704cbbf50f --- /dev/null +++ b/wsmaster/che-core-api-factory-git-ssh/src/test/resources/logback-test.xml @@ -0,0 +1,26 @@ + + + + + + %-41(%date[%.15thread]) %-45([%-5level] [%.30logger{30} %L]) - %msg%n%nopex + + + + + + + + diff --git a/wsmaster/che-core-api-factory/src/main/java/org/eclipse/che/api/factory/server/FactoryResolverPriority.java b/wsmaster/che-core-api-factory/src/main/java/org/eclipse/che/api/factory/server/FactoryResolverPriority.java new file mode 100644 index 0000000000..acaee3125a --- /dev/null +++ b/wsmaster/che-core-api-factory/src/main/java/org/eclipse/che/api/factory/server/FactoryResolverPriority.java @@ -0,0 +1,2 @@ +package PACKAGE_NAME;public enum FactoryResolverPriority { +} diff --git a/wsmaster/che-core-api-factory/src/main/java/org/eclipse/che/api/factory/server/urlfactory/DefaultFactoryUrl.java b/wsmaster/che-core-api-factory/src/main/java/org/eclipse/che/api/factory/server/urlfactory/DefaultFactoryUrl.java index 6560435f68..16078985ff 100644 --- a/wsmaster/che-core-api-factory/src/main/java/org/eclipse/che/api/factory/server/urlfactory/DefaultFactoryUrl.java +++ b/wsmaster/che-core-api-factory/src/main/java/org/eclipse/che/api/factory/server/urlfactory/DefaultFactoryUrl.java @@ -61,11 +61,6 @@ public class DefaultFactoryUrl implements RemoteFactoryUrl { return URI.create(devfileFileLocation).getHost(); } - @Override - public String getProviderUrl() { - return getHostName(); - } - @Override public String getBranch() { return null; diff --git a/wsmaster/che-core-api-factory/src/main/java/org/eclipse/che/api/factory/server/urlfactory/RemoteFactoryUrl.java b/wsmaster/che-core-api-factory/src/main/java/org/eclipse/che/api/factory/server/urlfactory/RemoteFactoryUrl.java index 7a8f3e25b7..213be2cbd2 100644 --- a/wsmaster/che-core-api-factory/src/main/java/org/eclipse/che/api/factory/server/urlfactory/RemoteFactoryUrl.java +++ b/wsmaster/che-core-api-factory/src/main/java/org/eclipse/che/api/factory/server/urlfactory/RemoteFactoryUrl.java @@ -39,9 +39,6 @@ public interface RemoteFactoryUrl { /** Remote hostname */ String getHostName(); - /** Remote provider URL */ - String getProviderUrl(); - /** Remote branch */ String getBranch(); diff --git a/wsmaster/che-core-api-factory/src/test/java/org/eclipse/che/api/factory/server/scm/AuthorizingFactoryParameterResolverTest.java b/wsmaster/che-core-api-factory/src/test/java/org/eclipse/che/api/factory/server/scm/AuthorizingFactoryParameterResolverTest.java index 4986a640dd..5306170c81 100644 --- a/wsmaster/che-core-api-factory/src/test/java/org/eclipse/che/api/factory/server/scm/AuthorizingFactoryParameterResolverTest.java +++ b/wsmaster/che-core-api-factory/src/test/java/org/eclipse/che/api/factory/server/scm/AuthorizingFactoryParameterResolverTest.java @@ -46,7 +46,7 @@ public class AuthorizingFactoryParameterResolverTest { @Test public void shouldFetchContentWithAuthentication() throws Exception { // given - when(remoteFactoryUrl.getProviderUrl()).thenReturn("https://provider.url"); + when(remoteFactoryUrl.getHostName()).thenReturn("hostName"); when(urlFetcher.fetch(anyString(), anyString())).thenReturn("content"); when(personalAccessTokenManager.getAndStore(anyString())).thenReturn(personalAccessToken); diff --git a/wsmaster/pom.xml b/wsmaster/pom.xml index 80a43b0902..c47f46601f 100644 --- a/wsmaster/pom.xml +++ b/wsmaster/pom.xml @@ -40,6 +40,7 @@ che-core-api-account che-core-api-user che-core-api-factory-azure-devops + che-core-api-factory-git-ssh che-core-api-factory-shared che-core-api-factory che-core-api-factory-github