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