In the Testament of Joseph, who was the eleventh son of Jacob/Israel, Joseph goes into excessive detail about his resistance to temptation from Potiphar's wife and the great lengths he went through to avoid bringing shame to his family when he was sold as a slave, in this, my least favorite of the Testaments.
On his deathbed, Joseph gathered together his sons to impart his life lessons (1:1-3).
Throughout his life, Joseph persevered in God's truth, and in return God protected, blessed, comforted, and exalted him. God does not forsake those who fear Him (1:4-22). God always protects, but may temporarily withdraw to try the soul. Joseph had been tempted ten times, and thereby proved to be good (1:23-24).
Pentephris's (Potiphar's) wife often punished and threatened Joseph with death, and tempted him with money and power, trying to get him to have sex with her (ref. Genesis 39). However, Joseph continued on righteously praying, fasting, abstaining from wine when Pentephris was away, and giving to the poor and sick. Pentephris's wife would make excuses to see him, and embraced him like a son to lure him into having sex. She would flatter him and praise his chastity in public, while trying to seduce him privately. Joseph lamented and tried to get her to change her evil ways. She said that she would learn the ways of righteousness if he had sex with her. He said God would not be pleased by that, and he prayed and fasted more. She threatened to kill her husband, but Joseph threatened to reveal her plot. She tried to enchant Joseph's food, but a vision revealed the trick to Joseph so that he didn't eat any tainted food. When she questioned him about why he didn't eat, he revealed that he knew that it was enchanted, and then prayed and ate some of that food to prove that such enchantments have no power over chaste, God-worshipers. Then she faked being sick and threatened to kill herself, but he reminded her that her rival would then wipe out her family. With her skewed perspective, she took this for a sign that he really loved her and would someday be hers (1:25-68).
After that, Joseph prayed all day and all night to be free from Pentephris's wife. The next day she grabbed him by his clothing to drag him into having sex, so he fled away naked. With his clothing, Pentephris's wife accused Joseph, and so he was thrown into prison. He gave thanks to God for delivering him from her. She sent him offers of release if he would have sex with her, but he never even thought about accepting them (1:69-75).
God loves a man who combines chastity with fasting. If a chaste man desires glory, God will give it to him, like He did with Joseph (1:76-77). God helped Joseph stand up to the temptations of Pentephris's beautiful wife (1:78-81).
Joseph advises his progeny that great things come from prayer, fasting, and chastity, and God especially loves chastity. God will protect and exalt a man due to his chastity (2:1-4).
Joseph humbled himself because he feared God and knew that this world would pass away. Joseph still respected his brothers despite being sold by them, and he kept his identity a secret from the Ishmaelite slave traders (the original ones who bought him) and from the Egyptian slave trader who temporarily held Joseph for the Ishmaelites until they go back. The Egyptian slave trader placed Joseph in charge of his household. While Joseph ran the household, the Egyptian slave trader became rich, which attracted the attention of Pentephris's wife. She heard that Joseph had most likely been stolen out of Canaan, and pleaded with Pentephris to free Joseph in order to be blessed by God. So Pentephris questioned the Egyptian slave trader, and beat him when he did not give good answers, but the trader didn't change his story. So Pentephris questioned Joseph, and Joseph continued to hide his identity, calling himself a slave from Canaan. So Pentephris beat Joseph for that unrealistic answer. Pentephris's wife pleaded that Pentephris was unjust, and Joseph didn't change his story, so Pentephris had Joseph put in prison until the Ishmaelites came back. When they did come back, they asked Joseph why he had lied to them about being a slave, because they had discovered that he was Jacob/Israel's son, but Joseph persisted in telling them that he was a slave and that he did not know Jacob/Israel. So the Ishmaelites sought to sell him quickly to escape possible wrath from Jacob/Israel. Hearing Joseph was for sale, Pentephris's wife sent a eunuch to buy Joseph. The eunuch paid eighty pieces of gold, but told Pentephris's wife that the cost was one hundred pieces. (Joseph kept quiet about this to avoid shaming the eunuch.) Joseph had kept his own identity secret throughout all of this so that his family would not be shamed (2:5-58).
Joseph advises his progeny also to, with love and patience, hide each others faults, because God loves unity (2:59-60).
When Joseph's brothers came to Egypt, he did not rebuke them at all, but rather richly blessed them and shared all that he had with them and their progeny in loving servitude for them (2:61-66).
Joseph advises to obey God's Laws, and do well to and pray for those who do evil to you, because then God will save you from evil (2:67-68).
In humility and patience, Joseph took the daughter of a pagan priest as a wife, so God gave him gold, servants, enduring strength. and good looks (2:69-71).
Joseph saw a vision where twelve hart (male deer) were feeding, then nine of them were scattered, followed by the remaining three. From Judah was born a virgin wearing linen, who then bore a spotless lamb. All beasts rushed against the lamb, but the lamb destroyed them and trod on them. Angels and men rejoiced. This will happen in the last days (2:72-76). Therefore, Joseph advises his progeny to obey God's Law, and honor Levi and Judah, because from them will come the Lamb of God, who takes away the sins of the world, and saves the Jews and Gentiles in His everlasting kingdom (2:77-78).
Joseph knows that the Egyptians will mistreat his progeny after he dies, but assures them that God will take vengeance on the Egyptians. When they take his bones to be buried at Hebron, God will be their light, and Egypt and Belair (Belial) will be in darkness (2:79-81).
Then Joseph died (2:82-84).
There are definite themes and unmistakable prophesies of Christianity in Joseph.
In Joseph 1:23, we see that God will not forsake those who fear Him, as Hebrews 13:5 would suggest, and He will depart from you only as necessary to try your soul, possibly like we see when God forsakes Jesus on the cross in Matthew 27:46 and Mark 15:34.
Joseph 1:29 is almost an anti-parallel, because Joseph claims that God will give you a beautiful face for fasting, while in Matthew 6:16-18 Jesus instructs to beautify yourself to hide the fact that you are fasting.
Joseph 1:68 speaks of becoming enslaved by wicked desires, similar to how John 8:34, Romans 6:6, Romans 6:16-22, Romans 7:14, and Romans 7:25 mention being a slave to sin.
Joseph 1:76-77 and Joseph 2:2-3 show how much God loves chastity, which is reflected in Jesus' words in Matthew 19:12, and in 1 Corinthians 7:1-9.
In Joseph 2:5, we see Joseph claim that this world would pass away, implicitly stating that Joseph stayed focused on the world of the afterlife, a sentiment common to Jesus' words in Matthew 24:35, Mark 13:31, and Luke 21:33, and in 1 Corinthians 7:29-35.
Joseph 2:6-60, highlighted explicitly in Joseph 2:10, Joseph 2:45, and Joseph 2:57-60, is a living example demonstrating the Christian principle of bearing patiently through the faults of other people and their consequences, so as to promote love and unity, and not shame people. This message can be found in Romans 2:1-4, Galatians 5:22-26, Ephesians 4:1-6, and Colossians 3:12-14.
Joseph 2:61-67 is another living example demonstrating the Christian principle that if you humble yourself and serve others, you will be exalted by God, as we see in Matthew 20:28, Matthew 23:12, Mark 10:45, Luke 1:52, Luke 14:11, Luke 18:14, Luke 22:26-27, Galatians 5:13, Philippians 2:8, James 4:6-10, and 1 Peter 5:5-6.
Joseph 6:68 claims that we should do well to and pray for those who wrong us, much like Jesus' message in Matthew 5:38-48, and like what we see in Romans 12:21.
In the prophesy department, Joseph 2:74-78 is an encapsulation of the Christian story: The Lamb of God (John 1:29, John 1:36, 1 Peter 1:19, Revelation 7:10), without spot (sin) (2 Corinthians 5:21, 1 Peter 1:19), with an eternal kingdom (Luke 1:33, 2 Peter 1:11), will be born to a virgin (Matthew 1:18-25, Luke 1:26-35, Luke 2:1-6) and will take away the sins of the world (John 1:29, Romans 11:27, Hebrews 9:26-28, 1 John 3:5) for both Jews and Gentiles (Romans 1:16, 1 Corinthians 12:13, Galatians 3:28, Colossians 3:11), and though beasts attack Him He will overcome them (the book of Revelation). Joseph 2:74 hints at and Joseph 2:77 speaks explicitly of the combined Levi and Judah lineage from where this Lamb of God will come. Consider that Matthew 1:1-17 has Jesus' lineage of Joseph traced through the tribe of Judah, and many Biblical scholars suggest that Luke 3:23-38 has Jesus' lineage traced through Mary, and hold that Mary had bloodline ties to Levi (although they are under some dispute where exactly the Levitical bloodline enters).
Finally, regarding Beliar, in Joseph 1:63 Beliar is a spirit troubling Pentephris's wife and causing her to act sinfully, like we would expect from Satan. In Joseph 2:80 we find Beliar being literally left in darkness with the Egyptians, which is unlike Satan.
"For the Lord doth not forsake them that fear Him, neither in darkness, nor in bonds, nor in tribulations, nor in necessities." - Joseph 1:21
"But in all those things doth He give protection, and in divers ways doth He comfort, though for a little space He departeth to try the inclination of the soul." - Joseph 1:23
"And I fasted in those seven years, and I appeared to the Egyptians as one living delicately, for they that fast for God's sake receive beauty of face." - Joseph 1:29
"And if my lord were away from home, I drank no wine; nor for three days did I take my food, but I gave it to the poor and sick." - Joseph 1:30
"And she said unto me: If thou willest that I should leave my idols, lie with me, and I will persuade my husband to depart from his idols, and we will walk in the law by thy Lord." - Joseph 1:40 (reference to God's Law hundreds of years before it would be Biblically given, oh, and that's quite the proposition!)
"And when I saw the spirit of Beliar was troubling her, I prayed unto the Lord, and said unto her:" - Joseph 1:63 (the spirit of Beliar was causing her to act sinfully)
"For if a man hath fallen before the passion of a wicked desire and become enslaved by it, even as she, whatever good thing he may hear with regard to that passion, he receiveth it with a view to his wicked desire." - Joseph 1:68
"For God loveth him who in a den of wickedness combines fasting with chastity, rather than the man who in kings' chambers combines luxury with license." - Joseph 1:76
"And if a man liveth in chastity, and desireth also glory, and the Most High knoweth that it is expedient for him, He bestoweth [it;] this [He] also [bestowed] upon me." - Joseph 1:77 (be chaste, and God will glorify you!)
"So ye too, if ye follow after chastity and purity with patience and prayer, with fasting in humility of heart, the Lord will dwell among you because He loveth chastity." - Joseph 2:2
"And wheresoever the Most High dwelleth, even though envy, or slavery, or slander befalleth a man, the Lord who dwelleth in him, for the sake of his chastity not only delivereth him from evil, but also exalteth him even as me." - Joseph 2:3
"My brethren knew how my father loved me, and yet I did not exalt myself in my mind: although I was a child, I had the fear of God in my heart; for I knew that all things would pass away." - Joseph 2:5
"Do ye also, therefore, love one another, and with long-suffering hide ye one another's faults." - Joseph 2:59
"And their children were my children, and my children as their servants; and their life was my life, and all their suffering was my suffering, and all their sickness was my infirmity." - Joseph 2:64
"And I exalted not myself among them in arrogance because of my worldly glory, but I was among them as one of the least." - Joseph 2:66
"And I saw that from Judah was born a virgin wearing a linen garment, and from her, was born a lamb, without spot; and on his left hand there was as it were a lion; and all the beasts rushed against him, and the lamb overcame them, and destroyed them and trod them under foot." - Joseph 2:74 (the linen worn by the virgin likely is a metaphor to the Levitical priesthood)
"And because of Him the angels and men rejoiced, and all the land." - Joseph 2:75
"Do ye therefore, my children, observe the commandments of the Lord, and honour Levi and Judah; for from them shall arise unto you the Lamb of God, who taketh away the sin of the world, one who saveth all the Gentiles and Israel." - Joseph 2:77 (Consider that Matthew 1:1-17 has Jesus' lineage of Joseph traced through the tribe of Judah, and many Biblical scholars suggest that Luke 3:23-38 has Jesus' lineage traced through Mary, and hold that Mary had bloodline ties to Levi.)
"For His kingdom is an everlasting kingdom, which shall not pass away; but my kingdom among you shall come to an end as a watcher's hammock, which after the summer disappeareth." - Joseph 2:78
"But ye shall carry up my bones with you; for when my bones are being taken up thither, the Lord shall be with you in light, and Beliar shall be in darkness with the Egyptians." - Joseph 2:80