Skip to content

Commit 82b51a8

Browse files
committed
Several smell-fixes
1 parent 06f97da commit 82b51a8

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

src/main/java/io/github/bonigarcia/wdm/WebDriverManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ public abstract class WebDriverManager {
170170
protected static final String CLI_RESOLVER = "resolveDriverFor";
171171
protected static final String CLI_DOCKER = "runInDocker";
172172
protected static final String BROWSER_WATCHER_ID = "kbnnckbeejhjlljpgelfponodpecfapp";
173-
protected static final String BROWSER_WATCHER_ERROR = "This feature is not available in BrowserWatcher ";
174173

175174
protected abstract List<URL> getDriverUrls(String driverVersion)
176175
throws IOException;
@@ -609,7 +608,8 @@ public WebDriverManager disableCsp() {
609608

610609
protected void checkBrowserWatcherVersion() {
611610
if (getDriverManagerType() != FIREFOX) {
612-
log.warn(BROWSER_WATCHER_ERROR + getBrowserWatcherVersion());
611+
log.warn("This feature is not available in BrowserWatcher {}",
612+
getBrowserWatcherVersion());
613613
}
614614
}
615615

src/main/java/io/github/bonigarcia/wdm/webdriver/Recording.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ public class Recording {
3232
private static final String SEPARATOR = "_";
3333
private static final String DATE_FORMAT = "yyyy.MM.dd_HH.mm.ss.SSS";
3434

35+
private Recording() {
36+
throw new IllegalStateException("Utility class");
37+
}
38+
3539
public static String getRecordingName(String browserName,
3640
String sessionId) {
3741
Date now = new Date();

src/main/java/io/github/bonigarcia/wdm/webdriver/WebDriverBrowser.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ public class WebDriverBrowser {
5151

5252
final Logger log = getLogger(lookup().lookupClass());
5353

54-
final String DEFAULT_DOWNLOADS_FOLDER = "Downloads";
55-
final String LINUX_ENV_DOWNLOAD_DIR = "XDG_DOWNLOAD_DIR";
56-
final String USER_HOME_PROPERTY = "user.home";
54+
static final String DEFAULT_DOWNLOADS_FOLDER = "Downloads";
55+
static final String LINUX_ENV_DOWNLOAD_DIR = "XDG_DOWNLOAD_DIR";
56+
static final String USER_HOME_PROPERTY = "user.home";
5757
static final int RECORDING_TIMEOUT_SEC = 5;
5858
static final int POLL_TIME_MSEC = 500;
5959

@@ -178,9 +178,8 @@ public Object executeJavaScript(String jsCommand) {
178178
}
179179

180180
public void startRecording() {
181-
String recordingName = Recording.getRecordingName(browserName,
182-
((RemoteWebDriver) driver).getSessionId().toString());
183-
startRecording(recordingName);
181+
startRecording(Recording.getRecordingName(browserName,
182+
((RemoteWebDriver) driver).getSessionId().toString()));
184183
}
185184

186185
public void startRecording(String recordingName) {

src/test/java/io/github/bonigarcia/wdm/test/watcher/RecordChromeTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void teardown() {
5454
}
5555

5656
@Test
57-
void test() throws InterruptedException {
57+
void test() {
5858
driver.get(
5959
"https://bonigarcia.dev/selenium-webdriver-java/slow-calculator.html");
6060

src/test/java/io/github/bonigarcia/wdm/test/watcher/RecordEdgeTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void teardown() {
5454
}
5555

5656
@Test
57-
void test() throws InterruptedException {
57+
void test() {
5858
driver.get(
5959
"https://bonigarcia.dev/selenium-webdriver-java/slow-calculator.html");
6060

0 commit comments

Comments
 (0)