In lots of our server integration tests we obtain and use the overlord. I added a small
utility to eliminate the boiler plate as well as the round trips to the database. Instead
of doing,
public void myTest() {
SubjectManagerLocal subjectManager = LookupUtil.getSubjectManager();
Subject overlord = subjectManager.getOverlord();
….
}
you can alternatively do,
public class MyTest {
@Inject @Overlord
private Subject overlord;
}
This is more succinct, eliminating the dependency on SubjectManagerLocal for those
frequent cases when you only want to get the overlord, and it eliminates the calls to the
database.
- John