From e8745c61e3ab3d1873d1a8cb178fc166aed63e71 Mon Sep 17 00:00:00 2001 From: Diego Molina Date: Wed, 26 Jun 2024 18:13:12 +0200 Subject: [PATCH] [java] Deleting tests referencing deprecated methods in Require.java --- .../test/org/openqa/selenium/RequireTest.java | 40 ------------------- 1 file changed, 40 deletions(-) diff --git a/java/test/org/openqa/selenium/RequireTest.java b/java/test/org/openqa/selenium/RequireTest.java index a3db623d279d3..ebfa5a1f17431 100644 --- a/java/test/org/openqa/selenium/RequireTest.java +++ b/java/test/org/openqa/selenium/RequireTest.java @@ -261,46 +261,6 @@ void canCheckStateClass() { assertThat(Require.state("That", arg2).instanceOf(String.class)).isSameAs(arg2); } - @Test - void canCheckFileState() throws IOException { - assertThatExceptionOfType(IllegalStateException.class) - .isThrownBy(() -> Require.state("Target", (Path) null).isFile()) - .withMessage("Target must be set"); - File tempFile = File.createTempFile("example", "tmp"); - tempFile.deleteOnExit(); - assertThat(Require.state("Target", tempFile.toPath()).isFile()).isSameAs(tempFile.toPath()); - File dir = tempFile.getParentFile(); - assertThatExceptionOfType(IllegalStateException.class) - .isThrownBy(() -> Require.state("Target", dir.toPath()).isFile()) - .withMessage("Target must be a regular file: %s", dir); - if (!tempFile.delete()) { - fail("Unable to delete temp file"); - } - assertThatExceptionOfType(IllegalStateException.class) - .isThrownBy(() -> Require.state("Target", tempFile.toPath()).isFile()) - .withMessage("Target must exist: %s", tempFile); - } - - @Test - void canCheckDirectoryState() throws IOException { - assertThatExceptionOfType(IllegalStateException.class) - .isThrownBy(() -> Require.state("Target", (Path) null).isDirectory()) - .withMessage("Target must be set"); - File tempFile = File.createTempFile("example", "tmp"); - tempFile.deleteOnExit(); - assertThatExceptionOfType(IllegalStateException.class) - .isThrownBy(() -> Require.state("Target", tempFile.toPath()).isDirectory()) - .withMessage("Target must be a directory: %s", tempFile); - File dir = tempFile.getParentFile(); - assertThat(Require.state("Target", dir.toPath()).isDirectory()).isSameAs(dir.toPath()); - if (!tempFile.delete()) { - fail("Unable to delete temp file"); - } - assertThatExceptionOfType(IllegalStateException.class) - .isThrownBy(() -> Require.state("Target", tempFile.toPath()).isDirectory()) - .withMessage("Target must exist: %s", tempFile); - } - @Test void canCheckFilePathState() throws IOException { assertThatExceptionOfType(IllegalStateException.class)