Hadithcore
Mishkat al-Masabih, 3076

Jabir reported God’s Messenger as saying, “He who dies leaving a will has died following a path and a <i>sunna</i>, he has died piously and testifying to the true faith, and he has died with his sins forgiven.” Ibn Majah transmitted it.

عَنْ جَابِرٍ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «مَنْ مَاتَ عَلَى وَصِيَّةٍ مَاتَ عَلَى سَبِيلٍ وَسُنَّةٍ وَمَاتَ عَلَى تُقًى وَشَهَادَةٍ وَمَاتَ مَغْفُورًا لَهُ» . رَوَاهُ ابْنُ مَاجَهْ

References1 variant
In-Book Reference
Book 12, Hadith 35