I ran into a problem when testing my Kerberos login class. If I set an invalid Kerberos realm (or KDC) and try to authenticate, instead of failing as it should, it authenticates successfully. It seems that it's using the correct realm and KDC that was provided in previous tests. I can tell that this is the case because if I start out with the tests that have the invalid realm, then the authentication fails (as it should).
Is there some sort of persistent state that I'm unaware of? I'm using System.setProperty to set the Kerberos realm to an invalid one.