Skip to content

Commit

Permalink
Ensure build task completes successfully as well as generate task.
Browse files Browse the repository at this point in the history
  • Loading branch information
baron1405 committed Apr 27, 2024
1 parent 83c0190 commit 69bbb36
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,18 @@ private GradleRunner createGradleRunner(final String gradleVersion) {
}

private void verifyBuild(final BuildResult result, final TaskOutcome outcome) {
final BuildTask task = result.task(":generatePropertyKeyConstants");
assertThat(task).isNotNull();
assertThat(task.getOutcome()).as(result.getOutput()).isEqualTo(outcome);
final BuildTask genTask = result.task(":generatePropertyKeyConstants");
assertThat(genTask).isNotNull();
assertThat(genTask.getOutcome()).as(result.getOutput()).isEqualTo(outcome);

if (outcome != SUCCESS) {
return;
}

final BuildTask buildTask = result.task(":build");
assertThat(buildTask).isNotNull();
assertThat(buildTask.getOutcome()).as(result.getOutput()).isEqualTo(SUCCESS);

final Path actualSource = this.projectDir.resolve("build/generated-src/property-key-constants/main/org/cthing/test/Constants.java");
assertThat(actualSource).isRegularFile();

Expand Down

0 comments on commit 69bbb36

Please sign in to comment.