Sirach (Ecclesiasticus) 12:8

A friend cannot be known in prosperity: and an enemy cannot be hidden in adversity.

Brenton's English Septuagint