From 7b212ee4beb4a41355c1da5624fc6b113de7c338 Mon Sep 17 00:00:00 2001 From: Diego Molina Date: Wed, 7 Dec 2022 21:25:31 +0100 Subject: [PATCH] [java] Removing deprecated ACCEPT_SSL_CERTS cap --- .../openqa/selenium/remote/CapabilityType.java | 5 ----- .../selenium/firefox/FirefoxDriverTest.java | 15 ++++++--------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/java/src/org/openqa/selenium/remote/CapabilityType.java b/java/src/org/openqa/selenium/remote/CapabilityType.java index 9653a23584e60..930bae91acf28 100644 --- a/java/src/org/openqa/selenium/remote/CapabilityType.java +++ b/java/src/org/openqa/selenium/remote/CapabilityType.java @@ -57,11 +57,6 @@ public interface CapabilityType { */ @Deprecated String SUPPORTS_WEB_STORAGE = "webStorageEnabled"; - /** - * @deprecated Use {@link CapabilityType#ACCEPT_INSECURE_CERTS} - */ - @Deprecated - String ACCEPT_SSL_CERTS = "acceptSslCerts"; /** * @deprecated Non W3C compliant */ diff --git a/java/test/org/openqa/selenium/firefox/FirefoxDriverTest.java b/java/test/org/openqa/selenium/firefox/FirefoxDriverTest.java index 2e4da097c7cee..b51885553a028 100644 --- a/java/test/org/openqa/selenium/firefox/FirefoxDriverTest.java +++ b/java/test/org/openqa/selenium/firefox/FirefoxDriverTest.java @@ -18,6 +18,7 @@ package org.openqa.selenium.firefox; import com.google.common.collect.ImmutableMap; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; import org.mockito.ArgumentMatchers; @@ -31,7 +32,6 @@ import org.openqa.selenium.ParallelTestRunner; import org.openqa.selenium.ParallelTestRunner.Worker; import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebDriverException; import org.openqa.selenium.WebElement; import org.openqa.selenium.build.InProject; import org.openqa.selenium.remote.CapabilityType; @@ -64,16 +64,16 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import static org.junit.jupiter.api.Assumptions.assumeTrue; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; +import static org.junit.jupiter.api.Assumptions.assumeTrue; import static org.mockito.Mockito.atLeastOnce; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; import static org.openqa.selenium.WaitingConditions.elementValueToEqual; -import static org.openqa.selenium.remote.CapabilityType.ACCEPT_SSL_CERTS; +import static org.openqa.selenium.remote.CapabilityType.ACCEPT_INSECURE_CERTS; import static org.openqa.selenium.support.ui.ExpectedConditions.titleIs; import static org.openqa.selenium.testing.drivers.Browser.FIREFOX; @@ -358,13 +358,10 @@ public void shouldBeAbleToPassCommandLineOptions() { @Test @NoDriverBeforeTest - public void canBlockInvalidSslCertificates() { - FirefoxProfile profile = new FirefoxProfile(); - profile.setAcceptUntrustedCertificates(false); - - localDriver = new WebDriverBuilder().get(new FirefoxOptions().setProfile(profile)); + public void canBlockInsecureCerts() { + localDriver = new WebDriverBuilder().get(new FirefoxOptions().setAcceptInsecureCerts(false)); Capabilities caps = ((HasCapabilities) localDriver).getCapabilities(); - assertThat(caps.is(ACCEPT_SSL_CERTS)).isFalse(); + assertThat(caps.is(ACCEPT_INSECURE_CERTS)).isFalse(); } @Test