Class AbstractCustomTemplateIntegrationTest
java.lang.Object
com.graphql_java_generator.plugin.compilation_tests.AbstractCustomTemplateIntegrationTest
Base integration test for Custom templates scenario Offers methods to assert customized code validation
- Author:
- ggomez
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Generatorprotected CompilationTestHelperprotected GraphQLConfigurationprotected org.springframework.context.support.AbstractApplicationContextprotected static final Stringprotected DocumentParserprotected GraphqlTestHelperprotected MavenTestHelperprotected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidassertCustomTemplateGeneration(File sourcesDirectory) Helper method that validates that given dir contains files generated with custom templates Custom template file are identified by it's first line.protected voidprotected URLClassLoaderprotected Class<?>loadGeneratedClass(String simpleClassname, com.graphql_java_generator.plugin.compilation_tests.AbstractIntegrationTest.FileType fileType) Loads the given class from the generated files.
-
Field Details
-
CUSTOMIZED_CODE_FIRST_LINE
- See Also:
-
ctx
protected org.springframework.context.support.AbstractApplicationContext ctx -
generateCodeDocumentParser
-
codeGenerator
-
compilationTestHelper
-
graphqlTestHelper
-
mavenTestHelper
-
configuration
-
moduleName
-
-
Constructor Details
-
AbstractCustomTemplateIntegrationTest
-
-
Method Details
-
assertCustomTemplateGeneration
Helper method that validates that given dir contains files generated with custom templates Custom template file are identified by it's first line. It's value is \/** This template is custom **\/- Parameters:
generatedSourcesDir-
-
doAdditionalChecks
- Throws:
Exception
-
loadGeneratedClass
protected Class<?> loadGeneratedClass(String simpleClassname, com.graphql_java_generator.plugin.compilation_tests.AbstractIntegrationTest.FileType fileType) throws Exception Loads the given class from the generated files. This method is used to load the class, and apply java reflexion to check the generated code.- Parameters:
simpleClassname- The name of the generated class, without the package, for instance "QueryController"fileType-- Returns:
- Throws:
Exception
-
getURLClassLoader
- Throws:
Exception
-