Hadith on Graves: People are tested and questioned in the grave

Asma bint Abi Bakr reported: The Messenger of Allah, peace and blessings be upon him, said, “It has been revealed to me that you will be put to trial in the grave, similar to the trial of the False Messiah. As for the believer or Muslim, he will say: Muhammad came to us with clear evidence and we answered him and believed in him. It will be said: Sleep in peace, for we knew you had conviction. As for the hypocrite or the doubter, he will say: I do not know, for I heard people saying something and I repeated it.

Source: Ṣaḥīḥ al-Bukhārī 6857

Grade: Sahih (authentic) according to Al-Bukhari

عَنْ أَسْمَاءَ ابْنَةِ أَبِي بَكْرٍ قَالَتْ قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ أُوحِيَ إِلَىَّ أَنَّكُمْ تُفْتَنُونَ فِي الْقُبُورِ قَرِيبًا مِنْ فِتْنَةِ الدَّجَّالِ فَأَمَّا الْمُؤْمِنُ أَوِ الْمُسْلِمُ فَيَقُولُ مُحَمَّدٌ جَاءَنَا بِالْبَيِّنَاتِ فَأَجَبْنَا وَآمَنَّا‏ فَيُقَالُ نَمْ صَالِحًا عَلِمْنَا أَنَّكَ مُوقِنٌ‏ وَأَمَّا الْمُنَافِقُ أَوِ الْمُرْتَابُ فَيَقُولُ لاَ أَدْرِي سَمِعْتُ النَّاسَ يَقُولُونَ شَيْئًا فَقُلْتُهُ

6857 صحيح البخاري كتاب الاعتصام بالكتاب والسنة