Skip to content

Commit

Permalink
[java] Less guava, more standard java
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Nov 18, 2018
1 parent 0c6ce82 commit 8255f90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 2 additions & 4 deletions java/client/test/org/openqa/selenium/UploadTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
import static org.openqa.selenium.testing.Driver.HTMLUNIT;
import static org.openqa.selenium.testing.Driver.SAFARI;

import com.google.common.io.Files;

import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.testing.Ignore;
Expand All @@ -41,6 +39,7 @@
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;


/**
Expand Down Expand Up @@ -119,8 +118,7 @@ public void testUploadingWithHiddenFileInput() {
private File createTmpFile(String content) throws IOException {
File f = File.createTempFile("webdriver", "tmp");
f.deleteOnExit();
Files.asCharSink(f, StandardCharsets.UTF_8).write(content);
Files.write(f.toPath(), content.getBytes(StandardCharsets.UTF_8));
return f;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
import static org.openqa.selenium.remote.CapabilityType.ACCEPT_SSL_CERTS;
import static org.openqa.selenium.support.ui.ExpectedConditions.titleIs;

import com.google.common.io.Files;

import org.junit.After;
import org.junit.Test;
import org.openqa.selenium.By;
Expand All @@ -33,6 +31,7 @@
import org.openqa.selenium.testing.NeedsLocalEnvironment;

import java.io.IOException;
import java.nio.file.Files;
import java.util.Base64;

/**
Expand Down Expand Up @@ -104,7 +103,7 @@ public void canAddExtensionFromFile() {
public void canAddExtensionFromStringEncodedInBase64() throws IOException {
ChromeOptions options = new ChromeOptions();
options.addEncodedExtensions(Base64.getEncoder().encodeToString(
Files.toByteArray(InProject.locate(EXT_PATH).toFile())));
Files.readAllBytes(InProject.locate(EXT_PATH))));
driver = new ChromeDriver(options);

driver.get(pages.clicksPage);
Expand Down

0 comments on commit 8255f90

Please sign in to comment.