LPS-51439 Extract junit calls as a macro to reduce duplicate code