From 405943d4bd50ee125559db4be5bd58c65c4a178a Mon Sep 17 00:00:00 2001 From: Darran Lofthouse Date: Tue, 17 Sep 2024 12:50:16 +0100 Subject: [PATCH] Revert "[ELY-2557] Add an afterclass method to do clean-up after the FileSystemEncryptRealmCommandTest testBulkWithoutNames test" This reverts commit 3d2f36b99ad01667c5f5fe83fc766c1da711d87f. --- .../tool/FileSystemEncryptRealmCommandTest.java | 16 ---------------- ...bulk-encryption-conversion-desc-without-names | 10 +++++----- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/tool/src/test/java/org/wildfly/security/tool/FileSystemEncryptRealmCommandTest.java b/tool/src/test/java/org/wildfly/security/tool/FileSystemEncryptRealmCommandTest.java index 910f78580f9..98854e8b7fd 100644 --- a/tool/src/test/java/org/wildfly/security/tool/FileSystemEncryptRealmCommandTest.java +++ b/tool/src/test/java/org/wildfly/security/tool/FileSystemEncryptRealmCommandTest.java @@ -25,17 +25,13 @@ import java.io.File; import java.io.FileNotFoundException; -import java.nio.file.Files; -import java.nio.file.Path; import java.nio.file.Paths; -import java.util.Comparator; import java.util.HashMap; import java.util.Map; import javax.crypto.SecretKey; import org.apache.commons.cli.MissingArgumentException; -import org.junit.AfterClass; import org.junit.Test; import org.wildfly.security.auth.principal.NamePrincipal; import org.wildfly.security.auth.realm.FileSystemSecurityRealm; @@ -283,18 +279,6 @@ public void testSingleUserAndVerify() throws Exception { existingIdentity.dispose(); } - @AfterClass - public static void cleanup() throws Exception { - //cleanup after testBulkWithoutNames test - Path bulkWithoutNamesFolderPath = Paths.get(RELATIVE_BASE_DIR + "fs-encrypted-realms/bulk-encryption-conversion-desc-without-names"); - if (bulkWithoutNamesFolderPath.toFile().exists()) { - Files.walk(bulkWithoutNamesFolderPath) - .sorted(Comparator.reverseOrder()) - .map(Path::toFile) - .forEach(File::delete); - } - } - private boolean fileExists(String path) { File tempFile = new File(path); return tempFile.exists(); diff --git a/tool/src/test/resources/bulk-encryption-conversion-desc-without-names b/tool/src/test/resources/bulk-encryption-conversion-desc-without-names index d51ee5e5b79..d28bded00a9 100644 --- a/tool/src/test/resources/bulk-encryption-conversion-desc-without-names +++ b/tool/src/test/resources/bulk-encryption-conversion-desc-without-names @@ -1,22 +1,22 @@ input-location:target/test-classes/filesystem-encrypt/fs-unencrypted-realms/multiple-credential-types -output-location:target/test-classes/filesystem-encrypt/fs-encrypted-realms/bulk-encryption-conversion-desc-without-names +output-location:target/test-classes/filesystem-encrypt/fs-encrypted-realms credential-store:target/test-classes/filesystem-encrypt/mycredstore.cs create:true levels:1 input-location:target/test-classes/filesystem-encrypt/fs-unencrypted-realms/level-4 -output-location:target/test-classes/filesystem-encrypt/fs-encrypted-realms/bulk-encryption-conversion-desc-without-names +output-location:target/test-classes/filesystem-encrypt/fs-encrypted-realms credential-store:target/test-classes/filesystem-encrypt/mycredstore.cs create:true levels:4 input-location:target/test-classes/filesystem-encrypt/fs-unencrypted-realms/fsRealmCharset -output-location:target/test-classes/filesystem-encrypt/fs-encrypted-realms/bulk-encryption-conversion-desc-without-names +output-location:target/test-classes/filesystem-encrypt/fs-encrypted-realms credential-store:target/test-classes/filesystem-encrypt/mycredstore.cs create:true input-location:target/test-classes/filesystem-encrypt/fs-unencrypted-realms/hashencoding -output-location:target/test-classes/filesystem-encrypt/fs-encrypted-realms/bulk-encryption-conversion-desc-without-names +output-location:target/test-classes/filesystem-encrypt/fs-encrypted-realms hash-encoding:hex credential-store:target/test-classes/filesystem-encrypt/mycredstore.cs -create:true \ No newline at end of file +create:true