Skip to content

Commit

Permalink
fixup! Use response status code to check gitlab repositories accessib…
Browse files Browse the repository at this point in the history
…ility
  • Loading branch information
vinokurig committed Nov 19, 2024
1 parent 7e8ae8c commit 5f3e1d0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class GitlabAuthorizingFileContentProvider extends AuthorizingFileContentProvide
Executors.newCachedThreadPool(
new ThreadFactoryBuilder()
.setUncaughtExceptionHandler(LoggingUncaughtExceptionHandler.getInstance())
.setNameFormat(GitlabApiClient.class.getName() + "-%d")
.setNameFormat(GitlabAuthorizingFileContentProvider.class.getName() + "-%d")
.setDaemon(true)
.build()))
.connectTimeout(DEFAULT_HTTP_TIMEOUT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ public void shouldThrowFileNotFoundException() throws Exception {
wireMockServer.url(
"/api/v4/projects/eclipse%2Fche/repository/files/devfile.yaml/raw?ref=HEAD"))))
.thenThrow(new FileNotFoundException());
when(urlFetcher.fetch(eq("http://gitlab.com/eclipse/che"))).thenReturn("content");
when(personalAccessTokenManager.getAndStore(anyString()))
.thenThrow(new UnknownScmProviderException("", ""));
URI uri = URI.create(wireMockServer.url("/"));
Expand Down Expand Up @@ -128,7 +127,6 @@ public void shouldThrowDevfileException() throws Exception {
wireMockServer.url(
"/api/v4/projects/eclipse%2Fche/repository/files/devfile.yaml/raw?ref=HEAD"))))
.thenThrow(new FileNotFoundException("test path"));
when(urlFetcher.fetch(eq("http://gitlab.com/eclipse/che"))).thenReturn("content");
when(personalAccessTokenManager.getAndStore(anyString()))
.thenThrow(new UnknownScmProviderException("", ""));
URI uri = URI.create(wireMockServer.url("/"));
Expand Down

0 comments on commit 5f3e1d0

Please sign in to comment.