Remove unused constructors in TestGenerationContext

This commit is contained in:
Sam Brannen
2022-08-16 11:54:42 +02:00
parent 59c2f4c069
commit 36fa8bd26b
3 changed files with 7 additions and 33 deletions

View File

@@ -23,7 +23,8 @@ import org.springframework.aot.generate.InMemoryGeneratedFiles;
/**
* {@link GenerationContext} test implementation that uses
* {@link InMemoryGeneratedFiles} by default.
* {@link InMemoryGeneratedFiles} and provides a convenient
* {@link TestTarget} by default.
*
* @author Stephane Nicoll
* @author Sam Brannen
@@ -35,15 +36,7 @@ public class TestGenerationContext extends DefaultGenerationContext {
* Create an instance using {@link TestTarget} as the default target class.
*/
public TestGenerationContext() {
this(TestTarget.class);
}
/**
* Create an instance using the specified {@code target}.
* @param target the default target class to use
*/
public TestGenerationContext(Class<?> target) {
this(new ClassNameGenerator(target));
this(new ClassNameGenerator(TestTarget.class));
}
/**
@@ -51,19 +44,9 @@ public class TestGenerationContext extends DefaultGenerationContext {
* @param classNameGenerator the class name generator to use
*/
public TestGenerationContext(ClassNameGenerator classNameGenerator) {
this(classNameGenerator, new InMemoryGeneratedFiles());
super(classNameGenerator, new InMemoryGeneratedFiles());
}
/**
* Create an instance using the specified {@link ClassNameGenerator} and
* {@link InMemoryGeneratedFiles}.
* @param classNameGenerator the class name generator to use
* @param generatedFiles the generated files
*/
public TestGenerationContext(ClassNameGenerator classNameGenerator,
InMemoryGeneratedFiles generatedFiles) {
super(classNameGenerator, generatedFiles);
}
@Override
public InMemoryGeneratedFiles getGeneratedFiles() {

View File

@@ -20,6 +20,7 @@ package org.springframework.core.testfixture.aot.generate;
* A <em>default target class</em> used by tests of code generation.
*
* @author Stephane Nicoll
* @since 6.0
*/
public class TestTarget {
}

View File

@@ -23,7 +23,7 @@ import org.springframework.aot.generate.InMemoryGeneratedFiles;
/**
* {@link GenerationContext} test implementation that uses
* {@link InMemoryGeneratedFiles} by default.
* {@link InMemoryGeneratedFiles}.
*
* @author Stephane Nicoll
* @author Sam Brannen
@@ -44,19 +44,9 @@ public class TestGenerationContext extends DefaultGenerationContext {
* @param classNameGenerator the class name generator to use
*/
public TestGenerationContext(ClassNameGenerator classNameGenerator) {
this(classNameGenerator, new InMemoryGeneratedFiles());
super(classNameGenerator, new InMemoryGeneratedFiles());
}
/**
* Create an instance using the specified {@link ClassNameGenerator} and
* {@link InMemoryGeneratedFiles}.
* @param classNameGenerator the class name generator to use
* @param generatedFiles the generated files
*/
public TestGenerationContext(ClassNameGenerator classNameGenerator,
InMemoryGeneratedFiles generatedFiles) {
super(classNameGenerator, generatedFiles);
}
@Override
public InMemoryGeneratedFiles getGeneratedFiles() {