Skip to content

Commit

Permalink
Merge pull request #63 from quarkusio/dependabot/maven/quarkus.versio…
Browse files Browse the repository at this point in the history
…n-3.6.0

Bump quarkus.version from 3.5.2 to 3.6.0
  • Loading branch information
yrodiere authored Nov 28, 2023
2 parents 6270d32 + 323de3b commit 5db9b70
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 30 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
<quarkus.version>3.5.2</quarkus.version>
<quarkus.version>3.6.0</quarkus.version>
<revision>999-SNAPSHOT</revision>
<skipITs>true</skipITs>
<surefire-plugin.version>3.2.2</surefire-plugin.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,23 @@
import java.util.Set;
import java.util.function.Consumer;

import io.quarkus.search.app.hibernate.InputProvider;
import io.quarkus.search.app.quarkusio.QuarkusIO;
import io.quarkus.search.app.quarkusio.QuarkusIOConfig;
import jakarta.inject.Inject;

import org.apache.commons.io.file.PathUtils;
import org.assertj.core.api.InstanceOfAssertFactories;
import org.assertj.core.api.SoftAssertions;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.revwalk.RevCommit;

import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import org.eclipse.jgit.revwalk.RevCommit;
import org.mockito.Mockito;

import io.quarkus.search.app.entity.Guide;
import io.quarkus.search.app.hibernate.InputProvider;
import io.quarkus.search.app.quarkusio.QuarkusIO;
import io.quarkus.search.app.testsupport.GitTestUtils;
import io.quarkus.search.app.util.CloseableDirectory;
import io.quarkus.test.component.QuarkusComponentTestExtension;
Expand Down Expand Up @@ -106,15 +103,7 @@ static void deleteTmpDir() throws IOException {

@RegisterExtension
static final QuarkusComponentTestExtension extension = QuarkusComponentTestExtension.builder()
// It seems injecting config mappings isn't supported at the moment;
// see https://quarkusio.zulipchat.com/#narrow/stream/187038-dev/topic/QuarkusComponentTest.20and.20ConfigMapping
.mock(QuarkusIOConfig.class)
.createMockitoMock(mock -> {
Mockito.when(mock.gitUri())
.thenReturn(tmpDir.path().toUri());
Mockito.when(mock.webUri())
.thenReturn(QuarkusIOConfig.WEB_URI_DEFAULT);
})
.configProperty("quarkusio.git-uri", tmpDir.path().toString())
.build();

@Inject
Expand Down
33 changes: 19 additions & 14 deletions src/test/java/io/quarkus/search/app/testsupport/GitTestUtils.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
package io.quarkus.search.app.testsupport;

import java.io.IOException;
import java.nio.file.CopyOption;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.Map;
import org.eclipse.jgit.lib.Config;
import org.eclipse.jgit.lib.StoredConfig;
import org.eclipse.jgit.util.SystemReader;

import org.jboss.logging.Logger;

import org.eclipse.jgit.util.SystemReader;

public final class GitTestUtils {

private static final Logger LOG = Logger.getLogger(GitTestUtils.class);
Expand All @@ -24,9 +15,23 @@ private GitTestUtils() {

public static void cleanGitUserConfig() {
try {
SystemReader.getInstance().getUserConfig().clear();
clearRecursively(SystemReader.getInstance().getUserConfig());
} catch (Exception e) {
LOG.warn("Unable to clear the Git user config");
LOG.warn("Unable to get Git user config");
}
}

private static void clearRecursively(Config config) {
if (config == null) {
return;
}
if (config instanceof StoredConfig) {
try {
((StoredConfig) config).clear();
} catch (Exception e) {
LOG.warnf("Unable to clear Git config %s", config);
}
}
clearRecursively(config.getBaseConfig());
}
}

0 comments on commit 5db9b70

Please sign in to comment.