### Question:
WF10ProviderConfigPresenter extends AbstractHasContentChangeHandlers implements ProviderConfigurationForm { public void isValid(final Callback<Boolean> callback) { boolean isValid = !isEmpty(view.getProviderName()) && !isEmpty(view.getHost()) && isValidPort(view.getPort()) && isValidPort(view.getManagementPort()) && !isEmpty(view.getUsername()) && !isEmpty(view.getPassword()); callback.callback(isValid); } @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();  }### Answer:
@Test public void testIsValid() { when(view.getProviderName()).thenReturn(EMPTY_VALUE); when(view.getHost()).thenReturn(EMPTY_VALUE); when(view.getPort()).thenReturn(EMPTY_VALUE); when(view.getManagementPort()).thenReturn(EMPTY_VALUE); when(view.getUsername()).thenReturn(EMPTY_VALUE); when(view.getPassword()).thenReturn(EMPTY_VALUE); presenter.isValid(Assert::assertFalse); when(view.getProviderName()).thenReturn(PROVIDER_NAME_VALUE); presenter.isValid(Assert::assertFalse); when(view.getHost()).thenReturn(HOST_VALUE); presenter.isValid(Assert::assertFalse); when(view.getPort()).thenReturn(PORT_VALUE); presenter.isValid(Assert::assertFalse); when(view.getManagementPort()).thenReturn(MANAGEMENT_PORT_VALUE); presenter.isValid(Assert::assertFalse); when(view.getUsername()).thenReturn(USER_VALUE); presenter.isValid(Assert::assertFalse); when(view.getPassword()).thenReturn(PASSWORD_VALUE); presenter.isValid(Assert::assertTrue); }