Add shortcut in TestGenerationContext

This commit is contained in:
Stephane Nicoll 2022-09-28 11:20:35 +02:00
parent 737967f924
commit c5fc0a5ef3
1 changed files with 10 additions and 1 deletions

View File

@ -51,12 +51,21 @@ public class TestGenerationContext extends DefaultGenerationContext implements U
/**
* Create an instance using the specified {@code target}.
* @param target the default target class to use
* @param target the default target class name to use
*/
public TestGenerationContext(ClassName target) {
this(new ClassNameGenerator(target));
}
/**
* Create an instance using the specified {@code target}.
* @param target the default target class to use
*/
public TestGenerationContext(Class<?> target) {
this(ClassName.get(target));
}
/**
* Create an instance using {@link #TEST_TARGET} as the {@code target}.
*/