Doorman: Fixing timing issue in JUnit test