UserDataHelpers { public static Properties writeUserDataAsProperties( Map<String,String> messagingConfiguration, String domain, String applicationName, String scopedInstancePath ) throws IOException { Properties result = new Properties(); if( applicationName != null ) result.setProperty( APPLICATION_NAME, applicationName ); if( scopedInstancePath != null ) result.setProperty( SCOPED_INSTANCE_PATH, scopedInstancePath ); if( domain != null ) result.setProperty( DOMAIN, domain ); if( messagingConfiguration != null ) { for( Map.Entry<String,String> e : messagingConfiguration.entrySet()) { if( e.getValue() != null ) result.setProperty( e.getKey(), e.getValue()); } } interceptLoadingFiles( result ); return result; } private  UserDataHelpers(); static String writeUserDataAsString(
			Map<String,String> messagingConfiguration,
			String domain,
			String applicationName,
			String scopedInstancePath ); static Properties writeUserDataAsProperties(
			Map<String,String> messagingConfiguration,
			String domain,
			String applicationName,
			String scopedInstancePath ); static Properties readUserData( String rawProperties, File outputDirectory ); static Properties processUserData( Properties properties, File outputDirectory ); static final String SCOPED_INSTANCE_PATH; static final String APPLICATION_NAME; static final String DOMAIN; static final String ENCODE_FILE_CONTENT_PREFIX; }
@Test( expected = IOException.class ) public void testWriteUserDataAsProperties_inexistingFile() throws Exception { Map<String,String> msgCfg = msgCfg( "192.168.1.24", "user", "pwd" ); msgCfg.put( "loc", "does/not/exist" ); msgCfg.put( UserDataHelpers.ENCODE_FILE_CONTENT_PREFIX + "loc", "" ); UserDataHelpers.writeUserDataAsProperties( msgCfg, "domain", "app", "/root" ); }