protected InputStream getTemplateAsStream ( TestContext context ) { Resource resource ; if ( templateResource != null ) { resource = templateResource ; } else { resource = FileUtils . getFileResource ( template , context ) ; } String templateYml ; try { templateYml = context . replaceDynamicContentInString ( FileUtils . readToString ( resource ) ) ; } catch ( IOException e ) { throw new CitrusRuntimeException ( "Failed to read template resource" , e ) ; } return new ByteArrayInputStream ( templateYml . getBytes ( ) ) ; }
Create input stream from template resource and add test variable support .