mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-22 15:10:43 +08:00
feat: support SpELSpringIOUtilsJDK17 (resolved #83)
Co-authored-by: ReaJason <[email protected]>
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
package com.reajason.javaweb.packer.spel;
|
||||
|
||||
import com.reajason.javaweb.packer.ClassPackerConfig;
|
||||
import com.reajason.javaweb.packer.Packers;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2025/8/25
|
||||
*/
|
||||
class SpELSpringIOUtilsGzipJDK17PackerTest {
|
||||
|
||||
@Test
|
||||
void pack() {
|
||||
ClassPackerConfig classPackerConfig = new ClassPackerConfig();
|
||||
classPackerConfig.setClassName("org.springframework.expression.sub.CommonUtil");
|
||||
classPackerConfig.setClassBytes("hello".getBytes());
|
||||
classPackerConfig.setClassBytesBase64Str(Base64.encodeBase64String("hello".getBytes()));
|
||||
Assertions.assertThrows(UnsupportedOperationException.class, () -> Packers.SpELSpringIOUtilsJDK17.getInstance().pack(classPackerConfig));
|
||||
|
||||
classPackerConfig.setClassName("org.springframework.expression.CommonUtil");
|
||||
Assertions.assertDoesNotThrow(() -> Packers.SpELSpringIOUtilsJDK17.getInstance().pack(classPackerConfig));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user