[WFLY-2879] - Remove duplicated code from test cases where custom modules are needed.

It is back now.