Skip to content

Commit c5fc0a5

Browse files
committed
Add shortcut in TestGenerationContext
1 parent 737967f commit c5fc0a5

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

spring-core-test/src/main/java/org/springframework/aot/test/generate/TestGenerationContext.java

+10-1
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,21 @@ public TestGenerationContext(ClassNameGenerator classNameGenerator) {
5151

5252
/**
5353
* Create an instance using the specified {@code target}.
54-
* @param target the default target class to use
54+
* @param target the default target class name to use
5555
*/
5656
public TestGenerationContext(ClassName target) {
5757
this(new ClassNameGenerator(target));
5858
}
5959

60+
/**
61+
* Create an instance using the specified {@code target}.
62+
* @param target the default target class to use
63+
*/
64+
public TestGenerationContext(Class<?> target) {
65+
this(ClassName.get(target));
66+
}
67+
68+
6069
/**
6170
* Create an instance using {@link #TEST_TARGET} as the {@code target}.
6271
*/

0 commit comments

Comments
 (0)