Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Kotlin guide test faillure #21756

Closed
Rooarii opened this issue Nov 27, 2021 · 2 comments
Closed

Using Kotlin guide test faillure #21756

Rooarii opened this issue Nov 27, 2021 · 2 comments
Labels
area/kotlin kind/bug Something isn't working triage/duplicate This issue or pull request already exists

Comments

@Rooarii
Copy link

Rooarii commented Nov 27, 2021

Describe the bug

I tried to run the GreetingTest from Using Kotlin guide and i got an faillure when running mvn test just after updating the code with Kotlin syntax.

Expected behavior

[INFO] Results:
[INFO] 
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  47.318 s
[INFO] Finished at: 2021-11-27T22:28:18+01:00
[INFO] ------------------------------------------------------------------------

Actual behavior

[ERROR] /Desktop/rest-kotlin-quickstart/src/test/kotlin/org/acme/rest/GreetingResourceTest.kt: (17, 31) Unresolved reference: equalTo
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  27.910 s
[INFO] Finished at: 2021-11-27T22:59:54+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.jetbrains.kotlin:kotlin-maven-plugin:1.5.31:test-compile (test-compile) on project rest-kotlin-quickstart: Compilation failure
[ERROR] /Desktop/rest-kotlin-quickstart/src/test/kotlin/org/acme/rest/GreetingResourceTest.kt:[17,31] Unresolved reference: equalTo
[ERROR] 
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

How to Reproduce?

Reproducer:

Steps to reproduce the behavior:

  1. Run the following command:
mvn io.quarkus.platform:quarkus-maven-plugin:2.5.0.Final:create \
    -DprojectGroupId=org.acme \
    -DprojectArtifactId=rest-kotlin-quickstart \
    -DclassName="org.acme.rest.GreetingResource" \
    -Dpath="/greeting" \
    -Dextensions="resteasy,kotlin,resteasy-jackson"
cd rest-kotlin-quickstart
  1. Update the code as described in Using Kotlin guide
  2. Run the test command mvn test

Output of uname -a or ver

Linux Precision-3551 5.11.0-40-generic #44~20.04.2-Ubuntu SMP Tue Oct 26 18:07:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk 11.0.12 2021-07-20 OpenJDK Runtime Environment 18.9 (build 11.0.12+7) OpenJDK 64-Bit Server VM 18.9 (build 11.0.12+7, mixed mode)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.5.0

Build tool (ie. output of mvnw --version or gradlew --version)

3.8.3

Additional information

when i run command to run the application mvn quarkus:dev i get the error form the greetinggTest as the application starts.
Nevertheless, when the app is up and i hit r to re-run the test, the test passes.

Suggestion to make the test pass:

package org.acme.rest

import io.quarkus.test.junit.QuarkusTest
import io.restassured.RestAssured.given
import org.hamcrest.CoreMatchers.`is`
import org.junit.jupiter.api.Test

@QuarkusTest
class GreetingResourceTest {

    @Test
    fun testHelloEndpoint() {
        given()
          .`when`().get("/greeting")
          .then()
             .statusCode(200)
             .body(`is`("{\"message\":\"hello\"}"))
    }

}
@Rooarii Rooarii added the kind/bug Something isn't working label Nov 27, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Nov 27, 2021

/cc @evanchooly

@geoand
Copy link
Contributor

geoand commented Nov 29, 2021

This is a duplicate of #21756

@geoand geoand closed this as completed Nov 29, 2021
@geoand geoand added the triage/duplicate This issue or pull request already exists label Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kotlin kind/bug Something isn't working triage/duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants