Fix tests that break on Wildfly

These tests are more generally robust as a result.