Skip to content

Commit

Permalink
Fix gradle test assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
glefloch committed Nov 22, 2020
1 parent 09580ad commit 09eff10
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ public void execute(Task test) {
t.useJUnitPlatform();
// quarkusBuild is expected to run after the project has passed the tests
quarkusBuild.shouldRunAfter(t);
t.doLast(new Action<Task>() {
@Override
public void execute(Task task) {
quarkusExt.afterTest(t);
}
});
};

project.getPlugins().withType(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ void beforeTest(Test task) {
}
}

void afterTest(Test task) {
task.getSystemProperties().remove(BootstrapConstants.SERIALIZED_APP_MODEL);
task.getSystemProperties().remove(BootstrapConstants.OUTPUT_SOURCES_DIR);
}

public Path appJarOrClasses() {
final Jar jarTask = (Jar) project.getTasks().findByName(JavaPlugin.JAR_TASK_NAME);
if (jarTask == null) {
Expand Down
1 change: 0 additions & 1 deletion integration-tests/gradle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ test {
if (System.properties.containsKey('maven.repo.local')) {
systemProperty 'maven.repo.local', System.properties.get('maven.repo.local')
}

useJUnitPlatform()

// Kotlin compiler does not support Java 14
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import javax.ws.rs.core.MediaType

import org.acme.service.SimpleService

@Path("/hello")
@Path("/hello-kotlin")
class ExampleResource {

@Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ExampleResourceTest {
@Test
fun testHelloEndpoint() {
given()
.`when`().get("/hello")
.`when`().get("/hello-kotlin")
.then()
.statusCode(200)
.body(`is`("hello"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ private ExtensionState doJavaStart(ExtensionContext context, Class<? extends Qua
}
}
}

runnerBuilder.setApplicationRoot(rootBuilder.build());

CuratedApplication curatedApplication = runnerBuilder
Expand Down

0 comments on commit 09eff10

Please sign in to comment.