@Test public void testOnTestConnectionWhenConnectionFailed() { when(view.getTestConnectionFailMessage(ERROR_MESSAGE)).thenReturn(ERROR_MESSAGE_TRANSFORMED); TestConnectionResult result = mock(TestConnectionResult.class); when(result.getManagementConnectionError()).thenReturn(true); when(result.getManagementConnectionMessage()).thenReturn(ERROR_MESSAGE); when(wildflyClientService.testConnection(HOST_VALUE, Integer.parseInt(PORT_VALUE), Integer.parseInt(MANAGEMENT_PORT_VALUE), USER_VALUE, PASSWORD_VALUE)).thenReturn(result); fillConnectionParams(); presenter.onTestConnection(); verify(view, times(1)).showInformationPopup(ERROR_MESSAGE_TRANSFORMED); }
protected void onTestConnection() { if (validateRemoteParams()) { wildflyClientService.call(getTestConnectionSuccessCallback(), getTestConnectionErrorCallback()).testConnection(view.getHost(), getInt(view.getPort()), getInt(view.getManagementPort()), view.getUsername(), view.getPassword()); } }
WF10ProviderConfigPresenter extends AbstractHasContentChangeHandlers implements ProviderConfigurationForm { protected void onTestConnection() { if (validateRemoteParams()) { wildflyClientService.call(getTestConnectionSuccessCallback(), getTestConnectionErrorCallback()).testConnection(view.getHost(), getInt(view.getPort()), getInt(view.getManagementPort()), view.getUsername(), view.getPassword()); } } }
WF10ProviderConfigPresenter extends AbstractHasContentChangeHandlers implements ProviderConfigurationForm { protected void onTestConnection() { if (validateRemoteParams()) { wildflyClientService.call(getTestConnectionSuccessCallback(), getTestConnectionErrorCallback()).testConnection(view.getHost(), getInt(view.getPort()), getInt(view.getManagementPort()), view.getUsername(), view.getPassword()); } } @Inject  WF10ProviderConfigPresenter(final View view,
                                       final Caller<WildflyClientService> wildflyClientService); }
WF10ProviderConfigPresenter extends AbstractHasContentChangeHandlers implements ProviderConfigurationForm { protected void onTestConnection() { if (validateRemoteParams()) { wildflyClientService.call(getTestConnectionSuccessCallback(), getTestConnectionErrorCallback()).testConnection(view.getHost(), getInt(view.getPort()), getInt(view.getManagementPort()), view.getUsername(), view.getPassword()); } } @Inject  WF10ProviderConfigPresenter(final View view,
                                       final Caller<WildflyClientService> wildflyClientService); @PostConstruct void init(); View getView(); @Override ProviderConfiguration buildProviderConfiguration(); @Override void clear(); @Override void load(final Provider provider); String getProviderName(); String getHost(); String getPort(); String getManagementPort(); String getUsername(); String getPassword(); void isValid(final Callback<Boolean> callback); @Override String getWizardTitle(); @Override void disable(); }
WF10ProviderConfigPresenter extends AbstractHasContentChangeHandlers implements ProviderConfigurationForm { protected void onTestConnection() { if (validateRemoteParams()) { wildflyClientService.call(getTestConnectionSuccessCallback(), getTestConnectionErrorCallback()).testConnection(view.getHost(), getInt(view.getPort()), getInt(view.getManagementPort()), view.getUsername(), view.getPassword()); } } @Inject  WF10ProviderConfigPresenter(final View view,
                                       final Caller<WildflyClientService> wildflyClientService); @PostConstruct void init(); View getView(); @Override ProviderConfiguration buildProviderConfiguration(); @Override void clear(); @Override void load(final Provider provider); String getProviderName(); String getHost(); String getPort(); String getManagementPort(); String getUsername(); String getPassword(); void isValid(final Callback<Boolean> callback); @Override String getWizardTitle(); @Override void disable();  }