Fix PluginCacheTest cherry-pick
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/plugins/processor/PluginCacheTest.java b/log4j-plugins/src/test/java/org/apache/logging/log4j/plugins/processor/PluginCacheTest.java
similarity index 85%
rename from log4j-core/src/test/java/org/apache/logging/log4j/core/config/plugins/processor/PluginCacheTest.java
rename to log4j-plugins/src/test/java/org/apache/logging/log4j/plugins/processor/PluginCacheTest.java
index c773908..4a56066 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/plugins/processor/PluginCacheTest.java
+++ b/log4j-plugins/src/test/java/org/apache/logging/log4j/plugins/processor/PluginCacheTest.java
@@ -15,16 +15,15 @@
* limitations under the license.
*/
-package org.apache.logging.log4j.core.config.plugins.processor;
+package org.apache.logging.log4j.plugins.processor;
-import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
-import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -47,7 +46,7 @@
assertEquals(cacheB.getAllCategories().size(), 2);
assertEquals(cacheB.getAllCategories().get("one").size(), 3);
assertEquals(cacheB.getAllCategories().get("two").size(), 3);
- assertArrayEquals(cacheData(cacheA), cacheData(cacheB));
+ assertEquals(Objects.toString(cacheA.getAllCategories()), Objects.toString(cacheB.getAllCategories()));
}
private void createCategory(PluginCache cache, String categoryName, List<String> entryNames) {
@@ -62,10 +61,4 @@
}
}
- private byte[] cacheData(PluginCache cache) throws IOException {
- ByteArrayOutputStream outputB = new ByteArrayOutputStream();
- cache.writeCache(outputB);
- return outputB.toByteArray();
- }
-
}