Skip to content

Commit

Permalink
Fixed #174 - Improve the output in case of an error
Browse files Browse the repository at this point in the history
 - First step of the solution is to output the information
   while using isFailure(), isSuccessful().
  • Loading branch information
khmarbaise committed Nov 30, 2020
1 parent 3caaae7 commit fdbba4e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Expand Up @@ -100,7 +100,7 @@ public MavenCacheResultAssert cache() {
public MavenExecutionResultAssert isSuccessful() {
isNotNull();
if (!this.actual.isSuccesful()) {
List<String> logs = Helper.logs(this.actual.getMavenLog().getStdout()).map(s -> " --> " + s + "\n").collect(Collectors.toList());
List<String> logs = Helper.logs(this.actual.getMavenLog().getStdout()).map(s -> " [STDOUT] " + s + "\n").collect(Collectors.toList());
failWithMessage("The build was not successful but was <%s> with returnCode:<%s> log file: <%s>", actual.getResult(),
actual.getReturnCode(), logs);
}
Expand All @@ -115,7 +115,7 @@ public MavenExecutionResultAssert isSuccessful() {
public MavenExecutionResultAssert isFailure() {
isNotNull();
if (!this.actual.isFailure()) {
List<String> logs = Helper.logs(this.actual.getMavenLog().getStdout()).map(s -> " --> " + s + "\n").collect(Collectors.toList());
List<String> logs = Helper.logs(this.actual.getMavenLog().getStdout()).map(s -> " [STDOUT] " + s + "\n").collect(Collectors.toList());
failWithMessage("The build should be not successful but was <%s> with returnCode:<%s> log file: <%s>", actual.getResult(),
actual.getReturnCode(), logs);
}
Expand Down
Expand Up @@ -37,6 +37,7 @@
:issue-157: https://github.com/khmarbaise/maven-it-extension/issues/157[Fixed #157]
:issue-166: https://github.com/khmarbaise/maven-it-extension/issues/166[Fixed #166]
:issue-173: https://github.com/khmarbaise/maven-it-extension/issues/173[Fixed #173]
:issue-174: https://github.com/khmarbaise/maven-it-extension/issues/174[Fixed #174]
:issue-??: https://github.com/khmarbaise/maven-it-extension/issues/??[Fixed #??]
:pr-??: https://github.com/khmarbaise/maven-it-extension/pull/??[Pull request #??]

Expand All @@ -55,6 +56,7 @@
* {issue-151} - Refactor code.
* {issue-156} - Remove unused code.
* {issue-173} - Improve issue template.
* {issue-174} - Improve the output in case of an error.

*Details*

Expand Down

0 comments on commit fdbba4e

Please sign in to comment.