Skip to content

Commit

Permalink
fixes #54 (handling of multipart for null info JSON) (#55)
Browse files Browse the repository at this point in the history
Co-authored-by: Sergio Freire <[email protected]>
  • Loading branch information
bitcoder and Sergio Freire authored Feb 2, 2023
1 parent 663c801 commit 47856b5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

## [0.7.1] - 2023-02-02

### Fixed

- handling of multipart requests for null test/testExec info JSON (#54)

## [0.7.0] - 2022-07-01

### Added
Expand Down Expand Up @@ -84,7 +90,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

[unreleased]: https://github.com/Xray-App/xray-maven-plugin/compare/0.7.0...HEAD
[unreleased]: https://github.com/Xray-App/xray-maven-plugin/compare/0.7.1...HEAD
[0.7.1]: https://github.com/Xray-App/xray-maven-plugin/compare/0.7.1...0.7.0
[0.7.0]: https://github.com/Xray-App/xray-maven-plugin/compare/0.7.0...0.7.0
[0.6.0]: https://github.com/Xray-App/xray-maven-plugin/compare/0.5.0...0.6.0
[0.5.0]: https://github.com/Xray-App/xray-maven-plugin/compare/0.4.0...0.5.0
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>app.getxray</groupId>
<artifactId>xray-maven-plugin</artifactId>
<version>0.7.0</version>
<version>0.7.1</version>
<packaging>maven-plugin</packaging>
<name>xray-maven-plugin</name>
<description>Maven plugin for interacting with Xray (server/datacenter and cloud), used in CI/CD for assisting in test automation flows, such as reporting test results back to Xray and, by consequence, Jira.</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
.withTimeout(timeout)
.withLogger(getLog())
.withVerbose(verbose);
if (testInfoJson==null && testExecInfoJson==null) {
if (testInfoJson==null && testExecInfoJson==null) {
if (XrayResultsImporter.XRAY_FORMAT.equals(reportFormat) || XrayResultsImporter.CUCUMBER_FORMAT.equals(reportFormat) || XrayResultsImporter.BEHAVE_FORMAT.equals(reportFormat)) {
xrayImporter = xrayImporterBuilder.build();
} else {
Expand All @@ -200,17 +200,13 @@ public void execute() throws MojoExecutionException, MojoFailureException {
} else {
abortWithError("file doesnt exist: " + testInfoJson);
}
} else {
testInfo = new JSONObject();
}
if (testExecInfoJson != null) {
if ((new File(testExecInfoJson)).isFile()) {
testExecInfo = new JSONObject(new String(Files.readAllBytes(Paths.get(testExecInfoJson))));
} else {
abortWithError("file doesnt exist: " + testExecInfoJson);
}
} else {
testExecInfo = new JSONObject();
}
response = xrayImporterBuilder.build().submitMultipartCloud(reportFormat, reportFile, testExecInfo, testInfo);
}
Expand Down Expand Up @@ -257,17 +253,13 @@ public void execute() throws MojoExecutionException, MojoFailureException {
} else {
abortWithError("file doesnt exist: " + testInfoJson);
}
} else {
testInfo = new JSONObject();
}
if (testExecInfoJson != null) {
if ((new File(testExecInfoJson)).isFile()) {
testExecInfo = new JSONObject(new String(Files.readAllBytes(Paths.get(testExecInfoJson))));
} else {
abortWithError("file doesnt exist: " + testExecInfoJson);
}
} else {
testExecInfo = new JSONObject();
}
response = xrayImporterBuilder.build().submitMultipartServerDC(reportFormat, reportFile, testExecInfo, testInfo);
}
Expand Down

0 comments on commit 47856b5

Please sign in to comment.