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

Fix an exception when doing Quarkus Test using default method. #21039

Merged
merged 1 commit into from
Nov 2, 2021

Conversation

orekyuu
Copy link
Contributor

@orekyuu orekyuu commented Oct 27, 2021

Before

In JUnit 5, you can test using the default method as follows.
Test Interfaces and Default Methods

public interface Testable {
  @Test
  void doTest() {  }
}

@QuarkusTest
class ExampleTest implements Testable {
}

When I run ExampleTest, I expect doTest to be run, but it actually throws a RuntimeException.

After

QuarkusTestExtension resolves interface method and executes doTest method.


Where should I write my QuarkusTestExtension test?
If you need a test, please give me some advice.

@quarkus-bot
Copy link

quarkus-bot bot commented Oct 27, 2021

Thanks for your pull request!

The title of your pull request does not follow our editorial rules. Could you have a look?

  • title should not end up with dot

This message is automatically generated by a bot.

@orekyuu orekyuu changed the title Fixed an exception when doing Quarkus Test using default method. Fix an exception when doing Quarkus Test using default method. Oct 27, 2021
@geoand
Copy link
Contributor

geoand commented Oct 27, 2021

Thanks for this.

You can add your tests somewhere in https://github.com/quarkusio/quarkus/tree/main/integration-tests/main as that is where other tests are for various JUnit related features.

@geoand
Copy link
Contributor

geoand commented Oct 29, 2021

Can you please squash the commits?

@orekyuu orekyuu force-pushed the resolve-default-method branch from e1725f5 to a16fe29 Compare October 29, 2021 12:18
@geoand geoand added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Nov 1, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Nov 1, 2021

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building a16fe29

Status Name Step Failures Logs Raw logs
Initial JDK 11 Build Build Failures Logs Raw logs

Failures

⚙️ Initial JDK 11 Build #

- Failing: integration-tests/main 

📦 integration-tests/main

Failed to execute goal net.revelc.code.formatter:formatter-maven-plugin:2.16.0:validate (default) on project quarkus-integration-test-main: File '/home/runner/work/quarkus/quarkus/integration-tests/main/src/test/java/io/quarkus/it/main/DefaultMethodInterface.java' has not been previously formatted. Please format file and commit before running validation!

@geoand
Copy link
Contributor

geoand commented Nov 1, 2021

Please run mvn process:sources on the integration test module, commit, squash and push.

Thanks

@orekyuu orekyuu force-pushed the resolve-default-method branch from a16fe29 to 30b1e2a Compare November 1, 2021 15:05
@geoand geoand merged commit a946a32 into quarkusio:main Nov 2, 2021
@quarkus-bot quarkus-bot bot added this to the 2.5 - main milestone Nov 2, 2021
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Nov 2, 2021
@orekyuu orekyuu deleted the resolve-default-method branch November 13, 2021 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants