Skip to content

[BUG] Generated tests are not executed in a Maven projectΒ #459

@sekikn

Description

@sekikn

Describe the bug.

java-spring-template can generate a Maven project using the -p maven=true parameter, but building the project doesn't run the generated unit tests.

Expected behavior

It should run the generated unit tests without any modification.

Screenshots

Image

How to Reproduce

  1. Generate a Maven project using java-spring-template:
$ asyncapi generate fromTemplate tests/mocks/kafka.yml . -o /tmp/kafka -p maven=true
  1. Ensure unit tests are included in the generated code:
$ cd /tmp/kafka
$ ls -l src/test/java/com/asyncapi
total 20
-rw-rw-r-- 1 sekikn sekikn  462 Dec  5 23:02 ApplicationTests.java
-rw-rw-r-- 1 sekikn sekikn 4901 Dec  5 23:02 SimpleKafkaTest.java
-rw-rw-r-- 1 sekikn sekikn 6428 Dec  5 23:02 TestcontainerKafkaTest.java
  1. Build the project and find the tests are not executed:
$ mvn clean install

(snip)

[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

πŸ–₯️ Device Information [optional]

  • Operating System (OS): Ubuntu 24.04
  • Browser: -
  • Browser Version: -

πŸ‘€ Have you checked for similar open issues?

  • I checked and didn't find similar issue

🏒 Have you read the Contributing Guidelines?

Are you willing to work on this issue ?

Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions