}
@Test
public void loadSubsystems() throws Exception
{
SubsystemStore subsystemStore = injector.getInstance(SubsystemStore.class);
TestCallback<List<SubsystemRecord>> callback = new TestCallback<List<SubsystemRecord>>() {
@Override
public void onSuccess(List<SubsystemRecord> result) {
assertTrue("No subsystems found", result.size()>0);
boolean match = false;
for(SubsystemRecord subsys : result)
{
if(!match)
match = subsys.getTitle().equals(EXPECTED_SUBSYSTEM);
}
assertTrue("Subsystem '" + EXPECTED_SUBSYSTEM + "' not found", match);
didCallback = true;
}
};
subsystemStore.loadSubsystems("default", callback);
synchronized (callback) {
callback.wait(500);
}