Quarkus finds 0 tests to run

Viewed 26

I'm trying to write some unit tests for my Quarkus app. My configuration seems fine. However, Quarkus is not finding my tests.

To run the tests, I run ./gradlew quarkusDev and then press the [r] key. This is the output I get:

Starting test run, 0 tests to run.
Running 1/0. Running: #JUnit Jupiter

My test is located at src/test/java/br.com.org.product.reports.service/ExampleTest.java. This is the test:

package br.com.org.product.reports.service;

import io.quarkus.test.junit.QuarkusTest;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;

@QuarkusTest
class ExampleTest {
    @Test
    public void example() {
        assertEquals(1 + 1, 2);
    }
}

These are the relevant parts of my build.gradle file:

plugins {
    id 'java'
    id 'io.quarkus'
    id 'jacoco'
}

java {
    sourceCompatibility = JavaVersion.VERSION_11
    targetCompatibility = JavaVersion.VERSION_11
}

dependencies {
    testImplementation 'io.quarkus:quarkus-junit5'
    testImplementation 'io.rest-assured:rest-assured'
}

compileJava {
    options.encoding = 'UTF-8'
    options.compilerArgs << '-parameters'
}

compileTestJava {
    options.encoding = 'UTF-8'
}

Any ideas on why my test is not being found? If I generate a new Quarkus project from scratch, the tests run fine. The generated configuration looks exactly like the one I have right now. However, I can't re-generate the project, I need to fix this one.

0 Answers
Related