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

Ability to use HelidonTest in a meta-annotation #4918

Closed
jvissers opened this issue Sep 20, 2022 · 2 comments
Closed

Ability to use HelidonTest in a meta-annotation #4918

jvissers opened this issue Sep 20, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request P3 testing

Comments

@jvissers
Copy link

Environment Details

  • Helidon Version: 2.5.2
  • Helidon MP
  • JDK version: 17.0.3+8-LTS-111
  • OS: Ubuntu 22.04.1 LTS

Problem Description

We love @HelidonTest and we use it heavily.
There are a bunch of @HelidonTest in which we also apply a specific @AddBean annotation.

Example:

@HelidonTest
@AddBean(LiquibaseProducer.class)
class MyGreatTest {
   ....
}

We would like you to consider providing support for us being able to declare a meta-annotation that captures this in a single place.

Something like this:

@Inherited
@HelidonTest
@Target(ElementType.TYPE)
@AddBean(LiquibaseProducer.class)
@Retention(RetentionPolicy.RUNTIME)
public @interface DECSHelidonTest {}

Which then can be used like so:

@DECSHelidonTest
class MyGreatTest {
   ....
}
@m0mus m0mus added enhancement New feature or request testing P3 labels Sep 26, 2022
@jbescos jbescos self-assigned this May 14, 2024
@jbescos
Copy link
Member

jbescos commented May 14, 2024

I am checking this.

You will still need to include @HelidonTest here because it contains @ExtendWith(HelidonJunitExtension.class).

@HelidonTest
@DECSHelidonTest
class MyGreatTest {
   ....
}

Or otherwise you will have to include @ExtendWith(HelidonJunitExtension.class) in DECSHelidonTest:

@ExtendWith(HelidonJunitExtension.class)
@Inherited
@HelidonTest
@Target(ElementType.TYPE)
@AddBean(LiquibaseProducer.class)
@Retention(RetentionPolicy.RUNTIME)
public @interface DECSHelidonTest {}

This is because we need to execute HelidonJunitExtension in order to parse annotations. The first option looks more friendly in my opinion, but you can choose any.

jbescos added a commit to jbescos/helidon that referenced this issue May 14, 2024
Signed-off-by: Jorge Bescos Gascon <jorge.bescos.gascon@oracle.com>
jbescos added a commit to jbescos/helidon that referenced this issue May 14, 2024
Signed-off-by: Jorge Bescos Gascon <jorge.bescos.gascon@oracle.com>
@m0mus m0mus added this to Backlog Aug 12, 2024
@m0mus m0mus moved this to Normal priority in Backlog Aug 12, 2024
romain-grecourt pushed a commit that referenced this issue Oct 22, 2024
Signed-off-by: Jorge Bescos Gascon <jorge.bescos.gascon@oracle.com>
@jbescos
Copy link
Member

jbescos commented Oct 23, 2024

Merged in #4918

@jbescos jbescos closed this as completed Oct 23, 2024
@github-project-automation github-project-automation bot moved this from Normal priority to Closed in Backlog Oct 23, 2024
arjav-desai pushed a commit to arjav-desai/helidon that referenced this issue Dec 11, 2024
…elidon-io#8759)

Signed-off-by: Jorge Bescos Gascon <jorge.bescos.gascon@oracle.com>
danielkec pushed a commit to danielkec/helidon that referenced this issue Dec 20, 2024
…elidon-io#8759)

Signed-off-by: Jorge Bescos Gascon <jorge.bescos.gascon@oracle.com>
(cherry picked from commit bd5bab5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P3 testing
Projects
Archived in project
Development

No branches or pull requests

3 participants