forked from cucumber/cucumber-jvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cucumber#2491 Support @CucumberContextConfiguration as a meta-annota…
…tion Adds suggestions from review: renames test package, more focused testing and updates the changelog. Method hasCucumberContextConfiguration now uses AnnotatedElementUtils isAnnotated with considers all merged annotations (including inherited and meta-annotation).
- Loading branch information
michael
committed
Oct 30, 2022
1 parent
c63783b
commit 6461925
Showing
9 changed files
with
83 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 0 additions & 29 deletions
29
cucumber-spring/src/test/java/io/cucumber/spring/cucontextconfig/WithMetaAnnotation.java
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...nfig/AbstractWithComponentAnnotation.java → ...tion/AbstractWithComponentAnnotation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
.../src/test/java/io/cucumber/spring/cucumbercontextconfigannotation/AnnotatedInterface.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package io.cucumber.spring.cucumbercontextconfigannotation; | ||
|
||
import io.cucumber.spring.CucumberContextConfiguration; | ||
|
||
@CucumberContextConfiguration | ||
public interface AnnotatedInterface { | ||
} |
21 changes: 21 additions & 0 deletions
21
...test/java/io/cucumber/spring/cucumbercontextconfigannotation/WithInheritedAnnotation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package io.cucumber.spring.cucumbercontextconfigannotation; | ||
|
||
import io.cucumber.spring.CucumberContextConfiguration; | ||
import org.springframework.test.context.ContextConfiguration; | ||
|
||
import java.lang.annotation.*; | ||
|
||
public class WithInheritedAnnotation extends ParentClass { | ||
} | ||
|
||
@InheritableCumberContextConfiguration | ||
class ParentClass { | ||
} | ||
|
||
@Target(ElementType.TYPE) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@CucumberContextConfiguration | ||
@ContextConfiguration("classpath:cucumber.xml") | ||
@Inherited | ||
@interface InheritableCumberContextConfiguration { | ||
} |
17 changes: 17 additions & 0 deletions
17
.../src/test/java/io/cucumber/spring/cucumbercontextconfigannotation/WithMetaAnnotation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.cucumber.spring.cucumbercontextconfigannotation; | ||
|
||
import io.cucumber.spring.CucumberContextConfiguration; | ||
import org.springframework.test.context.ContextConfiguration; | ||
|
||
import java.lang.annotation.*; | ||
|
||
@MyTestAnnotation | ||
public class WithMetaAnnotation { | ||
} | ||
|
||
@Target(ElementType.TYPE) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@CucumberContextConfiguration | ||
@ContextConfiguration("classpath:cucumber.xml") | ||
@interface MyTestAnnotation { | ||
} |