@Test
public void testReconfigureMessaging_noAgentConfigurationFile() throws IOException {

	// Prepare
	File karafEtc =  this.folder.newFolder();
	final File msgConf = new File( karafEtc, "net.roboconf.messaging.rabbitmq.cfg" );
	final File agentConf = new File( karafEtc, Constants.KARAF_CFG_FILE_AGENT );
	// Execute
	Map<String,String> msgData = new HashMap<> ();
	msgData.put( MessagingConstants.MESSAGING_TYPE_PROPERTY, "rabbitmq" );
	msgData.put("net.roboconf.messaging.rabbitmq.server.ip", "rabbit-server");
	msgData.put("net.roboconf.messaging.rabbitmq.server.username", "user1");
	msgData.put("net.roboconf.messaging.rabbitmq.server.password", "password1");
	Assert.assertFalse( msgConf.exists());
	Assert.assertFalse( agentConf.exists());
	this.userDataHelper.reconfigureMessaging(karafEtc.getAbsolutePath(), msgData);
	// Check
	Assert.assertTrue( msgConf.exists());
	Assert.assertTrue( agentConf.exists());
	Properties p = Utils.readPropertiesFile(msgConf);
	String val = p.getProperty("net.roboconf.messaging.rabbitmq.server.ip");
	Assert.assertEquals(val, "rabbit-server");
	val = p.getProperty("net.roboconf.messaging.rabbitmq.server.username");
	Assert.assertEquals(val, "user1");
	val = p.getProperty("net.roboconf.messaging.rabbitmq.server.password");
	Assert.assertEquals(val, "password1");
	p = Utils.readPropertiesFile( agentConf );
	Assert.assertEquals( "rabbitmq", p.get( Constants.MESSAGING_TYPE ));
	Assert.assertEquals( 1, p.size());
}