Revert "remove duplicate code in test classes"

This reverts commit 6318775faad41a07c1cd76a058562da9e1777ff9.