Buggy code:
@ Component ( "cloudify-blueprint-service" ) @ Slf4j public class BlueprintService { @ Resource private CloudConfigurationHolder cloudConfigurationHolder ; @ Resource private MappingConfigurationHolder mappingConfigurationHolder ; @ Resource private ClasspathResourceLoaderService resourceLoaderService ; private Path recipeDirectoryPath ; public Path generateBlueprint ( CloudifyDeployment alienDeployment ) throws IOException { Path generatedBlueprintDirectoryPath = resolveBlueprintPath ( alienDeployment . getRecipeId ( ) ) ; Path generatedBlueprintFilePath = generatedBlueprintDirectoryPath . resolve ( "blueprint.yaml" ) ; <START_BUG> BlueprintGenerationUtil util = new BlueprintGenerationUtil ( mappingConfigurationHolder . getMappingConfiguration ( ) , mappingConfigurationHolder . getProviderMappingConfiguration ( ) ) ; <END_BUG> Map < String , Object > context = Maps . newHashMap ( ) ; context . put ( "cloud" , cloudConfigurationHolder . getConfiguration ( ) ) ; context . put ( "mapping" , mappingConfigurationHolder . getMappingConfiguration ( ) ) ; context . put ( "providerMapping" , mappingConfigurationHolder . getProviderMappingConfiguration ( ) ) ; context . put ( "util" , util ) ; context . put ( "deployment" , alienDeployment ) ; context . put ( "newline" , "\n" ) ; context . put ( "provider_nodes_file" , resourceLoaderService . loadResourceFromClasspath ( ( ( "velocity//" + ( cloudConfigurationHolder . getConfiguration ( ) . getProvider ( ) ) ) + "-nodes.yaml.vm" ) ) . getFileName ( ) . toString ( ) ) ; context . put ( "provider_types_file" , resourceLoaderService . loadResourceFromClasspath ( ( ( "velocity//" + ( cloudConfigurationHolder . getConfiguration ( ) . getProvider ( ) ) ) + "-types.yaml.vm" ) ) . getFileName ( ) . toString ( ) ) ; VelocityUtil . generate ( resourceLoaderService . loadResourceFromClasspath ( "velocity//blueprint.yaml.vm" ) , generatedBlueprintFilePath , context ) ; List < PaaSNodeTemplate > nonNatives = alienDeployment . getNonNatives ( ) ; Set < String > processedNodeTypes = Sets . newHashSet ( ) ; Set < String > processedRelationshipTypes = Sets . newHashSet ( ) ; if ( nonNatives != null ) { for ( PaaSNodeTemplate nonNative : nonNatives ) { IndexedNodeType nonNativeType = nonNative . getIndexedToscaElement ( ) ; if ( processedNodeTypes . add ( nonNativeType . getElementId ( ) ) ) { copyImplementationArtifacts ( generatedBlueprintDirectoryPath , nonNative , nonNativeType ) ; } List < PaaSRelationshipTemplate > relationships = nonNative . getRelationshipTemplates ( ) ; for ( PaaSRelationshipTemplate relationship : relationships ) { IndexedRelationshipType relationshipType = relationship . getIndexedToscaElement ( ) ; if ( processedRelationshipTypes . add ( relationshipType . getElementId ( ) ) ) { copyImplementationArtifacts ( generatedBlueprintDirectoryPath , relationship , relationshipType ) ; } } } } if ( util . hasConfiguredVolume ( alienDeployment . getVolumes ( ) ) ) { Path volumeScriptPath = generatedBlueprintDirectoryPath . resolve ( "cfy3_native//volume" ) ; Files . createDirectories ( volumeScriptPath ) ; Files . copy ( resourceLoaderService . loadResourceFromClasspath ( "artifacts//volume//fdisk.sh" ) , volumeScriptPath . resolve ( "fdisk.sh" ) ) ; Files . copy ( resourceLoaderService . loadResourceFromClasspath ( "artifacts//volume//mkfs.sh" ) , volumeScriptPath . resolve ( "mkfs.sh" ) ) ; Files . copy ( resourceLoaderService . loadResourceFromClasspath ( "artifacts//volume//mount.sh" ) , volumeScriptPath . resolve ( "mount.sh" ) ) ; Files . copy ( resourceLoaderService . loadResourceFromClasspath ( "artifacts//volume//unmount.sh" ) , volumeScriptPath . resolve ( "unmount.sh" ) ) ; } return generatedBlueprintFilePath ; } private void copyImplementationArtifacts ( Path generatedBlueprintDirectoryPath , IPaaSTemplate < ? > nonNative , IndexedArtifactToscaElement nonNativeType ) throws IOException { } public Path resolveBlueprintPath ( String recipeId ) { } @ Required @ Value ( "${directories.alien}//cloudify3" ) public void setRecipeDirectoryPath ( final String path ) { } }

Fix:
BlueprintGenerationUtil util = new BlueprintGenerationUtil ( mappingConfigurationHolder . getMappingConfiguration ( ) , mappingConfigurationHolder . getProviderMappingConfiguration ( ) , alienDeployment ) ;