@Test
public void testExtractRuleSections_mixedTemplating() throws Exception {

	File f = TestUtils.findTestFile( "/mixed-events-templating.conf" );
	String fileContent = Utils.readFileContent( f );
	MonitoringRunnable task = new MonitoringRunnable( this.agentInterface, HANDLERS );
	this.agentInterface.setScopedInstance( new Instance( "root" ));
	File propertiesFile = TestUtils.findTestFile( "/mixed-events-templating.properties" );
	Assert.assertTrue( propertiesFile.exists());
	Properties params = Utils.readPropertiesFile( propertiesFile );
	List<MonitoringHandlerRun> handlers = task.extractRuleSections( f, fileContent, params );
	Assert.assertEquals( 2, handlers.size());
	// Test template expansion of "= {{ accept_passive_checks }}"
	// with "accept_passive_checks" property set to 1
	MonitoringHandlerRun bean = handlers.get( 0 );
	Assert.assertEquals( "nagios", bean.handlerName );
	Assert.assertTrue( bean.rawRulesText.endsWith( "= 1" ));
	// Test template expansion of "/tmp/{{ a-directory-to-not-delete }}"
	// with "a-directory-to-not-delete" property set to "roboconf"
	bean = handlers.get( 1 );
	Assert.assertEquals( "file", bean.handlerName );
	Assert.assertTrue( bean.rawRulesText.contains( "/tmp/roboconf" ));
}