TMDM-7266: "Edit the reference name ,save it will throw NPE"

Refactor unit test.