1 Chronicles 28:9,10 (KJV)
9 And thou, Solomon my son, know thou the God of thy father, and serve him with a perfect heart and with a willing mind: for the Lord searcheth all hearts, and understandeth all the imaginations of the thoughts: if thou seek him, he will be found of thee; but if thou forsake him, he will cast thee off for ever.
10 Take heed now; for the Lord hath chosen thee to build an house for the sanctuary: be strong, and do it.
1 Chronicles 28
David’s Counsel To The People And Solomon
So God trusted in Solomon but desired that he would show himself worthy, by keeping His commandments and judgments for the people.