@Test( expected = SdiException.class ) public void testGetResolvedBodyUnresolvedProp() throws Throwable { TestUtils.removeFromEnvironment( myEnv, SdiMainProperties.KEY_TARGET_NAME ); String received = myClassUnderTest.getResolvedBody( myPerson ); myLog.debug( "Received: " + received ); Assert.assertEquals( "You are now a member of our site MySocialSite", received ); }
public String getResolvedBody( Person<?> aPerson ) throws SdiException { if ( aPerson.containsProperty( KEY_EXTRA_MAIL_BODY_FILE ) ) { String key = KEY_EXTRA_MAIL_BODY_TEXT; try { String fileName = aPerson.getStringProperty( KEY_EXTRA_MAIL_BODY_FILE ); String body = loadFile( Charset.forName( "UTF-8" ), fileName ); ConfigUtils.addToEnvironment( myEnv, key, body ); return resolveValue( aPerson, key ); } finally { ConfigUtils.removeFromEnvironment( myEnv, key ); } } return resolveValue( aPerson, myBodyKey ); }
MailTextResolver { public String getResolvedBody( Person<?> aPerson ) throws SdiException { if ( aPerson.containsProperty( KEY_EXTRA_MAIL_BODY_FILE ) ) { String key = KEY_EXTRA_MAIL_BODY_TEXT; try { String fileName = aPerson.getStringProperty( KEY_EXTRA_MAIL_BODY_FILE ); String body = loadFile( Charset.forName( "UTF-8" ), fileName ); ConfigUtils.addToEnvironment( myEnv, key, body ); return resolveValue( aPerson, key ); } finally { ConfigUtils.removeFromEnvironment( myEnv, key ); } } return resolveValue( aPerson, myBodyKey ); } }
MailTextResolver { public String getResolvedBody( Person<?> aPerson ) throws SdiException { if ( aPerson.containsProperty( KEY_EXTRA_MAIL_BODY_FILE ) ) { String key = KEY_EXTRA_MAIL_BODY_TEXT; try { String fileName = aPerson.getStringProperty( KEY_EXTRA_MAIL_BODY_FILE ); String body = loadFile( Charset.forName( "UTF-8" ), fileName ); ConfigUtils.addToEnvironment( myEnv, key, body ); return resolveValue( aPerson, key ); } finally { ConfigUtils.removeFromEnvironment( myEnv, key ); } } return resolveValue( aPerson, myBodyKey ); }  }
MailTextResolver { public String getResolvedBody( Person<?> aPerson ) throws SdiException { if ( aPerson.containsProperty( KEY_EXTRA_MAIL_BODY_FILE ) ) { String key = KEY_EXTRA_MAIL_BODY_TEXT; try { String fileName = aPerson.getStringProperty( KEY_EXTRA_MAIL_BODY_FILE ); String body = loadFile( Charset.forName( "UTF-8" ), fileName ); ConfigUtils.addToEnvironment( myEnv, key, body ); return resolveValue( aPerson, key ); } finally { ConfigUtils.removeFromEnvironment( myEnv, key ); } } return resolveValue( aPerson, myBodyKey ); }  void init(); String getResolvedBody( Person<?> aPerson ); String getResolvedSubject( Person<?> aPerson ); }
MailTextResolver { public String getResolvedBody( Person<?> aPerson ) throws SdiException { if ( aPerson.containsProperty( KEY_EXTRA_MAIL_BODY_FILE ) ) { String key = KEY_EXTRA_MAIL_BODY_TEXT; try { String fileName = aPerson.getStringProperty( KEY_EXTRA_MAIL_BODY_FILE ); String body = loadFile( Charset.forName( "UTF-8" ), fileName ); ConfigUtils.addToEnvironment( myEnv, key, body ); return resolveValue( aPerson, key ); } finally { ConfigUtils.removeFromEnvironment( myEnv, key ); } } return resolveValue( aPerson, myBodyKey ); }  void init(); String getResolvedBody( Person<?> aPerson ); String getResolvedSubject( Person<?> aPerson ); static final String KEY_EXTRA_MAIL_BODY_FILE; static final String KEY_EXTRA_MAIL_BODY_TEXT; }