Skip to content

Commit

Permalink
Fix IgnoreComparatorUnitTest.
Browse files Browse the repository at this point in the history
Using smart nulls in the mock causes the String methods to return "" rather than null, which is more consistent with the use of default values in the annotation declaration.
  • Loading branch information
juangj committed May 26, 2017
1 parent 749af24 commit e84f0fe
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.mockito.Mockito;
import org.openqa.selenium.Platform;
import org.openqa.selenium.testing.Driver;
import org.openqa.selenium.testing.Ignore;
Expand Down Expand Up @@ -127,9 +128,9 @@ public void shouldIgnoreDisabledNativeEventsIfIgnoringAll() {

private IgnoreList ignoreForDriver(final Set<Driver> drivers,
final Set<Platform> platforms) {
final IgnoreList ignore = mock(IgnoreList.class);
final IgnoreList ignore = mock(IgnoreList.class, Mockito.RETURNS_SMART_NULLS);
final Ignore[] list = drivers.stream().map(driver -> {
Ignore ig = mock(Ignore.class);
Ignore ig = mock(Ignore.class, Mockito.RETURNS_SMART_NULLS);
when(ig.value()).thenReturn(driver);
return ig;
}).collect(Collectors.toList()).toArray(new Ignore[drivers.size()]);
Expand Down

0 comments on commit e84f0fe

Please sign in to comment.