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 Generator
protected CompilationTestHelper
protected GraphQLConfiguration
protected org.springframework.context.support.AbstractApplicationContext
protected static final String
protected DocumentParser
protected GraphqlTestHelper
protected MavenTestHelper
-
Constructor Summary
Constructors -
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
-
codeGenerator
-
compilationTestHelper
-
graphqlTestHelper
-
mavenTestHelper
-
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
-