Michaelia Cash’s former media adviser has admitted in court that he leaked details of a federal police raid on the Australian Workers’ Union but declined to say who tipped him off.

A high-profile federal court trial has begun to determine the legality of Australian federal police raids on the union’s Melbourne and Sydney headquarters in October 2017.

On Monday, the court heard that letters and communications sent by Cash, a senator and former employment minister in the Coalition government, and her office illustrate a “keen political interest” in the AWU before its offices were raided by police.

The raids, which were part of an investigation by the Registered Organisations Commission, drew scrutiny because tipped-off TV crews and journalists arrived at the offices before police.

Cash’s former media adviser, David De Garis, told the court on Monday he learned police were set to raid the union’s offices about midday on 24 October. Asked who told him about the upcoming raids, De Garis replied: “I respectfully decline to answer that question on the grounds it may incriminate me.”

The AWU claims the the investigation was illegal because it was politically motivated, allegedly instigated by Cash to hurt the union and the Labor leader, Bill Shorten.

Cash sent two letters of referral to the commission in relation to the AWU in the months before the investigation was launched, the trial was told.

“The underlying theme is there was a keen political interest on the part of the senator in the subject matter of the investigation,” the AWU’s lawyer Herman Borenstein QC told the trial on Monday.

“It is demonstrated in the beginning by the letters and demonstrated again in October 2017 by communications ... and the media exploitation.”

The commission’s legal counsel Frank Parry QC argued the media leaks about the raids, which came three days after the investigation was launched, were not relevant in determining the trial. He said the key issue was determining whether the investigation itself, launched by the commission executive director, Chris Enright, was deemed to be politically motivated.

“What goes on in the minister’s office is a matter for the minister,” Parry said. “Whatever views the minister might have had about political advantage ... take the matter nowhere as far as the Registered Organisation Commission is concerned.”

De Garis, who quit Cash’s office over the media leaks, began his testimony on Monday, detailing his work with journalists and ROC media representatives.

Cash, who is now Minister for Small and Family Business, Skills and Vocational Education, was expected to testify on Friday, with federal parliament sitting from Tuesday to Thursday.

“Michaelia Cash, after months of ducking and weaving, will herself give evidence,” AWU’s other lawyer Josh Bornstein said outside court. “There will be nowhere to hide for Michaelia Cash. There will be no whiteboards in the federal court.”

The raids were part of an investigation into a $100,000 donation from the union to activist group GetUp! in 2006.

Cash denies any wrongdoing, saying she is happy to assist the court and that the AWU must still answer questions about the donations, which were made to GetUp while Shorten was the union’s boss.

The other witnesses to be called are the ROC’s then-acting media adviser Mark Lee, Cash’s former chief of staff Ben Davies and Enright.

The federal police confirmed last month it would not lay charges against De Garis because there were “no prospects of a conviction”.