@Test public void testOnInstanceUpdateWithoutSelect() { final ServerInstance serverInstance = new ServerInstance( "templateId", "serverName", "serverInstanceId", "url", "1.0", Collections.<Message>emptyList(), Collections.<Container>emptyList() ); presenter.onInstanceUpdate( new ServerInstanceUpdated( serverInstance ) ); verify( view, never() ).clear(); verify( view, never() ).setServerName( anyString() ); verify( view, never() ).setServerURL( anyString() ); verify( view, never() ).setEmptyView( any(RemoteEmptyView.class) ); }
public void onInstanceUpdate( @Observes final ServerInstanceUpdated serverInstanceUpdated ) { if ( serverInstanceUpdated != null && serverInstanceUpdated.getServerInstance() != null ) { final ServerInstanceKey updatedServerInstanceKey = toKey( serverInstanceUpdated.getServerInstance() ); if ( serverInstanceKey != null && serverInstanceKey.getServerInstanceId().equals( updatedServerInstanceKey.getServerInstanceId() ) ) { serverInstanceKey = updatedServerInstanceKey; loadContent( serverInstanceUpdated.getServerInstance().getContainers() ); } } else { logger.warn( "Illegal event argument." ); } }
RemotePresenter { public void onInstanceUpdate( @Observes final ServerInstanceUpdated serverInstanceUpdated ) { if ( serverInstanceUpdated != null && serverInstanceUpdated.getServerInstance() != null ) { final ServerInstanceKey updatedServerInstanceKey = toKey( serverInstanceUpdated.getServerInstance() ); if ( serverInstanceKey != null && serverInstanceKey.getServerInstanceId().equals( updatedServerInstanceKey.getServerInstanceId() ) ) { serverInstanceKey = updatedServerInstanceKey; loadContent( serverInstanceUpdated.getServerInstance().getContainers() ); } } else { logger.warn( "Illegal event argument." ); } } }
RemotePresenter { public void onInstanceUpdate( @Observes final ServerInstanceUpdated serverInstanceUpdated ) { if ( serverInstanceUpdated != null && serverInstanceUpdated.getServerInstance() != null ) { final ServerInstanceKey updatedServerInstanceKey = toKey( serverInstanceUpdated.getServerInstance() ); if ( serverInstanceKey != null && serverInstanceKey.getServerInstanceId().equals( updatedServerInstanceKey.getServerInstanceId() ) ) { serverInstanceKey = updatedServerInstanceKey; loadContent( serverInstanceUpdated.getServerInstance().getContainers() ); } } else { logger.warn( "Illegal event argument." ); } } @Inject  RemotePresenter( final Logger logger,
                            final View view,
                            final RemoteStatusPresenter remoteStatusPresenter,
                            final RemoteEmptyPresenter remoteEmptyPresenter,
                            final Caller<RuntimeManagementService> runtimeManagementService,
                            final Caller<SpecManagementService> specManagementServiceCaller,
                            final Event<NotificationEvent> notification ); }
RemotePresenter { public void onInstanceUpdate( @Observes final ServerInstanceUpdated serverInstanceUpdated ) { if ( serverInstanceUpdated != null && serverInstanceUpdated.getServerInstance() != null ) { final ServerInstanceKey updatedServerInstanceKey = toKey( serverInstanceUpdated.getServerInstance() ); if ( serverInstanceKey != null && serverInstanceKey.getServerInstanceId().equals( updatedServerInstanceKey.getServerInstanceId() ) ) { serverInstanceKey = updatedServerInstanceKey; loadContent( serverInstanceUpdated.getServerInstance().getContainers() ); } } else { logger.warn( "Illegal event argument." ); } } @Inject  RemotePresenter( final Logger logger,
                            final View view,
                            final RemoteStatusPresenter remoteStatusPresenter,
                            final RemoteEmptyPresenter remoteEmptyPresenter,
                            final Caller<RuntimeManagementService> runtimeManagementService,
                            final Caller<SpecManagementService> specManagementServiceCaller,
                            final Event<NotificationEvent> notification ); @PostConstruct void init(); View getView(); void onSelect( @Observes final ServerInstanceSelected serverInstanceSelected ); void onInstanceUpdate( @Observes final ServerInstanceUpdated serverInstanceUpdated ); void remove(); void refresh(); void load( final ServerInstanceKey serverInstanceKey ); }
RemotePresenter { public void onInstanceUpdate( @Observes final ServerInstanceUpdated serverInstanceUpdated ) { if ( serverInstanceUpdated != null && serverInstanceUpdated.getServerInstance() != null ) { final ServerInstanceKey updatedServerInstanceKey = toKey( serverInstanceUpdated.getServerInstance() ); if ( serverInstanceKey != null && serverInstanceKey.getServerInstanceId().equals( updatedServerInstanceKey.getServerInstanceId() ) ) { serverInstanceKey = updatedServerInstanceKey; loadContent( serverInstanceUpdated.getServerInstance().getContainers() ); } } else { logger.warn( "Illegal event argument." ); } } @Inject  RemotePresenter( final Logger logger,
                            final View view,
                            final RemoteStatusPresenter remoteStatusPresenter,
                            final RemoteEmptyPresenter remoteEmptyPresenter,
                            final Caller<RuntimeManagementService> runtimeManagementService,
                            final Caller<SpecManagementService> specManagementServiceCaller,
                            final Event<NotificationEvent> notification ); @PostConstruct void init(); View getView(); void onSelect( @Observes final ServerInstanceSelected serverInstanceSelected ); void onInstanceUpdate( @Observes final ServerInstanceUpdated serverInstanceUpdated ); void remove(); void refresh(); void load( final ServerInstanceKey serverInstanceKey );  }