Possible meanings are 1) the writer uses the word "heavens" to refer to the angels who live there or 2) the writer speaks of "the heavens" as if they are a person who testifies about God's righteousness.