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

GithubIssue and ModelTest not working together #5229

Closed
MartinWitt opened this issue May 24, 2023 · 0 comments · Fixed by #5234
Closed

GithubIssue and ModelTest not working together #5229

MartinWitt opened this issue May 24, 2023 · 0 comments · Fixed by #5234

Comments

@MartinWitt
Copy link
Collaborator

Given this code, GithubIssue does not work together with ModelTest.

 @ParameterizedTest
 @ValueSource(strings = {"a", "b"})
 @GitHubIssue(fixed = true, issueNumber = 20)
 void testFoo(String a) {
     assertTrue(a.length() > 0);
 }

It produces this warning:

[INFO] -------------------------------------------------------
Mai 23, 2023 10:40:37 PM org.junit.jupiter.engine.discovery.MethodSelectorResolver resolve
WARNUNG: Possible configuration error: method [void spoon.support.TypeAdaptorTest.testFoo(java.lang.String)] resulted in multiple TestDescriptors [org.junit.jupiter.engine.descriptor.TestTemplateTestDescriptor, org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor]. This is typically the result of annotating a method with multiple competing annotations such as @Test, @RepeatedTest, @ParameterizedTest, @TestFactory, etc.
Mai 23, 2023 10:40:37 PM org.junit.jupiter.engine.discovery.MethodSelectorResolver resolve
WARNUNG: Possible configuration error: method [void spoon.support.TypeAdaptorTest.testFoo(java.lang.String)] resulted in multiple TestDescriptors [org.junit.jupiter.engine.descriptor.TestTemplateTestDescriptor, org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor]. This is typically the result of annotating a method with multiple competing annotations such as @Test, @RepeatedTest, @ParameterizedTest, @TestFactory, etc.
[INFO] Running spoon.support.TypeAdaptorTest
[ERROR] Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.101 s <<< FAILURE! - in spoon.support.TypeAdaptorTest
[ERROR] spoon.support.TypeAdaptorTest.testFoo(String)  Time elapsed: 0.029 s  <<< ERROR!
org.junit.jupiter.api.extension.ParameterResolutionException: No ParameterResolver registered for parameter [java.lang.String arg0] in method [void spoon.support.TypeAdaptorTest.testFoo(java.lang.String)].`

The easy fix is to remove @Test from GitHubIssue and ModelTest, in a later PR we could rename ModelTest because it is no longer a "Test". Wdyt?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant