@SuppressWarnings("unchecked")
public void testInitialization() {
// Test setup
ProjectRpcAsync mockProjService = EasyMock.createMock(ProjectRpcAsync.class);
ComponentsView mockView = EasyMock.createMock(ComponentsView.class);
SimpleEventBus mockEventBus = EasyMock.createMock(SimpleEventBus.class);
UserRpcAsync securityService = EasyMock.createMock(UserRpcAsync.class);
DataRpcAsync dataService = EasyMock.createMock(DataRpcAsync.class);
List<Component> components = new ArrayList<Component>();
List<Signoff> signoffs = new ArrayList<Signoff>();
Collection<String> labels = Lists.newArrayList();
Project parentProject = new Project();
parentProject.setProjectId(42L);
// Verify this initialization sequence
securityService.hasEditAccess(EasyMock.eq(42L), EasyMock.isA(AsyncCallback.class));
EasyMockUtils.setLastAsyncCallbackSuccessWithResult(true);
mockProjService.getProjectComponents(EasyMock.eq(42L), EasyMock.isA(AsyncCallback.class));
EasyMockUtils.setLastAsyncCallbackSuccessWithResult(components);
dataService.getSignoffsByType(EasyMock.eq(42L), EasyMock.eq(AccElementType.COMPONENT),
EasyMock.isA(AsyncCallback.class));
EasyMockUtils.setLastAsyncCallbackSuccessWithResult(signoffs);
mockProjService.getLabels(EasyMock.eq(42L), EasyMock.isA(AsyncCallback.class));
EasyMockUtils.setLastAsyncCallbackSuccessWithResult(labels);
mockView.enableEditing();
mockView.setPresenter((Presenter) EasyMock.anyObject());
mockView.setProjectComponents(components);
mockView.setSignoffs(signoffs);
mockView.setProjectLabels(labels);
EasyMock.replay(mockView, mockProjService, securityService, dataService);
ComponentsPresenter testPresenter = new ComponentsPresenter(
parentProject, mockProjService, securityService, dataService, mockView,
mockEventBus);