@Test
public void testVariableUpdateAction() {

  VariableContext variables = new VariableContext();
  variables.put("%default", "root.default");
  variables.put("%immutable", "immutable");
  variables.put("%empty", "");
  variables.put("%null", null);
  variables.put("%sub", "xxx");
  variables.setImmutables("%immutable");
  MappingRuleAction updateDefaultManual =
      new MappingRuleActions.VariableUpdateAction("%default", "root.%sub");
  MappingRuleAction updateDefaultHelper =
      MappingRuleActions.createUpdateDefaultAction("root.%sub%sub");
  MappingRuleAction updateImmutable =
      new MappingRuleActions.VariableUpdateAction("%immutable", "changed");
  MappingRuleAction updateEmpty =
      new MappingRuleActions.VariableUpdateAction("%empty", "something");
  MappingRuleAction updateNull =
      new MappingRuleActions.VariableUpdateAction("%null", "non-null");
  MappingRuleResult result;
  result = updateDefaultManual.execute(variables);
  assertSkipResult(result);
  assertEquals("root.xxx", variables.get("%default"));
  result = updateDefaultHelper.execute(variables);
  assertSkipResult(result);
  assertEquals("root.xxxxxx", variables.get("%default"));
  result = updateEmpty.execute(variables);
  assertSkipResult(result);
  assertEquals("something", variables.get("%empty"));
  result = updateNull.execute(variables);
  assertSkipResult(result);
  assertEquals("non-null", variables.get("%null"));
  try {
    updateImmutable.execute(variables);
    fail("Should've failed with exception");
  } catch (Exception e){
    assertTrue(e instanceof IllegalStateException);
  }
}