Usul al-Kafi
Book 4:
The Book of Divine Proof

Chapter 61
The Imams abide by the commandments of God

416. 3. Imam Muhammad al-Baqir (p) was asked by Humran about the persecution of Imam Ali (p), Imam al-Hasan (p) and Imam al-Husayn (p), and their steadfastness in the defence of the Religion of God. The Imam (p) upon hearing this said: God, the Glorious and Exalted, had destined these events to happen to them. They were aware of what the future held for them. This information was given to them by the Prophet Muhammad (p). Therefore, Imam Ali (p), Imam al-Hasan (p), and Imam al-Husayn (p) remained steadfast. Among us whoever was told to remain silent, did remain silent.