@Test public void testOnContainerSelect() { final ServerTemplateKey serverTemplateKey = new ServerTemplateKey( "ServerTemplateKeyId", "ServerTemplateKeyName" ); final ContainerSpecKey containerSpecKey = new ContainerSpecKey( "containerId", "containerName", serverTemplateKey ); presenter.onContainerSelect( new ContainerSpecSelected( containerSpecKey ) ); verify( view ).selectContainer( serverTemplateKey.getId(), containerSpecKey.getId() ); }
public void onContainerSelect( @Observes final ContainerSpecSelected containerSpecSelected ) { if ( containerSpecSelected != null && containerSpecSelected.getContainerSpecKey() != null && containerSpecSelected.getContainerSpecKey().getServerTemplateKey() != null && containerSpecSelected.getContainerSpecKey().getServerTemplateKey().getId() != null && containerSpecSelected.getContainerSpecKey().getId() != null ) { view.selectContainer( containerSpecSelected.getContainerSpecKey().getServerTemplateKey().getId(), containerSpecSelected.getContainerSpecKey().getId() ); } else { logger.warn( "Illegal event argument." ); } }
ServerTemplatePresenter { public void onContainerSelect( @Observes final ContainerSpecSelected containerSpecSelected ) { if ( containerSpecSelected != null && containerSpecSelected.getContainerSpecKey() != null && containerSpecSelected.getContainerSpecKey().getServerTemplateKey() != null && containerSpecSelected.getContainerSpecKey().getServerTemplateKey().getId() != null && containerSpecSelected.getContainerSpecKey().getId() != null ) { view.selectContainer( containerSpecSelected.getContainerSpecKey().getServerTemplateKey().getId(), containerSpecSelected.getContainerSpecKey().getId() ); } else { logger.warn( "Illegal event argument." ); } } }
ServerTemplatePresenter { public void onContainerSelect( @Observes final ContainerSpecSelected containerSpecSelected ) { if ( containerSpecSelected != null && containerSpecSelected.getContainerSpecKey() != null && containerSpecSelected.getContainerSpecKey().getServerTemplateKey() != null && containerSpecSelected.getContainerSpecKey().getServerTemplateKey().getId() != null && containerSpecSelected.getContainerSpecKey().getId() != null ) { view.selectContainer( containerSpecSelected.getContainerSpecKey().getServerTemplateKey().getId(), containerSpecSelected.getContainerSpecKey().getId() ); } else { logger.warn( "Illegal event argument." ); } } @Inject  ServerTemplatePresenter( final Logger logger,
                                    final View view,
                                    final CopyPopupPresenter copyPresenter,
                                    final Caller<SpecManagementService> specManagementService,
                                    final Event<NotificationEvent> notification,
                                    final Event<AddNewContainer> addNewContainerEvent,
                                    final Event<ContainerSpecSelected> containerSpecSelectedEvent,
                                    final Event<ServerInstanceSelected> serverInstanceSelectedEvent,
                                    final Event<ServerTemplateListRefresh> serverTemplateListRefreshEvent ); }
ServerTemplatePresenter { public void onContainerSelect( @Observes final ContainerSpecSelected containerSpecSelected ) { if ( containerSpecSelected != null && containerSpecSelected.getContainerSpecKey() != null && containerSpecSelected.getContainerSpecKey().getServerTemplateKey() != null && containerSpecSelected.getContainerSpecKey().getServerTemplateKey().getId() != null && containerSpecSelected.getContainerSpecKey().getId() != null ) { view.selectContainer( containerSpecSelected.getContainerSpecKey().getServerTemplateKey().getId(), containerSpecSelected.getContainerSpecKey().getId() ); } else { logger.warn( "Illegal event argument." ); } } @Inject  ServerTemplatePresenter( final Logger logger,
                                    final View view,
                                    final CopyPopupPresenter copyPresenter,
                                    final Caller<SpecManagementService> specManagementService,
                                    final Event<NotificationEvent> notification,
                                    final Event<AddNewContainer> addNewContainerEvent,
                                    final Event<ContainerSpecSelected> containerSpecSelectedEvent,
                                    final Event<ServerInstanceSelected> serverInstanceSelectedEvent,
                                    final Event<ServerTemplateListRefresh> serverTemplateListRefreshEvent ); @PostConstruct void init(); View getView(); ServerTemplate getCurrentServerTemplate(); void setup( final ServerTemplate serverTemplate,
                       final ContainerSpec firstContainerSpec ); void onContainerSelect( @Observes final ContainerSpecSelected containerSpecSelected ); void onServerInstanceSelect( @Observes final ServerInstanceSelected serverInstanceSelected ); void onServerInstanceUpdated( @Observes final ServerInstanceUpdated serverInstanceUpdated ); void onServerInstanceDeleted( @Observes final ServerInstanceDeleted serverInstanceDeleted ); void addNewContainer(); void copyTemplate(); void removeTemplate(); }
ServerTemplatePresenter { public void onContainerSelect( @Observes final ContainerSpecSelected containerSpecSelected ) { if ( containerSpecSelected != null && containerSpecSelected.getContainerSpecKey() != null && containerSpecSelected.getContainerSpecKey().getServerTemplateKey() != null && containerSpecSelected.getContainerSpecKey().getServerTemplateKey().getId() != null && containerSpecSelected.getContainerSpecKey().getId() != null ) { view.selectContainer( containerSpecSelected.getContainerSpecKey().getServerTemplateKey().getId(), containerSpecSelected.getContainerSpecKey().getId() ); } else { logger.warn( "Illegal event argument." ); } } @Inject  ServerTemplatePresenter( final Logger logger,
                                    final View view,
                                    final CopyPopupPresenter copyPresenter,
                                    final Caller<SpecManagementService> specManagementService,
                                    final Event<NotificationEvent> notification,
                                    final Event<AddNewContainer> addNewContainerEvent,
                                    final Event<ContainerSpecSelected> containerSpecSelectedEvent,
                                    final Event<ServerInstanceSelected> serverInstanceSelectedEvent,
                                    final Event<ServerTemplateListRefresh> serverTemplateListRefreshEvent ); @PostConstruct void init(); View getView(); ServerTemplate getCurrentServerTemplate(); void setup( final ServerTemplate serverTemplate,
                       final ContainerSpec firstContainerSpec ); void onContainerSelect( @Observes final ContainerSpecSelected containerSpecSelected ); void onServerInstanceSelect( @Observes final ServerInstanceSelected serverInstanceSelected ); void onServerInstanceUpdated( @Observes final ServerInstanceUpdated serverInstanceUpdated ); void onServerInstanceDeleted( @Observes final ServerInstanceDeleted serverInstanceDeleted ); void addNewContainer(); void copyTemplate(); void removeTemplate();  }