Skip to content

Commit

Permalink
Upgrade build-info dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
RobiNino committed Jan 29, 2023
1 parent 3fb9b0b commit 87d0223
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ dependencies {
implementation group: 'org.apache.groovy', name: 'groovy', version: '4.0.8'
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.19.0'
implementation group: 'org.jfrog.artifactory.client', name: 'artifactory-java-client-services', version: '2.13.1'
implementation group: 'org.jfrog.buildinfo', name: 'build-info-api', version: '2.26.1'
implementation group: 'org.jfrog.buildinfo', name: 'build-info-extractor', version: '2.26.1'
implementation group: 'org.jfrog.buildinfo', name: 'build-info-api', version: '2.39.0'
implementation group: 'org.jfrog.buildinfo', name: 'build-info-extractor', version: '2.39.0'
}

java {
Expand Down
15 changes: 8 additions & 7 deletions java/src/main/java/com/jfrog/testing/IntegrationTestsHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
import org.jfrog.build.api.Dependency;
import org.jfrog.build.api.Module;
import org.jfrog.build.api.util.NullLog;
import org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient;
import org.jfrog.build.extractor.ci.BuildInfo;
import org.jfrog.build.extractor.clientConfiguration.client.artifactory.ArtifactoryManager;

import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -64,12 +65,12 @@ public class IntegrationTestsHelper implements AutoCloseable {

private static final Pattern REPO_PATTERN = Pattern.compile("^jfrog-rt-tests(-\\w*)+-(\\d*)$");

private final ArtifactoryBuildInfoClient buildInfoClient;
private final ArtifactoryManager artifactoryManager;
private final Artifactory artifactoryClient;

public IntegrationTestsHelper() {
verifyEnvironment();
buildInfoClient = new ArtifactoryBuildInfoClient(ARTIFACTORY_URL, ARTIFACTORY_USERNAME, ARTIFACTORY_PASSWORD, new NullLog());
artifactoryManager = new ArtifactoryManager(ARTIFACTORY_URL, ARTIFACTORY_USERNAME, ARTIFACTORY_PASSWORD, new NullLog());
artifactoryClient = ArtifactoryClientBuilder.create()
.setUrl(ARTIFACTORY_URL)
.setUsername(ARTIFACTORY_USERNAME)
Expand Down Expand Up @@ -238,8 +239,8 @@ public void uploadFile(Path source, String repoKey) {
* @return build info for the specified build name and number
* @throws IOException if failed to get the build info.
*/
public Build getBuildInfo(String buildName, String buildNumber, String project) throws IOException {
return buildInfoClient.getBuildInfo(buildName, buildNumber, project);
public BuildInfo getBuildInfo(String buildName, String buildNumber, String project) throws IOException {
return artifactoryManager.getBuildInfo(buildName, buildNumber, project);
}

/**
Expand Down Expand Up @@ -361,8 +362,8 @@ private String encodeBuildName(String buildName) throws UnsupportedEncodingExcep

@Override
public void close() {
if (buildInfoClient != null) {
buildInfoClient.close();
if (artifactoryManager != null) {
artifactoryManager.close();
}
if (artifactoryClient != null) {
artifactoryClient.close();
Expand Down

0 comments on commit 87d0223

Please sign in to comment.