@Override
    public void process(CruiseConfig cruiseConfig) {
        for (PipelineConfig pipelineConfig : cruiseConfig.getAllPipelineConfigs()) {
            if (pipelineConfig.hasTemplate()) {
                CaseInsensitiveString templateName = pipelineConfig.getTemplateName();
                PipelineTemplateConfig pipelineTemplate = cruiseConfig.findTemplate(templateName);
                pipelineConfig.validateTemplate(pipelineTemplate);
                if (pipelineConfig.errors().isEmpty() && !pipelineConfig.hasTemplateApplied()) {
                    pipelineConfig.usingTemplate(pipelineTemplate);
                }
            }
        }
    }
@Test
    public void shouldNotExpandWhenTemplateAssociatedWithPipelineDoesNotExist() throws Exception {
        PipelineConfig pipelineConfig = new PipelineConfig(new CaseInsensitiveString("p"), new MaterialConfigs());
        pipelineConfig.templatize(new CaseInsensitiveString("does_not_exist"));
        preprocessor.process(new BasicCruiseConfig(new BasicPipelineConfigs(pipelineConfig)));
        assertThat(pipelineConfig.hasTemplateApplied(), is(false));
    }