The world tests new presidents.

President John F. Kennedy was in office less than three months when he was blindsided by a CIA-led invasion of Cuba that ended in humiliating defeat at the Bay of Pigs. He and the CIA never trusted each other after that.

Two months later, at the height of the Cold War, JFK met Soviet Premier Nikita Khrushchev for the first time. Poorly prepared and heavily medicated for back pain, Kennedy came across as weak and out of his depth. Khruschchev was emboldened to send nuclear weapons to Cuba, which brought the two nations to the brink of war.

President Jimmy Carter ran as a Washington outsider, and Washington insiders didnít take it well. Right off the bat, he clashed with the Democrats who ran Congress, members of his own party, over public works spending. He never established the working relationships with Congress necessary to advance his agenda.

Soon after he was sworn in, President Bill Clinton got in trouble with both Congress and the Pentagon over his pledge to lift the ban on gays in the military. Clinton had to back down, which emboldened Republican Senate leader Bob Dole to adopt as a default setting opposition to anything Clinton proposed.

I expect all presidents wish they had ďdo-oversĒ early in their first terms. President George W. Bush probably wishes he hadnít told his people not to worry so much about the threat from terrorists. President Barack Obama probably wishes heíd reached out more to Republicans in Congress and had fashioned his own health reform bill instead of letting Nancy Pelosi and Harry Reid carry the ball.

President-elect Donald J. Trump has yet to take office, but he is already being tested. Heís off to a terrible start with the CIA and other intelligence agencies. He has doubted their findings, undermined their credibility, even compared them to Nazis. The lack of trust between a president and these critical national security agencies has never been so publicly expressed.

Harsh words invite retaliation. The people in the intelligence community Trump has criticized may not be the ones who leaked the document to Buzzfeed containing unverified, scandalous claims about Trump, though strategic leaks are the most common weapon used in Washington battles. But just by including the document in briefing papers given to both Obama and Trump, top intelligence officials gave the mainstream media permission to talk out loud about charges that had previously only been whispered.

On another front, Russiaís Vladimir Putin is likely sizing up Trump just as Khruschchev sized up JFK, with world events hanging on his calculations. The leaders of other nations ó China, Iran, North Korea ó may be preparing their own test for the rookie president.

Trumpís relationship with Congress is also fraught. He campaigned against the Washington Republican establishment almost as hard as he campaigned against Democrats. Trumpís dealings with House Speaker Paul Ryan have run hot and cold for the last year, and Trump is still gloating about the primary defeats he dealt opponents like Lindsey Graham, Marco Rubio and Rand Paul.

But those men arenít just vanquished opponents, they are sitting senators with the power to stop Trumpís initiatives in their tracks. Actions have consequences. Do you think a day goes by without Rubio remembering Trumpís taunts of ďLittle Marco,Ē which helped kill his presidential bid? Rubio is among a handful of ambitious Republicans already looking to the next presidential campaign. Their agendas, both substantive and political, are not Trumpís.

All presidents face the test of building an administration capable of speaking with one voice, making sound decisions and executing complicated plans. Trumpís cabinet nominees are already disavowing his campaign positions. White House veterans worry that Trumpís emerging organization, much like its leader, will be characterized by chaos and competition, not discipline and coherence.

Trump is still relishing his November victory, as well he should. He enjoyed nothing more than pumping up his fans at mass rallies, which he plans to keep doing while in office. But the adulation of friendly crowds and the votes of strategically-located rust belt supporters donít count for much now that the electionís over. Trumpís in Washington now, and his success depends not on voters but on other leaders with their own power bases ó Congress members, generals, intelligence chiefs ó and on thousands of members of the permanent government who were there before Trump arrived and will be there long after heís gone.

Trump has had tremendous success in the last year, and nobody should write him off. But Washington can be a tough town, especially for outsiders and newcomers. As President Harry Truman is, perhaps inaccurately, credited with saying, ďIf you want a friend in Washington, get a dog.Ē

Donald Trump has never been fond of pets, so heís unlikely to follow Trumanís advice. But this much is certain: He will be tested.

ó Rick Holmes writes for GateHouse Media and the MetroWest Daily News. He can be reached at rholmes@wickedlocal.com. Like Rick on Facebook at Holmes & Co., and follow him @HolmesAndCo.