Refsctor basicAuth tests.