Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Commit

Permalink
Logging changes for ClientReference / associate build to TestResult :…
Browse files Browse the repository at this point in the history
… null check for buildUrl (#199)
  • Loading branch information
nireeshT authored Mar 22, 2021
1 parent 212f52b commit 12f0eb0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<artifactId>api</artifactId>
<packaging>jar</packaging>
<name>${project.groupId}:${project.artifactId}</name>
<version>3.4.8-SNAPSHOT</version>
<version>3.4.9-SNAPSHOT</version>
<description>Hygieia Rest API Layer</description>
<url>https://github.com/Hygieia/api</url>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -627,18 +627,20 @@ private TestResult createTestCucumber(CollectorItem collectorItem, CucumberJsonR
}

private void associateBuildToTestResult(String buildUrl, String clientReference, TestResult testResult){
Build build = buildRepository.findByBuildUrl(buildUrl);
if(Objects.nonNull(build)){
build.setClientReference(clientReference);
testResult.setBuildId(build.getId());
buildRepository.save(build);
}else{
Build baseBuild = new Build();
baseBuild.setBuildUrl(buildUrl);
baseBuild.setBuildStatus(BuildStatus.InProgress);
baseBuild.setClientReference(clientReference);
baseBuild = buildRepository.save(baseBuild);
testResult.setBuildId(baseBuild.getId());
if(Objects.nonNull(buildUrl)){
Build build = buildRepository.findByBuildUrl(buildUrl);
if(Objects.nonNull(build)){
build.setClientReference(clientReference);
testResult.setBuildId(build.getId());
buildRepository.save(build);
}else{
Build baseBuild = new Build();
baseBuild.setBuildUrl(buildUrl);
baseBuild.setBuildStatus(BuildStatus.InProgress);
baseBuild.setClientReference(clientReference);
baseBuild = buildRepository.save(baseBuild);
testResult.setBuildId(baseBuild.getId());
}
}
}

Expand Down

0 comments on commit 12f0eb0

Please sign in to comment.