You´re changing the real user config file. You need to set the user config to a temporary file, as done in https://github.com/forge/core/blob/master/configuration/tests/src/test/java/org/jboss/forge/addon/configuration/ConfigurationFactoryTest.java#L63