Skip to content
This repository was archived by the owner on Sep 6, 2024. It is now read-only.
This repository was archived by the owner on Sep 6, 2024. It is now read-only.

Support for meta-annotations #108

@xyzxyzxyzxyzxyz

Description

@xyzxyzxyzxyzxyz

Hi.

Great work here.
All I found missing is that the Docker annotation cannot be "meta-present".

That is, I cannot create a custom annotation:

@Docker( ... )
public @interface IntegrationTest {}

@IntegrationTest
public class TestClass { ... }  

And the solution is really simple!

Instead of this in DockerExtension.java:

private Docker findDockerAnnotation(ExtensionContext extensionContext) {
        Class<?> testClass = extensionContext.getTestClass().get();
        return testClass.getAnnotation(Docker.class);
}

Just use JUnit 5's AnnotationUtils class:

    private Docker findDockerAnnotation(ExtensionContext extensionContext) {
        Class<?> testClass = extensionContext.getTestClass().get();
        return AnnotationUtils.findAnnotation(testClass, Docker.class).orElse(null);
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions