I think Tim's answer will handle your specific use case. There are additional recipes for adding and changing spring property values and these recipes will make changes to both properties and yaml formatted files.
The best way to get an idea of how these recipes work is to take a peek at the tests: