Virginia could play host to a de facto referendum on President Trump in November, when it holds one of just two gubernatorial races this year – but before that, an upcoming June primary will give a glimpse into what kind of candidate each party intends to bring to the fight.

Going into the June 13 vote, a classic establishment vs. anti-establishment battle is being waged in both parties, complete with a Trump-style candidate on the GOP side and a Bernie Sanders-style contender on the other.

On the Democratic side, things got ugly last week in Richmond when Lt. Gov. Ralph Northam, backed by most state Democratic officials, debated former U.S. Rep. Tom Perriello, the candidate boasting endorsements from Sens. Sanders and Elizabeth Warren and some Obama administration alumni.

Northam said “Virginia is a fiscally responsible state,” and talked about “bringing together both sides.” Perriello invoked emotional anecdotes about single mothers and attacked his opponent for supporting “trickle-down economics” and for voting for George W. Bush twice. Northam fired back that Perriello was a former self-described libertarian.

Yet for all the barbs, both support policies like hiking the minimum wage to $15 per hour, subsidizing green energy, and supporting free pre-school and college.

It hasn’t been tame on the Republican side, either.

After frontrunner Ed Gillespie, a former Republican National Committee chairman, released a plan last week to cut $200 million in state spending, his opponent Corey Stewart blasted him for being a “career lobbyist” who wants to “reinvent himself as a conservative.”

Stewart, chairman of the Prince William County Board of Supervisors, made a name for himself a decade ago tackling illegal immigration. He was an early Trump supporter and chairman of Trump’s Virginia campaign before he was fired for participating in a protest at the RNC headquarters, claiming the RNC provided insufficient support for the nominee.

A third GOP candidate is state Sen. Frank Wagner, who is campaigning as an experienced problem solver.

A Quinnipiac University poll in April found Perriello had 25 percent of Democratic support to Northam’s 20 percent, but a majority of Democrats are still undecided. The same poll found Gillespie—who narrowly lost a 2014 Senate race to unseat Mark Warner—with a double-digit lead over both Stewart and Wagner.

In a worrisome note for Republicans, the Quinnipiac poll found either Perriello or Northam beating Gillespie by more than 10 points.

Primaries are difficult to poll, noted Geoff Skelley, political analyst with the University of Virginia’s Center for Politics. But Republicans likely prefer to run against Perriello, for a race they could characterize as a moderate Republican vs. a Bernie Sanders Democrat.

“If it is Gillespie vs. Perriello, there is a chance that a lot of main street business people that might well have voted for Northam would be inclined to vote for Gillespie,” Skelley told Fox News.

Former Hillary Clinton campaign chairman John Podesta, as well as Obama administration heavyweights like David Plouffe and Dan Pfeiffer, support Perriello, who was elected to Congress in 2008 but lost in the 2010 Republican wave. After that, Obama named him to a State Department job. Meanwhile, Gov. Terry McAuliffe, and Sens. Warner and Tim Kaine and virtually every elected Democrat in the state are backing Northam for the nomination.

So, in some ways, the contest is more about national Democrats vs. state Democrats, Skelley said.

“Northam and Perriello really have more stylistic differences, just different shades of blue,” Skelley said.

It won’t be easy for Republicans in the fall, given Trump’s troubles at the national level.

“The national Democratic Party will throw everything into this race since it will probably be the only competitive governor’s race and try to tie Trump around Gillespie’s neck,” said Quentin Kidd, director of the Wason Center for Public Policy at Christopher Newport University.

The other 2017 governor’s race is in New Jersey, but Kidd said he doesn’t anticipate a very competitive race there.

“Gillespie will earn every vote he gets and the people who work for Gillespie will earn every cent they make,” Kidd said.

Stewart has gone all-in with Trump, opposing political correctness by advocating for the Confederate flag and preservation of Confederate monuments.

Gillespie avoids mentioning Trump or his opponents, talking about the state’s anemic economic growth and touting a 10 percent across-the-board tax cut.

In an interview with Fox 5 in Washington, when asked about Trump, Gillespie answered, “We need to be less reliant on federal policies and federal programs and spending and for me the way that we’re going to do that is to foster more start-ups and scale-ups in Virginia.”