Yes, Cruz was cleverly used a poster boy for what the GOPe did become. Trump wisely let Cruz have his 15 minutes...now it would be stupid of Cruz not endorse Trump even though he is stumping for the 2020 pres run — which he would not get unless by default since the lawless RATS cannot produce a candidate that does not stand for the DemocRat Mafia.
So in reality Cruz punked himself which Trump and his advisors probably just smiled at each other.
But to be able to do so he has to separate himself - once and for all - from the caricature of the patrician right as exemplified by the GOPe. Since he's an expert at media, Trump knows he must have a clear visual ie a personal target, as well as a tag line. Hence Lyin' Ted, Crooked Hillary, etc.
So now Cruz is the poster boy of the petulant GOPe. Trump can/must demonstrate to Dems & independents that he's done with that (former) wing of the party. Secondly, he's going to tear into Hillary/Dems to characterize them as the other big biz, NWO party opposed to individual liberty & self determination.
We are watching a master at work. I have no doubt whatsoever that Trump suspected Cruz would do what he did, and by doing so, allowed Trump to seize the moment & control the narrative to suit his general election positioning.