mirror of
https://github.com/google/nomulus.git
synced 2025-06-02 02:28:40 +02:00
Merge pull request #121 from weiminyu/deprecate
Fix or suppress some deprecation warnings
This commit is contained in:
commit
efe33fc66e
6 changed files with 22 additions and 18 deletions
|
@ -48,7 +48,7 @@ import org.junit.Rule;
|
|||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
import org.mockito.Matchers;
|
||||
import org.mockito.ArgumentMatchers;
|
||||
|
||||
@RunWith(JUnit4.class)
|
||||
public class ExportPremiumTermsActionTest {
|
||||
|
@ -188,7 +188,8 @@ public class ExportPremiumTermsActionTest {
|
|||
EXPECTED_FILE_CONTENT.getBytes(UTF_8));
|
||||
verifyNoMoreInteractions(driveConnection);
|
||||
verify(response).setStatus(SC_INTERNAL_SERVER_ERROR);
|
||||
verify(response).setPayload(Matchers.contains("Error exporting premium terms file to Drive."));
|
||||
verify(response).setPayload(
|
||||
ArgumentMatchers.contains("Error exporting premium terms file to Drive."));
|
||||
verify(response).setContentType(PLAIN_TEXT_UTF_8);
|
||||
verifyNoMoreInteractions(response);
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.Map;
|
|||
import javax.annotation.Nullable;
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import javax.servlet.http.HttpSessionContext;
|
||||
|
||||
/** A fake {@link HttpSession} that only provides support for getting/setting attributes. */
|
||||
@SuppressWarnings("deprecation")
|
||||
|
@ -63,7 +62,7 @@ public class FakeHttpSession implements HttpSession {
|
|||
}
|
||||
|
||||
@Override
|
||||
public HttpSessionContext getSessionContext() {
|
||||
public javax.servlet.http.HttpSessionContext getSessionContext() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ import google.registry.model.registrar.RegistrarContact;
|
|||
import google.registry.module.frontend.FrontendServlet;
|
||||
import google.registry.server.RegistryTestServer;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.Timeout;
|
||||
|
@ -60,7 +61,7 @@ public class RegistrarConsoleWebTest extends WebDriverTestCase {
|
|||
|
||||
|
||||
|
||||
@Rule public final Timeout deathClock = new Timeout(60000);
|
||||
@Rule public final Timeout deathClock = new Timeout(60000, TimeUnit.MILLISECONDS);
|
||||
|
||||
/** Checks the identified element has the given text content. */
|
||||
void assertEltText(String eltId, String eltValue) {
|
||||
|
|
|
@ -39,17 +39,19 @@ import org.openqa.selenium.TakesScreenshot;
|
|||
import org.openqa.selenium.WebDriver;
|
||||
import org.openqa.selenium.WebDriverException;
|
||||
import org.openqa.selenium.WebElement;
|
||||
import org.openqa.selenium.interactions.HasInputDevices;
|
||||
import org.openqa.selenium.interactions.Keyboard;
|
||||
import org.openqa.selenium.interactions.Mouse;
|
||||
import org.openqa.selenium.remote.DesiredCapabilities;
|
||||
|
||||
/**
|
||||
* WebDriver delegate JUnit Rule that exposes most {@link WebDriver} API plus {@link ScreenDiffer}
|
||||
* API.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public final class WebDriverPlusScreenDifferRule extends ExternalResource
|
||||
implements WebDriver, HasInputDevices, TakesScreenshot, JavascriptExecutor, HasCapabilities {
|
||||
implements WebDriver,
|
||||
org.openqa.selenium.interactions.HasInputDevices,
|
||||
TakesScreenshot,
|
||||
JavascriptExecutor,
|
||||
HasCapabilities {
|
||||
|
||||
private static final int WAIT_FOR_ELEMENTS_POLLING_INTERVAL_MS = 10;
|
||||
private static final int WAIT_FOR_ELEMENTS_BONUS_DELAY_MS = 150;
|
||||
|
@ -274,13 +276,13 @@ public final class WebDriverPlusScreenDifferRule extends ExternalResource
|
|||
}
|
||||
|
||||
@Override
|
||||
public Keyboard getKeyboard() {
|
||||
return ((HasInputDevices) driver).getKeyboard();
|
||||
public org.openqa.selenium.interactions.Keyboard getKeyboard() {
|
||||
return ((org.openqa.selenium.interactions.HasInputDevices) driver).getKeyboard();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mouse getMouse() {
|
||||
return ((HasInputDevices) driver).getMouse();
|
||||
public org.openqa.selenium.interactions.Mouse getMouse() {
|
||||
return ((org.openqa.selenium.interactions.HasInputDevices) driver).getMouse();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue