private void verify() throws Exception {
    String motd = applicationContext.getBean("motd", String.class);
    assertEquals(configuration.getMOTD(), motd);

    String testingStr = applicationContext.getBean("testingStr", String.class);
    String expected = configuration.getMOTD() + "-" + configuration.getTesting().getInt();
    assertEquals(expected, testingStr);
    assertEquals(configuration.getMOTD(), bean.getValue());
  }
 @Test
 public void testProperties() throws Exception {
   assertEquals(configuration.getMOTD(), unchangableMotd);
   String expected = configuration.getMOTD() + "-" + configuration.getTesting().getInt();
   assertEquals(expected, unchangableTestingStr);
   assertEquals(configuration.getMOTD(), bean.getValue());
   verify();
   Thread.sleep(2000);
   for (int i = 0; i < 3; i++) {
     configuration = writeConfig();
     Thread.sleep(2000);
     verify();
   }
 }
 private static Configuration writeConfig() {
   Random r = new Random();
   ConfigurationDocument doc = ConfigurationDocument.Factory.newInstance();
   configuration = doc.addNewConfiguration();
   Testing testing = configuration.addNewTesting();
   configuration.setMOTD("Value_" + RandomStringUtils.randomAlphabetic(6));
   testing.setInt(r.nextInt());
   testing.setString("${//c:MOTD}-${//c:Testing/c:Int}");
   ThirdPartyConfiguration thirdPartyConfiguration = configuration.addNewThirdPartyConfiguration();
   thirdPartyConfiguration.setHost("localhost");
   thirdPartyConfiguration.setPort(1234);
   thirdPartyConfiguration.setUsername("username");
   thirdPartyConfiguration.setPassword("password");
   TestSupport.write(doc);
   return configuration;
 }