few years before Ezekiel the priest was taken into captivity (and made an agricultural slave outside of the city of Babylon) Daniel the prince had been taken (among many others), turned into a eunuch, and brought into the very court of Nebuchadnezzar, the king of Babylon. This turn of events had been prophesied by Isaiah to Hezekiah as is recorded back in 2nd Kings 20:18 (compare to Daniel 1:3). Nebuchadnezzar took Jerusalem in 3 phases, Daniel was taken in the first siege, Ezekiel in the second and the temple in the last.
Daniel and three of his cousins from the tribe of Judah (Hananiah, Mishael, and Azariah) were exceptional young men before they were ever taken into captivity. But, in Babylon they were destined to be trained for 3 years under the finest educational rigors that were available in that day. Along with their schooling, they were supposed to be fed the same things that the king himself was fed. This was problematic. Daniel was a good Jew who had committed himself to maintaining his Jewish distinctness (even in this foreign land). The things that the king was prone to eat would have included many items which had been forbidden under Moses' law. So, Daniel asked the prince of the eunuchs (to no avail) if he could have a simpler diet (Daniel 1:8-10). Since that didn't work, he asked a steward (who was only responsible for a fraction of the eunuchs) if he could have a 10-day test of eating a simpler diet (Daniel 1:11-13). It was a real step of faith for Daniel. He took the right stand (depending upon God to reward his faith). His 3 companions were in on the test as well and God certainly came through for them all.