@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } AddNewProviderEvent that = (AddNewProviderEvent) o; return providerType != null ? providerType.equals(that.providerType) : that.providerType == null; }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } AddNewProviderEvent that = (AddNewProviderEvent) o; return providerType != null ? providerType.equals(that.providerType) : that.providerType == null; }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ProvidersInfo that = (ProvidersInfo) o; if (providerType != null ? !providerType.equals(that.providerType) : that.providerType != null) { return false; } return providersKey != null ? providersKey.equals(that.providersKey) : that.providersKey == null; }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ProvidersInfo that = (ProvidersInfo) o; if (providerType != null ? !providerType.equals(that.providerType) : that.providerType != null) { return false; } return providersKey != null ? providersKey.equals(that.providersKey) : that.providersKey == null; }
public void setup(final ProviderType firstProvider, final Collection<ProviderType> providerTypes) { view.clear(); this.providerTypes.clear(); addProviderType(checkNotNull("firstProvider", firstProvider)); providerTypes.stream() .filter(providerType -> !providerType.equals(firstProvider)) .forEach(this::addProviderType); }
public void setup(final ProviderType firstProvider, final Collection<ProviderType> providerTypes) { view.clear(); this.providerTypes.clear(); addProviderType(checkNotNull("firstProvider", firstProvider)); providerTypes.stream() .filter(providerType -> !providerType.equals(firstProvider)) .forEach(this::addProviderType); }
@Test public void testOnSelect() { presenter.setup(providerType, providerTypes); //test the selection of whatever of the elements. providerTypes.forEach(currentProviderType -> { presenter.onSelect(new ProviderTypeSelectedEvent(currentProviderType.getKey())); if (!currentProviderType.equals(providerType)) { verify(view, times(1)).select(currentProviderType.getKey()); } }); verify(view, times(2)).select(providerType.getKey()); }
@Test public void testOnSelect() { presenter.setup(providerType, providerTypes); //test the selection of whatever of the elements. providerTypes.forEach(currentProviderType -> { presenter.onSelect(new ProviderTypeSelectedEvent(currentProviderType.getKey())); if (!currentProviderType.equals(providerType)) { verify(view, times(1)).select(currentProviderType.getKey()); } }); verify(view, times(2)).select(providerType.getKey()); }