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
Modifier and TypeFieldDescriptionprotected com.graphql_java_generator.plugin.Generator
protected CompilationTestHelper
protected com.graphql_java_generator.plugin.conf.GraphQLConfiguration
protected org.springframework.context.support.AbstractApplicationContext
protected static final String
protected com.graphql_java_generator.plugin.DocumentParser
protected GraphqlTestHelper
protected MavenTestHelper
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
assertCustomTemplateGeneration
(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 void
protected URLClassLoader
protected 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
protected com.graphql_java_generator.plugin.DocumentParser generateCodeDocumentParser -
codeGenerator
protected com.graphql_java_generator.plugin.Generator codeGenerator -
compilationTestHelper
-
graphqlTestHelper
-
mavenTestHelper
-
configuration
protected com.graphql_java_generator.plugin.conf.GraphQLConfiguration configuration
-
-
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
-