I lived in Barcelona for 8 months and twice I brought my hormones (estrogen and testosterone blocker) out of and in to the country without a problem. But then again I'm a European citizen and I didn't declare anything.
I unfortunately don't have any idea how it works if you're travelling from a country outside of EU and into one.
If you have a prescription for the testosterone there should be no problems though, as long as you bring the prescription. Then it's medication and it's your right to bring enough for your own use into the country.