Skip to content

Commit

Permalink
[java] Fixing use of deprecated methods after updating mockito
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Oct 1, 2019
1 parent 26a6315 commit e22c13b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion java/client/test/org/openqa/selenium/ProxyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public void longSocksVersionFromMap() {
proxyData.put("sslProxy", "ssl.proxy");
proxyData.put("noProxy", "localhost,127.0.0.*");
proxyData.put("socksProxy", "socks.proxy:65555");
proxyData.put("socksVersion", new Long(l));
proxyData.put("socksVersion", l);
proxyData.put("socksUsername", "test1");
proxyData.put("socksPassword", "test2");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static synchronized <T extends TestEnvironment> T get(
Class<T> startThisIfNothingIsAlreadyRunning) {
if (environment == null) {
try {
environment = startThisIfNothingIsAlreadyRunning.newInstance();
environment = startThisIfNothingIsAlreadyRunning.getConstructor().newInstance();
} catch (Exception e) {
throw new RuntimeException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;

import org.junit.Before;
Expand Down Expand Up @@ -52,6 +52,6 @@ public void testCanLongPress() {

verify(mockTouch).longPress(mockCoordinates);
verifyNoMoreInteractions(mockTouch);
verifyZeroInteractions(mockCoordinates);
verifyNoInteractions(mockCoordinates);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;

import org.junit.Test;
Expand Down Expand Up @@ -62,7 +62,7 @@ public void shouldAlwaysLocateTheElementPerCall() {
verify(locator, times(2)).findElements();
verify(element2, times(1)).sendKeys("Fishy");
verifyNoMoreInteractions(locator, element2);
verifyZeroInteractions(element1);
verifyNoInteractions(element1);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;
import static org.openqa.selenium.support.ui.ExpectedConditions.and;
import static org.openqa.selenium.support.ui.ExpectedConditions.attributeContains;
Expand Down Expand Up @@ -166,7 +166,7 @@ public void waitingForVisibilityOfElement_elementAlreadyVisible() {
when(mockElement.isDisplayed()).thenReturn(true);

assertThat(wait.until(visibilityOf(mockElement))).isSameAs(mockElement);
verifyZeroInteractions(mockSleeper);
verifyNoInteractions(mockSleeper);
}

@Test
Expand Down Expand Up @@ -194,7 +194,7 @@ public void waitingForVisibilityOfElementInverse_elementNotVisible() {
when(mockElement.isDisplayed()).thenReturn(false);

assertThat(wait.until(not(visibilityOf(mockElement)))).isTrue();
verifyZeroInteractions(mockSleeper);
verifyNoInteractions(mockSleeper);
}

@Test
Expand Down Expand Up @@ -228,7 +228,7 @@ public void invertingAConditionThatReturnsNull() {
when(mockCondition.apply(mockDriver)).thenReturn(null);

assertThat(wait.until(not(mockCondition))).isTrue();
verifyZeroInteractions(mockSleeper);
verifyNoInteractions(mockSleeper);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import static org.mockito.Mockito.atLeast;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;

import com.google.common.collect.ImmutableMap;
Expand Down Expand Up @@ -57,7 +57,7 @@ public void shouldCallSessionFactory() {

pipeline.createNewSession(NewSessionPayload.create(caps));
verify(factory).apply(argThat(req -> req.getCapabilities().getCapability("browserName").equals("firefox")));
verifyZeroInteractions(fallback);
verifyNoInteractions(fallback);
}

@Test
Expand Down

0 comments on commit e22c13b

Please sign in to comment.